Class AdBreakServiceClient (0.27.0)

GitHub RepositoryProduct 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().

Methods
Method Description Method Variants

GetAdBreak

API to retrieve 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.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getAdBreak(GetAdBreakRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getAdBreak(AdBreakName name)

  • getAdBreak(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getAdBreakCallable()

ListAdBreaks

API to retrieve a list of 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.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listAdBreaks(ListAdBreaksRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listAdBreaks(LiveStreamEventName parent)

  • listAdBreaks(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listAdBreaksPagedCallable()

  • listAdBreaksCallable()

CreateAdBreak

API to create 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.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createAdBreak(CreateAdBreakRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • createAdBreak(LiveStreamEventName parent, AdBreak adBreak)

  • createAdBreak(String parent, AdBreak adBreak)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createAdBreakCallable()

UpdateAdBreak

API to update an AdBreak object.

Modify an ad break when its state is SCHEDULED.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateAdBreak(UpdateAdBreakRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • updateAdBreak(AdBreak adBreak, FieldMask updateMask)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateAdBreakCallable()

DeleteAdBreak

API to delete 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.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteAdBreak(DeleteAdBreakRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • deleteAdBreak(AdBreakName name)

  • deleteAdBreak(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteAdBreakCallable()

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.

Inheritance

java.lang.Object > AdBreakServiceClient

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(CreateAdBreakRequest request)

public final AdBreak createAdBreak(CreateAdBreakRequest request)

API to create 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 CreateAdBreakRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
AdBreak

createAdBreak(LiveStreamEventName parent, AdBreak adBreak)

public final AdBreak createAdBreak(LiveStreamEventName parent, AdBreak adBreak)

API to create 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 LiveStreamEventName

Required. The parent resource where this AdBreak will be created identified by an asset key or custom asset key.

Formats: networks/{network_code}/liveStreamEventsByAssetKey/{asset_key} networks/{network_code}/liveStreamEventsByCustomAssetKey/{custom_asset_key}

adBreak AdBreak

Required. The AdBreak to create.

Returns
Type Description
AdBreak

createAdBreak(String parent, AdBreak adBreak)

public final AdBreak createAdBreak(String parent, AdBreak adBreak)

API to create 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 String

Required. The parent resource where this AdBreak will be created identified by an asset key or custom asset key.

Formats: networks/{network_code}/liveStreamEventsByAssetKey/{asset_key} networks/{network_code}/liveStreamEventsByCustomAssetKey/{custom_asset_key}

adBreak AdBreak

Required. The AdBreak to create.

Returns
Type Description
AdBreak

createAdBreakCallable()

public final UnaryCallable<CreateAdBreakRequest,AdBreak> createAdBreakCallable()

API to create 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(AdBreakName name)

public final void deleteAdBreak(AdBreakName name)

API to delete 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 AdBreakName

Required. The name of the ad break to delete.

Format: networks/{network_code}/liveStreamEventsByAssetKey/{asset_key}/adBreaks/{ad_break}

deleteAdBreak(DeleteAdBreakRequest request)

public final void deleteAdBreak(DeleteAdBreakRequest request)

API to delete 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 DeleteAdBreakRequest

The request object containing all of the parameters for the API call.

deleteAdBreak(String name)

public final void deleteAdBreak(String name)

API to delete 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 String

Required. The name of the ad break to delete.

Format: networks/{network_code}/liveStreamEventsByAssetKey/{asset_key}/adBreaks/{ad_break}

deleteAdBreakCallable()

public final UnaryCallable<DeleteAdBreakRequest,Empty> deleteAdBreakCallable()

API to delete 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(AdBreakName name)

public final AdBreak getAdBreak(AdBreakName name)

API to retrieve 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 AdBreakName

Required. The resource name of the AdBreak using the asset key or custom asset key.

Format: networks/{network_code}/liveStreamEventsByAssetKey/{asset_key}/adBreaks/{ad_break_id} networks/{network_code}/liveStreamEventsByCustomAssetKey/{custom_asset_key}/adBreaks/{ad_break_id}

Returns
Type Description
AdBreak

getAdBreak(GetAdBreakRequest request)

public final AdBreak getAdBreak(GetAdBreakRequest request)

API to retrieve 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 GetAdBreakRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
AdBreak

getAdBreak(String name)

public final AdBreak getAdBreak(String name)

API to retrieve 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 String

Required. The resource name of the AdBreak using the asset key or custom asset key.

Format: networks/{network_code}/liveStreamEventsByAssetKey/{asset_key}/adBreaks/{ad_break_id} networks/{network_code}/liveStreamEventsByCustomAssetKey/{custom_asset_key}/adBreaks/{ad_break_id}

Returns
Type Description
AdBreak

getAdBreakCallable()

public final UnaryCallable<GetAdBreakRequest,AdBreak> getAdBreakCallable()

API to retrieve 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 AdBreakServiceSettings getSettings()
Returns
Type Description
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(ListAdBreaksRequest request)

public final AdBreakServiceClient.ListAdBreaksPagedResponse listAdBreaks(ListAdBreaksRequest request)

API to retrieve a list of 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 ListAdBreaksRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
AdBreakServiceClient.ListAdBreaksPagedResponse

listAdBreaks(LiveStreamEventName parent)

public final AdBreakServiceClient.ListAdBreaksPagedResponse listAdBreaks(LiveStreamEventName parent)

API to retrieve a list of 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 LiveStreamEventName

Required. The parent, which owns this collection of AdBreaks.

Formats: networks/{network_code}/liveStreamEventsByAssetKey/{asset_key} networks/{network_code}/liveStreamEventsByCustomAssetKey/{custom_asset_key}

Returns
Type Description
AdBreakServiceClient.ListAdBreaksPagedResponse

listAdBreaks(String parent)

public final AdBreakServiceClient.ListAdBreaksPagedResponse listAdBreaks(String parent)

API to retrieve a list of 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 String

Required. The parent, which owns this collection of AdBreaks.

Formats: networks/{network_code}/liveStreamEventsByAssetKey/{asset_key} networks/{network_code}/liveStreamEventsByCustomAssetKey/{custom_asset_key}

Returns
Type Description
AdBreakServiceClient.ListAdBreaksPagedResponse

listAdBreaksCallable()

public final UnaryCallable<ListAdBreaksRequest,ListAdBreaksResponse> listAdBreaksCallable()

API to retrieve a list of 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()

API to retrieve a list of 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)

API to update 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 AdBreak

Required. The AdBreak to update.

The AdBreak's name is used to identify the AdBreak to update.

updateMask FieldMask

Required. The list of fields to update.

Returns
Type Description
AdBreak

updateAdBreak(UpdateAdBreakRequest request)

public final AdBreak updateAdBreak(UpdateAdBreakRequest request)

API to update 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 UpdateAdBreakRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
AdBreak

updateAdBreakCallable()

public final UnaryCallable<UpdateAdBreakRequest,AdBreak> updateAdBreakCallable()

API to update 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>