| GitHub Repository | Product Reference |
Service Description: Provides methods for handling CreativeSet 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 (CreativeSetServiceClient creativeSetServiceClient = CreativeSetServiceClient.create()) {
CreativeSetName name = CreativeSetName.of("[NETWORK_CODE]", "[CREATIVE_SET]");
CreativeSet response = creativeSetServiceClient.getCreativeSet(name);
}
Note: close() needs to be called on the CreativeSetServiceClient 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 |
|---|---|---|
GetCreativeSet |
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.
|
ListCreativeSets |
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.
|
CreateCreativeSet |
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.
|
UpdateCreativeSet |
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.
|
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 CreativeSetServiceSettings 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
CreativeSetServiceSettings creativeSetServiceSettings =
CreativeSetServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
CreativeSetServiceClient creativeSetServiceClient =
CreativeSetServiceClient.create(creativeSetServiceSettings);
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
CreativeSetServiceSettings creativeSetServiceSettings =
CreativeSetServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
CreativeSetServiceClient creativeSetServiceClient =
CreativeSetServiceClient.create(creativeSetServiceSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
Static Methods
create()
public static final CreativeSetServiceClient create()Constructs an instance of CreativeSetServiceClient with default settings.
| Returns | |
|---|---|
| Type | Description |
CreativeSetServiceClient |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
create(CreativeSetServiceSettings settings)
public static final CreativeSetServiceClient create(CreativeSetServiceSettings settings)Constructs an instance of CreativeSetServiceClient, 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 |
CreativeSetServiceSettings |
| Returns | |
|---|---|
| Type | Description |
CreativeSetServiceClient |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
create(CreativeSetServiceStub stub)
public static final CreativeSetServiceClient create(CreativeSetServiceStub stub)Constructs an instance of CreativeSetServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(CreativeSetServiceSettings).
| Parameter | |
|---|---|
| Name | Description |
stub |
CreativeSetServiceStub |
| Returns | |
|---|---|
| Type | Description |
CreativeSetServiceClient |
|
Constructors
CreativeSetServiceClient(CreativeSetServiceSettings settings)
protected CreativeSetServiceClient(CreativeSetServiceSettings settings)Constructs an instance of CreativeSetServiceClient, 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 |
CreativeSetServiceSettings |
CreativeSetServiceClient(CreativeSetServiceStub stub)
protected CreativeSetServiceClient(CreativeSetServiceStub stub)| Parameter | |
|---|---|
| Name | Description |
stub |
CreativeSetServiceStub |
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 |
|
close()
public final void close()createCreativeSet(@Nullable NetworkName parent, CreativeSet creativeSet)
public final CreativeSet createCreativeSet(@Nullable NetworkName parent, CreativeSet creativeSet)Creates a CreativeSet 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 (CreativeSetServiceClient creativeSetServiceClient = CreativeSetServiceClient.create()) {
NetworkName parent = NetworkName.of("[NETWORK_CODE]");
CreativeSet creativeSet = CreativeSet.newBuilder().build();
CreativeSet response = creativeSetServiceClient.createCreativeSet(parent, creativeSet);
}
| Parameters | |
|---|---|
| Name | Description |
parent |
@org.jspecify.annotations.Nullable com.google.ads.admanager.v1.NetworkNameRequired. The parent resource where this |
creativeSet |
CreativeSetRequired. The |
| Returns | |
|---|---|
| Type | Description |
CreativeSet |
|
createCreativeSet(CreateCreativeSetRequest request)
public final CreativeSet createCreativeSet(CreateCreativeSetRequest request)Creates a CreativeSet 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 (CreativeSetServiceClient creativeSetServiceClient = CreativeSetServiceClient.create()) {
CreateCreativeSetRequest request =
CreateCreativeSetRequest.newBuilder()
.setParent(NetworkName.of("[NETWORK_CODE]").toString())
.setCreativeSet(CreativeSet.newBuilder().build())
.build();
CreativeSet response = creativeSetServiceClient.createCreativeSet(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
CreateCreativeSetRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
CreativeSet |
|
createCreativeSet(String parent, CreativeSet creativeSet)
public final CreativeSet createCreativeSet(String parent, CreativeSet creativeSet)Creates a CreativeSet 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 (CreativeSetServiceClient creativeSetServiceClient = CreativeSetServiceClient.create()) {
String parent = NetworkName.of("[NETWORK_CODE]").toString();
CreativeSet creativeSet = CreativeSet.newBuilder().build();
CreativeSet response = creativeSetServiceClient.createCreativeSet(parent, creativeSet);
}
| Parameters | |
|---|---|
| Name | Description |
parent |
StringRequired. The parent resource where this |
creativeSet |
CreativeSetRequired. The |
| Returns | |
|---|---|
| Type | Description |
CreativeSet |
|
createCreativeSetCallable()
public final UnaryCallable<CreateCreativeSetRequest,CreativeSet> createCreativeSetCallable()Creates a CreativeSet 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 (CreativeSetServiceClient creativeSetServiceClient = CreativeSetServiceClient.create()) {
CreateCreativeSetRequest request =
CreateCreativeSetRequest.newBuilder()
.setParent(NetworkName.of("[NETWORK_CODE]").toString())
.setCreativeSet(CreativeSet.newBuilder().build())
.build();
ApiFuture<CreativeSet> future =
creativeSetServiceClient.createCreativeSetCallable().futureCall(request);
// Do something.
CreativeSet response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<CreateCreativeSetRequest,CreativeSet> |
|
getCreativeSet(@Nullable CreativeSetName name)
public final CreativeSet getCreativeSet(@Nullable CreativeSetName name)Retrieves a CreativeSet 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 (CreativeSetServiceClient creativeSetServiceClient = CreativeSetServiceClient.create()) {
CreativeSetName name = CreativeSetName.of("[NETWORK_CODE]", "[CREATIVE_SET]");
CreativeSet response = creativeSetServiceClient.getCreativeSet(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
@org.jspecify.annotations.Nullable com.google.ads.admanager.v1.CreativeSetNameRequired. The resource name of the CreativeSet. Format:
|
| Returns | |
|---|---|
| Type | Description |
CreativeSet |
|
getCreativeSet(GetCreativeSetRequest request)
public final CreativeSet getCreativeSet(GetCreativeSetRequest request)Retrieves a CreativeSet 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 (CreativeSetServiceClient creativeSetServiceClient = CreativeSetServiceClient.create()) {
GetCreativeSetRequest request =
GetCreativeSetRequest.newBuilder()
.setName(CreativeSetName.of("[NETWORK_CODE]", "[CREATIVE_SET]").toString())
.build();
CreativeSet response = creativeSetServiceClient.getCreativeSet(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
GetCreativeSetRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
CreativeSet |
|
getCreativeSet(String name)
public final CreativeSet getCreativeSet(String name)Retrieves a CreativeSet 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 (CreativeSetServiceClient creativeSetServiceClient = CreativeSetServiceClient.create()) {
String name = CreativeSetName.of("[NETWORK_CODE]", "[CREATIVE_SET]").toString();
CreativeSet response = creativeSetServiceClient.getCreativeSet(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
StringRequired. The resource name of the CreativeSet. Format:
|
| Returns | |
|---|---|
| Type | Description |
CreativeSet |
|
getCreativeSetCallable()
public final UnaryCallable<GetCreativeSetRequest,CreativeSet> getCreativeSetCallable()Retrieves a CreativeSet 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 (CreativeSetServiceClient creativeSetServiceClient = CreativeSetServiceClient.create()) {
GetCreativeSetRequest request =
GetCreativeSetRequest.newBuilder()
.setName(CreativeSetName.of("[NETWORK_CODE]", "[CREATIVE_SET]").toString())
.build();
ApiFuture<CreativeSet> future =
creativeSetServiceClient.getCreativeSetCallable().futureCall(request);
// Do something.
CreativeSet response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<GetCreativeSetRequest,CreativeSet> |
|
getSettings()
public final @Nullable CreativeSetServiceSettings getSettings()| Returns | |
|---|---|
| Type | Description |
@org.jspecify.annotations.Nullable com.google.ads.admanager.v1.CreativeSetServiceSettings |
|
getStub()
public CreativeSetServiceStub getStub()| Returns | |
|---|---|
| Type | Description |
CreativeSetServiceStub |
|
isShutdown()
public boolean isShutdown()| Returns | |
|---|---|
| Type | Description |
boolean |
|
isTerminated()
public boolean isTerminated()| Returns | |
|---|---|
| Type | Description |
boolean |
|
listCreativeSets(@Nullable NetworkName parent)
public final CreativeSetServiceClient.ListCreativeSetsPagedResponse listCreativeSets(@Nullable NetworkName parent)Lists CreativeSet 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 (CreativeSetServiceClient creativeSetServiceClient = CreativeSetServiceClient.create()) {
NetworkName parent = NetworkName.of("[NETWORK_CODE]");
for (CreativeSet element : creativeSetServiceClient.listCreativeSets(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 CreativeSets. Format:
|
| Returns | |
|---|---|
| Type | Description |
CreativeSetServiceClient.ListCreativeSetsPagedResponse |
|
listCreativeSets(ListCreativeSetsRequest request)
public final CreativeSetServiceClient.ListCreativeSetsPagedResponse listCreativeSets(ListCreativeSetsRequest request)Lists CreativeSet 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 (CreativeSetServiceClient creativeSetServiceClient = CreativeSetServiceClient.create()) {
ListCreativeSetsRequest request =
ListCreativeSetsRequest.newBuilder()
.setParent(NetworkName.of("[NETWORK_CODE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.setSkip(3532159)
.build();
for (CreativeSet element : creativeSetServiceClient.listCreativeSets(request).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
request |
ListCreativeSetsRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
CreativeSetServiceClient.ListCreativeSetsPagedResponse |
|
listCreativeSets(String parent)
public final CreativeSetServiceClient.ListCreativeSetsPagedResponse listCreativeSets(String parent)Lists CreativeSet 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 (CreativeSetServiceClient creativeSetServiceClient = CreativeSetServiceClient.create()) {
String parent = NetworkName.of("[NETWORK_CODE]").toString();
for (CreativeSet element : creativeSetServiceClient.listCreativeSets(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
StringRequired. The parent, which owns this collection of CreativeSets. Format:
|
| Returns | |
|---|---|
| Type | Description |
CreativeSetServiceClient.ListCreativeSetsPagedResponse |
|
listCreativeSetsCallable()
public final UnaryCallable<ListCreativeSetsRequest,ListCreativeSetsResponse> listCreativeSetsCallable()Lists CreativeSet 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 (CreativeSetServiceClient creativeSetServiceClient = CreativeSetServiceClient.create()) {
ListCreativeSetsRequest request =
ListCreativeSetsRequest.newBuilder()
.setParent(NetworkName.of("[NETWORK_CODE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.setSkip(3532159)
.build();
while (true) {
ListCreativeSetsResponse response =
creativeSetServiceClient.listCreativeSetsCallable().call(request);
for (CreativeSet element : response.getCreativeSetsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListCreativeSetsRequest,ListCreativeSetsResponse> |
|
listCreativeSetsPagedCallable()
public final UnaryCallable<ListCreativeSetsRequest,CreativeSetServiceClient.ListCreativeSetsPagedResponse> listCreativeSetsPagedCallable()Lists CreativeSet 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 (CreativeSetServiceClient creativeSetServiceClient = CreativeSetServiceClient.create()) {
ListCreativeSetsRequest request =
ListCreativeSetsRequest.newBuilder()
.setParent(NetworkName.of("[NETWORK_CODE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.setSkip(3532159)
.build();
ApiFuture<CreativeSet> future =
creativeSetServiceClient.listCreativeSetsPagedCallable().futureCall(request);
// Do something.
for (CreativeSet element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListCreativeSetsRequest,ListCreativeSetsPagedResponse> |
|
shutdown()
public void shutdown()shutdownNow()
public void shutdownNow()updateCreativeSet(CreativeSet creativeSet, FieldMask updateMask)
public final CreativeSet updateCreativeSet(CreativeSet creativeSet, FieldMask updateMask)Updates a CreativeSet 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 (CreativeSetServiceClient creativeSetServiceClient = CreativeSetServiceClient.create()) {
CreativeSet creativeSet = CreativeSet.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
CreativeSet response = creativeSetServiceClient.updateCreativeSet(creativeSet, updateMask);
}
| Parameters | |
|---|---|
| Name | Description |
creativeSet |
CreativeSetRequired. The The |
updateMask |
FieldMaskOptional. The list of fields to update. |
| Returns | |
|---|---|
| Type | Description |
CreativeSet |
|
updateCreativeSet(UpdateCreativeSetRequest request)
public final CreativeSet updateCreativeSet(UpdateCreativeSetRequest request)Updates a CreativeSet 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 (CreativeSetServiceClient creativeSetServiceClient = CreativeSetServiceClient.create()) {
UpdateCreativeSetRequest request =
UpdateCreativeSetRequest.newBuilder()
.setCreativeSet(CreativeSet.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
CreativeSet response = creativeSetServiceClient.updateCreativeSet(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
UpdateCreativeSetRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
CreativeSet |
|
updateCreativeSetCallable()
public final UnaryCallable<UpdateCreativeSetRequest,CreativeSet> updateCreativeSetCallable()Updates a CreativeSet 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 (CreativeSetServiceClient creativeSetServiceClient = CreativeSetServiceClient.create()) {
UpdateCreativeSetRequest request =
UpdateCreativeSetRequest.newBuilder()
.setCreativeSet(CreativeSet.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<CreativeSet> future =
creativeSetServiceClient.updateCreativeSetCallable().futureCall(request);
// Do something.
CreativeSet response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<UpdateCreativeSetRequest,CreativeSet> |
|