Skip to content

Commit f0ac4e4

Browse files
feat: [ShoppingMerchantQuota] Add the AccountLimit resource and its service to the quota bundle (#8728)
* feat: Add the AccountLimit resource and its service to the quota bundle PiperOrigin-RevId: 830811341 Source-Link: googleapis/googleapis@3568ce2 Source-Link: googleapis/googleapis-gen@9ffd593 Copy-Tag: eyJwIjoiU2hvcHBpbmdNZXJjaGFudFF1b3RhLy5Pd2xCb3QueWFtbCIsImgiOiI5ZmZkNTkzMGU2NGZmNTYwOWE5NjBlN2YxZjRjYzY5MzI2ZjIwMDQ3In0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 931e728 commit f0ac4e4

17 files changed

Lines changed: 1560 additions & 6 deletions
2.43 KB
Binary file not shown.
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<?php
2+
/*
3+
* Copyright 2025 Google LLC
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
/*
19+
* GENERATED CODE WARNING
20+
* This file was automatically generated - do not edit!
21+
*/
22+
23+
require_once __DIR__ . '/../../../vendor/autoload.php';
24+
25+
// [START merchantapi_v1_generated_AccountLimitsService_GetAccountLimit_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\Shopping\Merchant\Quota\V1\AccountLimit;
28+
use Google\Shopping\Merchant\Quota\V1\Client\AccountLimitsServiceClient;
29+
use Google\Shopping\Merchant\Quota\V1\GetAccountLimitRequest;
30+
31+
/**
32+
* Retrieves an account limit.
33+
*
34+
* @param string $formattedName The name of the limit to retrieve.
35+
* Format: `accounts/{account}/limits/{limit}`
36+
* For example: `accounts/123/limits/products~ADS_NON_EEA`
37+
* Please see {@see AccountLimitsServiceClient::accountLimitName()} for help formatting this field.
38+
*/
39+
function get_account_limit_sample(string $formattedName): void
40+
{
41+
// Create a client.
42+
$accountLimitsServiceClient = new AccountLimitsServiceClient();
43+
44+
// Prepare the request message.
45+
$request = (new GetAccountLimitRequest())
46+
->setName($formattedName);
47+
48+
// Call the API and handle any network failures.
49+
try {
50+
/** @var AccountLimit $response */
51+
$response = $accountLimitsServiceClient->getAccountLimit($request);
52+
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
53+
} catch (ApiException $ex) {
54+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
55+
}
56+
}
57+
58+
/**
59+
* Helper to execute the sample.
60+
*
61+
* This sample has been automatically generated and should be regarded as a code
62+
* template only. It will require modifications to work:
63+
* - It may require correct/in-range values for request initialization.
64+
* - It may require specifying regional endpoints when creating the service client,
65+
* please see the apiEndpoint client configuration option for more details.
66+
*/
67+
function callSample(): void
68+
{
69+
$formattedName = AccountLimitsServiceClient::accountLimitName('[ACCOUNT]', '[LIMIT]');
70+
71+
get_account_limit_sample($formattedName);
72+
}
73+
// [END merchantapi_v1_generated_AccountLimitsService_GetAccountLimit_sync]
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
<?php
2+
/*
3+
* Copyright 2025 Google LLC
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
/*
19+
* GENERATED CODE WARNING
20+
* This file was automatically generated - do not edit!
21+
*/
22+
23+
require_once __DIR__ . '/../../../vendor/autoload.php';
24+
25+
// [START merchantapi_v1_generated_AccountLimitsService_ListAccountLimits_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\ApiCore\PagedListResponse;
28+
use Google\Shopping\Merchant\Quota\V1\AccountLimit;
29+
use Google\Shopping\Merchant\Quota\V1\Client\AccountLimitsServiceClient;
30+
use Google\Shopping\Merchant\Quota\V1\ListAccountLimitsRequest;
31+
32+
/**
33+
* Lists the limits of an account.
34+
*
35+
* @param string $formattedParent The parent account.
36+
* Format: `accounts/{account}`
37+
* Please see {@see AccountLimitsServiceClient::accountName()} for help formatting this field.
38+
* @param string $filter A filter on the limit `type` is required, for example, `type =
39+
* "products"`.
40+
*/
41+
function list_account_limits_sample(string $formattedParent, string $filter): void
42+
{
43+
// Create a client.
44+
$accountLimitsServiceClient = new AccountLimitsServiceClient();
45+
46+
// Prepare the request message.
47+
$request = (new ListAccountLimitsRequest())
48+
->setParent($formattedParent)
49+
->setFilter($filter);
50+
51+
// Call the API and handle any network failures.
52+
try {
53+
/** @var PagedListResponse $response */
54+
$response = $accountLimitsServiceClient->listAccountLimits($request);
55+
56+
/** @var AccountLimit $element */
57+
foreach ($response as $element) {
58+
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
59+
}
60+
} catch (ApiException $ex) {
61+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
62+
}
63+
}
64+
65+
/**
66+
* Helper to execute the sample.
67+
*
68+
* This sample has been automatically generated and should be regarded as a code
69+
* template only. It will require modifications to work:
70+
* - It may require correct/in-range values for request initialization.
71+
* - It may require specifying regional endpoints when creating the service client,
72+
* please see the apiEndpoint client configuration option for more details.
73+
*/
74+
function callSample(): void
75+
{
76+
$formattedParent = AccountLimitsServiceClient::accountName('[ACCOUNT]');
77+
$filter = '[FILTER]';
78+
79+
list_account_limits_sample($formattedParent, $filter);
80+
}
81+
// [END merchantapi_v1_generated_AccountLimitsService_ListAccountLimits_sync]

ShoppingMerchantQuota/src/V1/AccountLimit.php

Lines changed: 117 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)