| GitHub Repository | Product Reference |
Service Description: Provides methods for handling CustomTargetingKey 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 (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
CustomTargetingKeyServiceClient.create()) {
CustomTargetingKeyName name =
CustomTargetingKeyName.of("[NETWORK_CODE]", "[CUSTOM_TARGETING_KEY]");
CustomTargetingKey response = customTargetingKeyServiceClient.getCustomTargetingKey(name);
}
Note: close() needs to be called on the CustomTargetingKeyServiceClient 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 |
|---|---|---|
GetCustomTargetingKey |
API to retrieve a |
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.
|
ListCustomTargetingKeys |
API to retrieve a list of |
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.
|
CreateCustomTargetingKey |
API to create a |
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.
|
BatchCreateCustomTargetingKeys |
API to batch create |
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.
|
UpdateCustomTargetingKey |
API to update a |
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.
|
BatchUpdateCustomTargetingKeys |
API to batch update |
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.
|
BatchActivateCustomTargetingKeys |
API to batch activate |
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.
|
BatchDeactivateCustomTargetingKeys |
Deactivates a list of |
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.
|
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 CustomTargetingKeyServiceSettings 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
CustomTargetingKeyServiceSettings customTargetingKeyServiceSettings =
CustomTargetingKeyServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
CustomTargetingKeyServiceClient.create(customTargetingKeyServiceSettings);
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
CustomTargetingKeyServiceSettings customTargetingKeyServiceSettings =
CustomTargetingKeyServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
CustomTargetingKeyServiceClient.create(customTargetingKeyServiceSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
Static Methods
create()
public static final CustomTargetingKeyServiceClient create()Constructs an instance of CustomTargetingKeyServiceClient with default settings.
| Returns | |
|---|---|
| Type | Description |
CustomTargetingKeyServiceClient |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
create(CustomTargetingKeyServiceSettings settings)
public static final CustomTargetingKeyServiceClient create(CustomTargetingKeyServiceSettings settings)Constructs an instance of CustomTargetingKeyServiceClient, 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 |
CustomTargetingKeyServiceSettings |
| Returns | |
|---|---|
| Type | Description |
CustomTargetingKeyServiceClient |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
create(CustomTargetingKeyServiceStub stub)
public static final CustomTargetingKeyServiceClient create(CustomTargetingKeyServiceStub stub)Constructs an instance of CustomTargetingKeyServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(CustomTargetingKeyServiceSettings).
| Parameter | |
|---|---|
| Name | Description |
stub |
CustomTargetingKeyServiceStub |
| Returns | |
|---|---|
| Type | Description |
CustomTargetingKeyServiceClient |
|
Constructors
CustomTargetingKeyServiceClient(CustomTargetingKeyServiceSettings settings)
protected CustomTargetingKeyServiceClient(CustomTargetingKeyServiceSettings settings)Constructs an instance of CustomTargetingKeyServiceClient, 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 |
CustomTargetingKeyServiceSettings |
CustomTargetingKeyServiceClient(CustomTargetingKeyServiceStub stub)
protected CustomTargetingKeyServiceClient(CustomTargetingKeyServiceStub stub)| Parameter | |
|---|---|
| Name | Description |
stub |
CustomTargetingKeyServiceStub |
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 |
|
batchActivateCustomTargetingKeys(BatchActivateCustomTargetingKeysRequest request)
public final BatchActivateCustomTargetingKeysResponse batchActivateCustomTargetingKeys(BatchActivateCustomTargetingKeysRequest request)API to batch activate CustomTargetingKey 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 (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
CustomTargetingKeyServiceClient.create()) {
BatchActivateCustomTargetingKeysRequest request =
BatchActivateCustomTargetingKeysRequest.newBuilder()
.setParent(NetworkName.of("[NETWORK_CODE]").toString())
.addAllNames(new ArrayList<String>())
.build();
BatchActivateCustomTargetingKeysResponse response =
customTargetingKeyServiceClient.batchActivateCustomTargetingKeys(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
BatchActivateCustomTargetingKeysRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
BatchActivateCustomTargetingKeysResponse |
|
batchActivateCustomTargetingKeys(NetworkName parent, List<String> names)
public final BatchActivateCustomTargetingKeysResponse batchActivateCustomTargetingKeys(NetworkName parent, List<String> names)API to batch activate CustomTargetingKey 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 (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
CustomTargetingKeyServiceClient.create()) {
NetworkName parent = NetworkName.of("[NETWORK_CODE]");
List<String> names = new ArrayList<>();
BatchActivateCustomTargetingKeysResponse response =
customTargetingKeyServiceClient.batchActivateCustomTargetingKeys(parent, names);
}
| Parameters | |
|---|---|
| Name | Description |
parent |
NetworkNameRequired. Format: |
names |
List<String>Required. The resource names of the |
| Returns | |
|---|---|
| Type | Description |
BatchActivateCustomTargetingKeysResponse |
|
batchActivateCustomTargetingKeys(String parent, List<String> names)
public final BatchActivateCustomTargetingKeysResponse batchActivateCustomTargetingKeys(String parent, List<String> names)API to batch activate CustomTargetingKey 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 (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
CustomTargetingKeyServiceClient.create()) {
String parent = NetworkName.of("[NETWORK_CODE]").toString();
List<String> names = new ArrayList<>();
BatchActivateCustomTargetingKeysResponse response =
customTargetingKeyServiceClient.batchActivateCustomTargetingKeys(parent, names);
}
| Parameters | |
|---|---|
| Name | Description |
parent |
StringRequired. Format: |
names |
List<String>Required. The resource names of the |
| Returns | |
|---|---|
| Type | Description |
BatchActivateCustomTargetingKeysResponse |
|
batchActivateCustomTargetingKeysCallable()
public final UnaryCallable<BatchActivateCustomTargetingKeysRequest,BatchActivateCustomTargetingKeysResponse> batchActivateCustomTargetingKeysCallable()API to batch activate CustomTargetingKey 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 (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
CustomTargetingKeyServiceClient.create()) {
BatchActivateCustomTargetingKeysRequest request =
BatchActivateCustomTargetingKeysRequest.newBuilder()
.setParent(NetworkName.of("[NETWORK_CODE]").toString())
.addAllNames(new ArrayList<String>())
.build();
ApiFuture<BatchActivateCustomTargetingKeysResponse> future =
customTargetingKeyServiceClient
.batchActivateCustomTargetingKeysCallable()
.futureCall(request);
// Do something.
BatchActivateCustomTargetingKeysResponse response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<BatchActivateCustomTargetingKeysRequest,BatchActivateCustomTargetingKeysResponse> |
|
batchCreateCustomTargetingKeys(BatchCreateCustomTargetingKeysRequest request)
public final BatchCreateCustomTargetingKeysResponse batchCreateCustomTargetingKeys(BatchCreateCustomTargetingKeysRequest request)API to batch create CustomTargetingKey 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 (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
CustomTargetingKeyServiceClient.create()) {
BatchCreateCustomTargetingKeysRequest request =
BatchCreateCustomTargetingKeysRequest.newBuilder()
.setParent(NetworkName.of("[NETWORK_CODE]").toString())
.addAllRequests(new ArrayList<CreateCustomTargetingKeyRequest>())
.build();
BatchCreateCustomTargetingKeysResponse response =
customTargetingKeyServiceClient.batchCreateCustomTargetingKeys(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
BatchCreateCustomTargetingKeysRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
BatchCreateCustomTargetingKeysResponse |
|
batchCreateCustomTargetingKeys(NetworkName parent, List<CreateCustomTargetingKeyRequest> requests)
public final BatchCreateCustomTargetingKeysResponse batchCreateCustomTargetingKeys(NetworkName parent, List<CreateCustomTargetingKeyRequest> requests)API to batch create CustomTargetingKey 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 (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
CustomTargetingKeyServiceClient.create()) {
NetworkName parent = NetworkName.of("[NETWORK_CODE]");
List<CreateCustomTargetingKeyRequest> requests = new ArrayList<>();
BatchCreateCustomTargetingKeysResponse response =
customTargetingKeyServiceClient.batchCreateCustomTargetingKeys(parent, requests);
}
| Parameters | |
|---|---|
| Name | Description |
parent |
NetworkNameRequired. The parent resource where |
requests |
List<CreateCustomTargetingKeyRequest>Required. The |
| Returns | |
|---|---|
| Type | Description |
BatchCreateCustomTargetingKeysResponse |
|
batchCreateCustomTargetingKeys(String parent, List<CreateCustomTargetingKeyRequest> requests)
public final BatchCreateCustomTargetingKeysResponse batchCreateCustomTargetingKeys(String parent, List<CreateCustomTargetingKeyRequest> requests)API to batch create CustomTargetingKey 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 (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
CustomTargetingKeyServiceClient.create()) {
String parent = NetworkName.of("[NETWORK_CODE]").toString();
List<CreateCustomTargetingKeyRequest> requests = new ArrayList<>();
BatchCreateCustomTargetingKeysResponse response =
customTargetingKeyServiceClient.batchCreateCustomTargetingKeys(parent, requests);
}
| Parameters | |
|---|---|
| Name | Description |
parent |
StringRequired. The parent resource where |
requests |
List<CreateCustomTargetingKeyRequest>Required. The |
| Returns | |
|---|---|
| Type | Description |
BatchCreateCustomTargetingKeysResponse |
|
batchCreateCustomTargetingKeysCallable()
public final UnaryCallable<BatchCreateCustomTargetingKeysRequest,BatchCreateCustomTargetingKeysResponse> batchCreateCustomTargetingKeysCallable()API to batch create CustomTargetingKey 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 (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
CustomTargetingKeyServiceClient.create()) {
BatchCreateCustomTargetingKeysRequest request =
BatchCreateCustomTargetingKeysRequest.newBuilder()
.setParent(NetworkName.of("[NETWORK_CODE]").toString())
.addAllRequests(new ArrayList<CreateCustomTargetingKeyRequest>())
.build();
ApiFuture<BatchCreateCustomTargetingKeysResponse> future =
customTargetingKeyServiceClient
.batchCreateCustomTargetingKeysCallable()
.futureCall(request);
// Do something.
BatchCreateCustomTargetingKeysResponse response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<BatchCreateCustomTargetingKeysRequest,BatchCreateCustomTargetingKeysResponse> |
|
batchDeactivateCustomTargetingKeys(BatchDeactivateCustomTargetingKeysRequest request)
public final BatchDeactivateCustomTargetingKeysResponse batchDeactivateCustomTargetingKeys(BatchDeactivateCustomTargetingKeysRequest request)Deactivates a list of CustomTargetingKey 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 (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
CustomTargetingKeyServiceClient.create()) {
BatchDeactivateCustomTargetingKeysRequest request =
BatchDeactivateCustomTargetingKeysRequest.newBuilder()
.setParent(NetworkName.of("[NETWORK_CODE]").toString())
.addAllNames(new ArrayList<String>())
.build();
BatchDeactivateCustomTargetingKeysResponse response =
customTargetingKeyServiceClient.batchDeactivateCustomTargetingKeys(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
BatchDeactivateCustomTargetingKeysRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
BatchDeactivateCustomTargetingKeysResponse |
|
batchDeactivateCustomTargetingKeys(NetworkName parent, List<String> names)
public final BatchDeactivateCustomTargetingKeysResponse batchDeactivateCustomTargetingKeys(NetworkName parent, List<String> names)Deactivates a list of CustomTargetingKey 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 (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
CustomTargetingKeyServiceClient.create()) {
NetworkName parent = NetworkName.of("[NETWORK_CODE]");
List<String> names = new ArrayList<>();
BatchDeactivateCustomTargetingKeysResponse response =
customTargetingKeyServiceClient.batchDeactivateCustomTargetingKeys(parent, names);
}
| Parameters | |
|---|---|
| Name | Description |
parent |
NetworkNameRequired. Format: |
names |
List<String>Required. The resource names of the |
| Returns | |
|---|---|
| Type | Description |
BatchDeactivateCustomTargetingKeysResponse |
|
batchDeactivateCustomTargetingKeys(String parent, List<String> names)
public final BatchDeactivateCustomTargetingKeysResponse batchDeactivateCustomTargetingKeys(String parent, List<String> names)Deactivates a list of CustomTargetingKey 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 (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
CustomTargetingKeyServiceClient.create()) {
String parent = NetworkName.of("[NETWORK_CODE]").toString();
List<String> names = new ArrayList<>();
BatchDeactivateCustomTargetingKeysResponse response =
customTargetingKeyServiceClient.batchDeactivateCustomTargetingKeys(parent, names);
}
| Parameters | |
|---|---|
| Name | Description |
parent |
StringRequired. Format: |
names |
List<String>Required. The resource names of the |
| Returns | |
|---|---|
| Type | Description |
BatchDeactivateCustomTargetingKeysResponse |
|
batchDeactivateCustomTargetingKeysCallable()
public final UnaryCallable<BatchDeactivateCustomTargetingKeysRequest,BatchDeactivateCustomTargetingKeysResponse> batchDeactivateCustomTargetingKeysCallable()Deactivates a list of CustomTargetingKey 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 (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
CustomTargetingKeyServiceClient.create()) {
BatchDeactivateCustomTargetingKeysRequest request =
BatchDeactivateCustomTargetingKeysRequest.newBuilder()
.setParent(NetworkName.of("[NETWORK_CODE]").toString())
.addAllNames(new ArrayList<String>())
.build();
ApiFuture<BatchDeactivateCustomTargetingKeysResponse> future =
customTargetingKeyServiceClient
.batchDeactivateCustomTargetingKeysCallable()
.futureCall(request);
// Do something.
BatchDeactivateCustomTargetingKeysResponse response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<BatchDeactivateCustomTargetingKeysRequest,BatchDeactivateCustomTargetingKeysResponse> |
|
batchUpdateCustomTargetingKeys(BatchUpdateCustomTargetingKeysRequest request)
public final BatchUpdateCustomTargetingKeysResponse batchUpdateCustomTargetingKeys(BatchUpdateCustomTargetingKeysRequest request)API to batch update CustomTargetingKey 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 (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
CustomTargetingKeyServiceClient.create()) {
BatchUpdateCustomTargetingKeysRequest request =
BatchUpdateCustomTargetingKeysRequest.newBuilder()
.setParent(NetworkName.of("[NETWORK_CODE]").toString())
.addAllRequests(new ArrayList<UpdateCustomTargetingKeyRequest>())
.build();
BatchUpdateCustomTargetingKeysResponse response =
customTargetingKeyServiceClient.batchUpdateCustomTargetingKeys(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
BatchUpdateCustomTargetingKeysRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
BatchUpdateCustomTargetingKeysResponse |
|
batchUpdateCustomTargetingKeys(NetworkName parent, List<UpdateCustomTargetingKeyRequest> requests)
public final BatchUpdateCustomTargetingKeysResponse batchUpdateCustomTargetingKeys(NetworkName parent, List<UpdateCustomTargetingKeyRequest> requests)API to batch update CustomTargetingKey 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 (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
CustomTargetingKeyServiceClient.create()) {
NetworkName parent = NetworkName.of("[NETWORK_CODE]");
List<UpdateCustomTargetingKeyRequest> requests = new ArrayList<>();
BatchUpdateCustomTargetingKeysResponse response =
customTargetingKeyServiceClient.batchUpdateCustomTargetingKeys(parent, requests);
}
| Parameters | |
|---|---|
| Name | Description |
parent |
NetworkNameRequired. The parent resource where |
requests |
List<UpdateCustomTargetingKeyRequest>Required. The |
| Returns | |
|---|---|
| Type | Description |
BatchUpdateCustomTargetingKeysResponse |
|
batchUpdateCustomTargetingKeys(String parent, List<UpdateCustomTargetingKeyRequest> requests)
public final BatchUpdateCustomTargetingKeysResponse batchUpdateCustomTargetingKeys(String parent, List<UpdateCustomTargetingKeyRequest> requests)API to batch update CustomTargetingKey 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 (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
CustomTargetingKeyServiceClient.create()) {
String parent = NetworkName.of("[NETWORK_CODE]").toString();
List<UpdateCustomTargetingKeyRequest> requests = new ArrayList<>();
BatchUpdateCustomTargetingKeysResponse response =
customTargetingKeyServiceClient.batchUpdateCustomTargetingKeys(parent, requests);
}
| Parameters | |
|---|---|
| Name | Description |
parent |
StringRequired. The parent resource where |
requests |
List<UpdateCustomTargetingKeyRequest>Required. The |
| Returns | |
|---|---|
| Type | Description |
BatchUpdateCustomTargetingKeysResponse |
|
batchUpdateCustomTargetingKeysCallable()
public final UnaryCallable<BatchUpdateCustomTargetingKeysRequest,BatchUpdateCustomTargetingKeysResponse> batchUpdateCustomTargetingKeysCallable()API to batch update CustomTargetingKey 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 (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
CustomTargetingKeyServiceClient.create()) {
BatchUpdateCustomTargetingKeysRequest request =
BatchUpdateCustomTargetingKeysRequest.newBuilder()
.setParent(NetworkName.of("[NETWORK_CODE]").toString())
.addAllRequests(new ArrayList<UpdateCustomTargetingKeyRequest>())
.build();
ApiFuture<BatchUpdateCustomTargetingKeysResponse> future =
customTargetingKeyServiceClient
.batchUpdateCustomTargetingKeysCallable()
.futureCall(request);
// Do something.
BatchUpdateCustomTargetingKeysResponse response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<BatchUpdateCustomTargetingKeysRequest,BatchUpdateCustomTargetingKeysResponse> |
|
close()
public final void close()createCustomTargetingKey(CreateCustomTargetingKeyRequest request)
public final CustomTargetingKey createCustomTargetingKey(CreateCustomTargetingKeyRequest request)API to create a CustomTargetingKey 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 (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
CustomTargetingKeyServiceClient.create()) {
CreateCustomTargetingKeyRequest request =
CreateCustomTargetingKeyRequest.newBuilder()
.setParent(NetworkName.of("[NETWORK_CODE]").toString())
.setCustomTargetingKey(CustomTargetingKey.newBuilder().build())
.build();
CustomTargetingKey response =
customTargetingKeyServiceClient.createCustomTargetingKey(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
CreateCustomTargetingKeyRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
CustomTargetingKey |
|
createCustomTargetingKey(NetworkName parent, CustomTargetingKey customTargetingKey)
public final CustomTargetingKey createCustomTargetingKey(NetworkName parent, CustomTargetingKey customTargetingKey)API to create a CustomTargetingKey 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 (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
CustomTargetingKeyServiceClient.create()) {
NetworkName parent = NetworkName.of("[NETWORK_CODE]");
CustomTargetingKey customTargetingKey = CustomTargetingKey.newBuilder().build();
CustomTargetingKey response =
customTargetingKeyServiceClient.createCustomTargetingKey(parent, customTargetingKey);
}
| Parameters | |
|---|---|
| Name | Description |
parent |
NetworkNameRequired. The parent resource where this |
customTargetingKey |
CustomTargetingKeyRequired. The |
| Returns | |
|---|---|
| Type | Description |
CustomTargetingKey |
|
createCustomTargetingKey(String parent, CustomTargetingKey customTargetingKey)
public final CustomTargetingKey createCustomTargetingKey(String parent, CustomTargetingKey customTargetingKey)API to create a CustomTargetingKey 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 (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
CustomTargetingKeyServiceClient.create()) {
String parent = NetworkName.of("[NETWORK_CODE]").toString();
CustomTargetingKey customTargetingKey = CustomTargetingKey.newBuilder().build();
CustomTargetingKey response =
customTargetingKeyServiceClient.createCustomTargetingKey(parent, customTargetingKey);
}
| Parameters | |
|---|---|
| Name | Description |
parent |
StringRequired. The parent resource where this |
customTargetingKey |
CustomTargetingKeyRequired. The |
| Returns | |
|---|---|
| Type | Description |
CustomTargetingKey |
|
createCustomTargetingKeyCallable()
public final UnaryCallable<CreateCustomTargetingKeyRequest,CustomTargetingKey> createCustomTargetingKeyCallable()API to create a CustomTargetingKey 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 (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
CustomTargetingKeyServiceClient.create()) {
CreateCustomTargetingKeyRequest request =
CreateCustomTargetingKeyRequest.newBuilder()
.setParent(NetworkName.of("[NETWORK_CODE]").toString())
.setCustomTargetingKey(CustomTargetingKey.newBuilder().build())
.build();
ApiFuture<CustomTargetingKey> future =
customTargetingKeyServiceClient.createCustomTargetingKeyCallable().futureCall(request);
// Do something.
CustomTargetingKey response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<CreateCustomTargetingKeyRequest,CustomTargetingKey> |
|
getCustomTargetingKey(CustomTargetingKeyName name)
public final CustomTargetingKey getCustomTargetingKey(CustomTargetingKeyName name)API to retrieve a CustomTargetingKey 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 (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
CustomTargetingKeyServiceClient.create()) {
CustomTargetingKeyName name =
CustomTargetingKeyName.of("[NETWORK_CODE]", "[CUSTOM_TARGETING_KEY]");
CustomTargetingKey response = customTargetingKeyServiceClient.getCustomTargetingKey(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
CustomTargetingKeyNameRequired. The resource name of the CustomTargetingKey. Format:
|
| Returns | |
|---|---|
| Type | Description |
CustomTargetingKey |
|
getCustomTargetingKey(GetCustomTargetingKeyRequest request)
public final CustomTargetingKey getCustomTargetingKey(GetCustomTargetingKeyRequest request)API to retrieve a CustomTargetingKey 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 (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
CustomTargetingKeyServiceClient.create()) {
GetCustomTargetingKeyRequest request =
GetCustomTargetingKeyRequest.newBuilder()
.setName(
CustomTargetingKeyName.of("[NETWORK_CODE]", "[CUSTOM_TARGETING_KEY]").toString())
.build();
CustomTargetingKey response = customTargetingKeyServiceClient.getCustomTargetingKey(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
GetCustomTargetingKeyRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
CustomTargetingKey |
|
getCustomTargetingKey(String name)
public final CustomTargetingKey getCustomTargetingKey(String name)API to retrieve a CustomTargetingKey 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 (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
CustomTargetingKeyServiceClient.create()) {
String name =
CustomTargetingKeyName.of("[NETWORK_CODE]", "[CUSTOM_TARGETING_KEY]").toString();
CustomTargetingKey response = customTargetingKeyServiceClient.getCustomTargetingKey(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
StringRequired. The resource name of the CustomTargetingKey. Format:
|
| Returns | |
|---|---|
| Type | Description |
CustomTargetingKey |
|
getCustomTargetingKeyCallable()
public final UnaryCallable<GetCustomTargetingKeyRequest,CustomTargetingKey> getCustomTargetingKeyCallable()API to retrieve a CustomTargetingKey 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 (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
CustomTargetingKeyServiceClient.create()) {
GetCustomTargetingKeyRequest request =
GetCustomTargetingKeyRequest.newBuilder()
.setName(
CustomTargetingKeyName.of("[NETWORK_CODE]", "[CUSTOM_TARGETING_KEY]").toString())
.build();
ApiFuture<CustomTargetingKey> future =
customTargetingKeyServiceClient.getCustomTargetingKeyCallable().futureCall(request);
// Do something.
CustomTargetingKey response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<GetCustomTargetingKeyRequest,CustomTargetingKey> |
|
getSettings()
public final CustomTargetingKeyServiceSettings getSettings()| Returns | |
|---|---|
| Type | Description |
CustomTargetingKeyServiceSettings |
|
getStub()
public CustomTargetingKeyServiceStub getStub()| Returns | |
|---|---|
| Type | Description |
CustomTargetingKeyServiceStub |
|
isShutdown()
public boolean isShutdown()| Returns | |
|---|---|
| Type | Description |
boolean |
|
isTerminated()
public boolean isTerminated()| Returns | |
|---|---|
| Type | Description |
boolean |
|
listCustomTargetingKeys(ListCustomTargetingKeysRequest request)
public final CustomTargetingKeyServiceClient.ListCustomTargetingKeysPagedResponse listCustomTargetingKeys(ListCustomTargetingKeysRequest request)API to retrieve a list of CustomTargetingKey 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 (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
CustomTargetingKeyServiceClient.create()) {
ListCustomTargetingKeysRequest request =
ListCustomTargetingKeysRequest.newBuilder()
.setParent(NetworkName.of("[NETWORK_CODE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.setSkip(3532159)
.build();
for (CustomTargetingKey element :
customTargetingKeyServiceClient.listCustomTargetingKeys(request).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
request |
ListCustomTargetingKeysRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
CustomTargetingKeyServiceClient.ListCustomTargetingKeysPagedResponse |
|
listCustomTargetingKeys(NetworkName parent)
public final CustomTargetingKeyServiceClient.ListCustomTargetingKeysPagedResponse listCustomTargetingKeys(NetworkName parent)API to retrieve a list of CustomTargetingKey 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 (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
CustomTargetingKeyServiceClient.create()) {
NetworkName parent = NetworkName.of("[NETWORK_CODE]");
for (CustomTargetingKey element :
customTargetingKeyServiceClient.listCustomTargetingKeys(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
NetworkNameRequired. The parent, which owns this collection of CustomTargetingKeys. Format:
|
| Returns | |
|---|---|
| Type | Description |
CustomTargetingKeyServiceClient.ListCustomTargetingKeysPagedResponse |
|
listCustomTargetingKeys(String parent)
public final CustomTargetingKeyServiceClient.ListCustomTargetingKeysPagedResponse listCustomTargetingKeys(String parent)API to retrieve a list of CustomTargetingKey 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 (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
CustomTargetingKeyServiceClient.create()) {
String parent = NetworkName.of("[NETWORK_CODE]").toString();
for (CustomTargetingKey element :
customTargetingKeyServiceClient.listCustomTargetingKeys(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
StringRequired. The parent, which owns this collection of CustomTargetingKeys. Format:
|
| Returns | |
|---|---|
| Type | Description |
CustomTargetingKeyServiceClient.ListCustomTargetingKeysPagedResponse |
|
listCustomTargetingKeysCallable()
public final UnaryCallable<ListCustomTargetingKeysRequest,ListCustomTargetingKeysResponse> listCustomTargetingKeysCallable()API to retrieve a list of CustomTargetingKey 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 (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
CustomTargetingKeyServiceClient.create()) {
ListCustomTargetingKeysRequest request =
ListCustomTargetingKeysRequest.newBuilder()
.setParent(NetworkName.of("[NETWORK_CODE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.setSkip(3532159)
.build();
while (true) {
ListCustomTargetingKeysResponse response =
customTargetingKeyServiceClient.listCustomTargetingKeysCallable().call(request);
for (CustomTargetingKey element : response.getCustomTargetingKeysList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListCustomTargetingKeysRequest,ListCustomTargetingKeysResponse> |
|
listCustomTargetingKeysPagedCallable()
public final UnaryCallable<ListCustomTargetingKeysRequest,CustomTargetingKeyServiceClient.ListCustomTargetingKeysPagedResponse> listCustomTargetingKeysPagedCallable()API to retrieve a list of CustomTargetingKey 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 (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
CustomTargetingKeyServiceClient.create()) {
ListCustomTargetingKeysRequest request =
ListCustomTargetingKeysRequest.newBuilder()
.setParent(NetworkName.of("[NETWORK_CODE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.setSkip(3532159)
.build();
ApiFuture<CustomTargetingKey> future =
customTargetingKeyServiceClient
.listCustomTargetingKeysPagedCallable()
.futureCall(request);
// Do something.
for (CustomTargetingKey element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListCustomTargetingKeysRequest,ListCustomTargetingKeysPagedResponse> |
|
shutdown()
public void shutdown()shutdownNow()
public void shutdownNow()updateCustomTargetingKey(CustomTargetingKey customTargetingKey, FieldMask updateMask)
public final CustomTargetingKey updateCustomTargetingKey(CustomTargetingKey customTargetingKey, FieldMask updateMask)API to update a CustomTargetingKey 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 (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
CustomTargetingKeyServiceClient.create()) {
CustomTargetingKey customTargetingKey = CustomTargetingKey.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
CustomTargetingKey response =
customTargetingKeyServiceClient.updateCustomTargetingKey(customTargetingKey, updateMask);
}
| Parameters | |
|---|---|
| Name | Description |
customTargetingKey |
CustomTargetingKeyRequired. The The |
updateMask |
FieldMaskRequired. The list of fields to update. |
| Returns | |
|---|---|
| Type | Description |
CustomTargetingKey |
|
updateCustomTargetingKey(UpdateCustomTargetingKeyRequest request)
public final CustomTargetingKey updateCustomTargetingKey(UpdateCustomTargetingKeyRequest request)API to update a CustomTargetingKey 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 (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
CustomTargetingKeyServiceClient.create()) {
UpdateCustomTargetingKeyRequest request =
UpdateCustomTargetingKeyRequest.newBuilder()
.setCustomTargetingKey(CustomTargetingKey.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
CustomTargetingKey response =
customTargetingKeyServiceClient.updateCustomTargetingKey(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
UpdateCustomTargetingKeyRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
CustomTargetingKey |
|
updateCustomTargetingKeyCallable()
public final UnaryCallable<UpdateCustomTargetingKeyRequest,CustomTargetingKey> updateCustomTargetingKeyCallable()API to update a CustomTargetingKey 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 (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
CustomTargetingKeyServiceClient.create()) {
UpdateCustomTargetingKeyRequest request =
UpdateCustomTargetingKeyRequest.newBuilder()
.setCustomTargetingKey(CustomTargetingKey.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<CustomTargetingKey> future =
customTargetingKeyServiceClient.updateCustomTargetingKeyCallable().futureCall(request);
// Do something.
CustomTargetingKey response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<UpdateCustomTargetingKeyRequest,CustomTargetingKey> |
|