Class AdBreakServiceClient
AdBreakService client wrapper, for convenient use.
Namespace: Google.Ads.AdManager.V1
Assembly: Google.Ads.AdManager.V1.dll
Syntax
public abstract class AdBreakServiceClient
Remarks
Provides methods for handling AdBreak objects.
Properties
DefaultEndpoint
The default endpoint for the AdBreakService service, which is a host of "admanager.googleapis.com" and a port of 443.
Declaration
public static string DefaultEndpoint { get; }
Property Value
| Type | Description |
|---|---|
| string |
DefaultScopes
The default AdBreakService scopes.
Declaration
public static IReadOnlyList<string> DefaultScopes { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<string> |
Remarks
The default AdBreakService scopes are:
- https://www.googleapis.com/auth/admanager
GrpcClient
The underlying gRPC AdBreakService client
Declaration
public virtual AdBreakService.AdBreakServiceClient GrpcClient { get; }
Property Value
| Type | Description |
|---|---|
| AdBreakService.AdBreakServiceClient |
ServiceMetadata
The service metadata associated with this client type.
Declaration
public static ServiceMetadata ServiceMetadata { get; }
Property Value
| Type | Description |
|---|---|
| ServiceMetadata |
Methods
Create()
Synchronously creates a AdBreakServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use AdBreakServiceClientBuilder.
Declaration
public static AdBreakServiceClient Create()
Returns
| Type | Description |
|---|---|
| AdBreakServiceClient | The created AdBreakServiceClient. |
CreateAdBreak(CreateAdBreakRequest, CallSettings)
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][google.ads.admanager.v1.AdBreakStateEnum.AdBreakState.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
LiveStreamEventmanifest only when the ad break has started decisioning. - Pod Serving: after the ad break is requested using the ad break ID or break sequence.
Declaration
public virtual AdBreak CreateAdBreak(CreateAdBreakRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| CreateAdBreakRequest | request | The request object containing all of the parameters for the API call. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| AdBreak | The RPC response. |
Sample code
// Create client
AdBreakServiceClient adBreakServiceClient = AdBreakServiceClient.Create();
// Initialize request argument(s)
CreateAdBreakRequest request = new CreateAdBreakRequest
{
ParentAsLiveStreamEventName = LiveStreamEventName.FromNetworkCodeLiveStreamEvent("[NETWORK_CODE]", "[LIVE_STREAM_EVENT]"),
AdBreak = new AdBreak(),
};
// Make the request
AdBreak response = adBreakServiceClient.CreateAdBreak(request);
CreateAdBreak(LiveStreamEventName, AdBreak, CallSettings)
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][google.ads.admanager.v1.AdBreakStateEnum.AdBreakState.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
LiveStreamEventmanifest only when the ad break has started decisioning. - Pod Serving: after the ad break is requested using the ad break ID or break sequence.
Declaration
public virtual AdBreak CreateAdBreak(LiveStreamEventName parent, AdBreak adBreak, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| LiveStreamEventName | parent | Required. The parent resource where this Formats:
|
| AdBreak | adBreak | Required. The |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| AdBreak | The RPC response. |
Sample code
// Create client
AdBreakServiceClient adBreakServiceClient = AdBreakServiceClient.Create();
// Initialize request argument(s)
LiveStreamEventName parent = LiveStreamEventName.FromNetworkCodeLiveStreamEvent("[NETWORK_CODE]", "[LIVE_STREAM_EVENT]");
AdBreak adBreak = new AdBreak();
// Make the request
AdBreak response = adBreakServiceClient.CreateAdBreak(parent, adBreak);
CreateAdBreak(string, AdBreak, CallSettings)
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][google.ads.admanager.v1.AdBreakStateEnum.AdBreakState.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
LiveStreamEventmanifest only when the ad break has started decisioning. - Pod Serving: after the ad break is requested using the ad break ID or break sequence.
Declaration
public virtual AdBreak CreateAdBreak(string parent, AdBreak adBreak, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | parent | Required. The parent resource where this Formats:
|
| AdBreak | adBreak | Required. The |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| AdBreak | The RPC response. |
Sample code
// Create client
AdBreakServiceClient adBreakServiceClient = AdBreakServiceClient.Create();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]/liveStreamEvents/[LIVE_STREAM_EVENT]";
AdBreak adBreak = new AdBreak();
// Make the request
AdBreak response = adBreakServiceClient.CreateAdBreak(parent, adBreak);
CreateAdBreakAsync(CreateAdBreakRequest, CallSettings)
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][google.ads.admanager.v1.AdBreakStateEnum.AdBreakState.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
LiveStreamEventmanifest only when the ad break has started decisioning. - Pod Serving: after the ad break is requested using the ad break ID or break sequence.
Declaration
public virtual Task<AdBreak> CreateAdBreakAsync(CreateAdBreakRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| CreateAdBreakRequest | request | The request object containing all of the parameters for the API call. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<AdBreak> | A Task containing the RPC response. |
Sample code
// Create client
AdBreakServiceClient adBreakServiceClient = await AdBreakServiceClient.CreateAsync();
// Initialize request argument(s)
CreateAdBreakRequest request = new CreateAdBreakRequest
{
ParentAsLiveStreamEventName = LiveStreamEventName.FromNetworkCodeLiveStreamEvent("[NETWORK_CODE]", "[LIVE_STREAM_EVENT]"),
AdBreak = new AdBreak(),
};
// Make the request
AdBreak response = await adBreakServiceClient.CreateAdBreakAsync(request);
CreateAdBreakAsync(CreateAdBreakRequest, CancellationToken)
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][google.ads.admanager.v1.AdBreakStateEnum.AdBreakState.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
LiveStreamEventmanifest only when the ad break has started decisioning. - Pod Serving: after the ad break is requested using the ad break ID or break sequence.
Declaration
public virtual Task<AdBreak> CreateAdBreakAsync(CreateAdBreakRequest request, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| CreateAdBreakRequest | request | The request object containing all of the parameters for the API call. |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<AdBreak> | A Task containing the RPC response. |
Sample code
// Create client
AdBreakServiceClient adBreakServiceClient = await AdBreakServiceClient.CreateAsync();
// Initialize request argument(s)
CreateAdBreakRequest request = new CreateAdBreakRequest
{
ParentAsLiveStreamEventName = LiveStreamEventName.FromNetworkCodeLiveStreamEvent("[NETWORK_CODE]", "[LIVE_STREAM_EVENT]"),
AdBreak = new AdBreak(),
};
// Make the request
AdBreak response = await adBreakServiceClient.CreateAdBreakAsync(request);
CreateAdBreakAsync(LiveStreamEventName, AdBreak, CallSettings)
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][google.ads.admanager.v1.AdBreakStateEnum.AdBreakState.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
LiveStreamEventmanifest only when the ad break has started decisioning. - Pod Serving: after the ad break is requested using the ad break ID or break sequence.
Declaration
public virtual Task<AdBreak> CreateAdBreakAsync(LiveStreamEventName parent, AdBreak adBreak, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| LiveStreamEventName | parent | Required. The parent resource where this Formats:
|
| AdBreak | adBreak | Required. The |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<AdBreak> | A Task containing the RPC response. |
Sample code
// Create client
AdBreakServiceClient adBreakServiceClient = await AdBreakServiceClient.CreateAsync();
// Initialize request argument(s)
LiveStreamEventName parent = LiveStreamEventName.FromNetworkCodeLiveStreamEvent("[NETWORK_CODE]", "[LIVE_STREAM_EVENT]");
AdBreak adBreak = new AdBreak();
// Make the request
AdBreak response = await adBreakServiceClient.CreateAdBreakAsync(parent, adBreak);
CreateAdBreakAsync(LiveStreamEventName, AdBreak, CancellationToken)
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][google.ads.admanager.v1.AdBreakStateEnum.AdBreakState.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
LiveStreamEventmanifest only when the ad break has started decisioning. - Pod Serving: after the ad break is requested using the ad break ID or break sequence.
Declaration
public virtual Task<AdBreak> CreateAdBreakAsync(LiveStreamEventName parent, AdBreak adBreak, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| LiveStreamEventName | parent | Required. The parent resource where this Formats:
|
| AdBreak | adBreak | Required. The |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<AdBreak> | A Task containing the RPC response. |
Sample code
// Create client
AdBreakServiceClient adBreakServiceClient = await AdBreakServiceClient.CreateAsync();
// Initialize request argument(s)
LiveStreamEventName parent = LiveStreamEventName.FromNetworkCodeLiveStreamEvent("[NETWORK_CODE]", "[LIVE_STREAM_EVENT]");
AdBreak adBreak = new AdBreak();
// Make the request
AdBreak response = await adBreakServiceClient.CreateAdBreakAsync(parent, adBreak);
CreateAdBreakAsync(string, AdBreak, CallSettings)
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][google.ads.admanager.v1.AdBreakStateEnum.AdBreakState.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
LiveStreamEventmanifest only when the ad break has started decisioning. - Pod Serving: after the ad break is requested using the ad break ID or break sequence.
Declaration
public virtual Task<AdBreak> CreateAdBreakAsync(string parent, AdBreak adBreak, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | parent | Required. The parent resource where this Formats:
|
| AdBreak | adBreak | Required. The |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<AdBreak> | A Task containing the RPC response. |
Sample code
// Create client
AdBreakServiceClient adBreakServiceClient = await AdBreakServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]/liveStreamEvents/[LIVE_STREAM_EVENT]";
AdBreak adBreak = new AdBreak();
// Make the request
AdBreak response = await adBreakServiceClient.CreateAdBreakAsync(parent, adBreak);
CreateAdBreakAsync(string, AdBreak, CancellationToken)
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][google.ads.admanager.v1.AdBreakStateEnum.AdBreakState.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
LiveStreamEventmanifest only when the ad break has started decisioning. - Pod Serving: after the ad break is requested using the ad break ID or break sequence.
Declaration
public virtual Task<AdBreak> CreateAdBreakAsync(string parent, AdBreak adBreak, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| string | parent | Required. The parent resource where this Formats:
|
| AdBreak | adBreak | Required. The |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<AdBreak> | A Task containing the RPC response. |
Sample code
// Create client
AdBreakServiceClient adBreakServiceClient = await AdBreakServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]/liveStreamEvents/[LIVE_STREAM_EVENT]";
AdBreak adBreak = new AdBreak();
// Make the request
AdBreak response = await adBreakServiceClient.CreateAdBreakAsync(parent, adBreak);
CreateAsync(CancellationToken)
Asynchronously creates a AdBreakServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use AdBreakServiceClientBuilder.
Declaration
public static Task<AdBreakServiceClient> CreateAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | The CancellationToken to use while creating the client. |
Returns
| Type | Description |
|---|---|
| Task<AdBreakServiceClient> | The task representing the created AdBreakServiceClient. |
DeleteAdBreak(AdBreakName, CallSettings)
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][google.ads.admanager.v1.AdBreakStateEnum.AdBreakState.SCHEDULED]
or
[DECISIONED][google.ads.admanager.v1.AdBreakStateEnum.AdBreakState.DECISIONED].
Declaration
public virtual void DeleteAdBreak(AdBreakName name, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| AdBreakName | name | Required. The name of the ad break to delete. Format:
|
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Sample code
// Create client
AdBreakServiceClient adBreakServiceClient = AdBreakServiceClient.Create();
// Initialize request argument(s)
AdBreakName name = AdBreakName.FromNetworkCodeAssetKeyAdBreak("[NETWORK_CODE]", "[ASSET_KEY]", "[AD_BREAK]");
// Make the request
adBreakServiceClient.DeleteAdBreak(name);
DeleteAdBreak(DeleteAdBreakRequest, CallSettings)
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][google.ads.admanager.v1.AdBreakStateEnum.AdBreakState.SCHEDULED]
or
[DECISIONED][google.ads.admanager.v1.AdBreakStateEnum.AdBreakState.DECISIONED].
Declaration
public virtual void DeleteAdBreak(DeleteAdBreakRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| DeleteAdBreakRequest | request | The request object containing all of the parameters for the API call. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Sample code
// Create client
AdBreakServiceClient adBreakServiceClient = AdBreakServiceClient.Create();
// Initialize request argument(s)
DeleteAdBreakRequest request = new DeleteAdBreakRequest
{
AdBreakName = AdBreakName.FromNetworkCodeAssetKeyAdBreak("[NETWORK_CODE]", "[ASSET_KEY]", "[AD_BREAK]"),
};
// Make the request
adBreakServiceClient.DeleteAdBreak(request);
DeleteAdBreak(string, CallSettings)
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][google.ads.admanager.v1.AdBreakStateEnum.AdBreakState.SCHEDULED]
or
[DECISIONED][google.ads.admanager.v1.AdBreakStateEnum.AdBreakState.DECISIONED].
Declaration
public virtual void DeleteAdBreak(string name, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Required. The name of the ad break to delete. Format:
|
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Sample code
// Create client
AdBreakServiceClient adBreakServiceClient = AdBreakServiceClient.Create();
// Initialize request argument(s)
string name = "networks/[NETWORK_CODE]/liveStreamEventsByAssetKey/[ASSET_KEY]/adBreaks/[AD_BREAK]";
// Make the request
adBreakServiceClient.DeleteAdBreak(name);
DeleteAdBreakAsync(AdBreakName, CallSettings)
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][google.ads.admanager.v1.AdBreakStateEnum.AdBreakState.SCHEDULED]
or
[DECISIONED][google.ads.admanager.v1.AdBreakStateEnum.AdBreakState.DECISIONED].
Declaration
public virtual Task DeleteAdBreakAsync(AdBreakName name, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| AdBreakName | name | Required. The name of the ad break to delete. Format:
|
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task | A Task containing the RPC response. |
Sample code
// Create client
AdBreakServiceClient adBreakServiceClient = await AdBreakServiceClient.CreateAsync();
// Initialize request argument(s)
AdBreakName name = AdBreakName.FromNetworkCodeAssetKeyAdBreak("[NETWORK_CODE]", "[ASSET_KEY]", "[AD_BREAK]");
// Make the request
await adBreakServiceClient.DeleteAdBreakAsync(name);
DeleteAdBreakAsync(AdBreakName, CancellationToken)
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][google.ads.admanager.v1.AdBreakStateEnum.AdBreakState.SCHEDULED]
or
[DECISIONED][google.ads.admanager.v1.AdBreakStateEnum.AdBreakState.DECISIONED].
Declaration
public virtual Task DeleteAdBreakAsync(AdBreakName name, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| AdBreakName | name | Required. The name of the ad break to delete. Format:
|
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task | A Task containing the RPC response. |
Sample code
// Create client
AdBreakServiceClient adBreakServiceClient = await AdBreakServiceClient.CreateAsync();
// Initialize request argument(s)
AdBreakName name = AdBreakName.FromNetworkCodeAssetKeyAdBreak("[NETWORK_CODE]", "[ASSET_KEY]", "[AD_BREAK]");
// Make the request
await adBreakServiceClient.DeleteAdBreakAsync(name);
DeleteAdBreakAsync(DeleteAdBreakRequest, CallSettings)
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][google.ads.admanager.v1.AdBreakStateEnum.AdBreakState.SCHEDULED]
or
[DECISIONED][google.ads.admanager.v1.AdBreakStateEnum.AdBreakState.DECISIONED].
Declaration
public virtual Task DeleteAdBreakAsync(DeleteAdBreakRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| DeleteAdBreakRequest | request | The request object containing all of the parameters for the API call. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task | A Task containing the RPC response. |
Sample code
// Create client
AdBreakServiceClient adBreakServiceClient = await AdBreakServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteAdBreakRequest request = new DeleteAdBreakRequest
{
AdBreakName = AdBreakName.FromNetworkCodeAssetKeyAdBreak("[NETWORK_CODE]", "[ASSET_KEY]", "[AD_BREAK]"),
};
// Make the request
await adBreakServiceClient.DeleteAdBreakAsync(request);
DeleteAdBreakAsync(DeleteAdBreakRequest, CancellationToken)
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][google.ads.admanager.v1.AdBreakStateEnum.AdBreakState.SCHEDULED]
or
[DECISIONED][google.ads.admanager.v1.AdBreakStateEnum.AdBreakState.DECISIONED].
Declaration
public virtual Task DeleteAdBreakAsync(DeleteAdBreakRequest request, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| DeleteAdBreakRequest | request | The request object containing all of the parameters for the API call. |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task | A Task containing the RPC response. |
Sample code
// Create client
AdBreakServiceClient adBreakServiceClient = await AdBreakServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteAdBreakRequest request = new DeleteAdBreakRequest
{
AdBreakName = AdBreakName.FromNetworkCodeAssetKeyAdBreak("[NETWORK_CODE]", "[ASSET_KEY]", "[AD_BREAK]"),
};
// Make the request
await adBreakServiceClient.DeleteAdBreakAsync(request);
DeleteAdBreakAsync(string, CallSettings)
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][google.ads.admanager.v1.AdBreakStateEnum.AdBreakState.SCHEDULED]
or
[DECISIONED][google.ads.admanager.v1.AdBreakStateEnum.AdBreakState.DECISIONED].
Declaration
public virtual Task DeleteAdBreakAsync(string name, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Required. The name of the ad break to delete. Format:
|
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task | A Task containing the RPC response. |
Sample code
// Create client
AdBreakServiceClient adBreakServiceClient = await AdBreakServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "networks/[NETWORK_CODE]/liveStreamEventsByAssetKey/[ASSET_KEY]/adBreaks/[AD_BREAK]";
// Make the request
await adBreakServiceClient.DeleteAdBreakAsync(name);
DeleteAdBreakAsync(string, CancellationToken)
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][google.ads.admanager.v1.AdBreakStateEnum.AdBreakState.SCHEDULED]
or
[DECISIONED][google.ads.admanager.v1.AdBreakStateEnum.AdBreakState.DECISIONED].
Declaration
public virtual Task DeleteAdBreakAsync(string name, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Required. The name of the ad break to delete. Format:
|
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task | A Task containing the RPC response. |
Sample code
// Create client
AdBreakServiceClient adBreakServiceClient = await AdBreakServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "networks/[NETWORK_CODE]/liveStreamEventsByAssetKey/[ASSET_KEY]/adBreaks/[AD_BREAK]";
// Make the request
await adBreakServiceClient.DeleteAdBreakAsync(name);
GetAdBreak(AdBreakName, CallSettings)
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.
Declaration
public virtual AdBreak GetAdBreak(AdBreakName name, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| AdBreakName | name | Required. The resource name of the AdBreak using the asset key or custom asset key. Format:
|
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| AdBreak | The RPC response. |
Sample code
// Create client
AdBreakServiceClient adBreakServiceClient = AdBreakServiceClient.Create();
// Initialize request argument(s)
AdBreakName name = AdBreakName.FromNetworkCodeAssetKeyAdBreak("[NETWORK_CODE]", "[ASSET_KEY]", "[AD_BREAK]");
// Make the request
AdBreak response = adBreakServiceClient.GetAdBreak(name);
GetAdBreak(GetAdBreakRequest, CallSettings)
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.
Declaration
public virtual AdBreak GetAdBreak(GetAdBreakRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| GetAdBreakRequest | request | The request object containing all of the parameters for the API call. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| AdBreak | The RPC response. |
Sample code
// Create client
AdBreakServiceClient adBreakServiceClient = AdBreakServiceClient.Create();
// Initialize request argument(s)
GetAdBreakRequest request = new GetAdBreakRequest
{
AdBreakName = AdBreakName.FromNetworkCodeAssetKeyAdBreak("[NETWORK_CODE]", "[ASSET_KEY]", "[AD_BREAK]"),
};
// Make the request
AdBreak response = adBreakServiceClient.GetAdBreak(request);
GetAdBreak(string, CallSettings)
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.
Declaration
public virtual AdBreak GetAdBreak(string name, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Required. The resource name of the AdBreak using the asset key or custom asset key. Format:
|
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| AdBreak | The RPC response. |
Sample code
// Create client
AdBreakServiceClient adBreakServiceClient = AdBreakServiceClient.Create();
// Initialize request argument(s)
string name = "networks/[NETWORK_CODE]/liveStreamEventsByAssetKey/[ASSET_KEY]/adBreaks/[AD_BREAK]";
// Make the request
AdBreak response = adBreakServiceClient.GetAdBreak(name);
GetAdBreakAsync(AdBreakName, CallSettings)
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.
Declaration
public virtual Task<AdBreak> GetAdBreakAsync(AdBreakName name, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| AdBreakName | name | Required. The resource name of the AdBreak using the asset key or custom asset key. Format:
|
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<AdBreak> | A Task containing the RPC response. |
Sample code
// Create client
AdBreakServiceClient adBreakServiceClient = await AdBreakServiceClient.CreateAsync();
// Initialize request argument(s)
AdBreakName name = AdBreakName.FromNetworkCodeAssetKeyAdBreak("[NETWORK_CODE]", "[ASSET_KEY]", "[AD_BREAK]");
// Make the request
AdBreak response = await adBreakServiceClient.GetAdBreakAsync(name);
GetAdBreakAsync(AdBreakName, CancellationToken)
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.
Declaration
public virtual Task<AdBreak> GetAdBreakAsync(AdBreakName name, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| AdBreakName | name | Required. The resource name of the AdBreak using the asset key or custom asset key. Format:
|
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<AdBreak> | A Task containing the RPC response. |
Sample code
// Create client
AdBreakServiceClient adBreakServiceClient = await AdBreakServiceClient.CreateAsync();
// Initialize request argument(s)
AdBreakName name = AdBreakName.FromNetworkCodeAssetKeyAdBreak("[NETWORK_CODE]", "[ASSET_KEY]", "[AD_BREAK]");
// Make the request
AdBreak response = await adBreakServiceClient.GetAdBreakAsync(name);
GetAdBreakAsync(GetAdBreakRequest, CallSettings)
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.
Declaration
public virtual Task<AdBreak> GetAdBreakAsync(GetAdBreakRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| GetAdBreakRequest | request | The request object containing all of the parameters for the API call. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<AdBreak> | A Task containing the RPC response. |
Sample code
// Create client
AdBreakServiceClient adBreakServiceClient = await AdBreakServiceClient.CreateAsync();
// Initialize request argument(s)
GetAdBreakRequest request = new GetAdBreakRequest
{
AdBreakName = AdBreakName.FromNetworkCodeAssetKeyAdBreak("[NETWORK_CODE]", "[ASSET_KEY]", "[AD_BREAK]"),
};
// Make the request
AdBreak response = await adBreakServiceClient.GetAdBreakAsync(request);
GetAdBreakAsync(GetAdBreakRequest, CancellationToken)
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.
Declaration
public virtual Task<AdBreak> GetAdBreakAsync(GetAdBreakRequest request, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| GetAdBreakRequest | request | The request object containing all of the parameters for the API call. |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<AdBreak> | A Task containing the RPC response. |
Sample code
// Create client
AdBreakServiceClient adBreakServiceClient = await AdBreakServiceClient.CreateAsync();
// Initialize request argument(s)
GetAdBreakRequest request = new GetAdBreakRequest
{
AdBreakName = AdBreakName.FromNetworkCodeAssetKeyAdBreak("[NETWORK_CODE]", "[ASSET_KEY]", "[AD_BREAK]"),
};
// Make the request
AdBreak response = await adBreakServiceClient.GetAdBreakAsync(request);
GetAdBreakAsync(string, CallSettings)
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.
Declaration
public virtual Task<AdBreak> GetAdBreakAsync(string name, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Required. The resource name of the AdBreak using the asset key or custom asset key. Format:
|
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<AdBreak> | A Task containing the RPC response. |
Sample code
// Create client
AdBreakServiceClient adBreakServiceClient = await AdBreakServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "networks/[NETWORK_CODE]/liveStreamEventsByAssetKey/[ASSET_KEY]/adBreaks/[AD_BREAK]";
// Make the request
AdBreak response = await adBreakServiceClient.GetAdBreakAsync(name);
GetAdBreakAsync(string, CancellationToken)
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.
Declaration
public virtual Task<AdBreak> GetAdBreakAsync(string name, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Required. The resource name of the AdBreak using the asset key or custom asset key. Format:
|
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<AdBreak> | A Task containing the RPC response. |
Sample code
// Create client
AdBreakServiceClient adBreakServiceClient = await AdBreakServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "networks/[NETWORK_CODE]/liveStreamEventsByAssetKey/[ASSET_KEY]/adBreaks/[AD_BREAK]";
// Make the request
AdBreak response = await adBreakServiceClient.GetAdBreakAsync(name);
ListAdBreaks(ListAdBreaksRequest, CallSettings)
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.
Declaration
public virtual PagedEnumerable<ListAdBreaksResponse, AdBreak> ListAdBreaks(ListAdBreaksRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ListAdBreaksRequest | request | The request object containing all of the parameters for the API call. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| PagedEnumerable<ListAdBreaksResponse, AdBreak> | A pageable sequence of AdBreak resources. |
Sample code
// Create client
AdBreakServiceClient adBreakServiceClient = AdBreakServiceClient.Create();
// Initialize request argument(s)
ListAdBreaksRequest request = new ListAdBreaksRequest
{
ParentAsLiveStreamEventName = LiveStreamEventName.FromNetworkCodeLiveStreamEvent("[NETWORK_CODE]", "[LIVE_STREAM_EVENT]"),
Filter = "",
OrderBy = "",
Skip = 0,
};
// Make the request
PagedEnumerable<ListAdBreaksResponse, AdBreak> response = adBreakServiceClient.ListAdBreaks(request);
// Iterate over all response items, lazily performing RPCs as required
foreach (AdBreak item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListAdBreaksResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (AdBreak item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AdBreak> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AdBreak item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListAdBreaks(LiveStreamEventName, string, int?, CallSettings)
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.
Declaration
public virtual PagedEnumerable<ListAdBreaksResponse, AdBreak> ListAdBreaks(LiveStreamEventName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| LiveStreamEventName | parent | Required. The parent, which owns this collection of AdBreaks. Formats:
|
| string | pageToken | The token returned from the previous request. A value of |
| int? | pageSize | The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| PagedEnumerable<ListAdBreaksResponse, AdBreak> | A pageable sequence of AdBreak resources. |
Sample code
// Create client
AdBreakServiceClient adBreakServiceClient = AdBreakServiceClient.Create();
// Initialize request argument(s)
LiveStreamEventName parent = LiveStreamEventName.FromNetworkCodeLiveStreamEvent("[NETWORK_CODE]", "[LIVE_STREAM_EVENT]");
// Make the request
PagedEnumerable<ListAdBreaksResponse, AdBreak> response = adBreakServiceClient.ListAdBreaks(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (AdBreak item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListAdBreaksResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (AdBreak item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AdBreak> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AdBreak item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListAdBreaks(string, string, int?, CallSettings)
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.
Declaration
public virtual PagedEnumerable<ListAdBreaksResponse, AdBreak> ListAdBreaks(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | parent | Required. The parent, which owns this collection of AdBreaks. Formats:
|
| string | pageToken | The token returned from the previous request. A value of |
| int? | pageSize | The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| PagedEnumerable<ListAdBreaksResponse, AdBreak> | A pageable sequence of AdBreak resources. |
Sample code
// Create client
AdBreakServiceClient adBreakServiceClient = AdBreakServiceClient.Create();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]/liveStreamEvents/[LIVE_STREAM_EVENT]";
// Make the request
PagedEnumerable<ListAdBreaksResponse, AdBreak> response = adBreakServiceClient.ListAdBreaks(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (AdBreak item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListAdBreaksResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (AdBreak item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AdBreak> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AdBreak item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListAdBreaksAsync(ListAdBreaksRequest, CallSettings)
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.
Declaration
public virtual PagedAsyncEnumerable<ListAdBreaksResponse, AdBreak> ListAdBreaksAsync(ListAdBreaksRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ListAdBreaksRequest | request | The request object containing all of the parameters for the API call. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| PagedAsyncEnumerable<ListAdBreaksResponse, AdBreak> | A pageable asynchronous sequence of AdBreak resources. |
Sample code
// Create client
AdBreakServiceClient adBreakServiceClient = await AdBreakServiceClient.CreateAsync();
// Initialize request argument(s)
ListAdBreaksRequest request = new ListAdBreaksRequest
{
ParentAsLiveStreamEventName = LiveStreamEventName.FromNetworkCodeLiveStreamEvent("[NETWORK_CODE]", "[LIVE_STREAM_EVENT]"),
Filter = "",
OrderBy = "",
Skip = 0,
};
// Make the request
PagedAsyncEnumerable<ListAdBreaksResponse, AdBreak> response = adBreakServiceClient.ListAdBreaksAsync(request);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((AdBreak item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListAdBreaksResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (AdBreak item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AdBreak> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AdBreak item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListAdBreaksAsync(LiveStreamEventName, string, int?, CallSettings)
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.
Declaration
public virtual PagedAsyncEnumerable<ListAdBreaksResponse, AdBreak> ListAdBreaksAsync(LiveStreamEventName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| LiveStreamEventName | parent | Required. The parent, which owns this collection of AdBreaks. Formats:
|
| string | pageToken | The token returned from the previous request. A value of |
| int? | pageSize | The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| PagedAsyncEnumerable<ListAdBreaksResponse, AdBreak> | A pageable asynchronous sequence of AdBreak resources. |
Sample code
// Create client
AdBreakServiceClient adBreakServiceClient = await AdBreakServiceClient.CreateAsync();
// Initialize request argument(s)
LiveStreamEventName parent = LiveStreamEventName.FromNetworkCodeLiveStreamEvent("[NETWORK_CODE]", "[LIVE_STREAM_EVENT]");
// Make the request
PagedAsyncEnumerable<ListAdBreaksResponse, AdBreak> response = adBreakServiceClient.ListAdBreaksAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((AdBreak item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListAdBreaksResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (AdBreak item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AdBreak> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AdBreak item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListAdBreaksAsync(string, string, int?, CallSettings)
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.
Declaration
public virtual PagedAsyncEnumerable<ListAdBreaksResponse, AdBreak> ListAdBreaksAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | parent | Required. The parent, which owns this collection of AdBreaks. Formats:
|
| string | pageToken | The token returned from the previous request. A value of |
| int? | pageSize | The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| PagedAsyncEnumerable<ListAdBreaksResponse, AdBreak> | A pageable asynchronous sequence of AdBreak resources. |
Sample code
// Create client
AdBreakServiceClient adBreakServiceClient = await AdBreakServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]/liveStreamEvents/[LIVE_STREAM_EVENT]";
// Make the request
PagedAsyncEnumerable<ListAdBreaksResponse, AdBreak> response = adBreakServiceClient.ListAdBreaksAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((AdBreak item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListAdBreaksResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (AdBreak item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AdBreak> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AdBreak item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ShutdownDefaultChannelsAsync()
Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.
Declaration
public static Task ShutdownDefaultChannelsAsync()
Returns
| Type | Description |
|---|---|
| Task | A task representing the asynchronous shutdown operation. |
Remarks
After calling this method, further calls to Create() and CreateAsync(CancellationToken) will create new channels, which could in turn be shut down by another call to this method.
UpdateAdBreak(AdBreak, FieldMask, CallSettings)
API to update an AdBreak object.
Modify an ad break when its state is
[SCHEDULED][google.ads.admanager.v1.AdBreakStateEnum.AdBreakState.SCHEDULED].
Declaration
public virtual AdBreak UpdateAdBreak(AdBreak adBreak, FieldMask updateMask, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| AdBreak | adBreak | Required. The The |
| FieldMask | updateMask | Required. The list of fields to update. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| AdBreak | The RPC response. |
Sample code
// Create client
AdBreakServiceClient adBreakServiceClient = AdBreakServiceClient.Create();
// Initialize request argument(s)
AdBreak adBreak = new AdBreak();
FieldMask updateMask = new FieldMask();
// Make the request
AdBreak response = adBreakServiceClient.UpdateAdBreak(adBreak, updateMask);
UpdateAdBreak(UpdateAdBreakRequest, CallSettings)
API to update an AdBreak object.
Modify an ad break when its state is
[SCHEDULED][google.ads.admanager.v1.AdBreakStateEnum.AdBreakState.SCHEDULED].
Declaration
public virtual AdBreak UpdateAdBreak(UpdateAdBreakRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| UpdateAdBreakRequest | request | The request object containing all of the parameters for the API call. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| AdBreak | The RPC response. |
Sample code
// Create client
AdBreakServiceClient adBreakServiceClient = AdBreakServiceClient.Create();
// Initialize request argument(s)
UpdateAdBreakRequest request = new UpdateAdBreakRequest
{
AdBreak = new AdBreak(),
UpdateMask = new FieldMask(),
};
// Make the request
AdBreak response = adBreakServiceClient.UpdateAdBreak(request);
UpdateAdBreakAsync(AdBreak, FieldMask, CallSettings)
API to update an AdBreak object.
Modify an ad break when its state is
[SCHEDULED][google.ads.admanager.v1.AdBreakStateEnum.AdBreakState.SCHEDULED].
Declaration
public virtual Task<AdBreak> UpdateAdBreakAsync(AdBreak adBreak, FieldMask updateMask, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| AdBreak | adBreak | Required. The The |
| FieldMask | updateMask | Required. The list of fields to update. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<AdBreak> | A Task containing the RPC response. |
Sample code
// Create client
AdBreakServiceClient adBreakServiceClient = await AdBreakServiceClient.CreateAsync();
// Initialize request argument(s)
AdBreak adBreak = new AdBreak();
FieldMask updateMask = new FieldMask();
// Make the request
AdBreak response = await adBreakServiceClient.UpdateAdBreakAsync(adBreak, updateMask);
UpdateAdBreakAsync(AdBreak, FieldMask, CancellationToken)
API to update an AdBreak object.
Modify an ad break when its state is
[SCHEDULED][google.ads.admanager.v1.AdBreakStateEnum.AdBreakState.SCHEDULED].
Declaration
public virtual Task<AdBreak> UpdateAdBreakAsync(AdBreak adBreak, FieldMask updateMask, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| AdBreak | adBreak | Required. The The |
| FieldMask | updateMask | Required. The list of fields to update. |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<AdBreak> | A Task containing the RPC response. |
Sample code
// Create client
AdBreakServiceClient adBreakServiceClient = await AdBreakServiceClient.CreateAsync();
// Initialize request argument(s)
AdBreak adBreak = new AdBreak();
FieldMask updateMask = new FieldMask();
// Make the request
AdBreak response = await adBreakServiceClient.UpdateAdBreakAsync(adBreak, updateMask);
UpdateAdBreakAsync(UpdateAdBreakRequest, CallSettings)
API to update an AdBreak object.
Modify an ad break when its state is
[SCHEDULED][google.ads.admanager.v1.AdBreakStateEnum.AdBreakState.SCHEDULED].
Declaration
public virtual Task<AdBreak> UpdateAdBreakAsync(UpdateAdBreakRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| UpdateAdBreakRequest | request | The request object containing all of the parameters for the API call. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<AdBreak> | A Task containing the RPC response. |
Sample code
// Create client
AdBreakServiceClient adBreakServiceClient = await AdBreakServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateAdBreakRequest request = new UpdateAdBreakRequest
{
AdBreak = new AdBreak(),
UpdateMask = new FieldMask(),
};
// Make the request
AdBreak response = await adBreakServiceClient.UpdateAdBreakAsync(request);
UpdateAdBreakAsync(UpdateAdBreakRequest, CancellationToken)
API to update an AdBreak object.
Modify an ad break when its state is
[SCHEDULED][google.ads.admanager.v1.AdBreakStateEnum.AdBreakState.SCHEDULED].
Declaration
public virtual Task<AdBreak> UpdateAdBreakAsync(UpdateAdBreakRequest request, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| UpdateAdBreakRequest | request | The request object containing all of the parameters for the API call. |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<AdBreak> | A Task containing the RPC response. |
Sample code
// Create client
AdBreakServiceClient adBreakServiceClient = await AdBreakServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateAdBreakRequest request = new UpdateAdBreakRequest
{
AdBreak = new AdBreak(),
UpdateMask = new FieldMask(),
};
// Make the request
AdBreak response = await adBreakServiceClient.UpdateAdBreakAsync(request);