Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix!: [ShoppingMerchantAccounts] The type of an existing field time_zone is changed from message to string in message .google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest #7705

Merged
merged 2 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading