| GitHub Repository | Product Reference |
Service Description: Provides methods for handling NativeStyle 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 (NativeStyleServiceClient nativeStyleServiceClient = NativeStyleServiceClient.create()) {
NativeStyleName name = NativeStyleName.of("[NETWORK_CODE]", "[NATIVE_STYLE]");
NativeStyle response = nativeStyleServiceClient.getNativeStyle(name);
}
Note: close() needs to be called on the NativeStyleServiceClient 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 |
|---|---|---|
GetNativeStyle |
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.
|
ListNativeStyles |
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.
|
BatchCreateNativeStyles |
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.
|
BatchUpdateNativeStyles |
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.
|
BatchActivateNativeStyles |
Beginning of non-CRUD 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.
|
BatchDeactivateNativeStyles |
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.
|
BatchArchiveNativeStyles |
Archives 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 NativeStyleServiceSettings 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
NativeStyleServiceSettings nativeStyleServiceSettings =
NativeStyleServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
NativeStyleServiceClient nativeStyleServiceClient =
NativeStyleServiceClient.create(nativeStyleServiceSettings);
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
NativeStyleServiceSettings nativeStyleServiceSettings =
NativeStyleServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
NativeStyleServiceClient nativeStyleServiceClient =
NativeStyleServiceClient.create(nativeStyleServiceSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
Static Methods
create()
public static final NativeStyleServiceClient create()Constructs an instance of NativeStyleServiceClient with default settings.
| Returns | |
|---|---|
| Type | Description |
NativeStyleServiceClient |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
create(NativeStyleServiceSettings settings)
public static final NativeStyleServiceClient create(NativeStyleServiceSettings settings)Constructs an instance of NativeStyleServiceClient, 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 |
NativeStyleServiceSettings |
| Returns | |
|---|---|
| Type | Description |
NativeStyleServiceClient |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
create(NativeStyleServiceStub stub)
public static final NativeStyleServiceClient create(NativeStyleServiceStub stub)Constructs an instance of NativeStyleServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(NativeStyleServiceSettings).
| Parameter | |
|---|---|
| Name | Description |
stub |
NativeStyleServiceStub |
| Returns | |
|---|---|
| Type | Description |
NativeStyleServiceClient |
|
Constructors
NativeStyleServiceClient(NativeStyleServiceSettings settings)
protected NativeStyleServiceClient(NativeStyleServiceSettings settings)Constructs an instance of NativeStyleServiceClient, 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 |
NativeStyleServiceSettings |
NativeStyleServiceClient(NativeStyleServiceStub stub)
protected NativeStyleServiceClient(NativeStyleServiceStub stub)| Parameter | |
|---|---|
| Name | Description |
stub |
NativeStyleServiceStub |
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 |
|
batchActivateNativeStyles(@Nullable NetworkName parent, List<String> names)
public final BatchActivateNativeStylesResponse batchActivateNativeStyles(@Nullable NetworkName parent, List<String> names)Beginning of non-CRUD Activates a list of NativeStyle 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 (NativeStyleServiceClient nativeStyleServiceClient = NativeStyleServiceClient.create()) {
NetworkName parent = NetworkName.of("[NETWORK_CODE]");
List<String> names = new ArrayList<>();
BatchActivateNativeStylesResponse response =
nativeStyleServiceClient.batchActivateNativeStyles(parent, names);
}
| Parameters | |
|---|---|
| Name | Description |
parent |
@org.jspecify.annotations.Nullable com.google.ads.admanager.v1.NetworkNameRequired. Format: |
names |
List<String>Required. Resource names for the |
| Returns | |
|---|---|
| Type | Description |
BatchActivateNativeStylesResponse |
|
batchActivateNativeStyles(BatchActivateNativeStylesRequest request)
public final BatchActivateNativeStylesResponse batchActivateNativeStyles(BatchActivateNativeStylesRequest request)Beginning of non-CRUD Activates a list of NativeStyle 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 (NativeStyleServiceClient nativeStyleServiceClient = NativeStyleServiceClient.create()) {
BatchActivateNativeStylesRequest request =
BatchActivateNativeStylesRequest.newBuilder()
.setParent(NetworkName.of("[NETWORK_CODE]").toString())
.addAllNames(new ArrayList<String>())
.build();
BatchActivateNativeStylesResponse response =
nativeStyleServiceClient.batchActivateNativeStyles(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
BatchActivateNativeStylesRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
BatchActivateNativeStylesResponse |
|
batchActivateNativeStyles(String parent, List<String> names)
public final BatchActivateNativeStylesResponse batchActivateNativeStyles(String parent, List<String> names)Beginning of non-CRUD Activates a list of NativeStyle 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 (NativeStyleServiceClient nativeStyleServiceClient = NativeStyleServiceClient.create()) {
String parent = NetworkName.of("[NETWORK_CODE]").toString();
List<String> names = new ArrayList<>();
BatchActivateNativeStylesResponse response =
nativeStyleServiceClient.batchActivateNativeStyles(parent, names);
}
| Parameters | |
|---|---|
| Name | Description |
parent |
StringRequired. Format: |
names |
List<String>Required. Resource names for the |
| Returns | |
|---|---|
| Type | Description |
BatchActivateNativeStylesResponse |
|
batchActivateNativeStylesCallable()
public final UnaryCallable<BatchActivateNativeStylesRequest,BatchActivateNativeStylesResponse> batchActivateNativeStylesCallable()Beginning of non-CRUD Activates a list of NativeStyle 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 (NativeStyleServiceClient nativeStyleServiceClient = NativeStyleServiceClient.create()) {
BatchActivateNativeStylesRequest request =
BatchActivateNativeStylesRequest.newBuilder()
.setParent(NetworkName.of("[NETWORK_CODE]").toString())
.addAllNames(new ArrayList<String>())
.build();
ApiFuture<BatchActivateNativeStylesResponse> future =
nativeStyleServiceClient.batchActivateNativeStylesCallable().futureCall(request);
// Do something.
BatchActivateNativeStylesResponse response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<BatchActivateNativeStylesRequest,BatchActivateNativeStylesResponse> |
|
batchArchiveNativeStyles(@Nullable NetworkName parent, List<String> names)
public final BatchArchiveNativeStylesResponse batchArchiveNativeStyles(@Nullable NetworkName parent, List<String> names)Archives a list of NativeStyle 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 (NativeStyleServiceClient nativeStyleServiceClient = NativeStyleServiceClient.create()) {
NetworkName parent = NetworkName.of("[NETWORK_CODE]");
List<String> names = new ArrayList<>();
BatchArchiveNativeStylesResponse response =
nativeStyleServiceClient.batchArchiveNativeStyles(parent, names);
}
| Parameters | |
|---|---|
| Name | Description |
parent |
@org.jspecify.annotations.Nullable com.google.ads.admanager.v1.NetworkNameRequired. Format: |
names |
List<String>Required. Resource names for the |
| Returns | |
|---|---|
| Type | Description |
BatchArchiveNativeStylesResponse |
|
batchArchiveNativeStyles(BatchArchiveNativeStylesRequest request)
public final BatchArchiveNativeStylesResponse batchArchiveNativeStyles(BatchArchiveNativeStylesRequest request)Archives a list of NativeStyle 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 (NativeStyleServiceClient nativeStyleServiceClient = NativeStyleServiceClient.create()) {
BatchArchiveNativeStylesRequest request =
BatchArchiveNativeStylesRequest.newBuilder()
.setParent(NetworkName.of("[NETWORK_CODE]").toString())
.addAllNames(new ArrayList<String>())
.build();
BatchArchiveNativeStylesResponse response =
nativeStyleServiceClient.batchArchiveNativeStyles(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
BatchArchiveNativeStylesRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
BatchArchiveNativeStylesResponse |
|
batchArchiveNativeStyles(String parent, List<String> names)
public final BatchArchiveNativeStylesResponse batchArchiveNativeStyles(String parent, List<String> names)Archives a list of NativeStyle 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 (NativeStyleServiceClient nativeStyleServiceClient = NativeStyleServiceClient.create()) {
String parent = NetworkName.of("[NETWORK_CODE]").toString();
List<String> names = new ArrayList<>();
BatchArchiveNativeStylesResponse response =
nativeStyleServiceClient.batchArchiveNativeStyles(parent, names);
}
| Parameters | |
|---|---|
| Name | Description |
parent |
StringRequired. Format: |
names |
List<String>Required. Resource names for the |
| Returns | |
|---|---|
| Type | Description |
BatchArchiveNativeStylesResponse |
|
batchArchiveNativeStylesCallable()
public final UnaryCallable<BatchArchiveNativeStylesRequest,BatchArchiveNativeStylesResponse> batchArchiveNativeStylesCallable()Archives a list of NativeStyle 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 (NativeStyleServiceClient nativeStyleServiceClient = NativeStyleServiceClient.create()) {
BatchArchiveNativeStylesRequest request =
BatchArchiveNativeStylesRequest.newBuilder()
.setParent(NetworkName.of("[NETWORK_CODE]").toString())
.addAllNames(new ArrayList<String>())
.build();
ApiFuture<BatchArchiveNativeStylesResponse> future =
nativeStyleServiceClient.batchArchiveNativeStylesCallable().futureCall(request);
// Do something.
BatchArchiveNativeStylesResponse response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<BatchArchiveNativeStylesRequest,BatchArchiveNativeStylesResponse> |
|
batchCreateNativeStyles(@Nullable NetworkName parent, List<CreateNativeStyleRequest> requests)
public final BatchCreateNativeStylesResponse batchCreateNativeStyles(@Nullable NetworkName parent, List<CreateNativeStyleRequest> requests)Creates NativeStyle 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 (NativeStyleServiceClient nativeStyleServiceClient = NativeStyleServiceClient.create()) {
NetworkName parent = NetworkName.of("[NETWORK_CODE]");
List<CreateNativeStyleRequest> requests = new ArrayList<>();
BatchCreateNativeStylesResponse response =
nativeStyleServiceClient.batchCreateNativeStyles(parent, requests);
}
| Parameters | |
|---|---|
| Name | Description |
parent |
@org.jspecify.annotations.Nullable com.google.ads.admanager.v1.NetworkNameRequired. The parent resource where |
requests |
List<CreateNativeStyleRequest>Required. The |
| Returns | |
|---|---|
| Type | Description |
BatchCreateNativeStylesResponse |
|
batchCreateNativeStyles(BatchCreateNativeStylesRequest request)
public final BatchCreateNativeStylesResponse batchCreateNativeStyles(BatchCreateNativeStylesRequest request)Creates NativeStyle 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 (NativeStyleServiceClient nativeStyleServiceClient = NativeStyleServiceClient.create()) {
BatchCreateNativeStylesRequest request =
BatchCreateNativeStylesRequest.newBuilder()
.setParent(NetworkName.of("[NETWORK_CODE]").toString())
.addAllRequests(new ArrayList<CreateNativeStyleRequest>())
.build();
BatchCreateNativeStylesResponse response =
nativeStyleServiceClient.batchCreateNativeStyles(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
BatchCreateNativeStylesRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
BatchCreateNativeStylesResponse |
|
batchCreateNativeStyles(String parent, List<CreateNativeStyleRequest> requests)
public final BatchCreateNativeStylesResponse batchCreateNativeStyles(String parent, List<CreateNativeStyleRequest> requests)Creates NativeStyle 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 (NativeStyleServiceClient nativeStyleServiceClient = NativeStyleServiceClient.create()) {
String parent = NetworkName.of("[NETWORK_CODE]").toString();
List<CreateNativeStyleRequest> requests = new ArrayList<>();
BatchCreateNativeStylesResponse response =
nativeStyleServiceClient.batchCreateNativeStyles(parent, requests);
}
| Parameters | |
|---|---|
| Name | Description |
parent |
StringRequired. The parent resource where |
requests |
List<CreateNativeStyleRequest>Required. The |
| Returns | |
|---|---|
| Type | Description |
BatchCreateNativeStylesResponse |
|
batchCreateNativeStylesCallable()
public final UnaryCallable<BatchCreateNativeStylesRequest,BatchCreateNativeStylesResponse> batchCreateNativeStylesCallable()Creates NativeStyle 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 (NativeStyleServiceClient nativeStyleServiceClient = NativeStyleServiceClient.create()) {
BatchCreateNativeStylesRequest request =
BatchCreateNativeStylesRequest.newBuilder()
.setParent(NetworkName.of("[NETWORK_CODE]").toString())
.addAllRequests(new ArrayList<CreateNativeStyleRequest>())
.build();
ApiFuture<BatchCreateNativeStylesResponse> future =
nativeStyleServiceClient.batchCreateNativeStylesCallable().futureCall(request);
// Do something.
BatchCreateNativeStylesResponse response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<BatchCreateNativeStylesRequest,BatchCreateNativeStylesResponse> |
|
batchDeactivateNativeStyles(@Nullable NetworkName parent, List<String> names)
public final BatchDeactivateNativeStylesResponse batchDeactivateNativeStyles(@Nullable NetworkName parent, List<String> names)Deactivates a list of NativeStyle 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 (NativeStyleServiceClient nativeStyleServiceClient = NativeStyleServiceClient.create()) {
NetworkName parent = NetworkName.of("[NETWORK_CODE]");
List<String> names = new ArrayList<>();
BatchDeactivateNativeStylesResponse response =
nativeStyleServiceClient.batchDeactivateNativeStyles(parent, names);
}
| Parameters | |
|---|---|
| Name | Description |
parent |
@org.jspecify.annotations.Nullable com.google.ads.admanager.v1.NetworkNameRequired. Format: |
names |
List<String>Required. Resource names for the |
| Returns | |
|---|---|
| Type | Description |
BatchDeactivateNativeStylesResponse |
|
batchDeactivateNativeStyles(BatchDeactivateNativeStylesRequest request)
public final BatchDeactivateNativeStylesResponse batchDeactivateNativeStyles(BatchDeactivateNativeStylesRequest request)Deactivates a list of NativeStyle 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 (NativeStyleServiceClient nativeStyleServiceClient = NativeStyleServiceClient.create()) {
BatchDeactivateNativeStylesRequest request =
BatchDeactivateNativeStylesRequest.newBuilder()
.setParent(NetworkName.of("[NETWORK_CODE]").toString())
.addAllNames(new ArrayList<String>())
.build();
BatchDeactivateNativeStylesResponse response =
nativeStyleServiceClient.batchDeactivateNativeStyles(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
BatchDeactivateNativeStylesRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
BatchDeactivateNativeStylesResponse |
|
batchDeactivateNativeStyles(String parent, List<String> names)
public final BatchDeactivateNativeStylesResponse batchDeactivateNativeStyles(String parent, List<String> names)Deactivates a list of NativeStyle 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 (NativeStyleServiceClient nativeStyleServiceClient = NativeStyleServiceClient.create()) {
String parent = NetworkName.of("[NETWORK_CODE]").toString();
List<String> names = new ArrayList<>();
BatchDeactivateNativeStylesResponse response =
nativeStyleServiceClient.batchDeactivateNativeStyles(parent, names);
}
| Parameters | |
|---|---|
| Name | Description |
parent |
StringRequired. Format: |
names |
List<String>Required. Resource names for the |
| Returns | |
|---|---|
| Type | Description |
BatchDeactivateNativeStylesResponse |
|
batchDeactivateNativeStylesCallable()
public final UnaryCallable<BatchDeactivateNativeStylesRequest,BatchDeactivateNativeStylesResponse> batchDeactivateNativeStylesCallable()Deactivates a list of NativeStyle 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 (NativeStyleServiceClient nativeStyleServiceClient = NativeStyleServiceClient.create()) {
BatchDeactivateNativeStylesRequest request =
BatchDeactivateNativeStylesRequest.newBuilder()
.setParent(NetworkName.of("[NETWORK_CODE]").toString())
.addAllNames(new ArrayList<String>())
.build();
ApiFuture<BatchDeactivateNativeStylesResponse> future =
nativeStyleServiceClient.batchDeactivateNativeStylesCallable().futureCall(request);
// Do something.
BatchDeactivateNativeStylesResponse response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<BatchDeactivateNativeStylesRequest,BatchDeactivateNativeStylesResponse> |
|
batchUpdateNativeStyles(@Nullable NetworkName parent, List<UpdateNativeStyleRequest> requests)
public final BatchUpdateNativeStylesResponse batchUpdateNativeStyles(@Nullable NetworkName parent, List<UpdateNativeStyleRequest> requests)Batch updates NativeStyle 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 (NativeStyleServiceClient nativeStyleServiceClient = NativeStyleServiceClient.create()) {
NetworkName parent = NetworkName.of("[NETWORK_CODE]");
List<UpdateNativeStyleRequest> requests = new ArrayList<>();
BatchUpdateNativeStylesResponse response =
nativeStyleServiceClient.batchUpdateNativeStyles(parent, requests);
}
| Parameters | |
|---|---|
| Name | Description |
parent |
@org.jspecify.annotations.Nullable com.google.ads.admanager.v1.NetworkNameRequired. The parent resource where |
requests |
List<UpdateNativeStyleRequest>Required. The |
| Returns | |
|---|---|
| Type | Description |
BatchUpdateNativeStylesResponse |
|
batchUpdateNativeStyles(BatchUpdateNativeStylesRequest request)
public final BatchUpdateNativeStylesResponse batchUpdateNativeStyles(BatchUpdateNativeStylesRequest request)Batch updates NativeStyle 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 (NativeStyleServiceClient nativeStyleServiceClient = NativeStyleServiceClient.create()) {
BatchUpdateNativeStylesRequest request =
BatchUpdateNativeStylesRequest.newBuilder()
.setParent(NetworkName.of("[NETWORK_CODE]").toString())
.addAllRequests(new ArrayList<UpdateNativeStyleRequest>())
.build();
BatchUpdateNativeStylesResponse response =
nativeStyleServiceClient.batchUpdateNativeStyles(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
BatchUpdateNativeStylesRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
BatchUpdateNativeStylesResponse |
|
batchUpdateNativeStyles(String parent, List<UpdateNativeStyleRequest> requests)
public final BatchUpdateNativeStylesResponse batchUpdateNativeStyles(String parent, List<UpdateNativeStyleRequest> requests)Batch updates NativeStyle 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 (NativeStyleServiceClient nativeStyleServiceClient = NativeStyleServiceClient.create()) {
String parent = NetworkName.of("[NETWORK_CODE]").toString();
List<UpdateNativeStyleRequest> requests = new ArrayList<>();
BatchUpdateNativeStylesResponse response =
nativeStyleServiceClient.batchUpdateNativeStyles(parent, requests);
}
| Parameters | |
|---|---|
| Name | Description |
parent |
StringRequired. The parent resource where |
requests |
List<UpdateNativeStyleRequest>Required. The |
| Returns | |
|---|---|
| Type | Description |
BatchUpdateNativeStylesResponse |
|
batchUpdateNativeStylesCallable()
public final UnaryCallable<BatchUpdateNativeStylesRequest,BatchUpdateNativeStylesResponse> batchUpdateNativeStylesCallable()Batch updates NativeStyle 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 (NativeStyleServiceClient nativeStyleServiceClient = NativeStyleServiceClient.create()) {
BatchUpdateNativeStylesRequest request =
BatchUpdateNativeStylesRequest.newBuilder()
.setParent(NetworkName.of("[NETWORK_CODE]").toString())
.addAllRequests(new ArrayList<UpdateNativeStyleRequest>())
.build();
ApiFuture<BatchUpdateNativeStylesResponse> future =
nativeStyleServiceClient.batchUpdateNativeStylesCallable().futureCall(request);
// Do something.
BatchUpdateNativeStylesResponse response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<BatchUpdateNativeStylesRequest,BatchUpdateNativeStylesResponse> |
|
close()
public final void close()getNativeStyle(@Nullable NativeStyleName name)
public final NativeStyle getNativeStyle(@Nullable NativeStyleName name)Retrieves a NativeStyle 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 (NativeStyleServiceClient nativeStyleServiceClient = NativeStyleServiceClient.create()) {
NativeStyleName name = NativeStyleName.of("[NETWORK_CODE]", "[NATIVE_STYLE]");
NativeStyle response = nativeStyleServiceClient.getNativeStyle(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
@org.jspecify.annotations.Nullable com.google.ads.admanager.v1.NativeStyleNameRequired. The resource name of the NativeStyle. Format:
|
| Returns | |
|---|---|
| Type | Description |
NativeStyle |
|
getNativeStyle(GetNativeStyleRequest request)
public final NativeStyle getNativeStyle(GetNativeStyleRequest request)Retrieves a NativeStyle 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 (NativeStyleServiceClient nativeStyleServiceClient = NativeStyleServiceClient.create()) {
GetNativeStyleRequest request =
GetNativeStyleRequest.newBuilder()
.setName(NativeStyleName.of("[NETWORK_CODE]", "[NATIVE_STYLE]").toString())
.build();
NativeStyle response = nativeStyleServiceClient.getNativeStyle(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
GetNativeStyleRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
NativeStyle |
|
getNativeStyle(String name)
public final NativeStyle getNativeStyle(String name)Retrieves a NativeStyle 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 (NativeStyleServiceClient nativeStyleServiceClient = NativeStyleServiceClient.create()) {
String name = NativeStyleName.of("[NETWORK_CODE]", "[NATIVE_STYLE]").toString();
NativeStyle response = nativeStyleServiceClient.getNativeStyle(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
StringRequired. The resource name of the NativeStyle. Format:
|
| Returns | |
|---|---|
| Type | Description |
NativeStyle |
|
getNativeStyleCallable()
public final UnaryCallable<GetNativeStyleRequest,NativeStyle> getNativeStyleCallable()Retrieves a NativeStyle 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 (NativeStyleServiceClient nativeStyleServiceClient = NativeStyleServiceClient.create()) {
GetNativeStyleRequest request =
GetNativeStyleRequest.newBuilder()
.setName(NativeStyleName.of("[NETWORK_CODE]", "[NATIVE_STYLE]").toString())
.build();
ApiFuture<NativeStyle> future =
nativeStyleServiceClient.getNativeStyleCallable().futureCall(request);
// Do something.
NativeStyle response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<GetNativeStyleRequest,NativeStyle> |
|
getSettings()
public final @Nullable NativeStyleServiceSettings getSettings()| Returns | |
|---|---|
| Type | Description |
@org.jspecify.annotations.Nullable com.google.ads.admanager.v1.NativeStyleServiceSettings |
|
getStub()
public NativeStyleServiceStub getStub()| Returns | |
|---|---|
| Type | Description |
NativeStyleServiceStub |
|
isShutdown()
public boolean isShutdown()| Returns | |
|---|---|
| Type | Description |
boolean |
|
isTerminated()
public boolean isTerminated()| Returns | |
|---|---|
| Type | Description |
boolean |
|
listNativeStyles(@Nullable NetworkName parent)
public final NativeStyleServiceClient.ListNativeStylesPagedResponse listNativeStyles(@Nullable NetworkName parent)Lists NativeStyle 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 (NativeStyleServiceClient nativeStyleServiceClient = NativeStyleServiceClient.create()) {
NetworkName parent = NetworkName.of("[NETWORK_CODE]");
for (NativeStyle element : nativeStyleServiceClient.listNativeStyles(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 NativeStyles. Format:
|
| Returns | |
|---|---|
| Type | Description |
NativeStyleServiceClient.ListNativeStylesPagedResponse |
|
listNativeStyles(ListNativeStylesRequest request)
public final NativeStyleServiceClient.ListNativeStylesPagedResponse listNativeStyles(ListNativeStylesRequest request)Lists NativeStyle 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 (NativeStyleServiceClient nativeStyleServiceClient = NativeStyleServiceClient.create()) {
ListNativeStylesRequest request =
ListNativeStylesRequest.newBuilder()
.setParent(NetworkName.of("[NETWORK_CODE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.setSkip(3532159)
.build();
for (NativeStyle element : nativeStyleServiceClient.listNativeStyles(request).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
request |
ListNativeStylesRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
NativeStyleServiceClient.ListNativeStylesPagedResponse |
|
listNativeStyles(String parent)
public final NativeStyleServiceClient.ListNativeStylesPagedResponse listNativeStyles(String parent)Lists NativeStyle 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 (NativeStyleServiceClient nativeStyleServiceClient = NativeStyleServiceClient.create()) {
String parent = NetworkName.of("[NETWORK_CODE]").toString();
for (NativeStyle element : nativeStyleServiceClient.listNativeStyles(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
StringRequired. The parent, which owns this collection of NativeStyles. Format:
|
| Returns | |
|---|---|
| Type | Description |
NativeStyleServiceClient.ListNativeStylesPagedResponse |
|
listNativeStylesCallable()
public final UnaryCallable<ListNativeStylesRequest,ListNativeStylesResponse> listNativeStylesCallable()Lists NativeStyle 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 (NativeStyleServiceClient nativeStyleServiceClient = NativeStyleServiceClient.create()) {
ListNativeStylesRequest request =
ListNativeStylesRequest.newBuilder()
.setParent(NetworkName.of("[NETWORK_CODE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.setSkip(3532159)
.build();
while (true) {
ListNativeStylesResponse response =
nativeStyleServiceClient.listNativeStylesCallable().call(request);
for (NativeStyle element : response.getNativeStylesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListNativeStylesRequest,ListNativeStylesResponse> |
|
listNativeStylesPagedCallable()
public final UnaryCallable<ListNativeStylesRequest,NativeStyleServiceClient.ListNativeStylesPagedResponse> listNativeStylesPagedCallable()Lists NativeStyle 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 (NativeStyleServiceClient nativeStyleServiceClient = NativeStyleServiceClient.create()) {
ListNativeStylesRequest request =
ListNativeStylesRequest.newBuilder()
.setParent(NetworkName.of("[NETWORK_CODE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.setSkip(3532159)
.build();
ApiFuture<NativeStyle> future =
nativeStyleServiceClient.listNativeStylesPagedCallable().futureCall(request);
// Do something.
for (NativeStyle element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListNativeStylesRequest,ListNativeStylesPagedResponse> |
|
shutdown()
public void shutdown()shutdownNow()
public void shutdownNow()