| GitHub Repository | Product Reference |
Service Description: APIs related to managing resources that model commercial transactions.
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
ServiceName name = ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]");
Service response = commerceTransactionClient.getService(name);
}
Note: close() needs to be called on the CommerceTransactionClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
| Method | Description | Method Variants |
|---|---|---|
ListServices |
Lists Services in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetService |
Gets details of a single Service. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListPrivateOffers |
Lists PrivateOffers for the given parent. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetPrivateOffer |
Gets details of a single PrivateOffer. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ResolveAmendmentTarget |
Resolves the existing offer that must be amended when creating a new PrivateOffer. Use this method to determine the correct amendment target before creating or publishing an offer. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreatePrivateOffer |
Creates a new PrivateOffer in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdatePrivateOffer |
Updates the target PrivateOffer. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
PublishPrivateOffer |
Publishes the target PrivateOffer. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CancelPrivateOffer |
Cancels the target PrivateOffer. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeletePrivateOffer |
Deletes the target PrivateOffer. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListPrivateOfferDocuments |
Lists PrivateOfferDocuments for the given parent. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetPrivateOfferDocument |
Gets details of a single PrivateOfferDocument. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreatePrivateOfferDocument |
Creates a new PrivateOfferDocument in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdatePrivateOfferDocument |
Updates the target PrivateOfferDocument. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeletePrivateOfferDocument |
Deletes the target PrivateOfferDocument. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListStandardOffers |
Lists StandardOffers for the given parent. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetStandardOffer |
Gets details of a single StandardOffer. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetSku |
Gets details of a single Sku. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListSkus |
Lists Skus for the given parent. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetSkuGroup |
Gets details of a single SkuGroup. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListSkuGroups |
Lists SkuGroups for the given parent. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListLocations |
Lists information about the supported locations for this service. This method lists locations based on the resource scope provided inthe ListLocationsRequest.name field: ***Global locations**: If For gRPC and client library implementations, the resource name ispassed as the |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetLocation |
Gets information about a location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of CommerceTransactionSettings to create(). For example:
To customize credentials:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
CommerceTransactionSettings commerceTransactionSettings =
CommerceTransactionSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
CommerceTransactionClient commerceTransactionClient =
CommerceTransactionClient.create(commerceTransactionSettings);
To customize the endpoint:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
CommerceTransactionSettings commerceTransactionSettings =
CommerceTransactionSettings.newBuilder().setEndpoint(myEndpoint).build();
CommerceTransactionClient commerceTransactionClient =
CommerceTransactionClient.create(commerceTransactionSettings);
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
CommerceTransactionSettings commerceTransactionSettings =
CommerceTransactionSettings.newHttpJsonBuilder().build();
CommerceTransactionClient commerceTransactionClient =
CommerceTransactionClient.create(commerceTransactionSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
Static Methods
create()
public static final CommerceTransactionClient create()Constructs an instance of CommerceTransactionClient with default settings.
| Returns | |
|---|---|
| Type | Description |
CommerceTransactionClient |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
create(CommerceTransactionSettings settings)
public static final CommerceTransactionClient create(CommerceTransactionSettings settings)Constructs an instance of CommerceTransactionClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.
| Parameter | |
|---|---|
| Name | Description |
settings |
CommerceTransactionSettings |
| Returns | |
|---|---|
| Type | Description |
CommerceTransactionClient |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
create(CommerceTransactionStub stub)
public static final CommerceTransactionClient create(CommerceTransactionStub stub)Constructs an instance of CommerceTransactionClient, using the given stub for making calls. This is for advanced usage - prefer using create(CommerceTransactionSettings).
| Parameter | |
|---|---|
| Name | Description |
stub |
CommerceTransactionStub |
| Returns | |
|---|---|
| Type | Description |
CommerceTransactionClient |
|
Constructors
CommerceTransactionClient(CommerceTransactionSettings settings)
protected CommerceTransactionClient(CommerceTransactionSettings settings)Constructs an instance of CommerceTransactionClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.
| Parameter | |
|---|---|
| Name | Description |
settings |
CommerceTransactionSettings |
CommerceTransactionClient(CommerceTransactionStub stub)
protected CommerceTransactionClient(CommerceTransactionStub stub)| Parameter | |
|---|---|
| Name | Description |
stub |
CommerceTransactionStub |
Methods
awaitTermination(long duration, TimeUnit unit)
public boolean awaitTermination(long duration, TimeUnit unit)| Parameters | |
|---|---|
| Name | Description |
duration |
long |
unit |
TimeUnit |
| Returns | |
|---|---|
| Type | Description |
boolean |
|
| Exceptions | |
|---|---|
| Type | Description |
InterruptedException |
|
cancelPrivateOffer(@Nullable PrivateOfferName name)
public final PrivateOffer cancelPrivateOffer(@Nullable PrivateOfferName name)Cancels the target PrivateOffer.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
PrivateOfferName name = PrivateOfferName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_OFFER]");
PrivateOffer response = commerceTransactionClient.cancelPrivateOffer(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
@org.jspecify.annotations.Nullable com.google.cloud.commerceproducer.v1beta.PrivateOfferNameRequired. Name of the resource |
| Returns | |
|---|---|
| Type | Description |
PrivateOffer |
|
cancelPrivateOffer(CancelPrivateOfferRequest request)
public final PrivateOffer cancelPrivateOffer(CancelPrivateOfferRequest request)Cancels the target PrivateOffer.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
CancelPrivateOfferRequest request =
CancelPrivateOfferRequest.newBuilder()
.setName(PrivateOfferName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_OFFER]").toString())
.setCancellationNote("cancellationNote806581141")
.build();
PrivateOffer response = commerceTransactionClient.cancelPrivateOffer(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
CancelPrivateOfferRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
PrivateOffer |
|
cancelPrivateOffer(String name)
public final PrivateOffer cancelPrivateOffer(String name)Cancels the target PrivateOffer.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
String name = PrivateOfferName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_OFFER]").toString();
PrivateOffer response = commerceTransactionClient.cancelPrivateOffer(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
StringRequired. Name of the resource |
| Returns | |
|---|---|
| Type | Description |
PrivateOffer |
|
cancelPrivateOfferCallable()
public final UnaryCallable<CancelPrivateOfferRequest,PrivateOffer> cancelPrivateOfferCallable()Cancels the target PrivateOffer.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
CancelPrivateOfferRequest request =
CancelPrivateOfferRequest.newBuilder()
.setName(PrivateOfferName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_OFFER]").toString())
.setCancellationNote("cancellationNote806581141")
.build();
ApiFuture<PrivateOffer> future =
commerceTransactionClient.cancelPrivateOfferCallable().futureCall(request);
// Do something.
PrivateOffer response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<CancelPrivateOfferRequest,PrivateOffer> |
|
close()
public final void close()createPrivateOffer(CreatePrivateOfferRequest request)
public final PrivateOffer createPrivateOffer(CreatePrivateOfferRequest request)Creates a new PrivateOffer in a given project and location.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
CreatePrivateOfferRequest request =
CreatePrivateOfferRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPrivateOffer(PrivateOffer.newBuilder().build())
.build();
PrivateOffer response = commerceTransactionClient.createPrivateOffer(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
CreatePrivateOfferRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
PrivateOffer |
|
createPrivateOfferCallable()
public final UnaryCallable<CreatePrivateOfferRequest,PrivateOffer> createPrivateOfferCallable()Creates a new PrivateOffer in a given project and location.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
CreatePrivateOfferRequest request =
CreatePrivateOfferRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPrivateOffer(PrivateOffer.newBuilder().build())
.build();
ApiFuture<PrivateOffer> future =
commerceTransactionClient.createPrivateOfferCallable().futureCall(request);
// Do something.
PrivateOffer response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<CreatePrivateOfferRequest,PrivateOffer> |
|
createPrivateOfferDocument(CreatePrivateOfferDocumentRequest request)
public final PrivateOfferDocument createPrivateOfferDocument(CreatePrivateOfferDocumentRequest request)Creates a new PrivateOfferDocument in a given project and location.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
CreatePrivateOfferDocumentRequest request =
CreatePrivateOfferDocumentRequest.newBuilder()
.setParent(
PrivateOfferName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_OFFER]").toString())
.setPrivateOfferDocument(PrivateOfferDocument.newBuilder().build())
.build();
PrivateOfferDocument response = commerceTransactionClient.createPrivateOfferDocument(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
CreatePrivateOfferDocumentRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
PrivateOfferDocument |
|
createPrivateOfferDocumentCallable()
public final UnaryCallable<CreatePrivateOfferDocumentRequest,PrivateOfferDocument> createPrivateOfferDocumentCallable()Creates a new PrivateOfferDocument in a given project and location.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
CreatePrivateOfferDocumentRequest request =
CreatePrivateOfferDocumentRequest.newBuilder()
.setParent(
PrivateOfferName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_OFFER]").toString())
.setPrivateOfferDocument(PrivateOfferDocument.newBuilder().build())
.build();
ApiFuture<PrivateOfferDocument> future =
commerceTransactionClient.createPrivateOfferDocumentCallable().futureCall(request);
// Do something.
PrivateOfferDocument response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<CreatePrivateOfferDocumentRequest,PrivateOfferDocument> |
|
deletePrivateOffer(@Nullable PrivateOfferName name)
public final void deletePrivateOffer(@Nullable PrivateOfferName name)Deletes the target PrivateOffer.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
PrivateOfferName name = PrivateOfferName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_OFFER]");
commerceTransactionClient.deletePrivateOffer(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
@org.jspecify.annotations.Nullable com.google.cloud.commerceproducer.v1beta.PrivateOfferNameRequired. Name of the resource |
deletePrivateOffer(DeletePrivateOfferRequest request)
public final void deletePrivateOffer(DeletePrivateOfferRequest request)Deletes the target PrivateOffer.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
DeletePrivateOfferRequest request =
DeletePrivateOfferRequest.newBuilder()
.setName(PrivateOfferName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_OFFER]").toString())
.setForce(true)
.build();
commerceTransactionClient.deletePrivateOffer(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
DeletePrivateOfferRequestThe request object containing all of the parameters for the API call. |
deletePrivateOffer(String name)
public final void deletePrivateOffer(String name)Deletes the target PrivateOffer.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
String name = PrivateOfferName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_OFFER]").toString();
commerceTransactionClient.deletePrivateOffer(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
StringRequired. Name of the resource |
deletePrivateOfferCallable()
public final UnaryCallable<DeletePrivateOfferRequest,Empty> deletePrivateOfferCallable()Deletes the target PrivateOffer.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
DeletePrivateOfferRequest request =
DeletePrivateOfferRequest.newBuilder()
.setName(PrivateOfferName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_OFFER]").toString())
.setForce(true)
.build();
ApiFuture<Empty> future =
commerceTransactionClient.deletePrivateOfferCallable().futureCall(request);
// Do something.
future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<DeletePrivateOfferRequest,Empty> |
|
deletePrivateOfferDocument(@Nullable PrivateOfferDocumentName name)
public final void deletePrivateOfferDocument(@Nullable PrivateOfferDocumentName name)Deletes the target PrivateOfferDocument.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
PrivateOfferDocumentName name =
PrivateOfferDocumentName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_OFFER]", "[DOCUMENT]");
commerceTransactionClient.deletePrivateOfferDocument(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
@org.jspecify.annotations.Nullable com.google.cloud.commerceproducer.v1beta.PrivateOfferDocumentNameRequired. Name of the resource. |
deletePrivateOfferDocument(DeletePrivateOfferDocumentRequest request)
public final void deletePrivateOfferDocument(DeletePrivateOfferDocumentRequest request)Deletes the target PrivateOfferDocument.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
DeletePrivateOfferDocumentRequest request =
DeletePrivateOfferDocumentRequest.newBuilder()
.setName(
PrivateOfferDocumentName.of(
"[PROJECT]", "[LOCATION]", "[PRIVATE_OFFER]", "[DOCUMENT]")
.toString())
.build();
commerceTransactionClient.deletePrivateOfferDocument(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
DeletePrivateOfferDocumentRequestThe request object containing all of the parameters for the API call. |
deletePrivateOfferDocument(String name)
public final void deletePrivateOfferDocument(String name)Deletes the target PrivateOfferDocument.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
String name =
PrivateOfferDocumentName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_OFFER]", "[DOCUMENT]")
.toString();
commerceTransactionClient.deletePrivateOfferDocument(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
StringRequired. Name of the resource. |
deletePrivateOfferDocumentCallable()
public final UnaryCallable<DeletePrivateOfferDocumentRequest,Empty> deletePrivateOfferDocumentCallable()Deletes the target PrivateOfferDocument.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
DeletePrivateOfferDocumentRequest request =
DeletePrivateOfferDocumentRequest.newBuilder()
.setName(
PrivateOfferDocumentName.of(
"[PROJECT]", "[LOCATION]", "[PRIVATE_OFFER]", "[DOCUMENT]")
.toString())
.build();
ApiFuture<Empty> future =
commerceTransactionClient.deletePrivateOfferDocumentCallable().futureCall(request);
// Do something.
future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<DeletePrivateOfferDocumentRequest,Empty> |
|
getLocation(GetLocationRequest request)
public final Location getLocation(GetLocationRequest request)Gets information about a location.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
Location response = commerceTransactionClient.getLocation(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
com.google.cloud.location.GetLocationRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
com.google.cloud.location.Location |
|
getLocationCallable()
public final UnaryCallable<GetLocationRequest,Location> getLocationCallable()Gets information about a location.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
ApiFuture<Location> future =
commerceTransactionClient.getLocationCallable().futureCall(request);
// Do something.
Location response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location> |
|
getPrivateOffer(@Nullable PrivateOfferName name)
public final PrivateOffer getPrivateOffer(@Nullable PrivateOfferName name)Gets details of a single PrivateOffer.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
PrivateOfferName name = PrivateOfferName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_OFFER]");
PrivateOffer response = commerceTransactionClient.getPrivateOffer(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
@org.jspecify.annotations.Nullable com.google.cloud.commerceproducer.v1beta.PrivateOfferNameRequired. Name of the resource |
| Returns | |
|---|---|
| Type | Description |
PrivateOffer |
|
getPrivateOffer(GetPrivateOfferRequest request)
public final PrivateOffer getPrivateOffer(GetPrivateOfferRequest request)Gets details of a single PrivateOffer.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
GetPrivateOfferRequest request =
GetPrivateOfferRequest.newBuilder()
.setName(PrivateOfferName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_OFFER]").toString())
.setView(PrivateOfferView.forNumber(0))
.build();
PrivateOffer response = commerceTransactionClient.getPrivateOffer(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
GetPrivateOfferRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
PrivateOffer |
|
getPrivateOffer(String name)
public final PrivateOffer getPrivateOffer(String name)Gets details of a single PrivateOffer.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
String name = PrivateOfferName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_OFFER]").toString();
PrivateOffer response = commerceTransactionClient.getPrivateOffer(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
StringRequired. Name of the resource |
| Returns | |
|---|---|
| Type | Description |
PrivateOffer |
|
getPrivateOfferCallable()
public final UnaryCallable<GetPrivateOfferRequest,PrivateOffer> getPrivateOfferCallable()Gets details of a single PrivateOffer.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
GetPrivateOfferRequest request =
GetPrivateOfferRequest.newBuilder()
.setName(PrivateOfferName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_OFFER]").toString())
.setView(PrivateOfferView.forNumber(0))
.build();
ApiFuture<PrivateOffer> future =
commerceTransactionClient.getPrivateOfferCallable().futureCall(request);
// Do something.
PrivateOffer response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<GetPrivateOfferRequest,PrivateOffer> |
|
getPrivateOfferDocument(@Nullable PrivateOfferDocumentName name)
public final PrivateOfferDocument getPrivateOfferDocument(@Nullable PrivateOfferDocumentName name)Gets details of a single PrivateOfferDocument.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
PrivateOfferDocumentName name =
PrivateOfferDocumentName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_OFFER]", "[DOCUMENT]");
PrivateOfferDocument response = commerceTransactionClient.getPrivateOfferDocument(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
@org.jspecify.annotations.Nullable com.google.cloud.commerceproducer.v1beta.PrivateOfferDocumentNameRequired. Name of the resource. |
| Returns | |
|---|---|
| Type | Description |
PrivateOfferDocument |
|
getPrivateOfferDocument(GetPrivateOfferDocumentRequest request)
public final PrivateOfferDocument getPrivateOfferDocument(GetPrivateOfferDocumentRequest request)Gets details of a single PrivateOfferDocument.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
GetPrivateOfferDocumentRequest request =
GetPrivateOfferDocumentRequest.newBuilder()
.setName(
PrivateOfferDocumentName.of(
"[PROJECT]", "[LOCATION]", "[PRIVATE_OFFER]", "[DOCUMENT]")
.toString())
.build();
PrivateOfferDocument response = commerceTransactionClient.getPrivateOfferDocument(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
GetPrivateOfferDocumentRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
PrivateOfferDocument |
|
getPrivateOfferDocument(String name)
public final PrivateOfferDocument getPrivateOfferDocument(String name)Gets details of a single PrivateOfferDocument.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
String name =
PrivateOfferDocumentName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_OFFER]", "[DOCUMENT]")
.toString();
PrivateOfferDocument response = commerceTransactionClient.getPrivateOfferDocument(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
StringRequired. Name of the resource. |
| Returns | |
|---|---|
| Type | Description |
PrivateOfferDocument |
|
getPrivateOfferDocumentCallable()
public final UnaryCallable<GetPrivateOfferDocumentRequest,PrivateOfferDocument> getPrivateOfferDocumentCallable()Gets details of a single PrivateOfferDocument.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
GetPrivateOfferDocumentRequest request =
GetPrivateOfferDocumentRequest.newBuilder()
.setName(
PrivateOfferDocumentName.of(
"[PROJECT]", "[LOCATION]", "[PRIVATE_OFFER]", "[DOCUMENT]")
.toString())
.build();
ApiFuture<PrivateOfferDocument> future =
commerceTransactionClient.getPrivateOfferDocumentCallable().futureCall(request);
// Do something.
PrivateOfferDocument response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<GetPrivateOfferDocumentRequest,PrivateOfferDocument> |
|
getService(@Nullable ServiceName name)
public final Service getService(@Nullable ServiceName name)Gets details of a single Service.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
ServiceName name = ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]");
Service response = commerceTransactionClient.getService(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
@org.jspecify.annotations.Nullable com.google.cloud.commerceproducer.v1beta.ServiceNameRequired. Name of the resource |
| Returns | |
|---|---|
| Type | Description |
Service |
|
getService(GetServiceRequest request)
public final Service getService(GetServiceRequest request)Gets details of a single Service.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
GetServiceRequest request =
GetServiceRequest.newBuilder()
.setName(ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]").toString())
.setView(ServiceView.forNumber(0))
.build();
Service response = commerceTransactionClient.getService(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
GetServiceRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
Service |
|
getService(String name)
public final Service getService(String name)Gets details of a single Service.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
String name = ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]").toString();
Service response = commerceTransactionClient.getService(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
StringRequired. Name of the resource |
| Returns | |
|---|---|
| Type | Description |
Service |
|
getServiceCallable()
public final UnaryCallable<GetServiceRequest,Service> getServiceCallable()Gets details of a single Service.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
GetServiceRequest request =
GetServiceRequest.newBuilder()
.setName(ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]").toString())
.setView(ServiceView.forNumber(0))
.build();
ApiFuture<Service> future =
commerceTransactionClient.getServiceCallable().futureCall(request);
// Do something.
Service response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<GetServiceRequest,Service> |
|
getSettings()
public final @Nullable CommerceTransactionSettings getSettings()| Returns | |
|---|---|
| Type | Description |
@org.jspecify.annotations.Nullable com.google.cloud.commerceproducer.v1beta.CommerceTransactionSettings |
|
getSku(@Nullable SkuName name)
public final Sku getSku(@Nullable SkuName name)Gets details of a single Sku.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
SkuName name = SkuName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[SKU]");
Sku response = commerceTransactionClient.getSku(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
@org.jspecify.annotations.Nullable com.google.cloud.commerceproducer.v1beta.SkuNameRequired. Name of the resource |
| Returns | |
|---|---|
| Type | Description |
Sku |
|
getSku(GetSkuRequest request)
public final Sku getSku(GetSkuRequest request)Gets details of a single Sku.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
GetSkuRequest request =
GetSkuRequest.newBuilder()
.setName(SkuName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[SKU]").toString())
.build();
Sku response = commerceTransactionClient.getSku(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
GetSkuRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
Sku |
|
getSku(String name)
public final Sku getSku(String name)Gets details of a single Sku.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
String name = SkuName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[SKU]").toString();
Sku response = commerceTransactionClient.getSku(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
StringRequired. Name of the resource |
| Returns | |
|---|---|
| Type | Description |
Sku |
|
getSkuCallable()
public final UnaryCallable<GetSkuRequest,Sku> getSkuCallable()Gets details of a single Sku.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
GetSkuRequest request =
GetSkuRequest.newBuilder()
.setName(SkuName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[SKU]").toString())
.build();
ApiFuture<Sku> future = commerceTransactionClient.getSkuCallable().futureCall(request);
// Do something.
Sku response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<GetSkuRequest,Sku> |
|
getSkuGroup(@Nullable SkuGroupName name)
public final SkuGroup getSkuGroup(@Nullable SkuGroupName name)Gets details of a single SkuGroup.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
SkuGroupName name = SkuGroupName.of("[PROJECT]", "[LOCATION]", "[SKU_GROUP]");
SkuGroup response = commerceTransactionClient.getSkuGroup(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
@org.jspecify.annotations.Nullable com.google.cloud.commerceproducer.v1beta.SkuGroupNameRequired. Name of the resource |
| Returns | |
|---|---|
| Type | Description |
SkuGroup |
|
getSkuGroup(GetSkuGroupRequest request)
public final SkuGroup getSkuGroup(GetSkuGroupRequest request)Gets details of a single SkuGroup.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
GetSkuGroupRequest request =
GetSkuGroupRequest.newBuilder()
.setName(SkuGroupName.of("[PROJECT]", "[LOCATION]", "[SKU_GROUP]").toString())
.build();
SkuGroup response = commerceTransactionClient.getSkuGroup(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
GetSkuGroupRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
SkuGroup |
|
getSkuGroup(String name)
public final SkuGroup getSkuGroup(String name)Gets details of a single SkuGroup.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
String name = SkuGroupName.of("[PROJECT]", "[LOCATION]", "[SKU_GROUP]").toString();
SkuGroup response = commerceTransactionClient.getSkuGroup(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
StringRequired. Name of the resource |
| Returns | |
|---|---|
| Type | Description |
SkuGroup |
|
getSkuGroupCallable()
public final UnaryCallable<GetSkuGroupRequest,SkuGroup> getSkuGroupCallable()Gets details of a single SkuGroup.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
GetSkuGroupRequest request =
GetSkuGroupRequest.newBuilder()
.setName(SkuGroupName.of("[PROJECT]", "[LOCATION]", "[SKU_GROUP]").toString())
.build();
ApiFuture<SkuGroup> future =
commerceTransactionClient.getSkuGroupCallable().futureCall(request);
// Do something.
SkuGroup response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<GetSkuGroupRequest,SkuGroup> |
|
getStandardOffer(@Nullable StandardOfferName name)
public final StandardOffer getStandardOffer(@Nullable StandardOfferName name)Gets details of a single StandardOffer.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
StandardOfferName name =
StandardOfferName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[STANDARD_OFFER]");
StandardOffer response = commerceTransactionClient.getStandardOffer(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
@org.jspecify.annotations.Nullable com.google.cloud.commerceproducer.v1beta.StandardOfferNameRequired. Name of the resource |
| Returns | |
|---|---|
| Type | Description |
StandardOffer |
|
getStandardOffer(GetStandardOfferRequest request)
public final StandardOffer getStandardOffer(GetStandardOfferRequest request)Gets details of a single StandardOffer.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
GetStandardOfferRequest request =
GetStandardOfferRequest.newBuilder()
.setName(
StandardOfferName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[STANDARD_OFFER]")
.toString())
.setView(StandardOfferView.forNumber(0))
.build();
StandardOffer response = commerceTransactionClient.getStandardOffer(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
GetStandardOfferRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
StandardOffer |
|
getStandardOffer(String name)
public final StandardOffer getStandardOffer(String name)Gets details of a single StandardOffer.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
String name =
StandardOfferName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[STANDARD_OFFER]")
.toString();
StandardOffer response = commerceTransactionClient.getStandardOffer(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
StringRequired. Name of the resource |
| Returns | |
|---|---|
| Type | Description |
StandardOffer |
|
getStandardOfferCallable()
public final UnaryCallable<GetStandardOfferRequest,StandardOffer> getStandardOfferCallable()Gets details of a single StandardOffer.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
GetStandardOfferRequest request =
GetStandardOfferRequest.newBuilder()
.setName(
StandardOfferName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[STANDARD_OFFER]")
.toString())
.setView(StandardOfferView.forNumber(0))
.build();
ApiFuture<StandardOffer> future =
commerceTransactionClient.getStandardOfferCallable().futureCall(request);
// Do something.
StandardOffer response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<GetStandardOfferRequest,StandardOffer> |
|
getStub()
public CommerceTransactionStub getStub()| Returns | |
|---|---|
| Type | Description |
CommerceTransactionStub |
|
isShutdown()
public boolean isShutdown()| Returns | |
|---|---|
| Type | Description |
boolean |
|
isTerminated()
public boolean isTerminated()| Returns | |
|---|---|
| Type | Description |
boolean |
|
listLocations(ListLocationsRequest request)
public final CommerceTransactionClient.ListLocationsPagedResponse listLocations(ListLocationsRequest request)Lists information about the supported locations for this service.
This method lists locations based on the resource scope provided inthe
ListLocationsRequest.name field:
***Global locations**: If name is empty, the method lists thepublic
locations available to all projects. * **Project-specificlocations**: If
name follows the formatprojects/{project}, the method lists locations visible to
thatspecific project. This includes public, private, or otherproject-specific locations enabled
for the project.
For gRPC and client library implementations, the resource name ispassed as the name field.
For direct service calls, the resourcename isincorporated into the request path based on the
specific serviceimplementation and version.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (Location element : commerceTransactionClient.listLocations(request).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
request |
com.google.cloud.location.ListLocationsRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
CommerceTransactionClient.ListLocationsPagedResponse |
|
listLocationsCallable()
public final UnaryCallable<ListLocationsRequest,ListLocationsResponse> listLocationsCallable()Lists information about the supported locations for this service.
This method lists locations based on the resource scope provided inthe
ListLocationsRequest.name field:
***Global locations**: If name is empty, the method lists thepublic
locations available to all projects. * **Project-specificlocations**: If
name follows the formatprojects/{project}, the method lists locations visible to
thatspecific project. This includes public, private, or otherproject-specific locations enabled
for the project.
For gRPC and client library implementations, the resource name ispassed as the name field.
For direct service calls, the resourcename isincorporated into the request path based on the
specific serviceimplementation and version.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListLocationsResponse response =
commerceTransactionClient.listLocationsCallable().call(request);
for (Location element : response.getLocationsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse> |
|
listLocationsPagedCallable()
public final UnaryCallable<ListLocationsRequest,CommerceTransactionClient.ListLocationsPagedResponse> listLocationsPagedCallable()Lists information about the supported locations for this service.
This method lists locations based on the resource scope provided inthe
ListLocationsRequest.name field:
***Global locations**: If name is empty, the method lists thepublic
locations available to all projects. * **Project-specificlocations**: If
name follows the formatprojects/{project}, the method lists locations visible to
thatspecific project. This includes public, private, or otherproject-specific locations enabled
for the project.
For gRPC and client library implementations, the resource name ispassed as the name field.
For direct service calls, the resourcename isincorporated into the request path based on the
specific serviceimplementation and version.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<Location> future =
commerceTransactionClient.listLocationsPagedCallable().futureCall(request);
// Do something.
for (Location element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<com.google.cloud.location.ListLocationsRequest,ListLocationsPagedResponse> |
|
listPrivateOfferDocuments(@Nullable PrivateOfferName parent)
public final CommerceTransactionClient.ListPrivateOfferDocumentsPagedResponse listPrivateOfferDocuments(@Nullable PrivateOfferName parent)Lists PrivateOfferDocuments for the given parent.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
PrivateOfferName parent = PrivateOfferName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_OFFER]");
for (PrivateOfferDocument element :
commerceTransactionClient.listPrivateOfferDocuments(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
@org.jspecify.annotations.Nullable com.google.cloud.commerceproducer.v1beta.PrivateOfferNameRequired. Parent value for ListPrivateOfferDocumentsRequest. |
| Returns | |
|---|---|
| Type | Description |
CommerceTransactionClient.ListPrivateOfferDocumentsPagedResponse |
|
listPrivateOfferDocuments(ListPrivateOfferDocumentsRequest request)
public final CommerceTransactionClient.ListPrivateOfferDocumentsPagedResponse listPrivateOfferDocuments(ListPrivateOfferDocumentsRequest request)Lists PrivateOfferDocuments for the given parent.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
ListPrivateOfferDocumentsRequest request =
ListPrivateOfferDocumentsRequest.newBuilder()
.setParent(
PrivateOfferName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_OFFER]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (PrivateOfferDocument element :
commerceTransactionClient.listPrivateOfferDocuments(request).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
request |
ListPrivateOfferDocumentsRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
CommerceTransactionClient.ListPrivateOfferDocumentsPagedResponse |
|
listPrivateOfferDocuments(String parent)
public final CommerceTransactionClient.ListPrivateOfferDocumentsPagedResponse listPrivateOfferDocuments(String parent)Lists PrivateOfferDocuments for the given parent.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
String parent = PrivateOfferName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_OFFER]").toString();
for (PrivateOfferDocument element :
commerceTransactionClient.listPrivateOfferDocuments(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
StringRequired. Parent value for ListPrivateOfferDocumentsRequest. |
| Returns | |
|---|---|
| Type | Description |
CommerceTransactionClient.ListPrivateOfferDocumentsPagedResponse |
|
listPrivateOfferDocumentsCallable()
public final UnaryCallable<ListPrivateOfferDocumentsRequest,ListPrivateOfferDocumentsResponse> listPrivateOfferDocumentsCallable()Lists PrivateOfferDocuments for the given parent.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
ListPrivateOfferDocumentsRequest request =
ListPrivateOfferDocumentsRequest.newBuilder()
.setParent(
PrivateOfferName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_OFFER]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListPrivateOfferDocumentsResponse response =
commerceTransactionClient.listPrivateOfferDocumentsCallable().call(request);
for (PrivateOfferDocument element : response.getPrivateOfferDocumentsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListPrivateOfferDocumentsRequest,ListPrivateOfferDocumentsResponse> |
|
listPrivateOfferDocumentsPagedCallable()
public final UnaryCallable<ListPrivateOfferDocumentsRequest,CommerceTransactionClient.ListPrivateOfferDocumentsPagedResponse> listPrivateOfferDocumentsPagedCallable()Lists PrivateOfferDocuments for the given parent.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
ListPrivateOfferDocumentsRequest request =
ListPrivateOfferDocumentsRequest.newBuilder()
.setParent(
PrivateOfferName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_OFFER]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<PrivateOfferDocument> future =
commerceTransactionClient.listPrivateOfferDocumentsPagedCallable().futureCall(request);
// Do something.
for (PrivateOfferDocument element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListPrivateOfferDocumentsRequest,ListPrivateOfferDocumentsPagedResponse> |
|
listPrivateOffers(@Nullable LocationName parent)
public final CommerceTransactionClient.ListPrivateOffersPagedResponse listPrivateOffers(@Nullable LocationName parent)Lists PrivateOffers for the given parent.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (PrivateOffer element :
commerceTransactionClient.listPrivateOffers(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
@org.jspecify.annotations.Nullable com.google.cloud.commerceproducer.v1beta.LocationNameRequired. Parent value for ListPrivateOffersRequest |
| Returns | |
|---|---|
| Type | Description |
CommerceTransactionClient.ListPrivateOffersPagedResponse |
|
listPrivateOffers(ListPrivateOffersRequest request)
public final CommerceTransactionClient.ListPrivateOffersPagedResponse listPrivateOffers(ListPrivateOffersRequest request)Lists PrivateOffers for the given parent.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
ListPrivateOffersRequest request =
ListPrivateOffersRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
for (PrivateOffer element :
commerceTransactionClient.listPrivateOffers(request).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
request |
ListPrivateOffersRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
CommerceTransactionClient.ListPrivateOffersPagedResponse |
|
listPrivateOffers(String parent)
public final CommerceTransactionClient.ListPrivateOffersPagedResponse listPrivateOffers(String parent)Lists PrivateOffers for the given parent.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
for (PrivateOffer element :
commerceTransactionClient.listPrivateOffers(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
StringRequired. Parent value for ListPrivateOffersRequest |
| Returns | |
|---|---|
| Type | Description |
CommerceTransactionClient.ListPrivateOffersPagedResponse |
|
listPrivateOffersCallable()
public final UnaryCallable<ListPrivateOffersRequest,ListPrivateOffersResponse> listPrivateOffersCallable()Lists PrivateOffers for the given parent.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
ListPrivateOffersRequest request =
ListPrivateOffersRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
while (true) {
ListPrivateOffersResponse response =
commerceTransactionClient.listPrivateOffersCallable().call(request);
for (PrivateOffer element : response.getPrivateOffersList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListPrivateOffersRequest,ListPrivateOffersResponse> |
|
listPrivateOffersPagedCallable()
public final UnaryCallable<ListPrivateOffersRequest,CommerceTransactionClient.ListPrivateOffersPagedResponse> listPrivateOffersPagedCallable()Lists PrivateOffers for the given parent.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
ListPrivateOffersRequest request =
ListPrivateOffersRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
ApiFuture<PrivateOffer> future =
commerceTransactionClient.listPrivateOffersPagedCallable().futureCall(request);
// Do something.
for (PrivateOffer element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListPrivateOffersRequest,ListPrivateOffersPagedResponse> |
|
listServices(@Nullable LocationName parent)
public final CommerceTransactionClient.ListServicesPagedResponse listServices(@Nullable LocationName parent)Lists Services in a given project and location.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (Service element : commerceTransactionClient.listServices(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
@org.jspecify.annotations.Nullable com.google.cloud.commerceproducer.v1beta.LocationNameRequired. Parent value for ListServicesRequest |
| Returns | |
|---|---|
| Type | Description |
CommerceTransactionClient.ListServicesPagedResponse |
|
listServices(ListServicesRequest request)
public final CommerceTransactionClient.ListServicesPagedResponse listServices(ListServicesRequest request)Lists Services in a given project and location.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
ListServicesRequest request =
ListServicesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (Service element : commerceTransactionClient.listServices(request).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
request |
ListServicesRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
CommerceTransactionClient.ListServicesPagedResponse |
|
listServices(String parent)
public final CommerceTransactionClient.ListServicesPagedResponse listServices(String parent)Lists Services in a given project and location.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
for (Service element : commerceTransactionClient.listServices(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
StringRequired. Parent value for ListServicesRequest |
| Returns | |
|---|---|
| Type | Description |
CommerceTransactionClient.ListServicesPagedResponse |
|
listServicesCallable()
public final UnaryCallable<ListServicesRequest,ListServicesResponse> listServicesCallable()Lists Services in a given project and location.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
ListServicesRequest request =
ListServicesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListServicesResponse response =
commerceTransactionClient.listServicesCallable().call(request);
for (Service element : response.getServicesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListServicesRequest,ListServicesResponse> |
|
listServicesPagedCallable()
public final UnaryCallable<ListServicesRequest,CommerceTransactionClient.ListServicesPagedResponse> listServicesPagedCallable()Lists Services in a given project and location.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
ListServicesRequest request =
ListServicesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<Service> future =
commerceTransactionClient.listServicesPagedCallable().futureCall(request);
// Do something.
for (Service element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListServicesRequest,ListServicesPagedResponse> |
|
listSkuGroups(@Nullable LocationName parent)
public final CommerceTransactionClient.ListSkuGroupsPagedResponse listSkuGroups(@Nullable LocationName parent)Lists SkuGroups for the given parent.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (SkuGroup element : commerceTransactionClient.listSkuGroups(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
@org.jspecify.annotations.Nullable com.google.cloud.commerceproducer.v1beta.LocationNameRequired. Parent value for ListSkuGroupsRequest |
| Returns | |
|---|---|
| Type | Description |
CommerceTransactionClient.ListSkuGroupsPagedResponse |
|
listSkuGroups(ListSkuGroupsRequest request)
public final CommerceTransactionClient.ListSkuGroupsPagedResponse listSkuGroups(ListSkuGroupsRequest request)Lists SkuGroups for the given parent.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
ListSkuGroupsRequest request =
ListSkuGroupsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (SkuGroup element : commerceTransactionClient.listSkuGroups(request).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
request |
ListSkuGroupsRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
CommerceTransactionClient.ListSkuGroupsPagedResponse |
|
listSkuGroups(String parent)
public final CommerceTransactionClient.ListSkuGroupsPagedResponse listSkuGroups(String parent)Lists SkuGroups for the given parent.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
for (SkuGroup element : commerceTransactionClient.listSkuGroups(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
StringRequired. Parent value for ListSkuGroupsRequest |
| Returns | |
|---|---|
| Type | Description |
CommerceTransactionClient.ListSkuGroupsPagedResponse |
|
listSkuGroupsCallable()
public final UnaryCallable<ListSkuGroupsRequest,ListSkuGroupsResponse> listSkuGroupsCallable()Lists SkuGroups for the given parent.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
ListSkuGroupsRequest request =
ListSkuGroupsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListSkuGroupsResponse response =
commerceTransactionClient.listSkuGroupsCallable().call(request);
for (SkuGroup element : response.getSkuGroupsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListSkuGroupsRequest,ListSkuGroupsResponse> |
|
listSkuGroupsPagedCallable()
public final UnaryCallable<ListSkuGroupsRequest,CommerceTransactionClient.ListSkuGroupsPagedResponse> listSkuGroupsPagedCallable()Lists SkuGroups for the given parent.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
ListSkuGroupsRequest request =
ListSkuGroupsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<SkuGroup> future =
commerceTransactionClient.listSkuGroupsPagedCallable().futureCall(request);
// Do something.
for (SkuGroup element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListSkuGroupsRequest,ListSkuGroupsPagedResponse> |
|
listSkus(@Nullable ServiceName parent)
public final CommerceTransactionClient.ListSkusPagedResponse listSkus(@Nullable ServiceName parent)Lists Skus for the given parent.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
ServiceName parent = ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]");
for (Sku element : commerceTransactionClient.listSkus(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
@org.jspecify.annotations.Nullable com.google.cloud.commerceproducer.v1beta.ServiceNameRequired. Parent value for ListSkusRequest |
| Returns | |
|---|---|
| Type | Description |
CommerceTransactionClient.ListSkusPagedResponse |
|
listSkus(ListSkusRequest request)
public final CommerceTransactionClient.ListSkusPagedResponse listSkus(ListSkusRequest request)Lists Skus for the given parent.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
ListSkusRequest request =
ListSkusRequest.newBuilder()
.setParent(ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (Sku element : commerceTransactionClient.listSkus(request).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
request |
ListSkusRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
CommerceTransactionClient.ListSkusPagedResponse |
|
listSkus(String parent)
public final CommerceTransactionClient.ListSkusPagedResponse listSkus(String parent)Lists Skus for the given parent.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
String parent = ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]").toString();
for (Sku element : commerceTransactionClient.listSkus(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
StringRequired. Parent value for ListSkusRequest |
| Returns | |
|---|---|
| Type | Description |
CommerceTransactionClient.ListSkusPagedResponse |
|
listSkusCallable()
public final UnaryCallable<ListSkusRequest,ListSkusResponse> listSkusCallable()Lists Skus for the given parent.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
ListSkusRequest request =
ListSkusRequest.newBuilder()
.setParent(ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListSkusResponse response = commerceTransactionClient.listSkusCallable().call(request);
for (Sku element : response.getSkusList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListSkusRequest,ListSkusResponse> |
|
listSkusPagedCallable()
public final UnaryCallable<ListSkusRequest,CommerceTransactionClient.ListSkusPagedResponse> listSkusPagedCallable()Lists Skus for the given parent.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
ListSkusRequest request =
ListSkusRequest.newBuilder()
.setParent(ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<Sku> future = commerceTransactionClient.listSkusPagedCallable().futureCall(request);
// Do something.
for (Sku element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListSkusRequest,ListSkusPagedResponse> |
|
listStandardOffers(@Nullable ServiceName parent)
public final CommerceTransactionClient.ListStandardOffersPagedResponse listStandardOffers(@Nullable ServiceName parent)Lists StandardOffers for the given parent.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
ServiceName parent = ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]");
for (StandardOffer element :
commerceTransactionClient.listStandardOffers(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
@org.jspecify.annotations.Nullable com.google.cloud.commerceproducer.v1beta.ServiceNameRequired. Parent value for ListStandardOffersRequest |
| Returns | |
|---|---|
| Type | Description |
CommerceTransactionClient.ListStandardOffersPagedResponse |
|
listStandardOffers(ListStandardOffersRequest request)
public final CommerceTransactionClient.ListStandardOffersPagedResponse listStandardOffers(ListStandardOffersRequest request)Lists StandardOffers for the given parent.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
ListStandardOffersRequest request =
ListStandardOffersRequest.newBuilder()
.setParent(ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
for (StandardOffer element :
commerceTransactionClient.listStandardOffers(request).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
request |
ListStandardOffersRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
CommerceTransactionClient.ListStandardOffersPagedResponse |
|
listStandardOffers(String parent)
public final CommerceTransactionClient.ListStandardOffersPagedResponse listStandardOffers(String parent)Lists StandardOffers for the given parent.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
String parent = ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]").toString();
for (StandardOffer element :
commerceTransactionClient.listStandardOffers(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
StringRequired. Parent value for ListStandardOffersRequest |
| Returns | |
|---|---|
| Type | Description |
CommerceTransactionClient.ListStandardOffersPagedResponse |
|
listStandardOffersCallable()
public final UnaryCallable<ListStandardOffersRequest,ListStandardOffersResponse> listStandardOffersCallable()Lists StandardOffers for the given parent.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
ListStandardOffersRequest request =
ListStandardOffersRequest.newBuilder()
.setParent(ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
while (true) {
ListStandardOffersResponse response =
commerceTransactionClient.listStandardOffersCallable().call(request);
for (StandardOffer element : response.getStandardOffersList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListStandardOffersRequest,ListStandardOffersResponse> |
|
listStandardOffersPagedCallable()
public final UnaryCallable<ListStandardOffersRequest,CommerceTransactionClient.ListStandardOffersPagedResponse> listStandardOffersPagedCallable()Lists StandardOffers for the given parent.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
ListStandardOffersRequest request =
ListStandardOffersRequest.newBuilder()
.setParent(ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
ApiFuture<StandardOffer> future =
commerceTransactionClient.listStandardOffersPagedCallable().futureCall(request);
// Do something.
for (StandardOffer element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListStandardOffersRequest,ListStandardOffersPagedResponse> |
|
publishPrivateOffer(@Nullable PrivateOfferName name)
public final PrivateOffer publishPrivateOffer(@Nullable PrivateOfferName name)Publishes the target PrivateOffer.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
PrivateOfferName name = PrivateOfferName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_OFFER]");
PrivateOffer response = commerceTransactionClient.publishPrivateOffer(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
@org.jspecify.annotations.Nullable com.google.cloud.commerceproducer.v1beta.PrivateOfferNameRequired. Name of the resource |
| Returns | |
|---|---|
| Type | Description |
PrivateOffer |
|
publishPrivateOffer(PublishPrivateOfferRequest request)
public final PrivateOffer publishPrivateOffer(PublishPrivateOfferRequest request)Publishes the target PrivateOffer.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
PublishPrivateOfferRequest request =
PublishPrivateOfferRequest.newBuilder()
.setName(PrivateOfferName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_OFFER]").toString())
.setValidateOnly(true)
.build();
PrivateOffer response = commerceTransactionClient.publishPrivateOffer(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
PublishPrivateOfferRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
PrivateOffer |
|
publishPrivateOffer(String name)
public final PrivateOffer publishPrivateOffer(String name)Publishes the target PrivateOffer.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
String name = PrivateOfferName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_OFFER]").toString();
PrivateOffer response = commerceTransactionClient.publishPrivateOffer(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
StringRequired. Name of the resource |
| Returns | |
|---|---|
| Type | Description |
PrivateOffer |
|
publishPrivateOfferCallable()
public final UnaryCallable<PublishPrivateOfferRequest,PrivateOffer> publishPrivateOfferCallable()Publishes the target PrivateOffer.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
PublishPrivateOfferRequest request =
PublishPrivateOfferRequest.newBuilder()
.setName(PrivateOfferName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_OFFER]").toString())
.setValidateOnly(true)
.build();
ApiFuture<PrivateOffer> future =
commerceTransactionClient.publishPrivateOfferCallable().futureCall(request);
// Do something.
PrivateOffer response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<PublishPrivateOfferRequest,PrivateOffer> |
|
resolveAmendmentTarget(@Nullable LocationName parent, @Nullable BillingAccountName targetBillingAccount, @Nullable StandardOfferName baseStandardOffer)
public final ResolveAmendmentTargetResponse resolveAmendmentTarget(@Nullable LocationName parent, @Nullable BillingAccountName targetBillingAccount, @Nullable StandardOfferName baseStandardOffer)Resolves the existing offer that must be amended when creating a new PrivateOffer. Use this method to determine the correct amendment target before creating or publishing an offer.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
BillingAccountName targetBillingAccount = BillingAccountName.of("[BILLING_ACCOUNT]");
StandardOfferName baseStandardOffer =
StandardOfferName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[STANDARD_OFFER]");
ResolveAmendmentTargetResponse response =
commerceTransactionClient.resolveAmendmentTarget(
parent, targetBillingAccount, baseStandardOffer);
}
| Parameters | |
|---|---|
| Name | Description |
parent |
@org.jspecify.annotations.Nullable com.google.cloud.commerceproducer.v1beta.LocationNameRequired. Parent value for ResolveAmendmentTargetRequest |
targetBillingAccount |
@org.jspecify.annotations.Nullable com.google.cloud.commerceproducer.v1beta.BillingAccountNameRequired. The customer's billing account targeted by the offer. This is the billing account for which the new private offer will be created on. Format: billingAccounts/{billing_account}. |
baseStandardOffer |
@org.jspecify.annotations.Nullable com.google.cloud.commerceproducer.v1beta.StandardOfferNameRequired. The base standard offer that the private offer will be based on. Format: projects/{project}/locations/{location}/services/{service}/standardOffers/{standard_offer}. |
| Returns | |
|---|---|
| Type | Description |
ResolveAmendmentTargetResponse |
|
resolveAmendmentTarget(@Nullable LocationName parent, @Nullable BillingAccountName targetBillingAccount, String baseStandardOffer)
public final ResolveAmendmentTargetResponse resolveAmendmentTarget(@Nullable LocationName parent, @Nullable BillingAccountName targetBillingAccount, String baseStandardOffer)Resolves the existing offer that must be amended when creating a new PrivateOffer. Use this method to determine the correct amendment target before creating or publishing an offer.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
BillingAccountName targetBillingAccount = BillingAccountName.of("[BILLING_ACCOUNT]");
String baseStandardOffer =
StandardOfferName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[STANDARD_OFFER]")
.toString();
ResolveAmendmentTargetResponse response =
commerceTransactionClient.resolveAmendmentTarget(
parent, targetBillingAccount, baseStandardOffer);
}
| Parameters | |
|---|---|
| Name | Description |
parent |
@org.jspecify.annotations.Nullable com.google.cloud.commerceproducer.v1beta.LocationNameRequired. Parent value for ResolveAmendmentTargetRequest |
targetBillingAccount |
@org.jspecify.annotations.Nullable com.google.cloud.commerceproducer.v1beta.BillingAccountNameRequired. The customer's billing account targeted by the offer. This is the billing account for which the new private offer will be created on. Format: billingAccounts/{billing_account}. |
baseStandardOffer |
StringRequired. The base standard offer that the private offer will be based on. Format: projects/{project}/locations/{location}/services/{service}/standardOffers/{standard_offer}. |
| Returns | |
|---|---|
| Type | Description |
ResolveAmendmentTargetResponse |
|
resolveAmendmentTarget(@Nullable LocationName parent, String targetBillingAccount, @Nullable StandardOfferName baseStandardOffer)
public final ResolveAmendmentTargetResponse resolveAmendmentTarget(@Nullable LocationName parent, String targetBillingAccount, @Nullable StandardOfferName baseStandardOffer)Resolves the existing offer that must be amended when creating a new PrivateOffer. Use this method to determine the correct amendment target before creating or publishing an offer.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
String targetBillingAccount = BillingAccountName.of("[BILLING_ACCOUNT]").toString();
StandardOfferName baseStandardOffer =
StandardOfferName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[STANDARD_OFFER]");
ResolveAmendmentTargetResponse response =
commerceTransactionClient.resolveAmendmentTarget(
parent, targetBillingAccount, baseStandardOffer);
}
| Parameters | |
|---|---|
| Name | Description |
parent |
@org.jspecify.annotations.Nullable com.google.cloud.commerceproducer.v1beta.LocationNameRequired. Parent value for ResolveAmendmentTargetRequest |
targetBillingAccount |
StringRequired. The customer's billing account targeted by the offer. This is the billing account for which the new private offer will be created on. Format: billingAccounts/{billing_account}. |
baseStandardOffer |
@org.jspecify.annotations.Nullable com.google.cloud.commerceproducer.v1beta.StandardOfferNameRequired. The base standard offer that the private offer will be based on. Format: projects/{project}/locations/{location}/services/{service}/standardOffers/{standard_offer}. |
| Returns | |
|---|---|
| Type | Description |
ResolveAmendmentTargetResponse |
|
resolveAmendmentTarget(@Nullable LocationName parent, String targetBillingAccount, String baseStandardOffer)
public final ResolveAmendmentTargetResponse resolveAmendmentTarget(@Nullable LocationName parent, String targetBillingAccount, String baseStandardOffer)Resolves the existing offer that must be amended when creating a new PrivateOffer. Use this method to determine the correct amendment target before creating or publishing an offer.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
String targetBillingAccount = BillingAccountName.of("[BILLING_ACCOUNT]").toString();
String baseStandardOffer =
StandardOfferName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[STANDARD_OFFER]")
.toString();
ResolveAmendmentTargetResponse response =
commerceTransactionClient.resolveAmendmentTarget(
parent, targetBillingAccount, baseStandardOffer);
}
| Parameters | |
|---|---|
| Name | Description |
parent |
@org.jspecify.annotations.Nullable com.google.cloud.commerceproducer.v1beta.LocationNameRequired. Parent value for ResolveAmendmentTargetRequest |
targetBillingAccount |
StringRequired. The customer's billing account targeted by the offer. This is the billing account for which the new private offer will be created on. Format: billingAccounts/{billing_account}. |
baseStandardOffer |
StringRequired. The base standard offer that the private offer will be based on. Format: projects/{project}/locations/{location}/services/{service}/standardOffers/{standard_offer}. |
| Returns | |
|---|---|
| Type | Description |
ResolveAmendmentTargetResponse |
|
resolveAmendmentTarget(ResolveAmendmentTargetRequest request)
public final ResolveAmendmentTargetResponse resolveAmendmentTarget(ResolveAmendmentTargetRequest request)Resolves the existing offer that must be amended when creating a new PrivateOffer. Use this method to determine the correct amendment target before creating or publishing an offer.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
ResolveAmendmentTargetRequest request =
ResolveAmendmentTargetRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setTargetBillingAccount(BillingAccountName.of("[BILLING_ACCOUNT]").toString())
.setBaseStandardOffer(
StandardOfferName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[STANDARD_OFFER]")
.toString())
.build();
ResolveAmendmentTargetResponse response =
commerceTransactionClient.resolveAmendmentTarget(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
ResolveAmendmentTargetRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
ResolveAmendmentTargetResponse |
|
resolveAmendmentTarget(String parent, @Nullable BillingAccountName targetBillingAccount, @Nullable StandardOfferName baseStandardOffer)
public final ResolveAmendmentTargetResponse resolveAmendmentTarget(String parent, @Nullable BillingAccountName targetBillingAccount, @Nullable StandardOfferName baseStandardOffer)Resolves the existing offer that must be amended when creating a new PrivateOffer. Use this method to determine the correct amendment target before creating or publishing an offer.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
BillingAccountName targetBillingAccount = BillingAccountName.of("[BILLING_ACCOUNT]");
StandardOfferName baseStandardOffer =
StandardOfferName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[STANDARD_OFFER]");
ResolveAmendmentTargetResponse response =
commerceTransactionClient.resolveAmendmentTarget(
parent, targetBillingAccount, baseStandardOffer);
}
| Parameters | |
|---|---|
| Name | Description |
parent |
StringRequired. Parent value for ResolveAmendmentTargetRequest |
targetBillingAccount |
@org.jspecify.annotations.Nullable com.google.cloud.commerceproducer.v1beta.BillingAccountNameRequired. The customer's billing account targeted by the offer. This is the billing account for which the new private offer will be created on. Format: billingAccounts/{billing_account}. |
baseStandardOffer |
@org.jspecify.annotations.Nullable com.google.cloud.commerceproducer.v1beta.StandardOfferNameRequired. The base standard offer that the private offer will be based on. Format: projects/{project}/locations/{location}/services/{service}/standardOffers/{standard_offer}. |
| Returns | |
|---|---|
| Type | Description |
ResolveAmendmentTargetResponse |
|
resolveAmendmentTarget(String parent, @Nullable BillingAccountName targetBillingAccount, String baseStandardOffer)
public final ResolveAmendmentTargetResponse resolveAmendmentTarget(String parent, @Nullable BillingAccountName targetBillingAccount, String baseStandardOffer)Resolves the existing offer that must be amended when creating a new PrivateOffer. Use this method to determine the correct amendment target before creating or publishing an offer.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
BillingAccountName targetBillingAccount = BillingAccountName.of("[BILLING_ACCOUNT]");
String baseStandardOffer =
StandardOfferName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[STANDARD_OFFER]")
.toString();
ResolveAmendmentTargetResponse response =
commerceTransactionClient.resolveAmendmentTarget(
parent, targetBillingAccount, baseStandardOffer);
}
| Parameters | |
|---|---|
| Name | Description |
parent |
StringRequired. Parent value for ResolveAmendmentTargetRequest |
targetBillingAccount |
@org.jspecify.annotations.Nullable com.google.cloud.commerceproducer.v1beta.BillingAccountNameRequired. The customer's billing account targeted by the offer. This is the billing account for which the new private offer will be created on. Format: billingAccounts/{billing_account}. |
baseStandardOffer |
StringRequired. The base standard offer that the private offer will be based on. Format: projects/{project}/locations/{location}/services/{service}/standardOffers/{standard_offer}. |
| Returns | |
|---|---|
| Type | Description |
ResolveAmendmentTargetResponse |
|
resolveAmendmentTarget(String parent, String targetBillingAccount, @Nullable StandardOfferName baseStandardOffer)
public final ResolveAmendmentTargetResponse resolveAmendmentTarget(String parent, String targetBillingAccount, @Nullable StandardOfferName baseStandardOffer)Resolves the existing offer that must be amended when creating a new PrivateOffer. Use this method to determine the correct amendment target before creating or publishing an offer.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
String targetBillingAccount = BillingAccountName.of("[BILLING_ACCOUNT]").toString();
StandardOfferName baseStandardOffer =
StandardOfferName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[STANDARD_OFFER]");
ResolveAmendmentTargetResponse response =
commerceTransactionClient.resolveAmendmentTarget(
parent, targetBillingAccount, baseStandardOffer);
}
| Parameters | |
|---|---|
| Name | Description |
parent |
StringRequired. Parent value for ResolveAmendmentTargetRequest |
targetBillingAccount |
StringRequired. The customer's billing account targeted by the offer. This is the billing account for which the new private offer will be created on. Format: billingAccounts/{billing_account}. |
baseStandardOffer |
@org.jspecify.annotations.Nullable com.google.cloud.commerceproducer.v1beta.StandardOfferNameRequired. The base standard offer that the private offer will be based on. Format: projects/{project}/locations/{location}/services/{service}/standardOffers/{standard_offer}. |
| Returns | |
|---|---|
| Type | Description |
ResolveAmendmentTargetResponse |
|
resolveAmendmentTarget(String parent, String targetBillingAccount, String baseStandardOffer)
public final ResolveAmendmentTargetResponse resolveAmendmentTarget(String parent, String targetBillingAccount, String baseStandardOffer)Resolves the existing offer that must be amended when creating a new PrivateOffer. Use this method to determine the correct amendment target before creating or publishing an offer.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
String targetBillingAccount = BillingAccountName.of("[BILLING_ACCOUNT]").toString();
String baseStandardOffer =
StandardOfferName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[STANDARD_OFFER]")
.toString();
ResolveAmendmentTargetResponse response =
commerceTransactionClient.resolveAmendmentTarget(
parent, targetBillingAccount, baseStandardOffer);
}
| Parameters | |
|---|---|
| Name | Description |
parent |
StringRequired. Parent value for ResolveAmendmentTargetRequest |
targetBillingAccount |
StringRequired. The customer's billing account targeted by the offer. This is the billing account for which the new private offer will be created on. Format: billingAccounts/{billing_account}. |
baseStandardOffer |
StringRequired. The base standard offer that the private offer will be based on. Format: projects/{project}/locations/{location}/services/{service}/standardOffers/{standard_offer}. |
| Returns | |
|---|---|
| Type | Description |
ResolveAmendmentTargetResponse |
|
resolveAmendmentTargetCallable()
public final UnaryCallable<ResolveAmendmentTargetRequest,ResolveAmendmentTargetResponse> resolveAmendmentTargetCallable()Resolves the existing offer that must be amended when creating a new PrivateOffer. Use this method to determine the correct amendment target before creating or publishing an offer.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
ResolveAmendmentTargetRequest request =
ResolveAmendmentTargetRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setTargetBillingAccount(BillingAccountName.of("[BILLING_ACCOUNT]").toString())
.setBaseStandardOffer(
StandardOfferName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[STANDARD_OFFER]")
.toString())
.build();
ApiFuture<ResolveAmendmentTargetResponse> future =
commerceTransactionClient.resolveAmendmentTargetCallable().futureCall(request);
// Do something.
ResolveAmendmentTargetResponse response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ResolveAmendmentTargetRequest,ResolveAmendmentTargetResponse> |
|
shutdown()
public void shutdown()shutdownNow()
public void shutdownNow()updatePrivateOffer(PrivateOffer privateOffer, FieldMask updateMask)
public final PrivateOffer updatePrivateOffer(PrivateOffer privateOffer, FieldMask updateMask)Updates the target PrivateOffer.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
PrivateOffer privateOffer = PrivateOffer.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
PrivateOffer response =
commerceTransactionClient.updatePrivateOffer(privateOffer, updateMask);
}
| Parameters | |
|---|---|
| Name | Description |
privateOffer |
PrivateOfferRequired. The resource being updated |
updateMask |
FieldMaskOptional. The list of fields to update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. The special value "*" means full replacement. If unspecified, all fields present in the request will be overwritten. |
| Returns | |
|---|---|
| Type | Description |
PrivateOffer |
|
updatePrivateOffer(UpdatePrivateOfferRequest request)
public final PrivateOffer updatePrivateOffer(UpdatePrivateOfferRequest request)Updates the target PrivateOffer.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
UpdatePrivateOfferRequest request =
UpdatePrivateOfferRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setPrivateOffer(PrivateOffer.newBuilder().build())
.build();
PrivateOffer response = commerceTransactionClient.updatePrivateOffer(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
UpdatePrivateOfferRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
PrivateOffer |
|
updatePrivateOfferCallable()
public final UnaryCallable<UpdatePrivateOfferRequest,PrivateOffer> updatePrivateOfferCallable()Updates the target PrivateOffer.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
UpdatePrivateOfferRequest request =
UpdatePrivateOfferRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setPrivateOffer(PrivateOffer.newBuilder().build())
.build();
ApiFuture<PrivateOffer> future =
commerceTransactionClient.updatePrivateOfferCallable().futureCall(request);
// Do something.
PrivateOffer response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<UpdatePrivateOfferRequest,PrivateOffer> |
|
updatePrivateOfferDocument(PrivateOfferDocument privateOfferDocument, FieldMask updateMask)
public final PrivateOfferDocument updatePrivateOfferDocument(PrivateOfferDocument privateOfferDocument, FieldMask updateMask)Updates the target PrivateOfferDocument.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
PrivateOfferDocument privateOfferDocument = PrivateOfferDocument.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
PrivateOfferDocument response =
commerceTransactionClient.updatePrivateOfferDocument(privateOfferDocument, updateMask);
}
| Parameters | |
|---|---|
| Name | Description |
privateOfferDocument |
PrivateOfferDocumentRequired. The resource being updated. |
updateMask |
FieldMaskOptional. The list of fields to update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. The special value "*" means full replacement. If unspecified, all fields present in the request will be overwritten. |
| Returns | |
|---|---|
| Type | Description |
PrivateOfferDocument |
|
updatePrivateOfferDocument(UpdatePrivateOfferDocumentRequest request)
public final PrivateOfferDocument updatePrivateOfferDocument(UpdatePrivateOfferDocumentRequest request)Updates the target PrivateOfferDocument.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
UpdatePrivateOfferDocumentRequest request =
UpdatePrivateOfferDocumentRequest.newBuilder()
.setPrivateOfferDocument(PrivateOfferDocument.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
PrivateOfferDocument response = commerceTransactionClient.updatePrivateOfferDocument(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
UpdatePrivateOfferDocumentRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
PrivateOfferDocument |
|
updatePrivateOfferDocumentCallable()
public final UnaryCallable<UpdatePrivateOfferDocumentRequest,PrivateOfferDocument> updatePrivateOfferDocumentCallable()Updates the target PrivateOfferDocument.
Sample code:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CommerceTransactionClient commerceTransactionClient = CommerceTransactionClient.create()) {
UpdatePrivateOfferDocumentRequest request =
UpdatePrivateOfferDocumentRequest.newBuilder()
.setPrivateOfferDocument(PrivateOfferDocument.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<PrivateOfferDocument> future =
commerceTransactionClient.updatePrivateOfferDocumentCallable().futureCall(request);
// Do something.
PrivateOfferDocument response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<UpdatePrivateOfferDocumentRequest,PrivateOfferDocument> |
|