Skip to content

Commit

Permalink
fix!: The type of an existing field time_zone is changed from `mess…
Browse files Browse the repository at this point in the history
…age` to `string` in message `.google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest` (#7705)

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: googleapis/googleapis@005df46
Source-Link: googleapis/googleapis-gen@1c58da1
Copy-Tag: eyJwIjoiU2hvcHBpbmdNZXJjaGFudEFjY291bnRzLy5Pd2xCb3QueWFtbCIsImgiOiIxYzU4ZGExMDA1MzFkMDllOTEyMzMzMWQxMjFmNDEwZTdkMDBlNGFhIn0=
  • Loading branch information
gcf-owl-bot[bot] authored Sep 27, 2024
1 parent 1ed4b42 commit 409b76d
Show file tree
Hide file tree
Showing 44 changed files with 1,795 additions and 155 deletions.
Binary file modified ShoppingMerchantAccounts/metadata/V1Beta/Accountissue.php
Binary file not shown.
Binary file modified ShoppingMerchantAccounts/metadata/V1Beta/Accounts.php
Binary file not shown.
32 changes: 32 additions & 0 deletions ShoppingMerchantAccounts/metadata/V1Beta/Accountservices.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 46 additions & 0 deletions ShoppingMerchantAccounts/metadata/V1Beta/Autofeedsettings.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified ShoppingMerchantAccounts/metadata/V1Beta/Businessinfo.php
Binary file not shown.
Binary file modified ShoppingMerchantAccounts/metadata/V1Beta/Termsofservice.php
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
use Google\Shopping\Merchant\Accounts\V1beta\Account;
use Google\Shopping\Merchant\Accounts\V1beta\Client\AccountsServiceClient;
use Google\Shopping\Merchant\Accounts\V1beta\CreateAndConfigureAccountRequest;
use Google\Shopping\Merchant\Accounts\V1beta\CreateAndConfigureAccountRequest\AddAccountService;
use Google\Type\TimeZone;

/**
Expand All @@ -53,8 +54,10 @@ function create_and_configure_account_sample(
->setAccountName($accountAccountName)
->setTimeZone($accountTimeZone)
->setLanguageCode($accountLanguageCode);
$service = [new AddAccountService()];
$request = (new CreateAndConfigureAccountRequest())
->setAccount($account);
->setAccount($account)
->setService($service);

// Call the API and handle any network failures.
try {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?php
/*
* 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.
*/

/*
* GENERATED CODE WARNING
* This file was automatically generated - do not edit!
*/

require_once __DIR__ . '/../../../vendor/autoload.php';

// [START merchantapi_v1beta_generated_AutofeedSettingsService_GetAutofeedSettings_sync]
use Google\ApiCore\ApiException;
use Google\Shopping\Merchant\Accounts\V1beta\AutofeedSettings;
use Google\Shopping\Merchant\Accounts\V1beta\Client\AutofeedSettingsServiceClient;
use Google\Shopping\Merchant\Accounts\V1beta\GetAutofeedSettingsRequest;

/**
* Retrieves the autofeed settings of an account.
*
* @param string $formattedName The resource name of the autofeed settings.
* Format: `accounts/{account}/autofeedSettings`
* Please see {@see AutofeedSettingsServiceClient::autofeedSettingsName()} for help formatting this field.
*/
function get_autofeed_settings_sample(string $formattedName): void
{
// Create a client.
$autofeedSettingsServiceClient = new AutofeedSettingsServiceClient();

// Prepare the request message.
$request = (new GetAutofeedSettingsRequest())
->setName($formattedName);

// Call the API and handle any network failures.
try {
/** @var AutofeedSettings $response */
$response = $autofeedSettingsServiceClient->getAutofeedSettings($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}

/**
* Helper to execute the sample.
*
* This sample 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.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = AutofeedSettingsServiceClient::autofeedSettingsName('[ACCOUNT]');

get_autofeed_settings_sample($formattedName);
}
// [END merchantapi_v1beta_generated_AutofeedSettingsService_GetAutofeedSettings_sync]
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<?php
/*
* 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.
*/

/*
* GENERATED CODE WARNING
* This file was automatically generated - do not edit!
*/

require_once __DIR__ . '/../../../vendor/autoload.php';

// [START merchantapi_v1beta_generated_AutofeedSettingsService_UpdateAutofeedSettings_sync]
use Google\ApiCore\ApiException;
use Google\Protobuf\FieldMask;
use Google\Shopping\Merchant\Accounts\V1beta\AutofeedSettings;
use Google\Shopping\Merchant\Accounts\V1beta\Client\AutofeedSettingsServiceClient;
use Google\Shopping\Merchant\Accounts\V1beta\UpdateAutofeedSettingsRequest;

/**
* Updates the autofeed settings of an account.
*
* @param bool $autofeedSettingsEnableProducts 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.
*/
function update_autofeed_settings_sample(bool $autofeedSettingsEnableProducts): void
{
// Create a client.
$autofeedSettingsServiceClient = new AutofeedSettingsServiceClient();

// Prepare the request message.
$autofeedSettings = (new AutofeedSettings())
->setEnableProducts($autofeedSettingsEnableProducts);
$updateMask = new FieldMask();
$request = (new UpdateAutofeedSettingsRequest())
->setAutofeedSettings($autofeedSettings)
->setUpdateMask($updateMask);

// Call the API and handle any network failures.
try {
/** @var AutofeedSettings $response */
$response = $autofeedSettingsServiceClient->updateAutofeedSettings($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}

/**
* Helper to execute the sample.
*
* This sample 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.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$autofeedSettingsEnableProducts = false;

update_autofeed_settings_sample($autofeedSettingsEnableProducts);
}
// [END merchantapi_v1beta_generated_AutofeedSettingsService_UpdateAutofeedSettings_sync]
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
*
* @param string $formattedName The resource name of the terms of service version.
* Format: `accounts/{account}/termsOfServiceAgreementState/{identifier}`
* The identifier format is: `{TermsOfServiceKind}-{country}`
* Please see {@see TermsOfServiceAgreementStateServiceClient::termsOfServiceAgreementStateName()} for help formatting this field.
*/
function get_terms_of_service_agreement_state_sample(string $formattedName): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,26 @@
use Google\Shopping\Merchant\Accounts\V1beta\Client\TermsOfServiceServiceClient;
use Google\Shopping\Merchant\Accounts\V1beta\RetrieveLatestTermsOfServiceRequest;
use Google\Shopping\Merchant\Accounts\V1beta\TermsOfService;
use Google\Shopping\Merchant\Accounts\V1beta\TermsOfServiceKind;

/**
* Retrieves the latest version of the `TermsOfService` for a given `kind` and
* `region_code`.
*
* This sample 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.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
* @param string $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.
* @param int $kind The Kind this terms of service version applies to.
*/
function retrieve_latest_terms_of_service_sample(): void
function retrieve_latest_terms_of_service_sample(string $regionCode, int $kind): void
{
// Create a client.
$termsOfServiceServiceClient = new TermsOfServiceServiceClient();

// Prepare the request message.
$request = new RetrieveLatestTermsOfServiceRequest();
$request = (new RetrieveLatestTermsOfServiceRequest())
->setRegionCode($regionCode)
->setKind($kind);

// Call the API and handle any network failures.
try {
Expand All @@ -55,4 +57,21 @@ function retrieve_latest_terms_of_service_sample(): void
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}

/**
* Helper to execute the sample.
*
* This sample 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.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$regionCode = '[REGION_CODE]';
$kind = TermsOfServiceKind::TERMS_OF_SERVICE_KIND_UNSPECIFIED;

retrieve_latest_terms_of_service_sample($regionCode, $kind);
}
// [END merchantapi_v1beta_generated_TermsOfServiceService_RetrieveLatestTermsOfService_sync]
33 changes: 33 additions & 0 deletions ShoppingMerchantAccounts/src/V1beta/AccountAggregation.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 409b76d

Please sign in to comment.