Skip to content
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/V1/Accounts.php
Binary file not shown.
Binary file modified ShoppingMerchantAccounts/metadata/V1/Accountservices.php
Binary file not shown.

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

Binary file modified ShoppingMerchantAccounts/metadata/V1/User.php
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,13 @@
/**
* Deletes the specified account regardless of its type: standalone, advanced
* account or sub-account. Deleting an advanced account leads to the deletion
* of all of its sub-accounts. Executing this method requires admin access.
* The deletion succeeds only if the account does not provide services
* to any other account and has no processed offers. You can use the `force`
* parameter to override this.
* of all of its sub-accounts. This also deletes the account's [developer
* registration
* entity](/merchant/api/reference/rest/accounts_v1/accounts.developerRegistration)
* and any associated GCP project to the account. Executing this method
* requires admin access. The deletion succeeds only if the account does not
* provide services to any other account and has no processed offers. You can
* use the `force` parameter to override this.
*
* @param string $formattedName The name of the account to delete.
* Format: `accounts/{account}`
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?php
/*
* Copyright 2025 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_v1_generated_DeveloperRegistrationService_GetAccountForGcpRegistration_sync]
use Google\ApiCore\ApiException;
use Google\Protobuf\GPBEmpty;
use Google\Shopping\Merchant\Accounts\V1\Client\DeveloperRegistrationServiceClient;
use Google\Shopping\Merchant\Accounts\V1\GetAccountForGcpRegistrationResponse;

/**
* Retrieves the merchant account that the calling GCP is registered with.
*
* 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 get_account_for_gcp_registration_sample(): void
{
// Create a client.
$developerRegistrationServiceClient = new DeveloperRegistrationServiceClient();

// Prepare the request message.
$request = new GPBEmpty();

// Call the API and handle any network failures.
try {
/** @var GetAccountForGcpRegistrationResponse $response */
$response = $developerRegistrationServiceClient->getAccountForGcpRegistration($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
// [END merchantapi_v1_generated_DeveloperRegistrationService_GetAccountForGcpRegistration_sync]
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<?php
/*
* Copyright 2025 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_v1_generated_UserService_VerifySelf_sync]
use Google\ApiCore\ApiException;
use Google\Shopping\Merchant\Accounts\V1\Client\UserServiceClient;
use Google\Shopping\Merchant\Accounts\V1\User;
use Google\Shopping\Merchant\Accounts\V1\VerifySelfRequest;

/**
* Updates the user that is represented by the caller from pending to
* verified.
*
* @param string $formattedAccount The name of the account under which the caller is a user.
* Format: `accounts/{account}`
* Please see {@see UserServiceClient::accountName()} for help formatting this field.
*/
function verify_self_sample(string $formattedAccount): void
{
// Create a client.
$userServiceClient = new UserServiceClient();

// Prepare the request message.
$request = (new VerifySelfRequest())
->setAccount($formattedAccount);

// Call the API and handle any network failures.
try {
/** @var User $response */
$response = $userServiceClient->verifySelf($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
{
$formattedAccount = UserServiceClient::accountName('[ACCOUNT]');

verify_self_sample($formattedAccount);
}
// [END merchantapi_v1_generated_UserService_VerifySelf_sync]
6 changes: 4 additions & 2 deletions ShoppingMerchantAccounts/src/V1/AccessRight.php

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

39 changes: 39 additions & 0 deletions ShoppingMerchantAccounts/src/V1/AccountService.php

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

Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,7 @@ final class AccountIssueServiceClient
private const CODEGEN_NAME = 'gapic';

/** The default scopes required by the service. */
public static $serviceScopes = [
'https://www.googleapis.com/auth/content',
];
public static $serviceScopes = ['https://www.googleapis.com/auth/content'];

private static function getClientDefaults()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,7 @@ final class AccountRelationshipsServiceClient
private const CODEGEN_NAME = 'gapic';

/** The default scopes required by the service. */
public static $serviceScopes = [
'https://www.googleapis.com/auth/content',
];
public static $serviceScopes = ['https://www.googleapis.com/auth/content'];

private static function getClientDefaults()
{
Expand All @@ -98,7 +96,8 @@ private static function getClientDefaults()
],
'transportConfig' => [
'rest' => [
'restClientConfigPath' => __DIR__ . '/../resources/account_relationships_service_rest_client_config.php',
'restClientConfigPath' =>
__DIR__ . '/../resources/account_relationships_service_rest_client_config.php',
],
],
];
Expand Down Expand Up @@ -268,8 +267,10 @@ public function __call($method, $args)
*
* @throws ApiException Thrown if the API call fails.
*/
public function getAccountRelationship(GetAccountRelationshipRequest $request, array $callOptions = []): AccountRelationship
{
public function getAccountRelationship(
GetAccountRelationshipRequest $request,
array $callOptions = []
): AccountRelationship {
return $this->startApiCall('GetAccountRelationship', $request, $callOptions)->wait();
}

Expand All @@ -295,8 +296,10 @@ public function getAccountRelationship(GetAccountRelationshipRequest $request, a
*
* @throws ApiException Thrown if the API call fails.
*/
public function listAccountRelationships(ListAccountRelationshipsRequest $request, array $callOptions = []): PagedListResponse
{
public function listAccountRelationships(
ListAccountRelationshipsRequest $request,
array $callOptions = []
): PagedListResponse {
return $this->startApiCall('ListAccountRelationships', $request, $callOptions);
}

Expand All @@ -323,8 +326,10 @@ public function listAccountRelationships(ListAccountRelationshipsRequest $reques
*
* @throws ApiException Thrown if the API call fails.
*/
public function updateAccountRelationship(UpdateAccountRelationshipRequest $request, array $callOptions = []): AccountRelationship
{
public function updateAccountRelationship(
UpdateAccountRelationshipRequest $request,
array $callOptions = []
): AccountRelationship {
return $this->startApiCall('UpdateAccountRelationship', $request, $callOptions)->wait();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,7 @@ final class AccountServicesServiceClient
private const CODEGEN_NAME = 'gapic';

/** The default scopes required by the service. */
public static $serviceScopes = [
'https://www.googleapis.com/auth/content',
];
public static $serviceScopes = ['https://www.googleapis.com/auth/content'];

private static function getClientDefaults()
{
Expand Down Expand Up @@ -272,8 +270,10 @@ public function __call($method, $args)
*
* @throws ApiException Thrown if the API call fails.
*/
public function approveAccountService(ApproveAccountServiceRequest $request, array $callOptions = []): AccountService
{
public function approveAccountService(
ApproveAccountServiceRequest $request,
array $callOptions = []
): AccountService {
return $this->startApiCall('ApproveAccountService', $request, $callOptions)->wait();
}

Expand Down Expand Up @@ -353,8 +353,10 @@ public function listAccountServices(ListAccountServicesRequest $request, array $
*
* @throws ApiException Thrown if the API call fails.
*/
public function proposeAccountService(ProposeAccountServiceRequest $request, array $callOptions = []): AccountService
{
public function proposeAccountService(
ProposeAccountServiceRequest $request,
array $callOptions = []
): AccountService {
return $this->startApiCall('ProposeAccountService', $request, $callOptions)->wait();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,7 @@ final class AccountsServiceClient
private const CODEGEN_NAME = 'gapic';

/** The default scopes required by the service. */
public static $serviceScopes = [
'https://www.googleapis.com/auth/content',
];
public static $serviceScopes = ['https://www.googleapis.com/auth/content'];

private static function getClientDefaults()
{
Expand Down Expand Up @@ -275,18 +273,23 @@ public function __call($method, $args)
*
* @throws ApiException Thrown if the API call fails.
*/
public function createAndConfigureAccount(CreateAndConfigureAccountRequest $request, array $callOptions = []): Account
{
public function createAndConfigureAccount(
CreateAndConfigureAccountRequest $request,
array $callOptions = []
): Account {
return $this->startApiCall('CreateAndConfigureAccount', $request, $callOptions)->wait();
}

/**
* Deletes the specified account regardless of its type: standalone, advanced
* account or sub-account. Deleting an advanced account leads to the deletion
* of all of its sub-accounts. Executing this method requires admin access.
* The deletion succeeds only if the account does not provide services
* to any other account and has no processed offers. You can use the `force`
* parameter to override this.
* of all of its sub-accounts. This also deletes the account's [developer
* registration
* entity](/merchant/api/reference/rest/accounts_v1/accounts.developerRegistration)
* and any associated GCP project to the account. Executing this method
* requires admin access. The deletion succeeds only if the account does not
* provide services to any other account and has no processed offers. You can
* use the `force` parameter to override this.
*
* The async variant is {@see AccountsServiceClient::deleteAccountAsync()} .
*
Expand Down
Loading
Loading