| GitHub Repository | Product Reference |
Service Description: Provides methods for handling RichMediaAdsCompany 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 (RichMediaAdsCompanyServiceClient richMediaAdsCompanyServiceClient =
RichMediaAdsCompanyServiceClient.create()) {
RichMediaAdsCompanyName name =
RichMediaAdsCompanyName.of("[NETWORK_CODE]", "[RICH_MEDIA_ADS_COMPANY]");
RichMediaAdsCompany response = richMediaAdsCompanyServiceClient.getRichMediaAdsCompany(name);
}
Note: close() needs to be called on the RichMediaAdsCompanyServiceClient 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 |
|---|---|---|
GetRichMediaAdsCompany |
API to retrieve a |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListRichMediaAdsCompanies |
API to retrieve a list of |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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 RichMediaAdsCompanyServiceSettings 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
RichMediaAdsCompanyServiceSettings richMediaAdsCompanyServiceSettings =
RichMediaAdsCompanyServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
RichMediaAdsCompanyServiceClient richMediaAdsCompanyServiceClient =
RichMediaAdsCompanyServiceClient.create(richMediaAdsCompanyServiceSettings);
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
RichMediaAdsCompanyServiceSettings richMediaAdsCompanyServiceSettings =
RichMediaAdsCompanyServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
RichMediaAdsCompanyServiceClient richMediaAdsCompanyServiceClient =
RichMediaAdsCompanyServiceClient.create(richMediaAdsCompanyServiceSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
Static Methods
create()
public static final RichMediaAdsCompanyServiceClient create()Constructs an instance of RichMediaAdsCompanyServiceClient with default settings.
| Returns | |
|---|---|
| Type | Description |
RichMediaAdsCompanyServiceClient |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
create(RichMediaAdsCompanyServiceSettings settings)
public static final RichMediaAdsCompanyServiceClient create(RichMediaAdsCompanyServiceSettings settings)Constructs an instance of RichMediaAdsCompanyServiceClient, 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 |
RichMediaAdsCompanyServiceSettings |
| Returns | |
|---|---|
| Type | Description |
RichMediaAdsCompanyServiceClient |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
create(RichMediaAdsCompanyServiceStub stub)
public static final RichMediaAdsCompanyServiceClient create(RichMediaAdsCompanyServiceStub stub)Constructs an instance of RichMediaAdsCompanyServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(RichMediaAdsCompanyServiceSettings).
| Parameter | |
|---|---|
| Name | Description |
stub |
RichMediaAdsCompanyServiceStub |
| Returns | |
|---|---|
| Type | Description |
RichMediaAdsCompanyServiceClient |
|
Constructors
RichMediaAdsCompanyServiceClient(RichMediaAdsCompanyServiceSettings settings)
protected RichMediaAdsCompanyServiceClient(RichMediaAdsCompanyServiceSettings settings)Constructs an instance of RichMediaAdsCompanyServiceClient, 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 |
RichMediaAdsCompanyServiceSettings |
RichMediaAdsCompanyServiceClient(RichMediaAdsCompanyServiceStub stub)
protected RichMediaAdsCompanyServiceClient(RichMediaAdsCompanyServiceStub stub)| Parameter | |
|---|---|
| Name | Description |
stub |
RichMediaAdsCompanyServiceStub |
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()getRichMediaAdsCompany(GetRichMediaAdsCompanyRequest request)
public final RichMediaAdsCompany getRichMediaAdsCompany(GetRichMediaAdsCompanyRequest request)API to retrieve a RichMediaAdsCompany 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 (RichMediaAdsCompanyServiceClient richMediaAdsCompanyServiceClient =
RichMediaAdsCompanyServiceClient.create()) {
GetRichMediaAdsCompanyRequest request =
GetRichMediaAdsCompanyRequest.newBuilder()
.setName(
RichMediaAdsCompanyName.of("[NETWORK_CODE]", "[RICH_MEDIA_ADS_COMPANY]")
.toString())
.build();
RichMediaAdsCompany response =
richMediaAdsCompanyServiceClient.getRichMediaAdsCompany(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
GetRichMediaAdsCompanyRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
RichMediaAdsCompany |
|
getRichMediaAdsCompany(RichMediaAdsCompanyName name)
public final RichMediaAdsCompany getRichMediaAdsCompany(RichMediaAdsCompanyName name)API to retrieve a RichMediaAdsCompany 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 (RichMediaAdsCompanyServiceClient richMediaAdsCompanyServiceClient =
RichMediaAdsCompanyServiceClient.create()) {
RichMediaAdsCompanyName name =
RichMediaAdsCompanyName.of("[NETWORK_CODE]", "[RICH_MEDIA_ADS_COMPANY]");
RichMediaAdsCompany response = richMediaAdsCompanyServiceClient.getRichMediaAdsCompany(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
RichMediaAdsCompanyNameRequired. The resource name of the RichMediaAdsCompany. Format:
|
| Returns | |
|---|---|
| Type | Description |
RichMediaAdsCompany |
|
getRichMediaAdsCompany(String name)
public final RichMediaAdsCompany getRichMediaAdsCompany(String name)API to retrieve a RichMediaAdsCompany 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 (RichMediaAdsCompanyServiceClient richMediaAdsCompanyServiceClient =
RichMediaAdsCompanyServiceClient.create()) {
String name =
RichMediaAdsCompanyName.of("[NETWORK_CODE]", "[RICH_MEDIA_ADS_COMPANY]").toString();
RichMediaAdsCompany response = richMediaAdsCompanyServiceClient.getRichMediaAdsCompany(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
StringRequired. The resource name of the RichMediaAdsCompany. Format:
|
| Returns | |
|---|---|
| Type | Description |
RichMediaAdsCompany |
|
getRichMediaAdsCompanyCallable()
public final UnaryCallable<GetRichMediaAdsCompanyRequest,RichMediaAdsCompany> getRichMediaAdsCompanyCallable()API to retrieve a RichMediaAdsCompany 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 (RichMediaAdsCompanyServiceClient richMediaAdsCompanyServiceClient =
RichMediaAdsCompanyServiceClient.create()) {
GetRichMediaAdsCompanyRequest request =
GetRichMediaAdsCompanyRequest.newBuilder()
.setName(
RichMediaAdsCompanyName.of("[NETWORK_CODE]", "[RICH_MEDIA_ADS_COMPANY]")
.toString())
.build();
ApiFuture<RichMediaAdsCompany> future =
richMediaAdsCompanyServiceClient.getRichMediaAdsCompanyCallable().futureCall(request);
// Do something.
RichMediaAdsCompany response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<GetRichMediaAdsCompanyRequest,RichMediaAdsCompany> |
|
getSettings()
public final RichMediaAdsCompanyServiceSettings getSettings()| Returns | |
|---|---|
| Type | Description |
RichMediaAdsCompanyServiceSettings |
|
getStub()
public RichMediaAdsCompanyServiceStub getStub()| Returns | |
|---|---|
| Type | Description |
RichMediaAdsCompanyServiceStub |
|
isShutdown()
public boolean isShutdown()| Returns | |
|---|---|
| Type | Description |
boolean |
|
isTerminated()
public boolean isTerminated()| Returns | |
|---|---|
| Type | Description |
boolean |
|
listRichMediaAdsCompanies(ListRichMediaAdsCompaniesRequest request)
public final RichMediaAdsCompanyServiceClient.ListRichMediaAdsCompaniesPagedResponse listRichMediaAdsCompanies(ListRichMediaAdsCompaniesRequest request)API to retrieve a list of RichMediaAdsCompany 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 (RichMediaAdsCompanyServiceClient richMediaAdsCompanyServiceClient =
RichMediaAdsCompanyServiceClient.create()) {
ListRichMediaAdsCompaniesRequest request =
ListRichMediaAdsCompaniesRequest.newBuilder()
.setParent(NetworkName.of("[NETWORK_CODE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.setSkip(3532159)
.build();
for (RichMediaAdsCompany element :
richMediaAdsCompanyServiceClient.listRichMediaAdsCompanies(request).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
request |
ListRichMediaAdsCompaniesRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
RichMediaAdsCompanyServiceClient.ListRichMediaAdsCompaniesPagedResponse |
|
listRichMediaAdsCompanies(NetworkName parent)
public final RichMediaAdsCompanyServiceClient.ListRichMediaAdsCompaniesPagedResponse listRichMediaAdsCompanies(NetworkName parent)API to retrieve a list of RichMediaAdsCompany 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 (RichMediaAdsCompanyServiceClient richMediaAdsCompanyServiceClient =
RichMediaAdsCompanyServiceClient.create()) {
NetworkName parent = NetworkName.of("[NETWORK_CODE]");
for (RichMediaAdsCompany element :
richMediaAdsCompanyServiceClient.listRichMediaAdsCompanies(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
NetworkNameRequired. The parent, which owns this collection of RichMediaAdsCompanies.
Format: |
| Returns | |
|---|---|
| Type | Description |
RichMediaAdsCompanyServiceClient.ListRichMediaAdsCompaniesPagedResponse |
|
listRichMediaAdsCompanies(String parent)
public final RichMediaAdsCompanyServiceClient.ListRichMediaAdsCompaniesPagedResponse listRichMediaAdsCompanies(String parent)API to retrieve a list of RichMediaAdsCompany 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 (RichMediaAdsCompanyServiceClient richMediaAdsCompanyServiceClient =
RichMediaAdsCompanyServiceClient.create()) {
String parent = NetworkName.of("[NETWORK_CODE]").toString();
for (RichMediaAdsCompany element :
richMediaAdsCompanyServiceClient.listRichMediaAdsCompanies(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
StringRequired. The parent, which owns this collection of RichMediaAdsCompanies.
Format: |
| Returns | |
|---|---|
| Type | Description |
RichMediaAdsCompanyServiceClient.ListRichMediaAdsCompaniesPagedResponse |
|
listRichMediaAdsCompaniesCallable()
public final UnaryCallable<ListRichMediaAdsCompaniesRequest,ListRichMediaAdsCompaniesResponse> listRichMediaAdsCompaniesCallable()API to retrieve a list of RichMediaAdsCompany 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 (RichMediaAdsCompanyServiceClient richMediaAdsCompanyServiceClient =
RichMediaAdsCompanyServiceClient.create()) {
ListRichMediaAdsCompaniesRequest request =
ListRichMediaAdsCompaniesRequest.newBuilder()
.setParent(NetworkName.of("[NETWORK_CODE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.setSkip(3532159)
.build();
while (true) {
ListRichMediaAdsCompaniesResponse response =
richMediaAdsCompanyServiceClient.listRichMediaAdsCompaniesCallable().call(request);
for (RichMediaAdsCompany element : response.getRichMediaAdsCompaniesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListRichMediaAdsCompaniesRequest,ListRichMediaAdsCompaniesResponse> |
|
listRichMediaAdsCompaniesPagedCallable()
public final UnaryCallable<ListRichMediaAdsCompaniesRequest,RichMediaAdsCompanyServiceClient.ListRichMediaAdsCompaniesPagedResponse> listRichMediaAdsCompaniesPagedCallable()API to retrieve a list of RichMediaAdsCompany 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 (RichMediaAdsCompanyServiceClient richMediaAdsCompanyServiceClient =
RichMediaAdsCompanyServiceClient.create()) {
ListRichMediaAdsCompaniesRequest request =
ListRichMediaAdsCompaniesRequest.newBuilder()
.setParent(NetworkName.of("[NETWORK_CODE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.setSkip(3532159)
.build();
ApiFuture<RichMediaAdsCompany> future =
richMediaAdsCompanyServiceClient
.listRichMediaAdsCompaniesPagedCallable()
.futureCall(request);
// Do something.
for (RichMediaAdsCompany element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListRichMediaAdsCompaniesRequest,ListRichMediaAdsCompaniesPagedResponse> |
|
shutdown()
public void shutdown()shutdownNow()
public void shutdownNow()