Class AdUnitServiceClient
AdUnitService client wrapper, for convenient use.
Namespace: Google.Ads.AdManager.V1
Assembly: Google.Ads.AdManager.V1.dll
Syntax
public abstract class AdUnitServiceClient
Remarks
Provides methods for handling AdUnit objects.
Properties
DefaultEndpoint
The default endpoint for the AdUnitService 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 AdUnitService scopes.
Declaration
public static IReadOnlyList<string> DefaultScopes { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<string> |
Remarks
The default AdUnitService scopes are:
- https://www.googleapis.com/auth/admanager
GrpcClient
The underlying gRPC AdUnitService client
Declaration
public virtual AdUnitService.AdUnitServiceClient GrpcClient { get; }
Property Value
| Type | Description |
|---|---|
| AdUnitService.AdUnitServiceClient |
ServiceMetadata
The service metadata associated with this client type.
Declaration
public static ServiceMetadata ServiceMetadata { get; }
Property Value
| Type | Description |
|---|---|
| ServiceMetadata |
Methods
BatchActivateAdUnits(BatchActivateAdUnitsRequest, CallSettings)
API to batch activate AdUnit objects.
Declaration
public virtual BatchActivateAdUnitsResponse BatchActivateAdUnits(BatchActivateAdUnitsRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| BatchActivateAdUnitsRequest | 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 |
|---|---|
| BatchActivateAdUnitsResponse | The RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.Create();
// Initialize request argument(s)
BatchActivateAdUnitsRequest request = new BatchActivateAdUnitsRequest
{
ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
AdUnitNames =
{
AdUnitName.FromNetworkCodeAdUnit("[NETWORK_CODE]", "[AD_UNIT]"),
},
};
// Make the request
BatchActivateAdUnitsResponse response = adUnitServiceClient.BatchActivateAdUnits(request);
BatchActivateAdUnits(NetworkName, IEnumerable<AdUnitName>, CallSettings)
API to batch activate AdUnit objects.
Declaration
public virtual BatchActivateAdUnitsResponse BatchActivateAdUnits(NetworkName parent, IEnumerable<AdUnitName> names, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| NetworkName | parent | Required. Format: |
| IEnumerable<AdUnitName> | names | Required. The resource names of the |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| BatchActivateAdUnitsResponse | The RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.Create();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<AdUnitName> names = new AdUnitName[]
{
AdUnitName.FromNetworkCodeAdUnit("[NETWORK_CODE]", "[AD_UNIT]"),
};
// Make the request
BatchActivateAdUnitsResponse response = adUnitServiceClient.BatchActivateAdUnits(parent, names);
BatchActivateAdUnits(string, IEnumerable<string>, CallSettings)
API to batch activate AdUnit objects.
Declaration
public virtual BatchActivateAdUnitsResponse BatchActivateAdUnits(string parent, IEnumerable<string> names, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | parent | Required. Format: |
| IEnumerable<string> | names | Required. The resource names of the |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| BatchActivateAdUnitsResponse | The RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.Create();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<string> names = new string[]
{
"networks/[NETWORK_CODE]/adUnits/[AD_UNIT]",
};
// Make the request
BatchActivateAdUnitsResponse response = adUnitServiceClient.BatchActivateAdUnits(parent, names);
BatchActivateAdUnitsAsync(BatchActivateAdUnitsRequest, CallSettings)
API to batch activate AdUnit objects.
Declaration
public virtual Task<BatchActivateAdUnitsResponse> BatchActivateAdUnitsAsync(BatchActivateAdUnitsRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| BatchActivateAdUnitsRequest | 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<BatchActivateAdUnitsResponse> | A Task containing the RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = await AdUnitServiceClient.CreateAsync();
// Initialize request argument(s)
BatchActivateAdUnitsRequest request = new BatchActivateAdUnitsRequest
{
ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
AdUnitNames =
{
AdUnitName.FromNetworkCodeAdUnit("[NETWORK_CODE]", "[AD_UNIT]"),
},
};
// Make the request
BatchActivateAdUnitsResponse response = await adUnitServiceClient.BatchActivateAdUnitsAsync(request);
BatchActivateAdUnitsAsync(BatchActivateAdUnitsRequest, CancellationToken)
API to batch activate AdUnit objects.
Declaration
public virtual Task<BatchActivateAdUnitsResponse> BatchActivateAdUnitsAsync(BatchActivateAdUnitsRequest request, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| BatchActivateAdUnitsRequest | 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<BatchActivateAdUnitsResponse> | A Task containing the RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = await AdUnitServiceClient.CreateAsync();
// Initialize request argument(s)
BatchActivateAdUnitsRequest request = new BatchActivateAdUnitsRequest
{
ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
AdUnitNames =
{
AdUnitName.FromNetworkCodeAdUnit("[NETWORK_CODE]", "[AD_UNIT]"),
},
};
// Make the request
BatchActivateAdUnitsResponse response = await adUnitServiceClient.BatchActivateAdUnitsAsync(request);
BatchActivateAdUnitsAsync(NetworkName, IEnumerable<AdUnitName>, CallSettings)
API to batch activate AdUnit objects.
Declaration
public virtual Task<BatchActivateAdUnitsResponse> BatchActivateAdUnitsAsync(NetworkName parent, IEnumerable<AdUnitName> names, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| NetworkName | parent | Required. Format: |
| IEnumerable<AdUnitName> | names | Required. The resource names of the |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<BatchActivateAdUnitsResponse> | A Task containing the RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = await AdUnitServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<AdUnitName> names = new AdUnitName[]
{
AdUnitName.FromNetworkCodeAdUnit("[NETWORK_CODE]", "[AD_UNIT]"),
};
// Make the request
BatchActivateAdUnitsResponse response = await adUnitServiceClient.BatchActivateAdUnitsAsync(parent, names);
BatchActivateAdUnitsAsync(NetworkName, IEnumerable<AdUnitName>, CancellationToken)
API to batch activate AdUnit objects.
Declaration
public virtual Task<BatchActivateAdUnitsResponse> BatchActivateAdUnitsAsync(NetworkName parent, IEnumerable<AdUnitName> names, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| NetworkName | parent | Required. Format: |
| IEnumerable<AdUnitName> | names | Required. The resource names of the |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<BatchActivateAdUnitsResponse> | A Task containing the RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = await AdUnitServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<AdUnitName> names = new AdUnitName[]
{
AdUnitName.FromNetworkCodeAdUnit("[NETWORK_CODE]", "[AD_UNIT]"),
};
// Make the request
BatchActivateAdUnitsResponse response = await adUnitServiceClient.BatchActivateAdUnitsAsync(parent, names);
BatchActivateAdUnitsAsync(string, IEnumerable<string>, CallSettings)
API to batch activate AdUnit objects.
Declaration
public virtual Task<BatchActivateAdUnitsResponse> BatchActivateAdUnitsAsync(string parent, IEnumerable<string> names, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | parent | Required. Format: |
| IEnumerable<string> | names | Required. The resource names of the |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<BatchActivateAdUnitsResponse> | A Task containing the RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = await AdUnitServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<string> names = new string[]
{
"networks/[NETWORK_CODE]/adUnits/[AD_UNIT]",
};
// Make the request
BatchActivateAdUnitsResponse response = await adUnitServiceClient.BatchActivateAdUnitsAsync(parent, names);
BatchActivateAdUnitsAsync(string, IEnumerable<string>, CancellationToken)
API to batch activate AdUnit objects.
Declaration
public virtual Task<BatchActivateAdUnitsResponse> BatchActivateAdUnitsAsync(string parent, IEnumerable<string> names, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| string | parent | Required. Format: |
| IEnumerable<string> | names | Required. The resource names of the |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<BatchActivateAdUnitsResponse> | A Task containing the RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = await AdUnitServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<string> names = new string[]
{
"networks/[NETWORK_CODE]/adUnits/[AD_UNIT]",
};
// Make the request
BatchActivateAdUnitsResponse response = await adUnitServiceClient.BatchActivateAdUnitsAsync(parent, names);
BatchArchiveAdUnits(BatchArchiveAdUnitsRequest, CallSettings)
Archives a list of AdUnit objects.
Declaration
public virtual BatchArchiveAdUnitsResponse BatchArchiveAdUnits(BatchArchiveAdUnitsRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| BatchArchiveAdUnitsRequest | 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 |
|---|---|
| BatchArchiveAdUnitsResponse | The RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.Create();
// Initialize request argument(s)
BatchArchiveAdUnitsRequest request = new BatchArchiveAdUnitsRequest
{
ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
AdUnitNames =
{
AdUnitName.FromNetworkCodeAdUnit("[NETWORK_CODE]", "[AD_UNIT]"),
},
};
// Make the request
BatchArchiveAdUnitsResponse response = adUnitServiceClient.BatchArchiveAdUnits(request);
BatchArchiveAdUnits(NetworkName, IEnumerable<AdUnitName>, CallSettings)
Archives a list of AdUnit objects.
Declaration
public virtual BatchArchiveAdUnitsResponse BatchArchiveAdUnits(NetworkName parent, IEnumerable<AdUnitName> names, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| NetworkName | parent | Required. Format: |
| IEnumerable<AdUnitName> | names | Required. The resource names of the |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| BatchArchiveAdUnitsResponse | The RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.Create();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<AdUnitName> names = new AdUnitName[]
{
AdUnitName.FromNetworkCodeAdUnit("[NETWORK_CODE]", "[AD_UNIT]"),
};
// Make the request
BatchArchiveAdUnitsResponse response = adUnitServiceClient.BatchArchiveAdUnits(parent, names);
BatchArchiveAdUnits(string, IEnumerable<string>, CallSettings)
Archives a list of AdUnit objects.
Declaration
public virtual BatchArchiveAdUnitsResponse BatchArchiveAdUnits(string parent, IEnumerable<string> names, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | parent | Required. Format: |
| IEnumerable<string> | names | Required. The resource names of the |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| BatchArchiveAdUnitsResponse | The RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.Create();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<string> names = new string[]
{
"networks/[NETWORK_CODE]/adUnits/[AD_UNIT]",
};
// Make the request
BatchArchiveAdUnitsResponse response = adUnitServiceClient.BatchArchiveAdUnits(parent, names);
BatchArchiveAdUnitsAsync(BatchArchiveAdUnitsRequest, CallSettings)
Archives a list of AdUnit objects.
Declaration
public virtual Task<BatchArchiveAdUnitsResponse> BatchArchiveAdUnitsAsync(BatchArchiveAdUnitsRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| BatchArchiveAdUnitsRequest | 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<BatchArchiveAdUnitsResponse> | A Task containing the RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = await AdUnitServiceClient.CreateAsync();
// Initialize request argument(s)
BatchArchiveAdUnitsRequest request = new BatchArchiveAdUnitsRequest
{
ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
AdUnitNames =
{
AdUnitName.FromNetworkCodeAdUnit("[NETWORK_CODE]", "[AD_UNIT]"),
},
};
// Make the request
BatchArchiveAdUnitsResponse response = await adUnitServiceClient.BatchArchiveAdUnitsAsync(request);
BatchArchiveAdUnitsAsync(BatchArchiveAdUnitsRequest, CancellationToken)
Archives a list of AdUnit objects.
Declaration
public virtual Task<BatchArchiveAdUnitsResponse> BatchArchiveAdUnitsAsync(BatchArchiveAdUnitsRequest request, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| BatchArchiveAdUnitsRequest | 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<BatchArchiveAdUnitsResponse> | A Task containing the RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = await AdUnitServiceClient.CreateAsync();
// Initialize request argument(s)
BatchArchiveAdUnitsRequest request = new BatchArchiveAdUnitsRequest
{
ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
AdUnitNames =
{
AdUnitName.FromNetworkCodeAdUnit("[NETWORK_CODE]", "[AD_UNIT]"),
},
};
// Make the request
BatchArchiveAdUnitsResponse response = await adUnitServiceClient.BatchArchiveAdUnitsAsync(request);
BatchArchiveAdUnitsAsync(NetworkName, IEnumerable<AdUnitName>, CallSettings)
Archives a list of AdUnit objects.
Declaration
public virtual Task<BatchArchiveAdUnitsResponse> BatchArchiveAdUnitsAsync(NetworkName parent, IEnumerable<AdUnitName> names, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| NetworkName | parent | Required. Format: |
| IEnumerable<AdUnitName> | names | Required. The resource names of the |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<BatchArchiveAdUnitsResponse> | A Task containing the RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = await AdUnitServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<AdUnitName> names = new AdUnitName[]
{
AdUnitName.FromNetworkCodeAdUnit("[NETWORK_CODE]", "[AD_UNIT]"),
};
// Make the request
BatchArchiveAdUnitsResponse response = await adUnitServiceClient.BatchArchiveAdUnitsAsync(parent, names);
BatchArchiveAdUnitsAsync(NetworkName, IEnumerable<AdUnitName>, CancellationToken)
Archives a list of AdUnit objects.
Declaration
public virtual Task<BatchArchiveAdUnitsResponse> BatchArchiveAdUnitsAsync(NetworkName parent, IEnumerable<AdUnitName> names, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| NetworkName | parent | Required. Format: |
| IEnumerable<AdUnitName> | names | Required. The resource names of the |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<BatchArchiveAdUnitsResponse> | A Task containing the RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = await AdUnitServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<AdUnitName> names = new AdUnitName[]
{
AdUnitName.FromNetworkCodeAdUnit("[NETWORK_CODE]", "[AD_UNIT]"),
};
// Make the request
BatchArchiveAdUnitsResponse response = await adUnitServiceClient.BatchArchiveAdUnitsAsync(parent, names);
BatchArchiveAdUnitsAsync(string, IEnumerable<string>, CallSettings)
Archives a list of AdUnit objects.
Declaration
public virtual Task<BatchArchiveAdUnitsResponse> BatchArchiveAdUnitsAsync(string parent, IEnumerable<string> names, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | parent | Required. Format: |
| IEnumerable<string> | names | Required. The resource names of the |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<BatchArchiveAdUnitsResponse> | A Task containing the RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = await AdUnitServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<string> names = new string[]
{
"networks/[NETWORK_CODE]/adUnits/[AD_UNIT]",
};
// Make the request
BatchArchiveAdUnitsResponse response = await adUnitServiceClient.BatchArchiveAdUnitsAsync(parent, names);
BatchArchiveAdUnitsAsync(string, IEnumerable<string>, CancellationToken)
Archives a list of AdUnit objects.
Declaration
public virtual Task<BatchArchiveAdUnitsResponse> BatchArchiveAdUnitsAsync(string parent, IEnumerable<string> names, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| string | parent | Required. Format: |
| IEnumerable<string> | names | Required. The resource names of the |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<BatchArchiveAdUnitsResponse> | A Task containing the RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = await AdUnitServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<string> names = new string[]
{
"networks/[NETWORK_CODE]/adUnits/[AD_UNIT]",
};
// Make the request
BatchArchiveAdUnitsResponse response = await adUnitServiceClient.BatchArchiveAdUnitsAsync(parent, names);
BatchCreateAdUnits(BatchCreateAdUnitsRequest, CallSettings)
API to batch create AdUnit objects.
Declaration
public virtual BatchCreateAdUnitsResponse BatchCreateAdUnits(BatchCreateAdUnitsRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| BatchCreateAdUnitsRequest | 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 |
|---|---|
| BatchCreateAdUnitsResponse | The RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.Create();
// Initialize request argument(s)
BatchCreateAdUnitsRequest request = new BatchCreateAdUnitsRequest
{
ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
Requests =
{
new CreateAdUnitRequest(),
},
};
// Make the request
BatchCreateAdUnitsResponse response = adUnitServiceClient.BatchCreateAdUnits(request);
BatchCreateAdUnits(NetworkName, IEnumerable<CreateAdUnitRequest>, CallSettings)
API to batch create AdUnit objects.
Declaration
public virtual BatchCreateAdUnitsResponse BatchCreateAdUnits(NetworkName parent, IEnumerable<CreateAdUnitRequest> requests, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| NetworkName | parent | Required. The parent resource where |
| IEnumerable<CreateAdUnitRequest> | requests | Required. The |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| BatchCreateAdUnitsResponse | The RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.Create();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<CreateAdUnitRequest> requests = new CreateAdUnitRequest[]
{
new CreateAdUnitRequest(),
};
// Make the request
BatchCreateAdUnitsResponse response = adUnitServiceClient.BatchCreateAdUnits(parent, requests);
BatchCreateAdUnits(string, IEnumerable<CreateAdUnitRequest>, CallSettings)
API to batch create AdUnit objects.
Declaration
public virtual BatchCreateAdUnitsResponse BatchCreateAdUnits(string parent, IEnumerable<CreateAdUnitRequest> requests, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | parent | Required. The parent resource where |
| IEnumerable<CreateAdUnitRequest> | requests | Required. The |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| BatchCreateAdUnitsResponse | The RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.Create();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<CreateAdUnitRequest> requests = new CreateAdUnitRequest[]
{
new CreateAdUnitRequest(),
};
// Make the request
BatchCreateAdUnitsResponse response = adUnitServiceClient.BatchCreateAdUnits(parent, requests);
BatchCreateAdUnitsAsync(BatchCreateAdUnitsRequest, CallSettings)
API to batch create AdUnit objects.
Declaration
public virtual Task<BatchCreateAdUnitsResponse> BatchCreateAdUnitsAsync(BatchCreateAdUnitsRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| BatchCreateAdUnitsRequest | 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<BatchCreateAdUnitsResponse> | A Task containing the RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = await AdUnitServiceClient.CreateAsync();
// Initialize request argument(s)
BatchCreateAdUnitsRequest request = new BatchCreateAdUnitsRequest
{
ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
Requests =
{
new CreateAdUnitRequest(),
},
};
// Make the request
BatchCreateAdUnitsResponse response = await adUnitServiceClient.BatchCreateAdUnitsAsync(request);
BatchCreateAdUnitsAsync(BatchCreateAdUnitsRequest, CancellationToken)
API to batch create AdUnit objects.
Declaration
public virtual Task<BatchCreateAdUnitsResponse> BatchCreateAdUnitsAsync(BatchCreateAdUnitsRequest request, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| BatchCreateAdUnitsRequest | 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<BatchCreateAdUnitsResponse> | A Task containing the RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = await AdUnitServiceClient.CreateAsync();
// Initialize request argument(s)
BatchCreateAdUnitsRequest request = new BatchCreateAdUnitsRequest
{
ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
Requests =
{
new CreateAdUnitRequest(),
},
};
// Make the request
BatchCreateAdUnitsResponse response = await adUnitServiceClient.BatchCreateAdUnitsAsync(request);
BatchCreateAdUnitsAsync(NetworkName, IEnumerable<CreateAdUnitRequest>, CallSettings)
API to batch create AdUnit objects.
Declaration
public virtual Task<BatchCreateAdUnitsResponse> BatchCreateAdUnitsAsync(NetworkName parent, IEnumerable<CreateAdUnitRequest> requests, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| NetworkName | parent | Required. The parent resource where |
| IEnumerable<CreateAdUnitRequest> | requests | Required. The |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<BatchCreateAdUnitsResponse> | A Task containing the RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = await AdUnitServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<CreateAdUnitRequest> requests = new CreateAdUnitRequest[]
{
new CreateAdUnitRequest(),
};
// Make the request
BatchCreateAdUnitsResponse response = await adUnitServiceClient.BatchCreateAdUnitsAsync(parent, requests);
BatchCreateAdUnitsAsync(NetworkName, IEnumerable<CreateAdUnitRequest>, CancellationToken)
API to batch create AdUnit objects.
Declaration
public virtual Task<BatchCreateAdUnitsResponse> BatchCreateAdUnitsAsync(NetworkName parent, IEnumerable<CreateAdUnitRequest> requests, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| NetworkName | parent | Required. The parent resource where |
| IEnumerable<CreateAdUnitRequest> | requests | Required. The |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<BatchCreateAdUnitsResponse> | A Task containing the RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = await AdUnitServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<CreateAdUnitRequest> requests = new CreateAdUnitRequest[]
{
new CreateAdUnitRequest(),
};
// Make the request
BatchCreateAdUnitsResponse response = await adUnitServiceClient.BatchCreateAdUnitsAsync(parent, requests);
BatchCreateAdUnitsAsync(string, IEnumerable<CreateAdUnitRequest>, CallSettings)
API to batch create AdUnit objects.
Declaration
public virtual Task<BatchCreateAdUnitsResponse> BatchCreateAdUnitsAsync(string parent, IEnumerable<CreateAdUnitRequest> requests, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | parent | Required. The parent resource where |
| IEnumerable<CreateAdUnitRequest> | requests | Required. The |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<BatchCreateAdUnitsResponse> | A Task containing the RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = await AdUnitServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<CreateAdUnitRequest> requests = new CreateAdUnitRequest[]
{
new CreateAdUnitRequest(),
};
// Make the request
BatchCreateAdUnitsResponse response = await adUnitServiceClient.BatchCreateAdUnitsAsync(parent, requests);
BatchCreateAdUnitsAsync(string, IEnumerable<CreateAdUnitRequest>, CancellationToken)
API to batch create AdUnit objects.
Declaration
public virtual Task<BatchCreateAdUnitsResponse> BatchCreateAdUnitsAsync(string parent, IEnumerable<CreateAdUnitRequest> requests, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| string | parent | Required. The parent resource where |
| IEnumerable<CreateAdUnitRequest> | requests | Required. The |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<BatchCreateAdUnitsResponse> | A Task containing the RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = await AdUnitServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<CreateAdUnitRequest> requests = new CreateAdUnitRequest[]
{
new CreateAdUnitRequest(),
};
// Make the request
BatchCreateAdUnitsResponse response = await adUnitServiceClient.BatchCreateAdUnitsAsync(parent, requests);
BatchDeactivateAdUnits(BatchDeactivateAdUnitsRequest, CallSettings)
Deactivates a list of AdUnit objects.
Declaration
public virtual BatchDeactivateAdUnitsResponse BatchDeactivateAdUnits(BatchDeactivateAdUnitsRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| BatchDeactivateAdUnitsRequest | 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 |
|---|---|
| BatchDeactivateAdUnitsResponse | The RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.Create();
// Initialize request argument(s)
BatchDeactivateAdUnitsRequest request = new BatchDeactivateAdUnitsRequest
{
ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
AdUnitNames =
{
AdUnitName.FromNetworkCodeAdUnit("[NETWORK_CODE]", "[AD_UNIT]"),
},
};
// Make the request
BatchDeactivateAdUnitsResponse response = adUnitServiceClient.BatchDeactivateAdUnits(request);
BatchDeactivateAdUnits(NetworkName, IEnumerable<AdUnitName>, CallSettings)
Deactivates a list of AdUnit objects.
Declaration
public virtual BatchDeactivateAdUnitsResponse BatchDeactivateAdUnits(NetworkName parent, IEnumerable<AdUnitName> names, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| NetworkName | parent | Required. Format: |
| IEnumerable<AdUnitName> | names | Required. The resource names of the |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| BatchDeactivateAdUnitsResponse | The RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.Create();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<AdUnitName> names = new AdUnitName[]
{
AdUnitName.FromNetworkCodeAdUnit("[NETWORK_CODE]", "[AD_UNIT]"),
};
// Make the request
BatchDeactivateAdUnitsResponse response = adUnitServiceClient.BatchDeactivateAdUnits(parent, names);
BatchDeactivateAdUnits(string, IEnumerable<string>, CallSettings)
Deactivates a list of AdUnit objects.
Declaration
public virtual BatchDeactivateAdUnitsResponse BatchDeactivateAdUnits(string parent, IEnumerable<string> names, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | parent | Required. Format: |
| IEnumerable<string> | names | Required. The resource names of the |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| BatchDeactivateAdUnitsResponse | The RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.Create();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<string> names = new string[]
{
"networks/[NETWORK_CODE]/adUnits/[AD_UNIT]",
};
// Make the request
BatchDeactivateAdUnitsResponse response = adUnitServiceClient.BatchDeactivateAdUnits(parent, names);
BatchDeactivateAdUnitsAsync(BatchDeactivateAdUnitsRequest, CallSettings)
Deactivates a list of AdUnit objects.
Declaration
public virtual Task<BatchDeactivateAdUnitsResponse> BatchDeactivateAdUnitsAsync(BatchDeactivateAdUnitsRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| BatchDeactivateAdUnitsRequest | 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<BatchDeactivateAdUnitsResponse> | A Task containing the RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = await AdUnitServiceClient.CreateAsync();
// Initialize request argument(s)
BatchDeactivateAdUnitsRequest request = new BatchDeactivateAdUnitsRequest
{
ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
AdUnitNames =
{
AdUnitName.FromNetworkCodeAdUnit("[NETWORK_CODE]", "[AD_UNIT]"),
},
};
// Make the request
BatchDeactivateAdUnitsResponse response = await adUnitServiceClient.BatchDeactivateAdUnitsAsync(request);
BatchDeactivateAdUnitsAsync(BatchDeactivateAdUnitsRequest, CancellationToken)
Deactivates a list of AdUnit objects.
Declaration
public virtual Task<BatchDeactivateAdUnitsResponse> BatchDeactivateAdUnitsAsync(BatchDeactivateAdUnitsRequest request, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| BatchDeactivateAdUnitsRequest | 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<BatchDeactivateAdUnitsResponse> | A Task containing the RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = await AdUnitServiceClient.CreateAsync();
// Initialize request argument(s)
BatchDeactivateAdUnitsRequest request = new BatchDeactivateAdUnitsRequest
{
ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
AdUnitNames =
{
AdUnitName.FromNetworkCodeAdUnit("[NETWORK_CODE]", "[AD_UNIT]"),
},
};
// Make the request
BatchDeactivateAdUnitsResponse response = await adUnitServiceClient.BatchDeactivateAdUnitsAsync(request);
BatchDeactivateAdUnitsAsync(NetworkName, IEnumerable<AdUnitName>, CallSettings)
Deactivates a list of AdUnit objects.
Declaration
public virtual Task<BatchDeactivateAdUnitsResponse> BatchDeactivateAdUnitsAsync(NetworkName parent, IEnumerable<AdUnitName> names, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| NetworkName | parent | Required. Format: |
| IEnumerable<AdUnitName> | names | Required. The resource names of the |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<BatchDeactivateAdUnitsResponse> | A Task containing the RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = await AdUnitServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<AdUnitName> names = new AdUnitName[]
{
AdUnitName.FromNetworkCodeAdUnit("[NETWORK_CODE]", "[AD_UNIT]"),
};
// Make the request
BatchDeactivateAdUnitsResponse response = await adUnitServiceClient.BatchDeactivateAdUnitsAsync(parent, names);
BatchDeactivateAdUnitsAsync(NetworkName, IEnumerable<AdUnitName>, CancellationToken)
Deactivates a list of AdUnit objects.
Declaration
public virtual Task<BatchDeactivateAdUnitsResponse> BatchDeactivateAdUnitsAsync(NetworkName parent, IEnumerable<AdUnitName> names, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| NetworkName | parent | Required. Format: |
| IEnumerable<AdUnitName> | names | Required. The resource names of the |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<BatchDeactivateAdUnitsResponse> | A Task containing the RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = await AdUnitServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<AdUnitName> names = new AdUnitName[]
{
AdUnitName.FromNetworkCodeAdUnit("[NETWORK_CODE]", "[AD_UNIT]"),
};
// Make the request
BatchDeactivateAdUnitsResponse response = await adUnitServiceClient.BatchDeactivateAdUnitsAsync(parent, names);
BatchDeactivateAdUnitsAsync(string, IEnumerable<string>, CallSettings)
Deactivates a list of AdUnit objects.
Declaration
public virtual Task<BatchDeactivateAdUnitsResponse> BatchDeactivateAdUnitsAsync(string parent, IEnumerable<string> names, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | parent | Required. Format: |
| IEnumerable<string> | names | Required. The resource names of the |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<BatchDeactivateAdUnitsResponse> | A Task containing the RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = await AdUnitServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<string> names = new string[]
{
"networks/[NETWORK_CODE]/adUnits/[AD_UNIT]",
};
// Make the request
BatchDeactivateAdUnitsResponse response = await adUnitServiceClient.BatchDeactivateAdUnitsAsync(parent, names);
BatchDeactivateAdUnitsAsync(string, IEnumerable<string>, CancellationToken)
Deactivates a list of AdUnit objects.
Declaration
public virtual Task<BatchDeactivateAdUnitsResponse> BatchDeactivateAdUnitsAsync(string parent, IEnumerable<string> names, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| string | parent | Required. Format: |
| IEnumerable<string> | names | Required. The resource names of the |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<BatchDeactivateAdUnitsResponse> | A Task containing the RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = await AdUnitServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<string> names = new string[]
{
"networks/[NETWORK_CODE]/adUnits/[AD_UNIT]",
};
// Make the request
BatchDeactivateAdUnitsResponse response = await adUnitServiceClient.BatchDeactivateAdUnitsAsync(parent, names);
BatchUpdateAdUnits(BatchUpdateAdUnitsRequest, CallSettings)
API to batch update AdUnit objects.
Declaration
public virtual BatchUpdateAdUnitsResponse BatchUpdateAdUnits(BatchUpdateAdUnitsRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| BatchUpdateAdUnitsRequest | 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 |
|---|---|
| BatchUpdateAdUnitsResponse | The RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.Create();
// Initialize request argument(s)
BatchUpdateAdUnitsRequest request = new BatchUpdateAdUnitsRequest
{
ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
Requests =
{
new UpdateAdUnitRequest(),
},
};
// Make the request
BatchUpdateAdUnitsResponse response = adUnitServiceClient.BatchUpdateAdUnits(request);
BatchUpdateAdUnits(NetworkName, IEnumerable<UpdateAdUnitRequest>, CallSettings)
API to batch update AdUnit objects.
Declaration
public virtual BatchUpdateAdUnitsResponse BatchUpdateAdUnits(NetworkName parent, IEnumerable<UpdateAdUnitRequest> requests, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| NetworkName | parent | Required. The parent resource where |
| IEnumerable<UpdateAdUnitRequest> | requests | Required. The |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| BatchUpdateAdUnitsResponse | The RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.Create();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<UpdateAdUnitRequest> requests = new UpdateAdUnitRequest[]
{
new UpdateAdUnitRequest(),
};
// Make the request
BatchUpdateAdUnitsResponse response = adUnitServiceClient.BatchUpdateAdUnits(parent, requests);
BatchUpdateAdUnits(string, IEnumerable<UpdateAdUnitRequest>, CallSettings)
API to batch update AdUnit objects.
Declaration
public virtual BatchUpdateAdUnitsResponse BatchUpdateAdUnits(string parent, IEnumerable<UpdateAdUnitRequest> requests, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | parent | Required. The parent resource where |
| IEnumerable<UpdateAdUnitRequest> | requests | Required. The |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| BatchUpdateAdUnitsResponse | The RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.Create();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<UpdateAdUnitRequest> requests = new UpdateAdUnitRequest[]
{
new UpdateAdUnitRequest(),
};
// Make the request
BatchUpdateAdUnitsResponse response = adUnitServiceClient.BatchUpdateAdUnits(parent, requests);
BatchUpdateAdUnitsAsync(BatchUpdateAdUnitsRequest, CallSettings)
API to batch update AdUnit objects.
Declaration
public virtual Task<BatchUpdateAdUnitsResponse> BatchUpdateAdUnitsAsync(BatchUpdateAdUnitsRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| BatchUpdateAdUnitsRequest | 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<BatchUpdateAdUnitsResponse> | A Task containing the RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = await AdUnitServiceClient.CreateAsync();
// Initialize request argument(s)
BatchUpdateAdUnitsRequest request = new BatchUpdateAdUnitsRequest
{
ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
Requests =
{
new UpdateAdUnitRequest(),
},
};
// Make the request
BatchUpdateAdUnitsResponse response = await adUnitServiceClient.BatchUpdateAdUnitsAsync(request);
BatchUpdateAdUnitsAsync(BatchUpdateAdUnitsRequest, CancellationToken)
API to batch update AdUnit objects.
Declaration
public virtual Task<BatchUpdateAdUnitsResponse> BatchUpdateAdUnitsAsync(BatchUpdateAdUnitsRequest request, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| BatchUpdateAdUnitsRequest | 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<BatchUpdateAdUnitsResponse> | A Task containing the RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = await AdUnitServiceClient.CreateAsync();
// Initialize request argument(s)
BatchUpdateAdUnitsRequest request = new BatchUpdateAdUnitsRequest
{
ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
Requests =
{
new UpdateAdUnitRequest(),
},
};
// Make the request
BatchUpdateAdUnitsResponse response = await adUnitServiceClient.BatchUpdateAdUnitsAsync(request);
BatchUpdateAdUnitsAsync(NetworkName, IEnumerable<UpdateAdUnitRequest>, CallSettings)
API to batch update AdUnit objects.
Declaration
public virtual Task<BatchUpdateAdUnitsResponse> BatchUpdateAdUnitsAsync(NetworkName parent, IEnumerable<UpdateAdUnitRequest> requests, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| NetworkName | parent | Required. The parent resource where |
| IEnumerable<UpdateAdUnitRequest> | requests | Required. The |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<BatchUpdateAdUnitsResponse> | A Task containing the RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = await AdUnitServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<UpdateAdUnitRequest> requests = new UpdateAdUnitRequest[]
{
new UpdateAdUnitRequest(),
};
// Make the request
BatchUpdateAdUnitsResponse response = await adUnitServiceClient.BatchUpdateAdUnitsAsync(parent, requests);
BatchUpdateAdUnitsAsync(NetworkName, IEnumerable<UpdateAdUnitRequest>, CancellationToken)
API to batch update AdUnit objects.
Declaration
public virtual Task<BatchUpdateAdUnitsResponse> BatchUpdateAdUnitsAsync(NetworkName parent, IEnumerable<UpdateAdUnitRequest> requests, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| NetworkName | parent | Required. The parent resource where |
| IEnumerable<UpdateAdUnitRequest> | requests | Required. The |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<BatchUpdateAdUnitsResponse> | A Task containing the RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = await AdUnitServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<UpdateAdUnitRequest> requests = new UpdateAdUnitRequest[]
{
new UpdateAdUnitRequest(),
};
// Make the request
BatchUpdateAdUnitsResponse response = await adUnitServiceClient.BatchUpdateAdUnitsAsync(parent, requests);
BatchUpdateAdUnitsAsync(string, IEnumerable<UpdateAdUnitRequest>, CallSettings)
API to batch update AdUnit objects.
Declaration
public virtual Task<BatchUpdateAdUnitsResponse> BatchUpdateAdUnitsAsync(string parent, IEnumerable<UpdateAdUnitRequest> requests, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | parent | Required. The parent resource where |
| IEnumerable<UpdateAdUnitRequest> | requests | Required. The |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<BatchUpdateAdUnitsResponse> | A Task containing the RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = await AdUnitServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<UpdateAdUnitRequest> requests = new UpdateAdUnitRequest[]
{
new UpdateAdUnitRequest(),
};
// Make the request
BatchUpdateAdUnitsResponse response = await adUnitServiceClient.BatchUpdateAdUnitsAsync(parent, requests);
BatchUpdateAdUnitsAsync(string, IEnumerable<UpdateAdUnitRequest>, CancellationToken)
API to batch update AdUnit objects.
Declaration
public virtual Task<BatchUpdateAdUnitsResponse> BatchUpdateAdUnitsAsync(string parent, IEnumerable<UpdateAdUnitRequest> requests, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| string | parent | Required. The parent resource where |
| IEnumerable<UpdateAdUnitRequest> | requests | Required. The |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<BatchUpdateAdUnitsResponse> | A Task containing the RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = await AdUnitServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<UpdateAdUnitRequest> requests = new UpdateAdUnitRequest[]
{
new UpdateAdUnitRequest(),
};
// Make the request
BatchUpdateAdUnitsResponse response = await adUnitServiceClient.BatchUpdateAdUnitsAsync(parent, requests);
Create()
Synchronously creates a AdUnitServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use AdUnitServiceClientBuilder.
Declaration
public static AdUnitServiceClient Create()
Returns
| Type | Description |
|---|---|
| AdUnitServiceClient | The created AdUnitServiceClient. |
CreateAdUnit(CreateAdUnitRequest, CallSettings)
API to create an AdUnit object.
Declaration
public virtual AdUnit CreateAdUnit(CreateAdUnitRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| CreateAdUnitRequest | 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 |
|---|---|
| AdUnit | The RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.Create();
// Initialize request argument(s)
CreateAdUnitRequest request = new CreateAdUnitRequest
{
ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
AdUnit = new AdUnit(),
};
// Make the request
AdUnit response = adUnitServiceClient.CreateAdUnit(request);
CreateAdUnit(NetworkName, AdUnit, CallSettings)
API to create an AdUnit object.
Declaration
public virtual AdUnit CreateAdUnit(NetworkName parent, AdUnit adUnit, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| NetworkName | parent | Required. The parent resource where this |
| AdUnit | adUnit | Required. The |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| AdUnit | The RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.Create();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
AdUnit adUnit = new AdUnit();
// Make the request
AdUnit response = adUnitServiceClient.CreateAdUnit(parent, adUnit);
CreateAdUnit(string, AdUnit, CallSettings)
API to create an AdUnit object.
Declaration
public virtual AdUnit CreateAdUnit(string parent, AdUnit adUnit, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | parent | Required. The parent resource where this |
| AdUnit | adUnit | Required. The |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| AdUnit | The RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.Create();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
AdUnit adUnit = new AdUnit();
// Make the request
AdUnit response = adUnitServiceClient.CreateAdUnit(parent, adUnit);
CreateAdUnitAsync(CreateAdUnitRequest, CallSettings)
API to create an AdUnit object.
Declaration
public virtual Task<AdUnit> CreateAdUnitAsync(CreateAdUnitRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| CreateAdUnitRequest | 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<AdUnit> | A Task containing the RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = await AdUnitServiceClient.CreateAsync();
// Initialize request argument(s)
CreateAdUnitRequest request = new CreateAdUnitRequest
{
ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
AdUnit = new AdUnit(),
};
// Make the request
AdUnit response = await adUnitServiceClient.CreateAdUnitAsync(request);
CreateAdUnitAsync(CreateAdUnitRequest, CancellationToken)
API to create an AdUnit object.
Declaration
public virtual Task<AdUnit> CreateAdUnitAsync(CreateAdUnitRequest request, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| CreateAdUnitRequest | 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<AdUnit> | A Task containing the RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = await AdUnitServiceClient.CreateAsync();
// Initialize request argument(s)
CreateAdUnitRequest request = new CreateAdUnitRequest
{
ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
AdUnit = new AdUnit(),
};
// Make the request
AdUnit response = await adUnitServiceClient.CreateAdUnitAsync(request);
CreateAdUnitAsync(NetworkName, AdUnit, CallSettings)
API to create an AdUnit object.
Declaration
public virtual Task<AdUnit> CreateAdUnitAsync(NetworkName parent, AdUnit adUnit, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| NetworkName | parent | Required. The parent resource where this |
| AdUnit | adUnit | Required. The |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<AdUnit> | A Task containing the RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = await AdUnitServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
AdUnit adUnit = new AdUnit();
// Make the request
AdUnit response = await adUnitServiceClient.CreateAdUnitAsync(parent, adUnit);
CreateAdUnitAsync(NetworkName, AdUnit, CancellationToken)
API to create an AdUnit object.
Declaration
public virtual Task<AdUnit> CreateAdUnitAsync(NetworkName parent, AdUnit adUnit, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| NetworkName | parent | Required. The parent resource where this |
| AdUnit | adUnit | Required. The |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<AdUnit> | A Task containing the RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = await AdUnitServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
AdUnit adUnit = new AdUnit();
// Make the request
AdUnit response = await adUnitServiceClient.CreateAdUnitAsync(parent, adUnit);
CreateAdUnitAsync(string, AdUnit, CallSettings)
API to create an AdUnit object.
Declaration
public virtual Task<AdUnit> CreateAdUnitAsync(string parent, AdUnit adUnit, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | parent | Required. The parent resource where this |
| AdUnit | adUnit | Required. The |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<AdUnit> | A Task containing the RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = await AdUnitServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
AdUnit adUnit = new AdUnit();
// Make the request
AdUnit response = await adUnitServiceClient.CreateAdUnitAsync(parent, adUnit);
CreateAdUnitAsync(string, AdUnit, CancellationToken)
API to create an AdUnit object.
Declaration
public virtual Task<AdUnit> CreateAdUnitAsync(string parent, AdUnit adUnit, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| string | parent | Required. The parent resource where this |
| AdUnit | adUnit | Required. The |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<AdUnit> | A Task containing the RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = await AdUnitServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
AdUnit adUnit = new AdUnit();
// Make the request
AdUnit response = await adUnitServiceClient.CreateAdUnitAsync(parent, adUnit);
CreateAsync(CancellationToken)
Asynchronously creates a AdUnitServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use AdUnitServiceClientBuilder.
Declaration
public static Task<AdUnitServiceClient> CreateAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | The CancellationToken to use while creating the client. |
Returns
| Type | Description |
|---|---|
| Task<AdUnitServiceClient> | The task representing the created AdUnitServiceClient. |
GetAdUnit(AdUnitName, CallSettings)
API to retrieve an AdUnit object.
Declaration
public virtual AdUnit GetAdUnit(AdUnitName name, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| AdUnitName | name | Required. The resource name of the AdUnit.
Format: |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| AdUnit | The RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.Create();
// Initialize request argument(s)
AdUnitName name = AdUnitName.FromNetworkCodeAdUnit("[NETWORK_CODE]", "[AD_UNIT]");
// Make the request
AdUnit response = adUnitServiceClient.GetAdUnit(name);
GetAdUnit(GetAdUnitRequest, CallSettings)
API to retrieve an AdUnit object.
Declaration
public virtual AdUnit GetAdUnit(GetAdUnitRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| GetAdUnitRequest | 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 |
|---|---|
| AdUnit | The RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.Create();
// Initialize request argument(s)
GetAdUnitRequest request = new GetAdUnitRequest
{
AdUnitName = AdUnitName.FromNetworkCodeAdUnit("[NETWORK_CODE]", "[AD_UNIT]"),
};
// Make the request
AdUnit response = adUnitServiceClient.GetAdUnit(request);
GetAdUnit(string, CallSettings)
API to retrieve an AdUnit object.
Declaration
public virtual AdUnit GetAdUnit(string name, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Required. The resource name of the AdUnit.
Format: |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| AdUnit | The RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.Create();
// Initialize request argument(s)
string name = "networks/[NETWORK_CODE]/adUnits/[AD_UNIT]";
// Make the request
AdUnit response = adUnitServiceClient.GetAdUnit(name);
GetAdUnitAsync(AdUnitName, CallSettings)
API to retrieve an AdUnit object.
Declaration
public virtual Task<AdUnit> GetAdUnitAsync(AdUnitName name, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| AdUnitName | name | Required. The resource name of the AdUnit.
Format: |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<AdUnit> | A Task containing the RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = await AdUnitServiceClient.CreateAsync();
// Initialize request argument(s)
AdUnitName name = AdUnitName.FromNetworkCodeAdUnit("[NETWORK_CODE]", "[AD_UNIT]");
// Make the request
AdUnit response = await adUnitServiceClient.GetAdUnitAsync(name);
GetAdUnitAsync(AdUnitName, CancellationToken)
API to retrieve an AdUnit object.
Declaration
public virtual Task<AdUnit> GetAdUnitAsync(AdUnitName name, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| AdUnitName | name | Required. The resource name of the AdUnit.
Format: |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<AdUnit> | A Task containing the RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = await AdUnitServiceClient.CreateAsync();
// Initialize request argument(s)
AdUnitName name = AdUnitName.FromNetworkCodeAdUnit("[NETWORK_CODE]", "[AD_UNIT]");
// Make the request
AdUnit response = await adUnitServiceClient.GetAdUnitAsync(name);
GetAdUnitAsync(GetAdUnitRequest, CallSettings)
API to retrieve an AdUnit object.
Declaration
public virtual Task<AdUnit> GetAdUnitAsync(GetAdUnitRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| GetAdUnitRequest | 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<AdUnit> | A Task containing the RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = await AdUnitServiceClient.CreateAsync();
// Initialize request argument(s)
GetAdUnitRequest request = new GetAdUnitRequest
{
AdUnitName = AdUnitName.FromNetworkCodeAdUnit("[NETWORK_CODE]", "[AD_UNIT]"),
};
// Make the request
AdUnit response = await adUnitServiceClient.GetAdUnitAsync(request);
GetAdUnitAsync(GetAdUnitRequest, CancellationToken)
API to retrieve an AdUnit object.
Declaration
public virtual Task<AdUnit> GetAdUnitAsync(GetAdUnitRequest request, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| GetAdUnitRequest | 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<AdUnit> | A Task containing the RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = await AdUnitServiceClient.CreateAsync();
// Initialize request argument(s)
GetAdUnitRequest request = new GetAdUnitRequest
{
AdUnitName = AdUnitName.FromNetworkCodeAdUnit("[NETWORK_CODE]", "[AD_UNIT]"),
};
// Make the request
AdUnit response = await adUnitServiceClient.GetAdUnitAsync(request);
GetAdUnitAsync(string, CallSettings)
API to retrieve an AdUnit object.
Declaration
public virtual Task<AdUnit> GetAdUnitAsync(string name, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Required. The resource name of the AdUnit.
Format: |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<AdUnit> | A Task containing the RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = await AdUnitServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "networks/[NETWORK_CODE]/adUnits/[AD_UNIT]";
// Make the request
AdUnit response = await adUnitServiceClient.GetAdUnitAsync(name);
GetAdUnitAsync(string, CancellationToken)
API to retrieve an AdUnit object.
Declaration
public virtual Task<AdUnit> GetAdUnitAsync(string name, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Required. The resource name of the AdUnit.
Format: |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<AdUnit> | A Task containing the RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = await AdUnitServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "networks/[NETWORK_CODE]/adUnits/[AD_UNIT]";
// Make the request
AdUnit response = await adUnitServiceClient.GetAdUnitAsync(name);
ListAdUnitSizes(ListAdUnitSizesRequest, CallSettings)
API to retrieve a list of AdUnitSize objects.
Declaration
public virtual PagedEnumerable<ListAdUnitSizesResponse, AdUnitSize> ListAdUnitSizes(ListAdUnitSizesRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ListAdUnitSizesRequest | 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<ListAdUnitSizesResponse, AdUnitSize> | A pageable sequence of AdUnitSize resources. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.Create();
// Initialize request argument(s)
ListAdUnitSizesRequest request = new ListAdUnitSizesRequest
{
ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
Filter = "",
OrderBy = "",
Skip = 0,
};
// Make the request
PagedEnumerable<ListAdUnitSizesResponse, AdUnitSize> response = adUnitServiceClient.ListAdUnitSizes(request);
// Iterate over all response items, lazily performing RPCs as required
foreach (AdUnitSize 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 (ListAdUnitSizesResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (AdUnitSize 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<AdUnitSize> 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 (AdUnitSize 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;
ListAdUnitSizes(NetworkName, string, int?, CallSettings)
API to retrieve a list of AdUnitSize objects.
Declaration
public virtual PagedEnumerable<ListAdUnitSizesResponse, AdUnitSize> ListAdUnitSizes(NetworkName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| NetworkName | parent | Required. The parent, which owns this collection of AdUnitSizes.
Format: |
| 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<ListAdUnitSizesResponse, AdUnitSize> | A pageable sequence of AdUnitSize resources. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.Create();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
// Make the request
PagedEnumerable<ListAdUnitSizesResponse, AdUnitSize> response = adUnitServiceClient.ListAdUnitSizes(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (AdUnitSize 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 (ListAdUnitSizesResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (AdUnitSize 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<AdUnitSize> 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 (AdUnitSize 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;
ListAdUnitSizes(string, string, int?, CallSettings)
API to retrieve a list of AdUnitSize objects.
Declaration
public virtual PagedEnumerable<ListAdUnitSizesResponse, AdUnitSize> ListAdUnitSizes(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 AdUnitSizes.
Format: |
| 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<ListAdUnitSizesResponse, AdUnitSize> | A pageable sequence of AdUnitSize resources. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.Create();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
// Make the request
PagedEnumerable<ListAdUnitSizesResponse, AdUnitSize> response = adUnitServiceClient.ListAdUnitSizes(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (AdUnitSize 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 (ListAdUnitSizesResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (AdUnitSize 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<AdUnitSize> 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 (AdUnitSize 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;
ListAdUnitSizesAsync(ListAdUnitSizesRequest, CallSettings)
API to retrieve a list of AdUnitSize objects.
Declaration
public virtual PagedAsyncEnumerable<ListAdUnitSizesResponse, AdUnitSize> ListAdUnitSizesAsync(ListAdUnitSizesRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ListAdUnitSizesRequest | 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<ListAdUnitSizesResponse, AdUnitSize> | A pageable asynchronous sequence of AdUnitSize resources. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = await AdUnitServiceClient.CreateAsync();
// Initialize request argument(s)
ListAdUnitSizesRequest request = new ListAdUnitSizesRequest
{
ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
Filter = "",
OrderBy = "",
Skip = 0,
};
// Make the request
PagedAsyncEnumerable<ListAdUnitSizesResponse, AdUnitSize> response = adUnitServiceClient.ListAdUnitSizesAsync(request);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((AdUnitSize 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((ListAdUnitSizesResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (AdUnitSize 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<AdUnitSize> 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 (AdUnitSize 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;
ListAdUnitSizesAsync(NetworkName, string, int?, CallSettings)
API to retrieve a list of AdUnitSize objects.
Declaration
public virtual PagedAsyncEnumerable<ListAdUnitSizesResponse, AdUnitSize> ListAdUnitSizesAsync(NetworkName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| NetworkName | parent | Required. The parent, which owns this collection of AdUnitSizes.
Format: |
| 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<ListAdUnitSizesResponse, AdUnitSize> | A pageable asynchronous sequence of AdUnitSize resources. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = await AdUnitServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
// Make the request
PagedAsyncEnumerable<ListAdUnitSizesResponse, AdUnitSize> response = adUnitServiceClient.ListAdUnitSizesAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((AdUnitSize 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((ListAdUnitSizesResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (AdUnitSize 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<AdUnitSize> 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 (AdUnitSize 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;
ListAdUnitSizesAsync(string, string, int?, CallSettings)
API to retrieve a list of AdUnitSize objects.
Declaration
public virtual PagedAsyncEnumerable<ListAdUnitSizesResponse, AdUnitSize> ListAdUnitSizesAsync(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 AdUnitSizes.
Format: |
| 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<ListAdUnitSizesResponse, AdUnitSize> | A pageable asynchronous sequence of AdUnitSize resources. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = await AdUnitServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
// Make the request
PagedAsyncEnumerable<ListAdUnitSizesResponse, AdUnitSize> response = adUnitServiceClient.ListAdUnitSizesAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((AdUnitSize 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((ListAdUnitSizesResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (AdUnitSize 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<AdUnitSize> 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 (AdUnitSize 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;
ListAdUnits(ListAdUnitsRequest, CallSettings)
API to retrieve a list of AdUnit objects.
Declaration
public virtual PagedEnumerable<ListAdUnitsResponse, AdUnit> ListAdUnits(ListAdUnitsRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ListAdUnitsRequest | 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<ListAdUnitsResponse, AdUnit> | A pageable sequence of AdUnit resources. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.Create();
// Initialize request argument(s)
ListAdUnitsRequest request = new ListAdUnitsRequest
{
ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
Filter = "",
OrderBy = "",
Skip = 0,
};
// Make the request
PagedEnumerable<ListAdUnitsResponse, AdUnit> response = adUnitServiceClient.ListAdUnits(request);
// Iterate over all response items, lazily performing RPCs as required
foreach (AdUnit 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 (ListAdUnitsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (AdUnit 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<AdUnit> 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 (AdUnit 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;
ListAdUnits(NetworkName, string, int?, CallSettings)
API to retrieve a list of AdUnit objects.
Declaration
public virtual PagedEnumerable<ListAdUnitsResponse, AdUnit> ListAdUnits(NetworkName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| NetworkName | parent | Required. The parent, which owns this collection of AdUnits.
Format: |
| 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<ListAdUnitsResponse, AdUnit> | A pageable sequence of AdUnit resources. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.Create();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
// Make the request
PagedEnumerable<ListAdUnitsResponse, AdUnit> response = adUnitServiceClient.ListAdUnits(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (AdUnit 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 (ListAdUnitsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (AdUnit 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<AdUnit> 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 (AdUnit 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;
ListAdUnits(string, string, int?, CallSettings)
API to retrieve a list of AdUnit objects.
Declaration
public virtual PagedEnumerable<ListAdUnitsResponse, AdUnit> ListAdUnits(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 AdUnits.
Format: |
| 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<ListAdUnitsResponse, AdUnit> | A pageable sequence of AdUnit resources. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.Create();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
// Make the request
PagedEnumerable<ListAdUnitsResponse, AdUnit> response = adUnitServiceClient.ListAdUnits(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (AdUnit 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 (ListAdUnitsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (AdUnit 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<AdUnit> 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 (AdUnit 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;
ListAdUnitsAsync(ListAdUnitsRequest, CallSettings)
API to retrieve a list of AdUnit objects.
Declaration
public virtual PagedAsyncEnumerable<ListAdUnitsResponse, AdUnit> ListAdUnitsAsync(ListAdUnitsRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ListAdUnitsRequest | 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<ListAdUnitsResponse, AdUnit> | A pageable asynchronous sequence of AdUnit resources. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = await AdUnitServiceClient.CreateAsync();
// Initialize request argument(s)
ListAdUnitsRequest request = new ListAdUnitsRequest
{
ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
Filter = "",
OrderBy = "",
Skip = 0,
};
// Make the request
PagedAsyncEnumerable<ListAdUnitsResponse, AdUnit> response = adUnitServiceClient.ListAdUnitsAsync(request);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((AdUnit 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((ListAdUnitsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (AdUnit 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<AdUnit> 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 (AdUnit 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;
ListAdUnitsAsync(NetworkName, string, int?, CallSettings)
API to retrieve a list of AdUnit objects.
Declaration
public virtual PagedAsyncEnumerable<ListAdUnitsResponse, AdUnit> ListAdUnitsAsync(NetworkName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| NetworkName | parent | Required. The parent, which owns this collection of AdUnits.
Format: |
| 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<ListAdUnitsResponse, AdUnit> | A pageable asynchronous sequence of AdUnit resources. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = await AdUnitServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
// Make the request
PagedAsyncEnumerable<ListAdUnitsResponse, AdUnit> response = adUnitServiceClient.ListAdUnitsAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((AdUnit 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((ListAdUnitsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (AdUnit 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<AdUnit> 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 (AdUnit 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;
ListAdUnitsAsync(string, string, int?, CallSettings)
API to retrieve a list of AdUnit objects.
Declaration
public virtual PagedAsyncEnumerable<ListAdUnitsResponse, AdUnit> ListAdUnitsAsync(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 AdUnits.
Format: |
| 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<ListAdUnitsResponse, AdUnit> | A pageable asynchronous sequence of AdUnit resources. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = await AdUnitServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
// Make the request
PagedAsyncEnumerable<ListAdUnitsResponse, AdUnit> response = adUnitServiceClient.ListAdUnitsAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((AdUnit 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((ListAdUnitsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (AdUnit 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<AdUnit> 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 (AdUnit 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.
UpdateAdUnit(AdUnit, FieldMask, CallSettings)
API to update an AdUnit object.
Declaration
public virtual AdUnit UpdateAdUnit(AdUnit adUnit, FieldMask updateMask, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| AdUnit | adUnit | 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 |
|---|---|
| AdUnit | The RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.Create();
// Initialize request argument(s)
AdUnit adUnit = new AdUnit();
FieldMask updateMask = new FieldMask();
// Make the request
AdUnit response = adUnitServiceClient.UpdateAdUnit(adUnit, updateMask);
UpdateAdUnit(UpdateAdUnitRequest, CallSettings)
API to update an AdUnit object.
Declaration
public virtual AdUnit UpdateAdUnit(UpdateAdUnitRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| UpdateAdUnitRequest | 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 |
|---|---|
| AdUnit | The RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.Create();
// Initialize request argument(s)
UpdateAdUnitRequest request = new UpdateAdUnitRequest
{
AdUnit = new AdUnit(),
UpdateMask = new FieldMask(),
};
// Make the request
AdUnit response = adUnitServiceClient.UpdateAdUnit(request);
UpdateAdUnitAsync(AdUnit, FieldMask, CallSettings)
API to update an AdUnit object.
Declaration
public virtual Task<AdUnit> UpdateAdUnitAsync(AdUnit adUnit, FieldMask updateMask, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| AdUnit | adUnit | 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<AdUnit> | A Task containing the RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = await AdUnitServiceClient.CreateAsync();
// Initialize request argument(s)
AdUnit adUnit = new AdUnit();
FieldMask updateMask = new FieldMask();
// Make the request
AdUnit response = await adUnitServiceClient.UpdateAdUnitAsync(adUnit, updateMask);
UpdateAdUnitAsync(AdUnit, FieldMask, CancellationToken)
API to update an AdUnit object.
Declaration
public virtual Task<AdUnit> UpdateAdUnitAsync(AdUnit adUnit, FieldMask updateMask, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| AdUnit | adUnit | 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<AdUnit> | A Task containing the RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = await AdUnitServiceClient.CreateAsync();
// Initialize request argument(s)
AdUnit adUnit = new AdUnit();
FieldMask updateMask = new FieldMask();
// Make the request
AdUnit response = await adUnitServiceClient.UpdateAdUnitAsync(adUnit, updateMask);
UpdateAdUnitAsync(UpdateAdUnitRequest, CallSettings)
API to update an AdUnit object.
Declaration
public virtual Task<AdUnit> UpdateAdUnitAsync(UpdateAdUnitRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| UpdateAdUnitRequest | 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<AdUnit> | A Task containing the RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = await AdUnitServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateAdUnitRequest request = new UpdateAdUnitRequest
{
AdUnit = new AdUnit(),
UpdateMask = new FieldMask(),
};
// Make the request
AdUnit response = await adUnitServiceClient.UpdateAdUnitAsync(request);
UpdateAdUnitAsync(UpdateAdUnitRequest, CancellationToken)
API to update an AdUnit object.
Declaration
public virtual Task<AdUnit> UpdateAdUnitAsync(UpdateAdUnitRequest request, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| UpdateAdUnitRequest | 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<AdUnit> | A Task containing the RPC response. |
Sample code
// Create client
AdUnitServiceClient adUnitServiceClient = await AdUnitServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateAdUnitRequest request = new UpdateAdUnitRequest
{
AdUnit = new AdUnit(),
UpdateMask = new FieldMask(),
};
// Make the request
AdUnit response = await adUnitServiceClient.UpdateAdUnitAsync(request);