Skip to content

Commit 75697a6

Browse files
authored
chore: librarian generate pull request: 20260323T185442Z (#16144)
PR created by the Librarian CLI to generate Cloud Client Libraries code from protos. BEGIN_COMMIT BEGIN_NESTED_COMMIT docs: Update Account.account_name documentation for naming restrictions PiperOrigin-RevId: 884882604 Library-IDs: google-shopping-merchant-accounts Source-link: [googleapis/googleapis@e68f10a4](googleapis/googleapis@e68f10a4) END_NESTED_COMMIT BEGIN_NESTED_COMMIT docs: Clarify CheckoutSettings.eligible_destinations usage PiperOrigin-RevId: 884882604 Library-IDs: google-shopping-merchant-accounts Source-link: [googleapis/googleapis@e68f10a4](googleapis/googleapis@e68f10a4) END_NESTED_COMMIT BEGIN_NESTED_COMMIT docs: Refine DeveloperRegistration.developer_email behavior description PiperOrigin-RevId: 884882604 Library-IDs: google-shopping-merchant-accounts Source-link: [googleapis/googleapis@e68f10a4](googleapis/googleapis@e68f10a4) END_NESTED_COMMIT BEGIN_NESTED_COMMIT docs: Add product-ratings to Program documentation PiperOrigin-RevId: 884882604 Library-IDs: google-shopping-merchant-accounts Source-link: [googleapis/googleapis@e68f10a4](googleapis/googleapis@e68f10a4) END_NESTED_COMMIT BEGIN_NESTED_COMMIT docs: Update Region to support radius_area and clarify area type exclusivity PiperOrigin-RevId: 884882604 Library-IDs: google-shopping-merchant-accounts Source-link: [googleapis/googleapis@e68f10a4](googleapis/googleapis@e68f10a4) END_NESTED_COMMIT BEGIN_NESTED_COMMIT docs: Improve TermsOfServiceKind.MERCHANT_CENTER comment PiperOrigin-RevId: 884882604 Library-IDs: google-shopping-merchant-accounts Source-link: [googleapis/googleapis@e68f10a4](googleapis/googleapis@e68f10a4) END_NESTED_COMMIT BEGIN_NESTED_COMMIT docs: Update DeleteUser method description PiperOrigin-RevId: 884882604 Library-IDs: google-shopping-merchant-accounts Source-link: [googleapis/googleapis@e68f10a4](googleapis/googleapis@e68f10a4) END_NESTED_COMMIT BEGIN_NESTED_COMMIT feat: Add CreateTestAccount RPC to Accounts service for creating test-only Merchant Center accounts PiperOrigin-RevId: 884882604 Library-IDs: google-shopping-merchant-accounts Source-link: [googleapis/googleapis@e68f10a4](googleapis/googleapis@e68f10a4) END_NESTED_COMMIT END_COMMIT This pull request is generated with proto changes between [googleapis/googleapis@256b575f](googleapis/googleapis@256b575) (exclusive) and [googleapis/googleapis@e68f10a4](googleapis/googleapis@e68f10a) (inclusive). Librarian Version: v0.7.0 Language Image: us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/python-librarian-generator@sha256:160860d189ff1c2f7515638478823712fa5b243e27ccc33a2728669fa1e2ed0c
1 parent 3f8124a commit 75697a6

File tree

32 files changed

+2006
-62
lines changed

32 files changed

+2006
-62
lines changed

.librarian/state.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3827,7 +3827,7 @@ libraries:
38273827
tag_format: '{id}-v{version}'
38283828
- id: google-shopping-merchant-accounts
38293829
version: 1.3.0
3830-
last_generated_commit: 256b575f6915282b20795c13414b21f2c0af65db
3830+
last_generated_commit: ffe6fc5c48419866f525b463f20400d65c0e6312
38313831
apis:
38323832
- path: google/shopping/merchant/accounts/v1
38333833
service_config: merchantapi_v1.yaml

packages/google-shopping-merchant-accounts/google/shopping/merchant_accounts/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@
166166
from google.shopping.merchant_accounts_v1.types.accounts import (
167167
Account,
168168
CreateAndConfigureAccountRequest,
169+
CreateTestAccountRequest,
169170
DeleteAccountRequest,
170171
GetAccountRequest,
171172
ListAccountsRequest,
@@ -415,6 +416,7 @@
415416
"UpdateAccountRelationshipRequest",
416417
"Account",
417418
"CreateAndConfigureAccountRequest",
419+
"CreateTestAccountRequest",
418420
"DeleteAccountRequest",
419421
"GetAccountRequest",
420422
"ListAccountsRequest",

packages/google-shopping-merchant-accounts/google/shopping/merchant_accounts_v1/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@
118118
from .types.accounts import (
119119
Account,
120120
CreateAndConfigureAccountRequest,
121+
CreateTestAccountRequest,
121122
DeleteAccountRequest,
122123
GetAccountRequest,
123124
ListAccountsRequest,
@@ -467,6 +468,7 @@ def _get_version(dependency_name):
467468
"CreateOmnichannelSettingRequest",
468469
"CreateOnlineReturnPolicyRequest",
469470
"CreateRegionRequest",
471+
"CreateTestAccountRequest",
470472
"CreateUserRequest",
471473
"CustomerService",
472474
"CutoffTime",

packages/google-shopping-merchant-accounts/google/shopping/merchant_accounts_v1/gapic_metadata.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,11 @@
207207
"create_and_configure_account"
208208
]
209209
},
210+
"CreateTestAccount": {
211+
"methods": [
212+
"create_test_account"
213+
]
214+
},
210215
"DeleteAccount": {
211216
"methods": [
212217
"delete_account"
@@ -242,6 +247,11 @@
242247
"create_and_configure_account"
243248
]
244249
},
250+
"CreateTestAccount": {
251+
"methods": [
252+
"create_test_account"
253+
]
254+
},
245255
"DeleteAccount": {
246256
"methods": [
247257
"delete_account"
@@ -277,6 +287,11 @@
277287
"create_and_configure_account"
278288
]
279289
},
290+
"CreateTestAccount": {
291+
"methods": [
292+
"create_test_account"
293+
]
294+
},
280295
"DeleteAccount": {
281296
"methods": [
282297
"delete_account"

packages/google-shopping-merchant-accounts/google/shopping/merchant_accounts_v1/services/accounts_service/async_client.py

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,164 @@ async def sample_create_and_configure_account():
531531
# Done; return the response.
532532
return response
533533

534+
async def create_test_account(
535+
self,
536+
request: Optional[Union[accounts.CreateTestAccountRequest, dict]] = None,
537+
*,
538+
parent: Optional[str] = None,
539+
account: Optional[accounts.Account] = None,
540+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
541+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
542+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
543+
) -> accounts.Account:
544+
r"""Creates a Merchant Center test account.
545+
546+
Test accounts are intended for development and testing
547+
purposes, such as validating API integrations or new
548+
feature behavior.
549+
550+
Key characteristics and limitations of test accounts:
551+
552+
- Immutable Type: A test account cannot be converted
553+
into a regular (live) Merchant Center account.
554+
Likewise, a regular account cannot be converted into
555+
a test account.
556+
- Non-Serving Products: Any products, offers, or data
557+
created within a test account will not be published
558+
or made visible to end-users on any Google surfaces.
559+
They are strictly for testing environments.
560+
- Separate Environment: Test accounts operate in a
561+
sandbox-like manner, isolated from live serving and
562+
real user traffic.
563+
564+
.. code-block:: python
565+
566+
# This snippet has been automatically generated and should be regarded as a
567+
# code template only.
568+
# It will require modifications to work:
569+
# - It may require correct/in-range values for request initialization.
570+
# - It may require specifying regional endpoints when creating the service
571+
# client as shown in:
572+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
573+
from google.shopping import merchant_accounts_v1
574+
575+
async def sample_create_test_account():
576+
# Create a client
577+
client = merchant_accounts_v1.AccountsServiceAsyncClient()
578+
579+
# Initialize request argument(s)
580+
account = merchant_accounts_v1.Account()
581+
account.account_name = "account_name_value"
582+
account.language_code = "language_code_value"
583+
584+
request = merchant_accounts_v1.CreateTestAccountRequest(
585+
parent="parent_value",
586+
account=account,
587+
)
588+
589+
# Make the request
590+
response = await client.create_test_account(request=request)
591+
592+
# Handle the response
593+
print(response)
594+
595+
Args:
596+
request (Optional[Union[google.shopping.merchant_accounts_v1.types.CreateTestAccountRequest, dict]]):
597+
The request object. Request message for the
598+
CreateTestAccount RPC
599+
parent (:class:`str`):
600+
Required. The account resource name
601+
to create the test account under.
602+
Format: accounts/{account}
603+
604+
This corresponds to the ``parent`` field
605+
on the ``request`` instance; if ``request`` is provided, this
606+
should not be set.
607+
account (:class:`google.shopping.merchant_accounts_v1.types.Account`):
608+
Required. The account to be created.
609+
This corresponds to the ``account`` field
610+
on the ``request`` instance; if ``request`` is provided, this
611+
should not be set.
612+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
613+
should be retried.
614+
timeout (float): The timeout for this request.
615+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
616+
sent along with the request as metadata. Normally, each value must be of type `str`,
617+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
618+
be of type `bytes`.
619+
620+
Returns:
621+
google.shopping.merchant_accounts_v1.types.Account:
622+
The Account message represents a business's account within Shopping
623+
Ads. It's the primary entity for managing product
624+
data, settings, and interactions with Google's
625+
services and external providers.
626+
627+
Accounts can operate as standalone entities or be
628+
part of a advanced account structure. In an advanced
629+
account setup the parent account manages multiple
630+
sub-accounts.
631+
632+
Establishing an account involves configuring
633+
attributes like the account name, time zone, and
634+
language preferences.
635+
636+
The Account message is the parent entity for many
637+
other resources, for example, AccountRelationship,
638+
Homepage, BusinessInfo and so on.
639+
640+
"""
641+
# Create or coerce a protobuf request object.
642+
# - Quick check: If we got a request object, we should *not* have
643+
# gotten any keyword arguments that map to the request.
644+
flattened_params = [parent, account]
645+
has_flattened_params = (
646+
len([param for param in flattened_params if param is not None]) > 0
647+
)
648+
if request is not None and has_flattened_params:
649+
raise ValueError(
650+
"If the `request` argument is set, then none of "
651+
"the individual field arguments should be set."
652+
)
653+
654+
# - Use the request object if provided (there's no risk of modifying the input as
655+
# there are no flattened fields), or create one.
656+
if not isinstance(request, accounts.CreateTestAccountRequest):
657+
request = accounts.CreateTestAccountRequest(request)
658+
659+
# If we have keyword arguments corresponding to fields on the
660+
# request, apply these.
661+
if parent is not None:
662+
request.parent = parent
663+
if account is not None:
664+
request.account = account
665+
666+
# Wrap the RPC method; this adds retry and timeout information,
667+
# and friendly error handling.
668+
rpc = self._client._transport._wrapped_methods[
669+
self._client._transport.create_test_account
670+
]
671+
672+
# Certain fields should be provided within the metadata header;
673+
# add these here.
674+
metadata = tuple(metadata) + (
675+
gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
676+
)
677+
678+
# Validate the universe domain.
679+
self._client._validate_universe_domain()
680+
681+
# Send the request.
682+
response = await rpc(
683+
request,
684+
retry=retry,
685+
timeout=timeout,
686+
metadata=metadata,
687+
)
688+
689+
# Done; return the response.
690+
return response
691+
534692
async def delete_account(
535693
self,
536694
request: Optional[Union[accounts.DeleteAccountRequest, dict]] = None,

0 commit comments

Comments
 (0)