Class CustomTargetingValueServiceClient (0.54.0)

GitHub RepositoryProduct Reference

Service Description: Provides methods for handling CustomTargetingValue objects.

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 (CustomTargetingValueServiceClient customTargetingValueServiceClient =
     CustomTargetingValueServiceClient.create()) {
   CustomTargetingValueName name =
       CustomTargetingValueName.of("[NETWORK_CODE]", "[CUSTOM_TARGETING_VALUE]");
   CustomTargetingValue response =
       customTargetingValueServiceClient.getCustomTargetingValue(name);
 }
 

Note: close() needs to be called on the CustomTargetingValueServiceClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().

Methods
Method Description Method Variants

GetCustomTargetingValue

Retrieves a CustomTargetingValue object.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getCustomTargetingValue(GetCustomTargetingValueRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getCustomTargetingValue(CustomTargetingValueName name)

  • getCustomTargetingValue(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getCustomTargetingValueCallable()

ListCustomTargetingValues

Lists CustomTargetingValue objects.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listCustomTargetingValues(ListCustomTargetingValuesRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listCustomTargetingValues(NetworkName parent)

  • listCustomTargetingValues(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listCustomTargetingValuesPagedCallable()

  • listCustomTargetingValuesCallable()

CreateCustomTargetingValue

Creates a CustomTargetingValue object.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createCustomTargetingValue(CreateCustomTargetingValueRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • createCustomTargetingValue(NetworkName parent, CustomTargetingValue customTargetingValue)

  • createCustomTargetingValue(String parent, CustomTargetingValue customTargetingValue)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createCustomTargetingValueCallable()

BatchCreateCustomTargetingValues

Creates CustomTargetingValue objects.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • batchCreateCustomTargetingValues(NetworkName parent, List<CreateCustomTargetingValueRequest> requests)

  • batchCreateCustomTargetingValues(String parent, List<CreateCustomTargetingValueRequest> requests)

  • batchCreateCustomTargetingValues(BatchCreateCustomTargetingValuesRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • batchCreateCustomTargetingValuesCallable()

UpdateCustomTargetingValue

Updates a CustomTargetingValue object.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateCustomTargetingValue(UpdateCustomTargetingValueRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • updateCustomTargetingValue(CustomTargetingValue customTargetingValue, FieldMask updateMask)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateCustomTargetingValueCallable()

BatchUpdateCustomTargetingValues

Batch updates CustomTargetingValue objects.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • batchUpdateCustomTargetingValues(NetworkName parent, List<UpdateCustomTargetingValueRequest> requests)

  • batchUpdateCustomTargetingValues(String parent, List<UpdateCustomTargetingValueRequest> requests)

  • batchUpdateCustomTargetingValues(BatchUpdateCustomTargetingValuesRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • batchUpdateCustomTargetingValuesCallable()

BatchActivateCustomTargetingValues

Batch activates CustomTargetingValue objects.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • batchActivateCustomTargetingValues(NetworkName parent, List<ActivateCustomTargetingValueRequest> requests)

  • batchActivateCustomTargetingValues(String parent, List<ActivateCustomTargetingValueRequest> requests)

  • batchActivateCustomTargetingValues(BatchActivateCustomTargetingValuesRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • batchActivateCustomTargetingValuesCallable()

BatchDeactivateCustomTargetingValues

Deactivates a list of CustomTargetingValue objects.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • batchDeactivateCustomTargetingValues(NetworkName parent, List<DeactivateCustomTargetingValueRequest> requests)

  • batchDeactivateCustomTargetingValues(String parent, List<DeactivateCustomTargetingValueRequest> requests)

  • batchDeactivateCustomTargetingValues(BatchDeactivateCustomTargetingValuesRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • batchDeactivateCustomTargetingValuesCallable()

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 CustomTargetingValueServiceSettings 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
 CustomTargetingValueServiceSettings customTargetingValueServiceSettings =
     CustomTargetingValueServiceSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 CustomTargetingValueServiceClient customTargetingValueServiceClient =
     CustomTargetingValueServiceClient.create(customTargetingValueServiceSettings);
 

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
 CustomTargetingValueServiceSettings customTargetingValueServiceSettings =
     CustomTargetingValueServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
 CustomTargetingValueServiceClient customTargetingValueServiceClient =
     CustomTargetingValueServiceClient.create(customTargetingValueServiceSettings);
 

Please refer to the GitHub repository's samples for more quickstart code snippets.

Inheritance

java.lang.Object > CustomTargetingValueServiceClient

Static Methods

create()

public static final CustomTargetingValueServiceClient create()

Constructs an instance of CustomTargetingValueServiceClient with default settings.

Returns
Type Description
CustomTargetingValueServiceClient
Exceptions
Type Description
IOException

create(CustomTargetingValueServiceSettings settings)

public static final CustomTargetingValueServiceClient create(CustomTargetingValueServiceSettings settings)

Constructs an instance of CustomTargetingValueServiceClient, 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 CustomTargetingValueServiceSettings
Returns
Type Description
CustomTargetingValueServiceClient
Exceptions
Type Description
IOException

create(CustomTargetingValueServiceStub stub)

public static final CustomTargetingValueServiceClient create(CustomTargetingValueServiceStub stub)

Constructs an instance of CustomTargetingValueServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(CustomTargetingValueServiceSettings).

Parameter
Name Description
stub CustomTargetingValueServiceStub
Returns
Type Description
CustomTargetingValueServiceClient

Constructors

CustomTargetingValueServiceClient(CustomTargetingValueServiceSettings settings)

protected CustomTargetingValueServiceClient(CustomTargetingValueServiceSettings settings)

Constructs an instance of CustomTargetingValueServiceClient, 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 CustomTargetingValueServiceSettings

CustomTargetingValueServiceClient(CustomTargetingValueServiceStub stub)

protected CustomTargetingValueServiceClient(CustomTargetingValueServiceStub stub)
Parameter
Name Description
stub CustomTargetingValueServiceStub

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

batchActivateCustomTargetingValues(@Nullable NetworkName parent, List<ActivateCustomTargetingValueRequest> requests)

public final BatchActivateCustomTargetingValuesResponse batchActivateCustomTargetingValues(@Nullable NetworkName parent, List<ActivateCustomTargetingValueRequest> requests)

Batch activates CustomTargetingValue objects.

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 (CustomTargetingValueServiceClient customTargetingValueServiceClient =
     CustomTargetingValueServiceClient.create()) {
   NetworkName parent = NetworkName.of("[NETWORK_CODE]");
   List<ActivateCustomTargetingValueRequest> requests = new ArrayList<>();
   BatchActivateCustomTargetingValuesResponse response =
       customTargetingValueServiceClient.batchActivateCustomTargetingValues(parent, requests);
 }
 
Parameters
Name Description
parent @org.jspecify.annotations.Nullable com.google.ads.admanager.v1.NetworkName

Required. The parent, which owns this collection of CustomTargetingValues. Format: networks/{network_code}

requests List<ActivateCustomTargetingValueRequest>

Required. The CustomTargetingValue objects to activate. A maximum of 100 objects can be activated in a batch.

Returns
Type Description
BatchActivateCustomTargetingValuesResponse

batchActivateCustomTargetingValues(BatchActivateCustomTargetingValuesRequest request)

public final BatchActivateCustomTargetingValuesResponse batchActivateCustomTargetingValues(BatchActivateCustomTargetingValuesRequest request)

Batch activates CustomTargetingValue objects.

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 (CustomTargetingValueServiceClient customTargetingValueServiceClient =
     CustomTargetingValueServiceClient.create()) {
   BatchActivateCustomTargetingValuesRequest request =
       BatchActivateCustomTargetingValuesRequest.newBuilder()
           .setParent(NetworkName.of("[NETWORK_CODE]").toString())
           .addAllRequests(new ArrayList<ActivateCustomTargetingValueRequest>())
           .build();
   BatchActivateCustomTargetingValuesResponse response =
       customTargetingValueServiceClient.batchActivateCustomTargetingValues(request);
 }
 
Parameter
Name Description
request BatchActivateCustomTargetingValuesRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
BatchActivateCustomTargetingValuesResponse

batchActivateCustomTargetingValues(String parent, List<ActivateCustomTargetingValueRequest> requests)

public final BatchActivateCustomTargetingValuesResponse batchActivateCustomTargetingValues(String parent, List<ActivateCustomTargetingValueRequest> requests)

Batch activates CustomTargetingValue objects.

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 (CustomTargetingValueServiceClient customTargetingValueServiceClient =
     CustomTargetingValueServiceClient.create()) {
   String parent = NetworkName.of("[NETWORK_CODE]").toString();
   List<ActivateCustomTargetingValueRequest> requests = new ArrayList<>();
   BatchActivateCustomTargetingValuesResponse response =
       customTargetingValueServiceClient.batchActivateCustomTargetingValues(parent, requests);
 }
 
Parameters
Name Description
parent String

Required. The parent, which owns this collection of CustomTargetingValues. Format: networks/{network_code}

requests List<ActivateCustomTargetingValueRequest>

Required. The CustomTargetingValue objects to activate. A maximum of 100 objects can be activated in a batch.

Returns
Type Description
BatchActivateCustomTargetingValuesResponse

batchActivateCustomTargetingValuesCallable()

public final UnaryCallable<BatchActivateCustomTargetingValuesRequest,BatchActivateCustomTargetingValuesResponse> batchActivateCustomTargetingValuesCallable()

Batch activates CustomTargetingValue objects.

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 (CustomTargetingValueServiceClient customTargetingValueServiceClient =
     CustomTargetingValueServiceClient.create()) {
   BatchActivateCustomTargetingValuesRequest request =
       BatchActivateCustomTargetingValuesRequest.newBuilder()
           .setParent(NetworkName.of("[NETWORK_CODE]").toString())
           .addAllRequests(new ArrayList<ActivateCustomTargetingValueRequest>())
           .build();
   ApiFuture<BatchActivateCustomTargetingValuesResponse> future =
       customTargetingValueServiceClient
           .batchActivateCustomTargetingValuesCallable()
           .futureCall(request);
   // Do something.
   BatchActivateCustomTargetingValuesResponse response = future.get();
 }
 
Returns
Type Description
UnaryCallable<BatchActivateCustomTargetingValuesRequest,BatchActivateCustomTargetingValuesResponse>

batchCreateCustomTargetingValues(@Nullable NetworkName parent, List<CreateCustomTargetingValueRequest> requests)

public final BatchCreateCustomTargetingValuesResponse batchCreateCustomTargetingValues(@Nullable NetworkName parent, List<CreateCustomTargetingValueRequest> requests)

Creates CustomTargetingValue objects.

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 (CustomTargetingValueServiceClient customTargetingValueServiceClient =
     CustomTargetingValueServiceClient.create()) {
   NetworkName parent = NetworkName.of("[NETWORK_CODE]");
   List<CreateCustomTargetingValueRequest> requests = new ArrayList<>();
   BatchCreateCustomTargetingValuesResponse response =
       customTargetingValueServiceClient.batchCreateCustomTargetingValues(parent, requests);
 }
 
Parameters
Name Description
parent @org.jspecify.annotations.Nullable com.google.ads.admanager.v1.NetworkName

Required. The parent, which owns this collection of CustomTargetingValues. Format: networks/{network_code}

requests List<CreateCustomTargetingValueRequest>

Required. The CustomTargetingValue objects to create. A maximum of 100 objects can be created in a batch.

Returns
Type Description
BatchCreateCustomTargetingValuesResponse

batchCreateCustomTargetingValues(BatchCreateCustomTargetingValuesRequest request)

public final BatchCreateCustomTargetingValuesResponse batchCreateCustomTargetingValues(BatchCreateCustomTargetingValuesRequest request)

Creates CustomTargetingValue objects.

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 (CustomTargetingValueServiceClient customTargetingValueServiceClient =
     CustomTargetingValueServiceClient.create()) {
   BatchCreateCustomTargetingValuesRequest request =
       BatchCreateCustomTargetingValuesRequest.newBuilder()
           .setParent(NetworkName.of("[NETWORK_CODE]").toString())
           .addAllRequests(new ArrayList<CreateCustomTargetingValueRequest>())
           .build();
   BatchCreateCustomTargetingValuesResponse response =
       customTargetingValueServiceClient.batchCreateCustomTargetingValues(request);
 }
 
Parameter
Name Description
request BatchCreateCustomTargetingValuesRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
BatchCreateCustomTargetingValuesResponse

batchCreateCustomTargetingValues(String parent, List<CreateCustomTargetingValueRequest> requests)

public final BatchCreateCustomTargetingValuesResponse batchCreateCustomTargetingValues(String parent, List<CreateCustomTargetingValueRequest> requests)

Creates CustomTargetingValue objects.

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 (CustomTargetingValueServiceClient customTargetingValueServiceClient =
     CustomTargetingValueServiceClient.create()) {
   String parent = NetworkName.of("[NETWORK_CODE]").toString();
   List<CreateCustomTargetingValueRequest> requests = new ArrayList<>();
   BatchCreateCustomTargetingValuesResponse response =
       customTargetingValueServiceClient.batchCreateCustomTargetingValues(parent, requests);
 }
 
Parameters
Name Description
parent String

Required. The parent, which owns this collection of CustomTargetingValues. Format: networks/{network_code}

requests List<CreateCustomTargetingValueRequest>

Required. The CustomTargetingValue objects to create. A maximum of 100 objects can be created in a batch.

Returns
Type Description
BatchCreateCustomTargetingValuesResponse

batchCreateCustomTargetingValuesCallable()

public final UnaryCallable<BatchCreateCustomTargetingValuesRequest,BatchCreateCustomTargetingValuesResponse> batchCreateCustomTargetingValuesCallable()

Creates CustomTargetingValue objects.

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 (CustomTargetingValueServiceClient customTargetingValueServiceClient =
     CustomTargetingValueServiceClient.create()) {
   BatchCreateCustomTargetingValuesRequest request =
       BatchCreateCustomTargetingValuesRequest.newBuilder()
           .setParent(NetworkName.of("[NETWORK_CODE]").toString())
           .addAllRequests(new ArrayList<CreateCustomTargetingValueRequest>())
           .build();
   ApiFuture<BatchCreateCustomTargetingValuesResponse> future =
       customTargetingValueServiceClient
           .batchCreateCustomTargetingValuesCallable()
           .futureCall(request);
   // Do something.
   BatchCreateCustomTargetingValuesResponse response = future.get();
 }
 
Returns
Type Description
UnaryCallable<BatchCreateCustomTargetingValuesRequest,BatchCreateCustomTargetingValuesResponse>

batchDeactivateCustomTargetingValues(@Nullable NetworkName parent, List<DeactivateCustomTargetingValueRequest> requests)

public final BatchDeactivateCustomTargetingValuesResponse batchDeactivateCustomTargetingValues(@Nullable NetworkName parent, List<DeactivateCustomTargetingValueRequest> requests)

Deactivates a list of CustomTargetingValue objects.

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 (CustomTargetingValueServiceClient customTargetingValueServiceClient =
     CustomTargetingValueServiceClient.create()) {
   NetworkName parent = NetworkName.of("[NETWORK_CODE]");
   List<DeactivateCustomTargetingValueRequest> requests = new ArrayList<>();
   BatchDeactivateCustomTargetingValuesResponse response =
       customTargetingValueServiceClient.batchDeactivateCustomTargetingValues(parent, requests);
 }
 
Parameters
Name Description
parent @org.jspecify.annotations.Nullable com.google.ads.admanager.v1.NetworkName

Required. The parent, which owns this collection of CustomTargetingValues. Format: networks/{network_code}/

requests List<DeactivateCustomTargetingValueRequest>

Required. The CustomTargetingValue objects to deactivate.

Returns
Type Description
BatchDeactivateCustomTargetingValuesResponse

batchDeactivateCustomTargetingValues(BatchDeactivateCustomTargetingValuesRequest request)

public final BatchDeactivateCustomTargetingValuesResponse batchDeactivateCustomTargetingValues(BatchDeactivateCustomTargetingValuesRequest request)

Deactivates a list of CustomTargetingValue objects.

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 (CustomTargetingValueServiceClient customTargetingValueServiceClient =
     CustomTargetingValueServiceClient.create()) {
   BatchDeactivateCustomTargetingValuesRequest request =
       BatchDeactivateCustomTargetingValuesRequest.newBuilder()
           .setParent(NetworkName.of("[NETWORK_CODE]").toString())
           .addAllRequests(new ArrayList<DeactivateCustomTargetingValueRequest>())
           .build();
   BatchDeactivateCustomTargetingValuesResponse response =
       customTargetingValueServiceClient.batchDeactivateCustomTargetingValues(request);
 }
 
Parameter
Name Description
request BatchDeactivateCustomTargetingValuesRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
BatchDeactivateCustomTargetingValuesResponse

batchDeactivateCustomTargetingValues(String parent, List<DeactivateCustomTargetingValueRequest> requests)

public final BatchDeactivateCustomTargetingValuesResponse batchDeactivateCustomTargetingValues(String parent, List<DeactivateCustomTargetingValueRequest> requests)

Deactivates a list of CustomTargetingValue objects.

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 (CustomTargetingValueServiceClient customTargetingValueServiceClient =
     CustomTargetingValueServiceClient.create()) {
   String parent = NetworkName.of("[NETWORK_CODE]").toString();
   List<DeactivateCustomTargetingValueRequest> requests = new ArrayList<>();
   BatchDeactivateCustomTargetingValuesResponse response =
       customTargetingValueServiceClient.batchDeactivateCustomTargetingValues(parent, requests);
 }
 
Parameters
Name Description
parent String

Required. The parent, which owns this collection of CustomTargetingValues. Format: networks/{network_code}/

requests List<DeactivateCustomTargetingValueRequest>

Required. The CustomTargetingValue objects to deactivate.

Returns
Type Description
BatchDeactivateCustomTargetingValuesResponse

batchDeactivateCustomTargetingValuesCallable()

public final UnaryCallable<BatchDeactivateCustomTargetingValuesRequest,BatchDeactivateCustomTargetingValuesResponse> batchDeactivateCustomTargetingValuesCallable()

Deactivates a list of CustomTargetingValue objects.

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 (CustomTargetingValueServiceClient customTargetingValueServiceClient =
     CustomTargetingValueServiceClient.create()) {
   BatchDeactivateCustomTargetingValuesRequest request =
       BatchDeactivateCustomTargetingValuesRequest.newBuilder()
           .setParent(NetworkName.of("[NETWORK_CODE]").toString())
           .addAllRequests(new ArrayList<DeactivateCustomTargetingValueRequest>())
           .build();
   ApiFuture<BatchDeactivateCustomTargetingValuesResponse> future =
       customTargetingValueServiceClient
           .batchDeactivateCustomTargetingValuesCallable()
           .futureCall(request);
   // Do something.
   BatchDeactivateCustomTargetingValuesResponse response = future.get();
 }
 
Returns
Type Description
UnaryCallable<BatchDeactivateCustomTargetingValuesRequest,BatchDeactivateCustomTargetingValuesResponse>

batchUpdateCustomTargetingValues(@Nullable NetworkName parent, List<UpdateCustomTargetingValueRequest> requests)

public final BatchUpdateCustomTargetingValuesResponse batchUpdateCustomTargetingValues(@Nullable NetworkName parent, List<UpdateCustomTargetingValueRequest> requests)

Batch updates CustomTargetingValue objects.

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 (CustomTargetingValueServiceClient customTargetingValueServiceClient =
     CustomTargetingValueServiceClient.create()) {
   NetworkName parent = NetworkName.of("[NETWORK_CODE]");
   List<UpdateCustomTargetingValueRequest> requests = new ArrayList<>();
   BatchUpdateCustomTargetingValuesResponse response =
       customTargetingValueServiceClient.batchUpdateCustomTargetingValues(parent, requests);
 }
 
Parameters
Name Description
parent @org.jspecify.annotations.Nullable com.google.ads.admanager.v1.NetworkName

Required. The parent, which owns this collection of CustomTargetingValues. Format: networks/{network_code}

requests List<UpdateCustomTargetingValueRequest>

Required. The CustomTargetingValue objects to update. A maximum of 100 objects can be updated in a batch.

Returns
Type Description
BatchUpdateCustomTargetingValuesResponse

batchUpdateCustomTargetingValues(BatchUpdateCustomTargetingValuesRequest request)

public final BatchUpdateCustomTargetingValuesResponse batchUpdateCustomTargetingValues(BatchUpdateCustomTargetingValuesRequest request)

Batch updates CustomTargetingValue objects.

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 (CustomTargetingValueServiceClient customTargetingValueServiceClient =
     CustomTargetingValueServiceClient.create()) {
   BatchUpdateCustomTargetingValuesRequest request =
       BatchUpdateCustomTargetingValuesRequest.newBuilder()
           .setParent(NetworkName.of("[NETWORK_CODE]").toString())
           .addAllRequests(new ArrayList<UpdateCustomTargetingValueRequest>())
           .build();
   BatchUpdateCustomTargetingValuesResponse response =
       customTargetingValueServiceClient.batchUpdateCustomTargetingValues(request);
 }
 
Parameter
Name Description
request BatchUpdateCustomTargetingValuesRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
BatchUpdateCustomTargetingValuesResponse

batchUpdateCustomTargetingValues(String parent, List<UpdateCustomTargetingValueRequest> requests)

public final BatchUpdateCustomTargetingValuesResponse batchUpdateCustomTargetingValues(String parent, List<UpdateCustomTargetingValueRequest> requests)

Batch updates CustomTargetingValue objects.

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 (CustomTargetingValueServiceClient customTargetingValueServiceClient =
     CustomTargetingValueServiceClient.create()) {
   String parent = NetworkName.of("[NETWORK_CODE]").toString();
   List<UpdateCustomTargetingValueRequest> requests = new ArrayList<>();
   BatchUpdateCustomTargetingValuesResponse response =
       customTargetingValueServiceClient.batchUpdateCustomTargetingValues(parent, requests);
 }
 
Parameters
Name Description
parent String

Required. The parent, which owns this collection of CustomTargetingValues. Format: networks/{network_code}

requests List<UpdateCustomTargetingValueRequest>

Required. The CustomTargetingValue objects to update. A maximum of 100 objects can be updated in a batch.

Returns
Type Description
BatchUpdateCustomTargetingValuesResponse

batchUpdateCustomTargetingValuesCallable()

public final UnaryCallable<BatchUpdateCustomTargetingValuesRequest,BatchUpdateCustomTargetingValuesResponse> batchUpdateCustomTargetingValuesCallable()

Batch updates CustomTargetingValue objects.

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 (CustomTargetingValueServiceClient customTargetingValueServiceClient =
     CustomTargetingValueServiceClient.create()) {
   BatchUpdateCustomTargetingValuesRequest request =
       BatchUpdateCustomTargetingValuesRequest.newBuilder()
           .setParent(NetworkName.of("[NETWORK_CODE]").toString())
           .addAllRequests(new ArrayList<UpdateCustomTargetingValueRequest>())
           .build();
   ApiFuture<BatchUpdateCustomTargetingValuesResponse> future =
       customTargetingValueServiceClient
           .batchUpdateCustomTargetingValuesCallable()
           .futureCall(request);
   // Do something.
   BatchUpdateCustomTargetingValuesResponse response = future.get();
 }
 
Returns
Type Description
UnaryCallable<BatchUpdateCustomTargetingValuesRequest,BatchUpdateCustomTargetingValuesResponse>

close()

public final void close()

createCustomTargetingValue(@Nullable NetworkName parent, CustomTargetingValue customTargetingValue)

public final CustomTargetingValue createCustomTargetingValue(@Nullable NetworkName parent, CustomTargetingValue customTargetingValue)

Creates a CustomTargetingValue object.

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 (CustomTargetingValueServiceClient customTargetingValueServiceClient =
     CustomTargetingValueServiceClient.create()) {
   NetworkName parent = NetworkName.of("[NETWORK_CODE]");
   CustomTargetingValue customTargetingValue = CustomTargetingValue.newBuilder().build();
   CustomTargetingValue response =
       customTargetingValueServiceClient.createCustomTargetingValue(
           parent, customTargetingValue);
 }
 
Parameters
Name Description
parent @org.jspecify.annotations.Nullable com.google.ads.admanager.v1.NetworkName

Required. The parent, which owns this collection of CustomTargetingValues. Format: networks/{network_code}

customTargetingValue CustomTargetingValue

Required. The CustomTargetingValue to create.

Returns
Type Description
CustomTargetingValue

createCustomTargetingValue(CreateCustomTargetingValueRequest request)

public final CustomTargetingValue createCustomTargetingValue(CreateCustomTargetingValueRequest request)

Creates a CustomTargetingValue object.

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 (CustomTargetingValueServiceClient customTargetingValueServiceClient =
     CustomTargetingValueServiceClient.create()) {
   CreateCustomTargetingValueRequest request =
       CreateCustomTargetingValueRequest.newBuilder()
           .setParent(NetworkName.of("[NETWORK_CODE]").toString())
           .setCustomTargetingValue(CustomTargetingValue.newBuilder().build())
           .build();
   CustomTargetingValue response =
       customTargetingValueServiceClient.createCustomTargetingValue(request);
 }
 
Parameter
Name Description
request CreateCustomTargetingValueRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
CustomTargetingValue

createCustomTargetingValue(String parent, CustomTargetingValue customTargetingValue)

public final CustomTargetingValue createCustomTargetingValue(String parent, CustomTargetingValue customTargetingValue)

Creates a CustomTargetingValue object.

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 (CustomTargetingValueServiceClient customTargetingValueServiceClient =
     CustomTargetingValueServiceClient.create()) {
   String parent = NetworkName.of("[NETWORK_CODE]").toString();
   CustomTargetingValue customTargetingValue = CustomTargetingValue.newBuilder().build();
   CustomTargetingValue response =
       customTargetingValueServiceClient.createCustomTargetingValue(
           parent, customTargetingValue);
 }
 
Parameters
Name Description
parent String

Required. The parent, which owns this collection of CustomTargetingValues. Format: networks/{network_code}

customTargetingValue CustomTargetingValue

Required. The CustomTargetingValue to create.

Returns
Type Description
CustomTargetingValue

createCustomTargetingValueCallable()

public final UnaryCallable<CreateCustomTargetingValueRequest,CustomTargetingValue> createCustomTargetingValueCallable()

Creates a CustomTargetingValue object.

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 (CustomTargetingValueServiceClient customTargetingValueServiceClient =
     CustomTargetingValueServiceClient.create()) {
   CreateCustomTargetingValueRequest request =
       CreateCustomTargetingValueRequest.newBuilder()
           .setParent(NetworkName.of("[NETWORK_CODE]").toString())
           .setCustomTargetingValue(CustomTargetingValue.newBuilder().build())
           .build();
   ApiFuture<CustomTargetingValue> future =
       customTargetingValueServiceClient
           .createCustomTargetingValueCallable()
           .futureCall(request);
   // Do something.
   CustomTargetingValue response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateCustomTargetingValueRequest,CustomTargetingValue>

getCustomTargetingValue(@Nullable CustomTargetingValueName name)

public final CustomTargetingValue getCustomTargetingValue(@Nullable CustomTargetingValueName name)

Retrieves a CustomTargetingValue object.

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 (CustomTargetingValueServiceClient customTargetingValueServiceClient =
     CustomTargetingValueServiceClient.create()) {
   CustomTargetingValueName name =
       CustomTargetingValueName.of("[NETWORK_CODE]", "[CUSTOM_TARGETING_VALUE]");
   CustomTargetingValue response =
       customTargetingValueServiceClient.getCustomTargetingValue(name);
 }
 
Parameter
Name Description
name @org.jspecify.annotations.Nullable com.google.ads.admanager.v1.CustomTargetingValueName

Required. The resource name of the CustomTargetingValue. Format: networks/{network_code}/customTargetingValues/{custom_targeting_value_id}

Returns
Type Description
CustomTargetingValue

getCustomTargetingValue(GetCustomTargetingValueRequest request)

public final CustomTargetingValue getCustomTargetingValue(GetCustomTargetingValueRequest request)

Retrieves a CustomTargetingValue object.

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 (CustomTargetingValueServiceClient customTargetingValueServiceClient =
     CustomTargetingValueServiceClient.create()) {
   GetCustomTargetingValueRequest request =
       GetCustomTargetingValueRequest.newBuilder()
           .setName(
               CustomTargetingValueName.of("[NETWORK_CODE]", "[CUSTOM_TARGETING_VALUE]")
                   .toString())
           .build();
   CustomTargetingValue response =
       customTargetingValueServiceClient.getCustomTargetingValue(request);
 }
 
Parameter
Name Description
request GetCustomTargetingValueRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
CustomTargetingValue

getCustomTargetingValue(String name)

public final CustomTargetingValue getCustomTargetingValue(String name)

Retrieves a CustomTargetingValue object.

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 (CustomTargetingValueServiceClient customTargetingValueServiceClient =
     CustomTargetingValueServiceClient.create()) {
   String name =
       CustomTargetingValueName.of("[NETWORK_CODE]", "[CUSTOM_TARGETING_VALUE]").toString();
   CustomTargetingValue response =
       customTargetingValueServiceClient.getCustomTargetingValue(name);
 }
 
Parameter
Name Description
name String

Required. The resource name of the CustomTargetingValue. Format: networks/{network_code}/customTargetingValues/{custom_targeting_value_id}

Returns
Type Description
CustomTargetingValue

getCustomTargetingValueCallable()

public final UnaryCallable<GetCustomTargetingValueRequest,CustomTargetingValue> getCustomTargetingValueCallable()

Retrieves a CustomTargetingValue object.

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 (CustomTargetingValueServiceClient customTargetingValueServiceClient =
     CustomTargetingValueServiceClient.create()) {
   GetCustomTargetingValueRequest request =
       GetCustomTargetingValueRequest.newBuilder()
           .setName(
               CustomTargetingValueName.of("[NETWORK_CODE]", "[CUSTOM_TARGETING_VALUE]")
                   .toString())
           .build();
   ApiFuture<CustomTargetingValue> future =
       customTargetingValueServiceClient.getCustomTargetingValueCallable().futureCall(request);
   // Do something.
   CustomTargetingValue response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetCustomTargetingValueRequest,CustomTargetingValue>

getSettings()

public final @Nullable CustomTargetingValueServiceSettings getSettings()
Returns
Type Description
@org.jspecify.annotations.Nullable com.google.ads.admanager.v1.CustomTargetingValueServiceSettings

getStub()

public CustomTargetingValueServiceStub getStub()
Returns
Type Description
CustomTargetingValueServiceStub

isShutdown()

public boolean isShutdown()
Returns
Type Description
boolean

isTerminated()

public boolean isTerminated()
Returns
Type Description
boolean

listCustomTargetingValues(@Nullable NetworkName parent)

public final CustomTargetingValueServiceClient.ListCustomTargetingValuesPagedResponse listCustomTargetingValues(@Nullable NetworkName parent)

Lists CustomTargetingValue objects.

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 (CustomTargetingValueServiceClient customTargetingValueServiceClient =
     CustomTargetingValueServiceClient.create()) {
   NetworkName parent = NetworkName.of("[NETWORK_CODE]");
   for (CustomTargetingValue element :
       customTargetingValueServiceClient.listCustomTargetingValues(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent @org.jspecify.annotations.Nullable com.google.ads.admanager.v1.NetworkName

Required. The parent, which owns this collection of CustomTargetingValues. Format: networks/{network_code}

Returns
Type Description
CustomTargetingValueServiceClient.ListCustomTargetingValuesPagedResponse

listCustomTargetingValues(ListCustomTargetingValuesRequest request)

public final CustomTargetingValueServiceClient.ListCustomTargetingValuesPagedResponse listCustomTargetingValues(ListCustomTargetingValuesRequest request)

Lists CustomTargetingValue objects.

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 (CustomTargetingValueServiceClient customTargetingValueServiceClient =
     CustomTargetingValueServiceClient.create()) {
   ListCustomTargetingValuesRequest request =
       ListCustomTargetingValuesRequest.newBuilder()
           .setParent(NetworkName.of("[NETWORK_CODE]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .setOrderBy("orderBy-1207110587")
           .setSkip(3532159)
           .build();
   for (CustomTargetingValue element :
       customTargetingValueServiceClient.listCustomTargetingValues(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
request ListCustomTargetingValuesRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
CustomTargetingValueServiceClient.ListCustomTargetingValuesPagedResponse

listCustomTargetingValues(String parent)

public final CustomTargetingValueServiceClient.ListCustomTargetingValuesPagedResponse listCustomTargetingValues(String parent)

Lists CustomTargetingValue objects.

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 (CustomTargetingValueServiceClient customTargetingValueServiceClient =
     CustomTargetingValueServiceClient.create()) {
   String parent = NetworkName.of("[NETWORK_CODE]").toString();
   for (CustomTargetingValue element :
       customTargetingValueServiceClient.listCustomTargetingValues(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent String

Required. The parent, which owns this collection of CustomTargetingValues. Format: networks/{network_code}

Returns
Type Description
CustomTargetingValueServiceClient.ListCustomTargetingValuesPagedResponse

listCustomTargetingValuesCallable()

public final UnaryCallable<ListCustomTargetingValuesRequest,ListCustomTargetingValuesResponse> listCustomTargetingValuesCallable()

Lists CustomTargetingValue objects.

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 (CustomTargetingValueServiceClient customTargetingValueServiceClient =
     CustomTargetingValueServiceClient.create()) {
   ListCustomTargetingValuesRequest request =
       ListCustomTargetingValuesRequest.newBuilder()
           .setParent(NetworkName.of("[NETWORK_CODE]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .setOrderBy("orderBy-1207110587")
           .setSkip(3532159)
           .build();
   while (true) {
     ListCustomTargetingValuesResponse response =
         customTargetingValueServiceClient.listCustomTargetingValuesCallable().call(request);
     for (CustomTargetingValue element : response.getCustomTargetingValuesList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListCustomTargetingValuesRequest,ListCustomTargetingValuesResponse>

listCustomTargetingValuesPagedCallable()

public final UnaryCallable<ListCustomTargetingValuesRequest,CustomTargetingValueServiceClient.ListCustomTargetingValuesPagedResponse> listCustomTargetingValuesPagedCallable()

Lists CustomTargetingValue objects.

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 (CustomTargetingValueServiceClient customTargetingValueServiceClient =
     CustomTargetingValueServiceClient.create()) {
   ListCustomTargetingValuesRequest request =
       ListCustomTargetingValuesRequest.newBuilder()
           .setParent(NetworkName.of("[NETWORK_CODE]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .setOrderBy("orderBy-1207110587")
           .setSkip(3532159)
           .build();
   ApiFuture<CustomTargetingValue> future =
       customTargetingValueServiceClient
           .listCustomTargetingValuesPagedCallable()
           .futureCall(request);
   // Do something.
   for (CustomTargetingValue element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<ListCustomTargetingValuesRequest,ListCustomTargetingValuesPagedResponse>

shutdown()

public void shutdown()

shutdownNow()

public void shutdownNow()

updateCustomTargetingValue(CustomTargetingValue customTargetingValue, FieldMask updateMask)

public final CustomTargetingValue updateCustomTargetingValue(CustomTargetingValue customTargetingValue, FieldMask updateMask)

Updates a CustomTargetingValue object.

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 (CustomTargetingValueServiceClient customTargetingValueServiceClient =
     CustomTargetingValueServiceClient.create()) {
   CustomTargetingValue customTargetingValue = CustomTargetingValue.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   CustomTargetingValue response =
       customTargetingValueServiceClient.updateCustomTargetingValue(
           customTargetingValue, updateMask);
 }
 
Parameters
Name Description
customTargetingValue CustomTargetingValue

Required. The CustomTargetingValue to update.

The CustomTargetingValue's name is used to identify the CustomTargetingValue to update.

updateMask FieldMask

Optional. The list of fields to update.

Returns
Type Description
CustomTargetingValue

updateCustomTargetingValue(UpdateCustomTargetingValueRequest request)

public final CustomTargetingValue updateCustomTargetingValue(UpdateCustomTargetingValueRequest request)

Updates a CustomTargetingValue object.

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 (CustomTargetingValueServiceClient customTargetingValueServiceClient =
     CustomTargetingValueServiceClient.create()) {
   UpdateCustomTargetingValueRequest request =
       UpdateCustomTargetingValueRequest.newBuilder()
           .setCustomTargetingValue(CustomTargetingValue.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   CustomTargetingValue response =
       customTargetingValueServiceClient.updateCustomTargetingValue(request);
 }
 
Parameter
Name Description
request UpdateCustomTargetingValueRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
CustomTargetingValue

updateCustomTargetingValueCallable()

public final UnaryCallable<UpdateCustomTargetingValueRequest,CustomTargetingValue> updateCustomTargetingValueCallable()

Updates a CustomTargetingValue object.

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 (CustomTargetingValueServiceClient customTargetingValueServiceClient =
     CustomTargetingValueServiceClient.create()) {
   UpdateCustomTargetingValueRequest request =
       UpdateCustomTargetingValueRequest.newBuilder()
           .setCustomTargetingValue(CustomTargetingValue.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   ApiFuture<CustomTargetingValue> future =
       customTargetingValueServiceClient
           .updateCustomTargetingValueCallable()
           .futureCall(request);
   // Do something.
   CustomTargetingValue response = future.get();
 }
 
Returns
Type Description
UnaryCallable<UpdateCustomTargetingValueRequest,CustomTargetingValue>