| GitHub Repository | Product Reference |
Service Description: Provides methods for handling AdBreak 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 (AdBreakServiceClient adBreakServiceClient = AdBreakServiceClient.create()) {
AdBreakName name = AdBreakName.of("[NETWORK_CODE]", "[ASSET_KEY]", "[AD_BREAK]");
AdBreak response = adBreakServiceClient.getAdBreak(name);
}
Note: close() needs to be called on the AdBreakServiceClient 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 |
|---|---|---|
GetAdBreak |
Retrieves an Query an ad break by its resource name or custom asset key. Check the resource's |
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.
|
ListAdBreaks |
Lists By default, when no |
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.
|
CreateAdBreak |
Creates an Informs DAI of an upcoming ad break for a live stream event, with an optional expected start time. DAI will begin decisioning ads for the break shortly before the expected start time, if provided. Each live stream event can only have one incomplete ad break at any given time. The next ad break can be scheduled after the previous ad break has started serving, indicated by its state being This method cannot be used if the An ad break's state is complete when the following occurs: - Full service DAI: after a matching ad break shows in the |
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.
|
UpdateAdBreak |
Updates an Modify an ad break when its state is |
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.
|
DeleteAdBreak |
Deletes an Deletes and cancels an incomplete ad break, mitigating the need to wait for the current break to serve before recreating an ad break. You can delete an ad break that has not started serving or seen in manifests, indicated by its state being |
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 AdBreakServiceSettings 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
AdBreakServiceSettings adBreakServiceSettings =
AdBreakServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
AdBreakServiceClient adBreakServiceClient = AdBreakServiceClient.create(adBreakServiceSettings);
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
AdBreakServiceSettings adBreakServiceSettings =
AdBreakServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
AdBreakServiceClient adBreakServiceClient = AdBreakServiceClient.create(adBreakServiceSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
Static Methods
create()
public static final AdBreakServiceClient create()Constructs an instance of AdBreakServiceClient with default settings.
| Returns | |
|---|---|
| Type | Description |
AdBreakServiceClient |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
create(AdBreakServiceSettings settings)
public static final AdBreakServiceClient create(AdBreakServiceSettings settings)Constructs an instance of AdBreakServiceClient, 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 |
AdBreakServiceSettings |
| Returns | |
|---|---|
| Type | Description |
AdBreakServiceClient |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
create(AdBreakServiceStub stub)
public static final AdBreakServiceClient create(AdBreakServiceStub stub)Constructs an instance of AdBreakServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(AdBreakServiceSettings).
| Parameter | |
|---|---|
| Name | Description |
stub |
AdBreakServiceStub |
| Returns | |
|---|---|
| Type | Description |
AdBreakServiceClient |
|
Constructors
AdBreakServiceClient(AdBreakServiceSettings settings)
protected AdBreakServiceClient(AdBreakServiceSettings settings)Constructs an instance of AdBreakServiceClient, 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 |
AdBreakServiceSettings |
AdBreakServiceClient(AdBreakServiceStub stub)
protected AdBreakServiceClient(AdBreakServiceStub stub)| Parameter | |
|---|---|
| Name | Description |
stub |
AdBreakServiceStub |
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()createAdBreak(@Nullable LiveStreamEventName parent, AdBreak adBreak)
public final AdBreak createAdBreak(@Nullable LiveStreamEventName parent, AdBreak adBreak)Creates an AdBreak object.
Informs DAI of an upcoming ad break for a live stream event, with an optional expected start
time. DAI will begin decisioning ads for the break shortly before the expected start time, if
provided. Each live stream event can only have one incomplete ad break at any given time. The
next ad break can be scheduled after the previous ad break has started serving, indicated by
its state being COMPLETE,
or it has been deleted.
This method cannot be used if the LiveStreamEvent has prefetching ad breaks
enabled
or the event is not active. If a LiveStreamEvent is deactivated after creating an ad break
and before the ad break is complete, the ad break is discarded.
An ad break's state is complete when the following occurs: - Full service DAI: after a
matching ad break shows in the LiveStreamEvent manifest only when the ad break has started
decisioning. - Pod Serving: after the ad break is requested using the ad break ID or break
sequence.
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 (AdBreakServiceClient adBreakServiceClient = AdBreakServiceClient.create()) {
LiveStreamEventName parent = LiveStreamEventName.of("[NETWORK_CODE]", "[LIVE_STREAM_EVENT]");
AdBreak adBreak = AdBreak.newBuilder().build();
AdBreak response = adBreakServiceClient.createAdBreak(parent, adBreak);
}
| Parameters | |
|---|---|
| Name | Description |
parent |
@org.jspecify.annotations.Nullable com.google.ads.admanager.v1.LiveStreamEventNameRequired. The parent resource where this Formats: |
adBreak |
AdBreakRequired. The |
| Returns | |
|---|---|
| Type | Description |
AdBreak |
|
createAdBreak(CreateAdBreakRequest request)
public final AdBreak createAdBreak(CreateAdBreakRequest request)Creates an AdBreak object.
Informs DAI of an upcoming ad break for a live stream event, with an optional expected start
time. DAI will begin decisioning ads for the break shortly before the expected start time, if
provided. Each live stream event can only have one incomplete ad break at any given time. The
next ad break can be scheduled after the previous ad break has started serving, indicated by
its state being COMPLETE,
or it has been deleted.
This method cannot be used if the LiveStreamEvent has prefetching ad breaks
enabled
or the event is not active. If a LiveStreamEvent is deactivated after creating an ad break
and before the ad break is complete, the ad break is discarded.
An ad break's state is complete when the following occurs: - Full service DAI: after a
matching ad break shows in the LiveStreamEvent manifest only when the ad break has started
decisioning. - Pod Serving: after the ad break is requested using the ad break ID or break
sequence.
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 (AdBreakServiceClient adBreakServiceClient = AdBreakServiceClient.create()) {
CreateAdBreakRequest request =
CreateAdBreakRequest.newBuilder()
.setParent(LiveStreamEventName.of("[NETWORK_CODE]", "[LIVE_STREAM_EVENT]").toString())
.setAdBreak(AdBreak.newBuilder().build())
.build();
AdBreak response = adBreakServiceClient.createAdBreak(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
CreateAdBreakRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
AdBreak |
|
createAdBreak(String parent, AdBreak adBreak)
public final AdBreak createAdBreak(String parent, AdBreak adBreak)Creates an AdBreak object.
Informs DAI of an upcoming ad break for a live stream event, with an optional expected start
time. DAI will begin decisioning ads for the break shortly before the expected start time, if
provided. Each live stream event can only have one incomplete ad break at any given time. The
next ad break can be scheduled after the previous ad break has started serving, indicated by
its state being COMPLETE,
or it has been deleted.
This method cannot be used if the LiveStreamEvent has prefetching ad breaks
enabled
or the event is not active. If a LiveStreamEvent is deactivated after creating an ad break
and before the ad break is complete, the ad break is discarded.
An ad break's state is complete when the following occurs: - Full service DAI: after a
matching ad break shows in the LiveStreamEvent manifest only when the ad break has started
decisioning. - Pod Serving: after the ad break is requested using the ad break ID or break
sequence.
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 (AdBreakServiceClient adBreakServiceClient = AdBreakServiceClient.create()) {
String parent = LiveStreamEventName.of("[NETWORK_CODE]", "[LIVE_STREAM_EVENT]").toString();
AdBreak adBreak = AdBreak.newBuilder().build();
AdBreak response = adBreakServiceClient.createAdBreak(parent, adBreak);
}
| Parameters | |
|---|---|
| Name | Description |
parent |
StringRequired. The parent resource where this Formats: |
adBreak |
AdBreakRequired. The |
| Returns | |
|---|---|
| Type | Description |
AdBreak |
|
createAdBreakCallable()
public final UnaryCallable<CreateAdBreakRequest,AdBreak> createAdBreakCallable()Creates an AdBreak object.
Informs DAI of an upcoming ad break for a live stream event, with an optional expected start
time. DAI will begin decisioning ads for the break shortly before the expected start time, if
provided. Each live stream event can only have one incomplete ad break at any given time. The
next ad break can be scheduled after the previous ad break has started serving, indicated by
its state being COMPLETE,
or it has been deleted.
This method cannot be used if the LiveStreamEvent has prefetching ad breaks
enabled
or the event is not active. If a LiveStreamEvent is deactivated after creating an ad break
and before the ad break is complete, the ad break is discarded.
An ad break's state is complete when the following occurs: - Full service DAI: after a
matching ad break shows in the LiveStreamEvent manifest only when the ad break has started
decisioning. - Pod Serving: after the ad break is requested using the ad break ID or break
sequence.
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 (AdBreakServiceClient adBreakServiceClient = AdBreakServiceClient.create()) {
CreateAdBreakRequest request =
CreateAdBreakRequest.newBuilder()
.setParent(LiveStreamEventName.of("[NETWORK_CODE]", "[LIVE_STREAM_EVENT]").toString())
.setAdBreak(AdBreak.newBuilder().build())
.build();
ApiFuture<AdBreak> future = adBreakServiceClient.createAdBreakCallable().futureCall(request);
// Do something.
AdBreak response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<CreateAdBreakRequest,AdBreak> |
|
deleteAdBreak(@Nullable AdBreakName name)
public final void deleteAdBreak(@Nullable AdBreakName name)Deletes an AdBreak object.
Deletes and cancels an incomplete ad break, mitigating the need to wait for the current
break to serve before recreating an ad break. You can delete an ad break that has not started
serving or seen in manifests, indicated by its state being
SCHEDULED or
DECISIONED.
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 (AdBreakServiceClient adBreakServiceClient = AdBreakServiceClient.create()) {
AdBreakName name = AdBreakName.of("[NETWORK_CODE]", "[ASSET_KEY]", "[AD_BREAK]");
adBreakServiceClient.deleteAdBreak(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
@org.jspecify.annotations.Nullable com.google.ads.admanager.v1.AdBreakNameRequired. The name of the ad break to delete. Format:
|
deleteAdBreak(DeleteAdBreakRequest request)
public final void deleteAdBreak(DeleteAdBreakRequest request)Deletes an AdBreak object.
Deletes and cancels an incomplete ad break, mitigating the need to wait for the current
break to serve before recreating an ad break. You can delete an ad break that has not started
serving or seen in manifests, indicated by its state being
SCHEDULED or
DECISIONED.
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 (AdBreakServiceClient adBreakServiceClient = AdBreakServiceClient.create()) {
DeleteAdBreakRequest request =
DeleteAdBreakRequest.newBuilder()
.setName(AdBreakName.of("[NETWORK_CODE]", "[ASSET_KEY]", "[AD_BREAK]").toString())
.build();
adBreakServiceClient.deleteAdBreak(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
DeleteAdBreakRequestThe request object containing all of the parameters for the API call. |
deleteAdBreak(String name)
public final void deleteAdBreak(String name)Deletes an AdBreak object.
Deletes and cancels an incomplete ad break, mitigating the need to wait for the current
break to serve before recreating an ad break. You can delete an ad break that has not started
serving or seen in manifests, indicated by its state being
SCHEDULED or
DECISIONED.
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 (AdBreakServiceClient adBreakServiceClient = AdBreakServiceClient.create()) {
String name = AdBreakName.of("[NETWORK_CODE]", "[ASSET_KEY]", "[AD_BREAK]").toString();
adBreakServiceClient.deleteAdBreak(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
StringRequired. The name of the ad break to delete. Format:
|
deleteAdBreakCallable()
public final UnaryCallable<DeleteAdBreakRequest,Empty> deleteAdBreakCallable()Deletes an AdBreak object.
Deletes and cancels an incomplete ad break, mitigating the need to wait for the current
break to serve before recreating an ad break. You can delete an ad break that has not started
serving or seen in manifests, indicated by its state being
SCHEDULED or
DECISIONED.
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 (AdBreakServiceClient adBreakServiceClient = AdBreakServiceClient.create()) {
DeleteAdBreakRequest request =
DeleteAdBreakRequest.newBuilder()
.setName(AdBreakName.of("[NETWORK_CODE]", "[ASSET_KEY]", "[AD_BREAK]").toString())
.build();
ApiFuture<Empty> future = adBreakServiceClient.deleteAdBreakCallable().futureCall(request);
// Do something.
future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<DeleteAdBreakRequest,Empty> |
|
getAdBreak(@Nullable AdBreakName name)
public final AdBreak getAdBreak(@Nullable AdBreakName name)Retrieves an AdBreak object.
Query an ad break by its resource name or custom asset key. Check the resource's
breakState field to determine its state.
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 (AdBreakServiceClient adBreakServiceClient = AdBreakServiceClient.create()) {
AdBreakName name = AdBreakName.of("[NETWORK_CODE]", "[ASSET_KEY]", "[AD_BREAK]");
AdBreak response = adBreakServiceClient.getAdBreak(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
@org.jspecify.annotations.Nullable com.google.ads.admanager.v1.AdBreakNameRequired. The resource name of the AdBreak using the asset key or custom asset key. Format:
|
| Returns | |
|---|---|
| Type | Description |
AdBreak |
|
getAdBreak(GetAdBreakRequest request)
public final AdBreak getAdBreak(GetAdBreakRequest request)Retrieves an AdBreak object.
Query an ad break by its resource name or custom asset key. Check the resource's
breakState field to determine its state.
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 (AdBreakServiceClient adBreakServiceClient = AdBreakServiceClient.create()) {
GetAdBreakRequest request =
GetAdBreakRequest.newBuilder()
.setName(AdBreakName.of("[NETWORK_CODE]", "[ASSET_KEY]", "[AD_BREAK]").toString())
.build();
AdBreak response = adBreakServiceClient.getAdBreak(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
GetAdBreakRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
AdBreak |
|
getAdBreak(String name)
public final AdBreak getAdBreak(String name)Retrieves an AdBreak object.
Query an ad break by its resource name or custom asset key. Check the resource's
breakState field to determine its state.
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 (AdBreakServiceClient adBreakServiceClient = AdBreakServiceClient.create()) {
String name = AdBreakName.of("[NETWORK_CODE]", "[ASSET_KEY]", "[AD_BREAK]").toString();
AdBreak response = adBreakServiceClient.getAdBreak(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
StringRequired. The resource name of the AdBreak using the asset key or custom asset key. Format:
|
| Returns | |
|---|---|
| Type | Description |
AdBreak |
|
getAdBreakCallable()
public final UnaryCallable<GetAdBreakRequest,AdBreak> getAdBreakCallable()Retrieves an AdBreak object.
Query an ad break by its resource name or custom asset key. Check the resource's
breakState field to determine its state.
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 (AdBreakServiceClient adBreakServiceClient = AdBreakServiceClient.create()) {
GetAdBreakRequest request =
GetAdBreakRequest.newBuilder()
.setName(AdBreakName.of("[NETWORK_CODE]", "[ASSET_KEY]", "[AD_BREAK]").toString())
.build();
ApiFuture<AdBreak> future = adBreakServiceClient.getAdBreakCallable().futureCall(request);
// Do something.
AdBreak response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<GetAdBreakRequest,AdBreak> |
|
getSettings()
public final @Nullable AdBreakServiceSettings getSettings()| Returns | |
|---|---|
| Type | Description |
@org.jspecify.annotations.Nullable com.google.ads.admanager.v1.AdBreakServiceSettings |
|
getStub()
public AdBreakServiceStub getStub()| Returns | |
|---|---|
| Type | Description |
AdBreakServiceStub |
|
isShutdown()
public boolean isShutdown()| Returns | |
|---|---|
| Type | Description |
boolean |
|
isTerminated()
public boolean isTerminated()| Returns | |
|---|---|
| Type | Description |
boolean |
|
listAdBreaks(@Nullable LiveStreamEventName parent)
public final AdBreakServiceClient.ListAdBreaksPagedResponse listAdBreaks(@Nullable LiveStreamEventName parent)Lists AdBreak objects.
By default, when no orderBy query parameter is specified, ad breaks are ordered reverse
chronologically. However, ad breaks with a 'breakState' of 'SCHEDULED' or 'DECISIONED' are
prioritized and appear first.
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 (AdBreakServiceClient adBreakServiceClient = AdBreakServiceClient.create()) {
LiveStreamEventName parent = LiveStreamEventName.of("[NETWORK_CODE]", "[LIVE_STREAM_EVENT]");
for (AdBreak element : adBreakServiceClient.listAdBreaks(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
@org.jspecify.annotations.Nullable com.google.ads.admanager.v1.LiveStreamEventNameRequired. The parent, which owns this collection of AdBreaks. Formats: |
| Returns | |
|---|---|
| Type | Description |
AdBreakServiceClient.ListAdBreaksPagedResponse |
|
listAdBreaks(ListAdBreaksRequest request)
public final AdBreakServiceClient.ListAdBreaksPagedResponse listAdBreaks(ListAdBreaksRequest request)Lists AdBreak objects.
By default, when no orderBy query parameter is specified, ad breaks are ordered reverse
chronologically. However, ad breaks with a 'breakState' of 'SCHEDULED' or 'DECISIONED' are
prioritized and appear first.
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 (AdBreakServiceClient adBreakServiceClient = AdBreakServiceClient.create()) {
ListAdBreaksRequest request =
ListAdBreaksRequest.newBuilder()
.setParent(LiveStreamEventName.of("[NETWORK_CODE]", "[LIVE_STREAM_EVENT]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.setSkip(3532159)
.build();
for (AdBreak element : adBreakServiceClient.listAdBreaks(request).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
request |
ListAdBreaksRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
AdBreakServiceClient.ListAdBreaksPagedResponse |
|
listAdBreaks(String parent)
public final AdBreakServiceClient.ListAdBreaksPagedResponse listAdBreaks(String parent)Lists AdBreak objects.
By default, when no orderBy query parameter is specified, ad breaks are ordered reverse
chronologically. However, ad breaks with a 'breakState' of 'SCHEDULED' or 'DECISIONED' are
prioritized and appear first.
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 (AdBreakServiceClient adBreakServiceClient = AdBreakServiceClient.create()) {
String parent = LiveStreamEventName.of("[NETWORK_CODE]", "[LIVE_STREAM_EVENT]").toString();
for (AdBreak element : adBreakServiceClient.listAdBreaks(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
StringRequired. The parent, which owns this collection of AdBreaks. Formats: |
| Returns | |
|---|---|
| Type | Description |
AdBreakServiceClient.ListAdBreaksPagedResponse |
|
listAdBreaksCallable()
public final UnaryCallable<ListAdBreaksRequest,ListAdBreaksResponse> listAdBreaksCallable()Lists AdBreak objects.
By default, when no orderBy query parameter is specified, ad breaks are ordered reverse
chronologically. However, ad breaks with a 'breakState' of 'SCHEDULED' or 'DECISIONED' are
prioritized and appear first.
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 (AdBreakServiceClient adBreakServiceClient = AdBreakServiceClient.create()) {
ListAdBreaksRequest request =
ListAdBreaksRequest.newBuilder()
.setParent(LiveStreamEventName.of("[NETWORK_CODE]", "[LIVE_STREAM_EVENT]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.setSkip(3532159)
.build();
while (true) {
ListAdBreaksResponse response = adBreakServiceClient.listAdBreaksCallable().call(request);
for (AdBreak element : response.getAdBreaksList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListAdBreaksRequest,ListAdBreaksResponse> |
|
listAdBreaksPagedCallable()
public final UnaryCallable<ListAdBreaksRequest,AdBreakServiceClient.ListAdBreaksPagedResponse> listAdBreaksPagedCallable()Lists AdBreak objects.
By default, when no orderBy query parameter is specified, ad breaks are ordered reverse
chronologically. However, ad breaks with a 'breakState' of 'SCHEDULED' or 'DECISIONED' are
prioritized and appear first.
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 (AdBreakServiceClient adBreakServiceClient = AdBreakServiceClient.create()) {
ListAdBreaksRequest request =
ListAdBreaksRequest.newBuilder()
.setParent(LiveStreamEventName.of("[NETWORK_CODE]", "[LIVE_STREAM_EVENT]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.setSkip(3532159)
.build();
ApiFuture<AdBreak> future =
adBreakServiceClient.listAdBreaksPagedCallable().futureCall(request);
// Do something.
for (AdBreak element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListAdBreaksRequest,ListAdBreaksPagedResponse> |
|
shutdown()
public void shutdown()shutdownNow()
public void shutdownNow()updateAdBreak(AdBreak adBreak, FieldMask updateMask)
public final AdBreak updateAdBreak(AdBreak adBreak, FieldMask updateMask)Updates an AdBreak object.
Modify an ad break when its state is
SCHEDULED.
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 (AdBreakServiceClient adBreakServiceClient = AdBreakServiceClient.create()) {
AdBreak adBreak = AdBreak.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
AdBreak response = adBreakServiceClient.updateAdBreak(adBreak, updateMask);
}
| Parameters | |
|---|---|
| Name | Description |
adBreak |
AdBreakRequired. The The |
updateMask |
FieldMaskOptional. The list of fields to update. |
| Returns | |
|---|---|
| Type | Description |
AdBreak |
|
updateAdBreak(UpdateAdBreakRequest request)
public final AdBreak updateAdBreak(UpdateAdBreakRequest request)Updates an AdBreak object.
Modify an ad break when its state is
SCHEDULED.
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 (AdBreakServiceClient adBreakServiceClient = AdBreakServiceClient.create()) {
UpdateAdBreakRequest request =
UpdateAdBreakRequest.newBuilder()
.setAdBreak(AdBreak.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
AdBreak response = adBreakServiceClient.updateAdBreak(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
UpdateAdBreakRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
AdBreak |
|
updateAdBreakCallable()
public final UnaryCallable<UpdateAdBreakRequest,AdBreak> updateAdBreakCallable()Updates an AdBreak object.
Modify an ad break when its state is
SCHEDULED.
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 (AdBreakServiceClient adBreakServiceClient = AdBreakServiceClient.create()) {
UpdateAdBreakRequest request =
UpdateAdBreakRequest.newBuilder()
.setAdBreak(AdBreak.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<AdBreak> future = adBreakServiceClient.updateAdBreakCallable().futureCall(request);
// Do something.
AdBreak response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<UpdateAdBreakRequest,AdBreak> |
|