Class RichMediaAdsCompanyServiceClient
RichMediaAdsCompanyService client wrapper, for convenient use.
Namespace: Google.Ads.AdManager.V1
Assembly: Google.Ads.AdManager.V1.dll
Syntax
public abstract class RichMediaAdsCompanyServiceClient
Remarks
Provides methods for handling RichMediaAdsCompany objects.
Properties
DefaultEndpoint
The default endpoint for the RichMediaAdsCompanyService 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 RichMediaAdsCompanyService scopes.
Declaration
public static IReadOnlyList<string> DefaultScopes { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<string> |
Remarks
The default RichMediaAdsCompanyService scopes are:
- https://www.googleapis.com/auth/admanager
- https://www.googleapis.com/auth/admanager.readonly
GrpcClient
The underlying gRPC RichMediaAdsCompanyService client
Declaration
public virtual RichMediaAdsCompanyService.RichMediaAdsCompanyServiceClient GrpcClient { get; }
Property Value
| Type | Description |
|---|---|
| RichMediaAdsCompanyService.RichMediaAdsCompanyServiceClient |
ServiceMetadata
The service metadata associated with this client type.
Declaration
public static ServiceMetadata ServiceMetadata { get; }
Property Value
| Type | Description |
|---|---|
| ServiceMetadata |
Methods
Create()
Synchronously creates a RichMediaAdsCompanyServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use RichMediaAdsCompanyServiceClientBuilder.
Declaration
public static RichMediaAdsCompanyServiceClient Create()
Returns
| Type | Description |
|---|---|
| RichMediaAdsCompanyServiceClient | The created RichMediaAdsCompanyServiceClient. |
CreateAsync(CancellationToken)
Asynchronously creates a RichMediaAdsCompanyServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use RichMediaAdsCompanyServiceClientBuilder.
Declaration
public static Task<RichMediaAdsCompanyServiceClient> CreateAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | The CancellationToken to use while creating the client. |
Returns
| Type | Description |
|---|---|
| Task<RichMediaAdsCompanyServiceClient> | The task representing the created RichMediaAdsCompanyServiceClient. |
GetRichMediaAdsCompany(GetRichMediaAdsCompanyRequest, CallSettings)
API to retrieve a RichMediaAdsCompany object.
Declaration
public virtual RichMediaAdsCompany GetRichMediaAdsCompany(GetRichMediaAdsCompanyRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| GetRichMediaAdsCompanyRequest | 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 |
|---|---|
| RichMediaAdsCompany | The RPC response. |
Sample code
// Create client
RichMediaAdsCompanyServiceClient richMediaAdsCompanyServiceClient = RichMediaAdsCompanyServiceClient.Create();
// Initialize request argument(s)
GetRichMediaAdsCompanyRequest request = new GetRichMediaAdsCompanyRequest
{
RichMediaAdsCompanyName = RichMediaAdsCompanyName.FromNetworkCodeRichMediaAdsCompany("[NETWORK_CODE]", "[RICH_MEDIA_ADS_COMPANY]"),
};
// Make the request
RichMediaAdsCompany response = richMediaAdsCompanyServiceClient.GetRichMediaAdsCompany(request);
GetRichMediaAdsCompany(RichMediaAdsCompanyName, CallSettings)
API to retrieve a RichMediaAdsCompany object.
Declaration
public virtual RichMediaAdsCompany GetRichMediaAdsCompany(RichMediaAdsCompanyName name, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| RichMediaAdsCompanyName | name | Required. The resource name of the RichMediaAdsCompany.
Format:
|
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| RichMediaAdsCompany | The RPC response. |
Sample code
// Create client
RichMediaAdsCompanyServiceClient richMediaAdsCompanyServiceClient = RichMediaAdsCompanyServiceClient.Create();
// Initialize request argument(s)
RichMediaAdsCompanyName name = RichMediaAdsCompanyName.FromNetworkCodeRichMediaAdsCompany("[NETWORK_CODE]", "[RICH_MEDIA_ADS_COMPANY]");
// Make the request
RichMediaAdsCompany response = richMediaAdsCompanyServiceClient.GetRichMediaAdsCompany(name);
GetRichMediaAdsCompany(string, CallSettings)
API to retrieve a RichMediaAdsCompany object.
Declaration
public virtual RichMediaAdsCompany GetRichMediaAdsCompany(string name, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Required. The resource name of the RichMediaAdsCompany.
Format:
|
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| RichMediaAdsCompany | The RPC response. |
Sample code
// Create client
RichMediaAdsCompanyServiceClient richMediaAdsCompanyServiceClient = RichMediaAdsCompanyServiceClient.Create();
// Initialize request argument(s)
string name = "networks/[NETWORK_CODE]/richMediaAdsCompanies/[RICH_MEDIA_ADS_COMPANY]";
// Make the request
RichMediaAdsCompany response = richMediaAdsCompanyServiceClient.GetRichMediaAdsCompany(name);
GetRichMediaAdsCompanyAsync(GetRichMediaAdsCompanyRequest, CallSettings)
API to retrieve a RichMediaAdsCompany object.
Declaration
public virtual Task<RichMediaAdsCompany> GetRichMediaAdsCompanyAsync(GetRichMediaAdsCompanyRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| GetRichMediaAdsCompanyRequest | 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<RichMediaAdsCompany> | A Task containing the RPC response. |
Sample code
// Create client
RichMediaAdsCompanyServiceClient richMediaAdsCompanyServiceClient = await RichMediaAdsCompanyServiceClient.CreateAsync();
// Initialize request argument(s)
GetRichMediaAdsCompanyRequest request = new GetRichMediaAdsCompanyRequest
{
RichMediaAdsCompanyName = RichMediaAdsCompanyName.FromNetworkCodeRichMediaAdsCompany("[NETWORK_CODE]", "[RICH_MEDIA_ADS_COMPANY]"),
};
// Make the request
RichMediaAdsCompany response = await richMediaAdsCompanyServiceClient.GetRichMediaAdsCompanyAsync(request);
GetRichMediaAdsCompanyAsync(GetRichMediaAdsCompanyRequest, CancellationToken)
API to retrieve a RichMediaAdsCompany object.
Declaration
public virtual Task<RichMediaAdsCompany> GetRichMediaAdsCompanyAsync(GetRichMediaAdsCompanyRequest request, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| GetRichMediaAdsCompanyRequest | 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<RichMediaAdsCompany> | A Task containing the RPC response. |
Sample code
// Create client
RichMediaAdsCompanyServiceClient richMediaAdsCompanyServiceClient = await RichMediaAdsCompanyServiceClient.CreateAsync();
// Initialize request argument(s)
GetRichMediaAdsCompanyRequest request = new GetRichMediaAdsCompanyRequest
{
RichMediaAdsCompanyName = RichMediaAdsCompanyName.FromNetworkCodeRichMediaAdsCompany("[NETWORK_CODE]", "[RICH_MEDIA_ADS_COMPANY]"),
};
// Make the request
RichMediaAdsCompany response = await richMediaAdsCompanyServiceClient.GetRichMediaAdsCompanyAsync(request);
GetRichMediaAdsCompanyAsync(RichMediaAdsCompanyName, CallSettings)
API to retrieve a RichMediaAdsCompany object.
Declaration
public virtual Task<RichMediaAdsCompany> GetRichMediaAdsCompanyAsync(RichMediaAdsCompanyName name, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| RichMediaAdsCompanyName | name | Required. The resource name of the RichMediaAdsCompany.
Format:
|
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<RichMediaAdsCompany> | A Task containing the RPC response. |
Sample code
// Create client
RichMediaAdsCompanyServiceClient richMediaAdsCompanyServiceClient = await RichMediaAdsCompanyServiceClient.CreateAsync();
// Initialize request argument(s)
RichMediaAdsCompanyName name = RichMediaAdsCompanyName.FromNetworkCodeRichMediaAdsCompany("[NETWORK_CODE]", "[RICH_MEDIA_ADS_COMPANY]");
// Make the request
RichMediaAdsCompany response = await richMediaAdsCompanyServiceClient.GetRichMediaAdsCompanyAsync(name);
GetRichMediaAdsCompanyAsync(RichMediaAdsCompanyName, CancellationToken)
API to retrieve a RichMediaAdsCompany object.
Declaration
public virtual Task<RichMediaAdsCompany> GetRichMediaAdsCompanyAsync(RichMediaAdsCompanyName name, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| RichMediaAdsCompanyName | name | Required. The resource name of the RichMediaAdsCompany.
Format:
|
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<RichMediaAdsCompany> | A Task containing the RPC response. |
Sample code
// Create client
RichMediaAdsCompanyServiceClient richMediaAdsCompanyServiceClient = await RichMediaAdsCompanyServiceClient.CreateAsync();
// Initialize request argument(s)
RichMediaAdsCompanyName name = RichMediaAdsCompanyName.FromNetworkCodeRichMediaAdsCompany("[NETWORK_CODE]", "[RICH_MEDIA_ADS_COMPANY]");
// Make the request
RichMediaAdsCompany response = await richMediaAdsCompanyServiceClient.GetRichMediaAdsCompanyAsync(name);
GetRichMediaAdsCompanyAsync(string, CallSettings)
API to retrieve a RichMediaAdsCompany object.
Declaration
public virtual Task<RichMediaAdsCompany> GetRichMediaAdsCompanyAsync(string name, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Required. The resource name of the RichMediaAdsCompany.
Format:
|
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<RichMediaAdsCompany> | A Task containing the RPC response. |
Sample code
// Create client
RichMediaAdsCompanyServiceClient richMediaAdsCompanyServiceClient = await RichMediaAdsCompanyServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "networks/[NETWORK_CODE]/richMediaAdsCompanies/[RICH_MEDIA_ADS_COMPANY]";
// Make the request
RichMediaAdsCompany response = await richMediaAdsCompanyServiceClient.GetRichMediaAdsCompanyAsync(name);
GetRichMediaAdsCompanyAsync(string, CancellationToken)
API to retrieve a RichMediaAdsCompany object.
Declaration
public virtual Task<RichMediaAdsCompany> GetRichMediaAdsCompanyAsync(string name, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Required. The resource name of the RichMediaAdsCompany.
Format:
|
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<RichMediaAdsCompany> | A Task containing the RPC response. |
Sample code
// Create client
RichMediaAdsCompanyServiceClient richMediaAdsCompanyServiceClient = await RichMediaAdsCompanyServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "networks/[NETWORK_CODE]/richMediaAdsCompanies/[RICH_MEDIA_ADS_COMPANY]";
// Make the request
RichMediaAdsCompany response = await richMediaAdsCompanyServiceClient.GetRichMediaAdsCompanyAsync(name);
ListRichMediaAdsCompanies(ListRichMediaAdsCompaniesRequest, CallSettings)
API to retrieve a list of RichMediaAdsCompany objects.
Declaration
public virtual PagedEnumerable<ListRichMediaAdsCompaniesResponse, RichMediaAdsCompany> ListRichMediaAdsCompanies(ListRichMediaAdsCompaniesRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ListRichMediaAdsCompaniesRequest | 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<ListRichMediaAdsCompaniesResponse, RichMediaAdsCompany> | A pageable sequence of RichMediaAdsCompany resources. |
Sample code
// Create client
RichMediaAdsCompanyServiceClient richMediaAdsCompanyServiceClient = RichMediaAdsCompanyServiceClient.Create();
// Initialize request argument(s)
ListRichMediaAdsCompaniesRequest request = new ListRichMediaAdsCompaniesRequest
{
ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
Filter = "",
OrderBy = "",
Skip = 0,
};
// Make the request
PagedEnumerable<ListRichMediaAdsCompaniesResponse, RichMediaAdsCompany> response = richMediaAdsCompanyServiceClient.ListRichMediaAdsCompanies(request);
// Iterate over all response items, lazily performing RPCs as required
foreach (RichMediaAdsCompany 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 (ListRichMediaAdsCompaniesResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (RichMediaAdsCompany 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<RichMediaAdsCompany> 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 (RichMediaAdsCompany 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;
ListRichMediaAdsCompanies(NetworkName, string, int?, CallSettings)
API to retrieve a list of RichMediaAdsCompany objects.
Declaration
public virtual PagedEnumerable<ListRichMediaAdsCompaniesResponse, RichMediaAdsCompany> ListRichMediaAdsCompanies(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 RichMediaAdsCompanies.
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<ListRichMediaAdsCompaniesResponse, RichMediaAdsCompany> | A pageable sequence of RichMediaAdsCompany resources. |
Sample code
// Create client
RichMediaAdsCompanyServiceClient richMediaAdsCompanyServiceClient = RichMediaAdsCompanyServiceClient.Create();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
// Make the request
PagedEnumerable<ListRichMediaAdsCompaniesResponse, RichMediaAdsCompany> response = richMediaAdsCompanyServiceClient.ListRichMediaAdsCompanies(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (RichMediaAdsCompany 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 (ListRichMediaAdsCompaniesResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (RichMediaAdsCompany 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<RichMediaAdsCompany> 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 (RichMediaAdsCompany 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;
ListRichMediaAdsCompanies(string, string, int?, CallSettings)
API to retrieve a list of RichMediaAdsCompany objects.
Declaration
public virtual PagedEnumerable<ListRichMediaAdsCompaniesResponse, RichMediaAdsCompany> ListRichMediaAdsCompanies(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 RichMediaAdsCompanies.
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<ListRichMediaAdsCompaniesResponse, RichMediaAdsCompany> | A pageable sequence of RichMediaAdsCompany resources. |
Sample code
// Create client
RichMediaAdsCompanyServiceClient richMediaAdsCompanyServiceClient = RichMediaAdsCompanyServiceClient.Create();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
// Make the request
PagedEnumerable<ListRichMediaAdsCompaniesResponse, RichMediaAdsCompany> response = richMediaAdsCompanyServiceClient.ListRichMediaAdsCompanies(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (RichMediaAdsCompany 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 (ListRichMediaAdsCompaniesResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (RichMediaAdsCompany 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<RichMediaAdsCompany> 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 (RichMediaAdsCompany 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;
ListRichMediaAdsCompaniesAsync(ListRichMediaAdsCompaniesRequest, CallSettings)
API to retrieve a list of RichMediaAdsCompany objects.
Declaration
public virtual PagedAsyncEnumerable<ListRichMediaAdsCompaniesResponse, RichMediaAdsCompany> ListRichMediaAdsCompaniesAsync(ListRichMediaAdsCompaniesRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ListRichMediaAdsCompaniesRequest | 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<ListRichMediaAdsCompaniesResponse, RichMediaAdsCompany> | A pageable asynchronous sequence of RichMediaAdsCompany resources. |
Sample code
// Create client
RichMediaAdsCompanyServiceClient richMediaAdsCompanyServiceClient = await RichMediaAdsCompanyServiceClient.CreateAsync();
// Initialize request argument(s)
ListRichMediaAdsCompaniesRequest request = new ListRichMediaAdsCompaniesRequest
{
ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
Filter = "",
OrderBy = "",
Skip = 0,
};
// Make the request
PagedAsyncEnumerable<ListRichMediaAdsCompaniesResponse, RichMediaAdsCompany> response = richMediaAdsCompanyServiceClient.ListRichMediaAdsCompaniesAsync(request);
// Iterate over all response items, lazily performing RPCs as required
await foreach (RichMediaAdsCompany item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (ListRichMediaAdsCompaniesResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (RichMediaAdsCompany 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<RichMediaAdsCompany> 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 (RichMediaAdsCompany 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;
ListRichMediaAdsCompaniesAsync(NetworkName, string, int?, CallSettings)
API to retrieve a list of RichMediaAdsCompany objects.
Declaration
public virtual PagedAsyncEnumerable<ListRichMediaAdsCompaniesResponse, RichMediaAdsCompany> ListRichMediaAdsCompaniesAsync(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 RichMediaAdsCompanies.
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<ListRichMediaAdsCompaniesResponse, RichMediaAdsCompany> | A pageable asynchronous sequence of RichMediaAdsCompany resources. |
Sample code
// Create client
RichMediaAdsCompanyServiceClient richMediaAdsCompanyServiceClient = await RichMediaAdsCompanyServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
// Make the request
PagedAsyncEnumerable<ListRichMediaAdsCompaniesResponse, RichMediaAdsCompany> response = richMediaAdsCompanyServiceClient.ListRichMediaAdsCompaniesAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await foreach (RichMediaAdsCompany item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (ListRichMediaAdsCompaniesResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (RichMediaAdsCompany 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<RichMediaAdsCompany> 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 (RichMediaAdsCompany 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;
ListRichMediaAdsCompaniesAsync(string, string, int?, CallSettings)
API to retrieve a list of RichMediaAdsCompany objects.
Declaration
public virtual PagedAsyncEnumerable<ListRichMediaAdsCompaniesResponse, RichMediaAdsCompany> ListRichMediaAdsCompaniesAsync(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 RichMediaAdsCompanies.
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<ListRichMediaAdsCompaniesResponse, RichMediaAdsCompany> | A pageable asynchronous sequence of RichMediaAdsCompany resources. |
Sample code
// Create client
RichMediaAdsCompanyServiceClient richMediaAdsCompanyServiceClient = await RichMediaAdsCompanyServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
// Make the request
PagedAsyncEnumerable<ListRichMediaAdsCompaniesResponse, RichMediaAdsCompany> response = richMediaAdsCompanyServiceClient.ListRichMediaAdsCompaniesAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await foreach (RichMediaAdsCompany item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (ListRichMediaAdsCompaniesResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (RichMediaAdsCompany 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<RichMediaAdsCompany> 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 (RichMediaAdsCompany 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.