| GitHub Repository | Product Reference |
Service Description: Provides methods for handling CustomField 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 (CustomFieldServiceClient customFieldServiceClient = CustomFieldServiceClient.create()) {
CustomFieldName name = CustomFieldName.of("[NETWORK_CODE]", "[CUSTOM_FIELD]");
CustomField response = customFieldServiceClient.getCustomField(name);
}
Note: close() needs to be called on the CustomFieldServiceClient 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 |
|---|---|---|
GetCustomField |
Retrieves 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.
|
ListCustomFields |
Lists |
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.
|
CreateCustomField |
Creates 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.
|
BatchCreateCustomFields |
Creates |
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.
|
UpdateCustomField |
Updates 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.
|
BatchUpdateCustomFields |
Batch updates |
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.
|
BatchActivateCustomFields |
Activates 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.
|
BatchDeactivateCustomFields |
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 CustomFieldServiceSettings 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
CustomFieldServiceSettings customFieldServiceSettings =
CustomFieldServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
CustomFieldServiceClient customFieldServiceClient =
CustomFieldServiceClient.create(customFieldServiceSettings);
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
CustomFieldServiceSettings customFieldServiceSettings =
CustomFieldServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
CustomFieldServiceClient customFieldServiceClient =
CustomFieldServiceClient.create(customFieldServiceSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
Static Methods
create()
public static final CustomFieldServiceClient create()Constructs an instance of CustomFieldServiceClient with default settings.
| Returns | |
|---|---|
| Type | Description |
CustomFieldServiceClient |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
create(CustomFieldServiceSettings settings)
public static final CustomFieldServiceClient create(CustomFieldServiceSettings settings)Constructs an instance of CustomFieldServiceClient, 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 |
CustomFieldServiceSettings |
| Returns | |
|---|---|
| Type | Description |
CustomFieldServiceClient |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
create(CustomFieldServiceStub stub)
public static final CustomFieldServiceClient create(CustomFieldServiceStub stub)Constructs an instance of CustomFieldServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(CustomFieldServiceSettings).
| Parameter | |
|---|---|
| Name | Description |
stub |
CustomFieldServiceStub |
| Returns | |
|---|---|
| Type | Description |
CustomFieldServiceClient |
|
Constructors
CustomFieldServiceClient(CustomFieldServiceSettings settings)
protected CustomFieldServiceClient(CustomFieldServiceSettings settings)Constructs an instance of CustomFieldServiceClient, 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 |
CustomFieldServiceSettings |
CustomFieldServiceClient(CustomFieldServiceStub stub)
protected CustomFieldServiceClient(CustomFieldServiceStub stub)| Parameter | |
|---|---|
| Name | Description |
stub |
CustomFieldServiceStub |
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 |
|
batchActivateCustomFields(@Nullable NetworkName parent, List<String> names)
public final BatchActivateCustomFieldsResponse batchActivateCustomFields(@Nullable NetworkName parent, List<String> names)Activates a list of CustomField 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 (CustomFieldServiceClient customFieldServiceClient = CustomFieldServiceClient.create()) {
NetworkName parent = NetworkName.of("[NETWORK_CODE]");
List<String> names = new ArrayList<>();
BatchActivateCustomFieldsResponse response =
customFieldServiceClient.batchActivateCustomFields(parent, names);
}
| Parameters | |
|---|---|
| Name | Description |
parent |
@org.jspecify.annotations.Nullable com.google.ads.admanager.v1.NetworkNameRequired. Format: |
names |
List<String>Required. The resource names of the |
| Returns | |
|---|---|
| Type | Description |
BatchActivateCustomFieldsResponse |
|
batchActivateCustomFields(BatchActivateCustomFieldsRequest request)
public final BatchActivateCustomFieldsResponse batchActivateCustomFields(BatchActivateCustomFieldsRequest request)Activates a list of CustomField 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 (CustomFieldServiceClient customFieldServiceClient = CustomFieldServiceClient.create()) {
BatchActivateCustomFieldsRequest request =
BatchActivateCustomFieldsRequest.newBuilder()
.setParent(NetworkName.of("[NETWORK_CODE]").toString())
.addAllNames(new ArrayList<String>())
.build();
BatchActivateCustomFieldsResponse response =
customFieldServiceClient.batchActivateCustomFields(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
BatchActivateCustomFieldsRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
BatchActivateCustomFieldsResponse |
|
batchActivateCustomFields(String parent, List<String> names)
public final BatchActivateCustomFieldsResponse batchActivateCustomFields(String parent, List<String> names)Activates a list of CustomField 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 (CustomFieldServiceClient customFieldServiceClient = CustomFieldServiceClient.create()) {
String parent = NetworkName.of("[NETWORK_CODE]").toString();
List<String> names = new ArrayList<>();
BatchActivateCustomFieldsResponse response =
customFieldServiceClient.batchActivateCustomFields(parent, names);
}
| Parameters | |
|---|---|
| Name | Description |
parent |
StringRequired. Format: |
names |
List<String>Required. The resource names of the |
| Returns | |
|---|---|
| Type | Description |
BatchActivateCustomFieldsResponse |
|
batchActivateCustomFieldsCallable()
public final UnaryCallable<BatchActivateCustomFieldsRequest,BatchActivateCustomFieldsResponse> batchActivateCustomFieldsCallable()Activates a list of CustomField 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 (CustomFieldServiceClient customFieldServiceClient = CustomFieldServiceClient.create()) {
BatchActivateCustomFieldsRequest request =
BatchActivateCustomFieldsRequest.newBuilder()
.setParent(NetworkName.of("[NETWORK_CODE]").toString())
.addAllNames(new ArrayList<String>())
.build();
ApiFuture<BatchActivateCustomFieldsResponse> future =
customFieldServiceClient.batchActivateCustomFieldsCallable().futureCall(request);
// Do something.
BatchActivateCustomFieldsResponse response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<BatchActivateCustomFieldsRequest,BatchActivateCustomFieldsResponse> |
|
batchCreateCustomFields(@Nullable NetworkName parent, List<CreateCustomFieldRequest> requests)
public final BatchCreateCustomFieldsResponse batchCreateCustomFields(@Nullable NetworkName parent, List<CreateCustomFieldRequest> requests)Creates CustomField 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 (CustomFieldServiceClient customFieldServiceClient = CustomFieldServiceClient.create()) {
NetworkName parent = NetworkName.of("[NETWORK_CODE]");
List<CreateCustomFieldRequest> requests = new ArrayList<>();
BatchCreateCustomFieldsResponse response =
customFieldServiceClient.batchCreateCustomFields(parent, requests);
}
| Parameters | |
|---|---|
| Name | Description |
parent |
@org.jspecify.annotations.Nullable com.google.ads.admanager.v1.NetworkNameRequired. The parent resource where |
requests |
List<CreateCustomFieldRequest>Required. The |
| Returns | |
|---|---|
| Type | Description |
BatchCreateCustomFieldsResponse |
|
batchCreateCustomFields(BatchCreateCustomFieldsRequest request)
public final BatchCreateCustomFieldsResponse batchCreateCustomFields(BatchCreateCustomFieldsRequest request)Creates CustomField 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 (CustomFieldServiceClient customFieldServiceClient = CustomFieldServiceClient.create()) {
BatchCreateCustomFieldsRequest request =
BatchCreateCustomFieldsRequest.newBuilder()
.setParent(NetworkName.of("[NETWORK_CODE]").toString())
.addAllRequests(new ArrayList<CreateCustomFieldRequest>())
.build();
BatchCreateCustomFieldsResponse response =
customFieldServiceClient.batchCreateCustomFields(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
BatchCreateCustomFieldsRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
BatchCreateCustomFieldsResponse |
|
batchCreateCustomFields(String parent, List<CreateCustomFieldRequest> requests)
public final BatchCreateCustomFieldsResponse batchCreateCustomFields(String parent, List<CreateCustomFieldRequest> requests)Creates CustomField 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 (CustomFieldServiceClient customFieldServiceClient = CustomFieldServiceClient.create()) {
String parent = NetworkName.of("[NETWORK_CODE]").toString();
List<CreateCustomFieldRequest> requests = new ArrayList<>();
BatchCreateCustomFieldsResponse response =
customFieldServiceClient.batchCreateCustomFields(parent, requests);
}
| Parameters | |
|---|---|
| Name | Description |
parent |
StringRequired. The parent resource where |
requests |
List<CreateCustomFieldRequest>Required. The |
| Returns | |
|---|---|
| Type | Description |
BatchCreateCustomFieldsResponse |
|
batchCreateCustomFieldsCallable()
public final UnaryCallable<BatchCreateCustomFieldsRequest,BatchCreateCustomFieldsResponse> batchCreateCustomFieldsCallable()Creates CustomField 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 (CustomFieldServiceClient customFieldServiceClient = CustomFieldServiceClient.create()) {
BatchCreateCustomFieldsRequest request =
BatchCreateCustomFieldsRequest.newBuilder()
.setParent(NetworkName.of("[NETWORK_CODE]").toString())
.addAllRequests(new ArrayList<CreateCustomFieldRequest>())
.build();
ApiFuture<BatchCreateCustomFieldsResponse> future =
customFieldServiceClient.batchCreateCustomFieldsCallable().futureCall(request);
// Do something.
BatchCreateCustomFieldsResponse response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<BatchCreateCustomFieldsRequest,BatchCreateCustomFieldsResponse> |
|
batchDeactivateCustomFields(@Nullable NetworkName parent, List<String> names)
public final BatchDeactivateCustomFieldsResponse batchDeactivateCustomFields(@Nullable NetworkName parent, List<String> names)Deactivates a list of CustomField 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 (CustomFieldServiceClient customFieldServiceClient = CustomFieldServiceClient.create()) {
NetworkName parent = NetworkName.of("[NETWORK_CODE]");
List<String> names = new ArrayList<>();
BatchDeactivateCustomFieldsResponse response =
customFieldServiceClient.batchDeactivateCustomFields(parent, names);
}
| Parameters | |
|---|---|
| Name | Description |
parent |
@org.jspecify.annotations.Nullable com.google.ads.admanager.v1.NetworkNameRequired. Format: |
names |
List<String>Required. The resource names of the |
| Returns | |
|---|---|
| Type | Description |
BatchDeactivateCustomFieldsResponse |
|
batchDeactivateCustomFields(BatchDeactivateCustomFieldsRequest request)
public final BatchDeactivateCustomFieldsResponse batchDeactivateCustomFields(BatchDeactivateCustomFieldsRequest request)Deactivates a list of CustomField 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 (CustomFieldServiceClient customFieldServiceClient = CustomFieldServiceClient.create()) {
BatchDeactivateCustomFieldsRequest request =
BatchDeactivateCustomFieldsRequest.newBuilder()
.setParent(NetworkName.of("[NETWORK_CODE]").toString())
.addAllNames(new ArrayList<String>())
.build();
BatchDeactivateCustomFieldsResponse response =
customFieldServiceClient.batchDeactivateCustomFields(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
BatchDeactivateCustomFieldsRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
BatchDeactivateCustomFieldsResponse |
|
batchDeactivateCustomFields(String parent, List<String> names)
public final BatchDeactivateCustomFieldsResponse batchDeactivateCustomFields(String parent, List<String> names)Deactivates a list of CustomField 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 (CustomFieldServiceClient customFieldServiceClient = CustomFieldServiceClient.create()) {
String parent = NetworkName.of("[NETWORK_CODE]").toString();
List<String> names = new ArrayList<>();
BatchDeactivateCustomFieldsResponse response =
customFieldServiceClient.batchDeactivateCustomFields(parent, names);
}
| Parameters | |
|---|---|
| Name | Description |
parent |
StringRequired. Format: |
names |
List<String>Required. The resource names of the |
| Returns | |
|---|---|
| Type | Description |
BatchDeactivateCustomFieldsResponse |
|
batchDeactivateCustomFieldsCallable()
public final UnaryCallable<BatchDeactivateCustomFieldsRequest,BatchDeactivateCustomFieldsResponse> batchDeactivateCustomFieldsCallable()Deactivates a list of CustomField 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 (CustomFieldServiceClient customFieldServiceClient = CustomFieldServiceClient.create()) {
BatchDeactivateCustomFieldsRequest request =
BatchDeactivateCustomFieldsRequest.newBuilder()
.setParent(NetworkName.of("[NETWORK_CODE]").toString())
.addAllNames(new ArrayList<String>())
.build();
ApiFuture<BatchDeactivateCustomFieldsResponse> future =
customFieldServiceClient.batchDeactivateCustomFieldsCallable().futureCall(request);
// Do something.
BatchDeactivateCustomFieldsResponse response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<BatchDeactivateCustomFieldsRequest,BatchDeactivateCustomFieldsResponse> |
|
batchUpdateCustomFields(@Nullable NetworkName parent, List<UpdateCustomFieldRequest> requests)
public final BatchUpdateCustomFieldsResponse batchUpdateCustomFields(@Nullable NetworkName parent, List<UpdateCustomFieldRequest> requests)Batch updates CustomField 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 (CustomFieldServiceClient customFieldServiceClient = CustomFieldServiceClient.create()) {
NetworkName parent = NetworkName.of("[NETWORK_CODE]");
List<UpdateCustomFieldRequest> requests = new ArrayList<>();
BatchUpdateCustomFieldsResponse response =
customFieldServiceClient.batchUpdateCustomFields(parent, requests);
}
| Parameters | |
|---|---|
| Name | Description |
parent |
@org.jspecify.annotations.Nullable com.google.ads.admanager.v1.NetworkNameRequired. The parent resource where |
requests |
List<UpdateCustomFieldRequest>Required. The |
| Returns | |
|---|---|
| Type | Description |
BatchUpdateCustomFieldsResponse |
|
batchUpdateCustomFields(BatchUpdateCustomFieldsRequest request)
public final BatchUpdateCustomFieldsResponse batchUpdateCustomFields(BatchUpdateCustomFieldsRequest request)Batch updates CustomField 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 (CustomFieldServiceClient customFieldServiceClient = CustomFieldServiceClient.create()) {
BatchUpdateCustomFieldsRequest request =
BatchUpdateCustomFieldsRequest.newBuilder()
.setParent(NetworkName.of("[NETWORK_CODE]").toString())
.addAllRequests(new ArrayList<UpdateCustomFieldRequest>())
.build();
BatchUpdateCustomFieldsResponse response =
customFieldServiceClient.batchUpdateCustomFields(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
BatchUpdateCustomFieldsRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
BatchUpdateCustomFieldsResponse |
|
batchUpdateCustomFields(String parent, List<UpdateCustomFieldRequest> requests)
public final BatchUpdateCustomFieldsResponse batchUpdateCustomFields(String parent, List<UpdateCustomFieldRequest> requests)Batch updates CustomField 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 (CustomFieldServiceClient customFieldServiceClient = CustomFieldServiceClient.create()) {
String parent = NetworkName.of("[NETWORK_CODE]").toString();
List<UpdateCustomFieldRequest> requests = new ArrayList<>();
BatchUpdateCustomFieldsResponse response =
customFieldServiceClient.batchUpdateCustomFields(parent, requests);
}
| Parameters | |
|---|---|
| Name | Description |
parent |
StringRequired. The parent resource where |
requests |
List<UpdateCustomFieldRequest>Required. The |
| Returns | |
|---|---|
| Type | Description |
BatchUpdateCustomFieldsResponse |
|
batchUpdateCustomFieldsCallable()
public final UnaryCallable<BatchUpdateCustomFieldsRequest,BatchUpdateCustomFieldsResponse> batchUpdateCustomFieldsCallable()Batch updates CustomField 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 (CustomFieldServiceClient customFieldServiceClient = CustomFieldServiceClient.create()) {
BatchUpdateCustomFieldsRequest request =
BatchUpdateCustomFieldsRequest.newBuilder()
.setParent(NetworkName.of("[NETWORK_CODE]").toString())
.addAllRequests(new ArrayList<UpdateCustomFieldRequest>())
.build();
ApiFuture<BatchUpdateCustomFieldsResponse> future =
customFieldServiceClient.batchUpdateCustomFieldsCallable().futureCall(request);
// Do something.
BatchUpdateCustomFieldsResponse response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<BatchUpdateCustomFieldsRequest,BatchUpdateCustomFieldsResponse> |
|
close()
public final void close()createCustomField(@Nullable NetworkName parent, CustomField customField)
public final CustomField createCustomField(@Nullable NetworkName parent, CustomField customField)Creates a CustomField 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 (CustomFieldServiceClient customFieldServiceClient = CustomFieldServiceClient.create()) {
NetworkName parent = NetworkName.of("[NETWORK_CODE]");
CustomField customField = CustomField.newBuilder().build();
CustomField response = customFieldServiceClient.createCustomField(parent, customField);
}
| Parameters | |
|---|---|
| Name | Description |
parent |
@org.jspecify.annotations.Nullable com.google.ads.admanager.v1.NetworkNameRequired. The parent resource where this |
customField |
CustomFieldRequired. The |
| Returns | |
|---|---|
| Type | Description |
CustomField |
|
createCustomField(CreateCustomFieldRequest request)
public final CustomField createCustomField(CreateCustomFieldRequest request)Creates a CustomField 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 (CustomFieldServiceClient customFieldServiceClient = CustomFieldServiceClient.create()) {
CreateCustomFieldRequest request =
CreateCustomFieldRequest.newBuilder()
.setParent(NetworkName.of("[NETWORK_CODE]").toString())
.setCustomField(CustomField.newBuilder().build())
.build();
CustomField response = customFieldServiceClient.createCustomField(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
CreateCustomFieldRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
CustomField |
|
createCustomField(String parent, CustomField customField)
public final CustomField createCustomField(String parent, CustomField customField)Creates a CustomField 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 (CustomFieldServiceClient customFieldServiceClient = CustomFieldServiceClient.create()) {
String parent = NetworkName.of("[NETWORK_CODE]").toString();
CustomField customField = CustomField.newBuilder().build();
CustomField response = customFieldServiceClient.createCustomField(parent, customField);
}
| Parameters | |
|---|---|
| Name | Description |
parent |
StringRequired. The parent resource where this |
customField |
CustomFieldRequired. The |
| Returns | |
|---|---|
| Type | Description |
CustomField |
|
createCustomFieldCallable()
public final UnaryCallable<CreateCustomFieldRequest,CustomField> createCustomFieldCallable()Creates a CustomField 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 (CustomFieldServiceClient customFieldServiceClient = CustomFieldServiceClient.create()) {
CreateCustomFieldRequest request =
CreateCustomFieldRequest.newBuilder()
.setParent(NetworkName.of("[NETWORK_CODE]").toString())
.setCustomField(CustomField.newBuilder().build())
.build();
ApiFuture<CustomField> future =
customFieldServiceClient.createCustomFieldCallable().futureCall(request);
// Do something.
CustomField response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<CreateCustomFieldRequest,CustomField> |
|
getCustomField(@Nullable CustomFieldName name)
public final CustomField getCustomField(@Nullable CustomFieldName name)Retrieves a CustomField 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 (CustomFieldServiceClient customFieldServiceClient = CustomFieldServiceClient.create()) {
CustomFieldName name = CustomFieldName.of("[NETWORK_CODE]", "[CUSTOM_FIELD]");
CustomField response = customFieldServiceClient.getCustomField(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
@org.jspecify.annotations.Nullable com.google.ads.admanager.v1.CustomFieldNameRequired. The resource name of the CustomField. Format:
|
| Returns | |
|---|---|
| Type | Description |
CustomField |
|
getCustomField(GetCustomFieldRequest request)
public final CustomField getCustomField(GetCustomFieldRequest request)Retrieves a CustomField 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 (CustomFieldServiceClient customFieldServiceClient = CustomFieldServiceClient.create()) {
GetCustomFieldRequest request =
GetCustomFieldRequest.newBuilder()
.setName(CustomFieldName.of("[NETWORK_CODE]", "[CUSTOM_FIELD]").toString())
.build();
CustomField response = customFieldServiceClient.getCustomField(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
GetCustomFieldRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
CustomField |
|
getCustomField(String name)
public final CustomField getCustomField(String name)Retrieves a CustomField 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 (CustomFieldServiceClient customFieldServiceClient = CustomFieldServiceClient.create()) {
String name = CustomFieldName.of("[NETWORK_CODE]", "[CUSTOM_FIELD]").toString();
CustomField response = customFieldServiceClient.getCustomField(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
StringRequired. The resource name of the CustomField. Format:
|
| Returns | |
|---|---|
| Type | Description |
CustomField |
|
getCustomFieldCallable()
public final UnaryCallable<GetCustomFieldRequest,CustomField> getCustomFieldCallable()Retrieves a CustomField 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 (CustomFieldServiceClient customFieldServiceClient = CustomFieldServiceClient.create()) {
GetCustomFieldRequest request =
GetCustomFieldRequest.newBuilder()
.setName(CustomFieldName.of("[NETWORK_CODE]", "[CUSTOM_FIELD]").toString())
.build();
ApiFuture<CustomField> future =
customFieldServiceClient.getCustomFieldCallable().futureCall(request);
// Do something.
CustomField response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<GetCustomFieldRequest,CustomField> |
|
getSettings()
public final @Nullable CustomFieldServiceSettings getSettings()| Returns | |
|---|---|
| Type | Description |
@org.jspecify.annotations.Nullable com.google.ads.admanager.v1.CustomFieldServiceSettings |
|
getStub()
public CustomFieldServiceStub getStub()| Returns | |
|---|---|
| Type | Description |
CustomFieldServiceStub |
|
isShutdown()
public boolean isShutdown()| Returns | |
|---|---|
| Type | Description |
boolean |
|
isTerminated()
public boolean isTerminated()| Returns | |
|---|---|
| Type | Description |
boolean |
|
listCustomFields(@Nullable NetworkName parent)
public final CustomFieldServiceClient.ListCustomFieldsPagedResponse listCustomFields(@Nullable NetworkName parent)Lists CustomField 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 (CustomFieldServiceClient customFieldServiceClient = CustomFieldServiceClient.create()) {
NetworkName parent = NetworkName.of("[NETWORK_CODE]");
for (CustomField element : customFieldServiceClient.listCustomFields(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
@org.jspecify.annotations.Nullable com.google.ads.admanager.v1.NetworkNameRequired. The parent, which owns this collection of CustomFields. Format:
|
| Returns | |
|---|---|
| Type | Description |
CustomFieldServiceClient.ListCustomFieldsPagedResponse |
|
listCustomFields(ListCustomFieldsRequest request)
public final CustomFieldServiceClient.ListCustomFieldsPagedResponse listCustomFields(ListCustomFieldsRequest request)Lists CustomField 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 (CustomFieldServiceClient customFieldServiceClient = CustomFieldServiceClient.create()) {
ListCustomFieldsRequest request =
ListCustomFieldsRequest.newBuilder()
.setParent(NetworkName.of("[NETWORK_CODE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.setSkip(3532159)
.build();
for (CustomField element : customFieldServiceClient.listCustomFields(request).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
request |
ListCustomFieldsRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
CustomFieldServiceClient.ListCustomFieldsPagedResponse |
|
listCustomFields(String parent)
public final CustomFieldServiceClient.ListCustomFieldsPagedResponse listCustomFields(String parent)Lists CustomField 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 (CustomFieldServiceClient customFieldServiceClient = CustomFieldServiceClient.create()) {
String parent = NetworkName.of("[NETWORK_CODE]").toString();
for (CustomField element : customFieldServiceClient.listCustomFields(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
StringRequired. The parent, which owns this collection of CustomFields. Format:
|
| Returns | |
|---|---|
| Type | Description |
CustomFieldServiceClient.ListCustomFieldsPagedResponse |
|
listCustomFieldsCallable()
public final UnaryCallable<ListCustomFieldsRequest,ListCustomFieldsResponse> listCustomFieldsCallable()Lists CustomField 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 (CustomFieldServiceClient customFieldServiceClient = CustomFieldServiceClient.create()) {
ListCustomFieldsRequest request =
ListCustomFieldsRequest.newBuilder()
.setParent(NetworkName.of("[NETWORK_CODE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.setSkip(3532159)
.build();
while (true) {
ListCustomFieldsResponse response =
customFieldServiceClient.listCustomFieldsCallable().call(request);
for (CustomField element : response.getCustomFieldsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListCustomFieldsRequest,ListCustomFieldsResponse> |
|
listCustomFieldsPagedCallable()
public final UnaryCallable<ListCustomFieldsRequest,CustomFieldServiceClient.ListCustomFieldsPagedResponse> listCustomFieldsPagedCallable()Lists CustomField 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 (CustomFieldServiceClient customFieldServiceClient = CustomFieldServiceClient.create()) {
ListCustomFieldsRequest request =
ListCustomFieldsRequest.newBuilder()
.setParent(NetworkName.of("[NETWORK_CODE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.setSkip(3532159)
.build();
ApiFuture<CustomField> future =
customFieldServiceClient.listCustomFieldsPagedCallable().futureCall(request);
// Do something.
for (CustomField element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListCustomFieldsRequest,ListCustomFieldsPagedResponse> |
|
shutdown()
public void shutdown()shutdownNow()
public void shutdownNow()updateCustomField(CustomField customField, FieldMask updateMask)
public final CustomField updateCustomField(CustomField customField, FieldMask updateMask)Updates a CustomField 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 (CustomFieldServiceClient customFieldServiceClient = CustomFieldServiceClient.create()) {
CustomField customField = CustomField.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
CustomField response = customFieldServiceClient.updateCustomField(customField, updateMask);
}
| Parameters | |
|---|---|
| Name | Description |
customField |
CustomFieldRequired. The The |
updateMask |
FieldMaskOptional. The list of fields to update. |
| Returns | |
|---|---|
| Type | Description |
CustomField |
|
updateCustomField(UpdateCustomFieldRequest request)
public final CustomField updateCustomField(UpdateCustomFieldRequest request)Updates a CustomField 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 (CustomFieldServiceClient customFieldServiceClient = CustomFieldServiceClient.create()) {
UpdateCustomFieldRequest request =
UpdateCustomFieldRequest.newBuilder()
.setCustomField(CustomField.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
CustomField response = customFieldServiceClient.updateCustomField(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
UpdateCustomFieldRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
CustomField |
|
updateCustomFieldCallable()
public final UnaryCallable<UpdateCustomFieldRequest,CustomField> updateCustomFieldCallable()Updates a CustomField 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 (CustomFieldServiceClient customFieldServiceClient = CustomFieldServiceClient.create()) {
UpdateCustomFieldRequest request =
UpdateCustomFieldRequest.newBuilder()
.setCustomField(CustomField.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<CustomField> future =
customFieldServiceClient.updateCustomFieldCallable().futureCall(request);
// Do something.
CustomField response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<UpdateCustomFieldRequest,CustomField> |
|