Show / Hide Table of Contents

Class AudienceSegmentCategoryServiceClient

AudienceSegmentCategoryService client wrapper, for convenient use.

Inheritance
object
AudienceSegmentCategoryServiceClient
AudienceSegmentCategoryServiceClientImpl
Inherited Members
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ToString()
Namespace: Google.Ads.AdManager.V1
Assembly: Google.Ads.AdManager.V1.dll
Syntax
public abstract class AudienceSegmentCategoryServiceClient
Remarks

Provides methods for handling AudienceSegmentCategory objects.

Properties

DefaultEndpoint

The default endpoint for the AudienceSegmentCategoryService 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 AudienceSegmentCategoryService scopes.

Declaration
public static IReadOnlyList<string> DefaultScopes { get; }
Property Value
Type Description
IReadOnlyList<string>
Remarks

The default AudienceSegmentCategoryService scopes are:

  • https://www.googleapis.com/auth/admanager
  • https://www.googleapis.com/auth/admanager.readonly

GrpcClient

The underlying gRPC AudienceSegmentCategoryService client

Declaration
public virtual AudienceSegmentCategoryService.AudienceSegmentCategoryServiceClient GrpcClient { get; }
Property Value
Type Description
AudienceSegmentCategoryService.AudienceSegmentCategoryServiceClient

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 AudienceSegmentCategoryServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use AudienceSegmentCategoryServiceClientBuilder.

Declaration
public static AudienceSegmentCategoryServiceClient Create()
Returns
Type Description
AudienceSegmentCategoryServiceClient

The created AudienceSegmentCategoryServiceClient.

CreateAsync(CancellationToken)

Asynchronously creates a AudienceSegmentCategoryServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use AudienceSegmentCategoryServiceClientBuilder.

Declaration
public static Task<AudienceSegmentCategoryServiceClient> CreateAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
Task<AudienceSegmentCategoryServiceClient>

The task representing the created AudienceSegmentCategoryServiceClient.

GetAudienceSegmentCategory(AudienceSegmentCategoryName, CallSettings)

Retrieves a AudienceSegmentCategory object.

Declaration
public virtual AudienceSegmentCategory GetAudienceSegmentCategory(AudienceSegmentCategoryName name, CallSettings callSettings = null)
Parameters
Type Name Description
AudienceSegmentCategoryName name

Required. The resource name of the AudienceSegmentCategory. Format: networks/{network_code}/audienceSegmentCategories/{audience_segment_category_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
AudienceSegmentCategory

The RPC response.

Sample code
// Create client
AudienceSegmentCategoryServiceClient audienceSegmentCategoryServiceClient = AudienceSegmentCategoryServiceClient.Create();
// Initialize request argument(s)
AudienceSegmentCategoryName name = AudienceSegmentCategoryName.FromNetworkCodeAudienceSegmentCategory("[NETWORK_CODE]", "[AUDIENCE_SEGMENT_CATEGORY]");
// Make the request
AudienceSegmentCategory response = audienceSegmentCategoryServiceClient.GetAudienceSegmentCategory(name);

GetAudienceSegmentCategory(GetAudienceSegmentCategoryRequest, CallSettings)

Retrieves a AudienceSegmentCategory object.

Declaration
public virtual AudienceSegmentCategory GetAudienceSegmentCategory(GetAudienceSegmentCategoryRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
GetAudienceSegmentCategoryRequest 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
AudienceSegmentCategory

The RPC response.

Sample code
// Create client
AudienceSegmentCategoryServiceClient audienceSegmentCategoryServiceClient = AudienceSegmentCategoryServiceClient.Create();
// Initialize request argument(s)
GetAudienceSegmentCategoryRequest request = new GetAudienceSegmentCategoryRequest
{
    AudienceSegmentCategoryName = AudienceSegmentCategoryName.FromNetworkCodeAudienceSegmentCategory("[NETWORK_CODE]", "[AUDIENCE_SEGMENT_CATEGORY]"),
};
// Make the request
AudienceSegmentCategory response = audienceSegmentCategoryServiceClient.GetAudienceSegmentCategory(request);

GetAudienceSegmentCategory(string, CallSettings)

Retrieves a AudienceSegmentCategory object.

Declaration
public virtual AudienceSegmentCategory GetAudienceSegmentCategory(string name, CallSettings callSettings = null)
Parameters
Type Name Description
string name

Required. The resource name of the AudienceSegmentCategory. Format: networks/{network_code}/audienceSegmentCategories/{audience_segment_category_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
AudienceSegmentCategory

The RPC response.

Sample code
// Create client
AudienceSegmentCategoryServiceClient audienceSegmentCategoryServiceClient = AudienceSegmentCategoryServiceClient.Create();
// Initialize request argument(s)
string name = "networks/[NETWORK_CODE]/audienceSegmentCategories/[AUDIENCE_SEGMENT_CATEGORY]";
// Make the request
AudienceSegmentCategory response = audienceSegmentCategoryServiceClient.GetAudienceSegmentCategory(name);

GetAudienceSegmentCategoryAsync(AudienceSegmentCategoryName, CallSettings)

Retrieves a AudienceSegmentCategory object.

Declaration
public virtual Task<AudienceSegmentCategory> GetAudienceSegmentCategoryAsync(AudienceSegmentCategoryName name, CallSettings callSettings = null)
Parameters
Type Name Description
AudienceSegmentCategoryName name

Required. The resource name of the AudienceSegmentCategory. Format: networks/{network_code}/audienceSegmentCategories/{audience_segment_category_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<AudienceSegmentCategory>

A Task containing the RPC response.

Sample code
// Create client
AudienceSegmentCategoryServiceClient audienceSegmentCategoryServiceClient = await AudienceSegmentCategoryServiceClient.CreateAsync();
// Initialize request argument(s)
AudienceSegmentCategoryName name = AudienceSegmentCategoryName.FromNetworkCodeAudienceSegmentCategory("[NETWORK_CODE]", "[AUDIENCE_SEGMENT_CATEGORY]");
// Make the request
AudienceSegmentCategory response = await audienceSegmentCategoryServiceClient.GetAudienceSegmentCategoryAsync(name);

GetAudienceSegmentCategoryAsync(AudienceSegmentCategoryName, CancellationToken)

Retrieves a AudienceSegmentCategory object.

Declaration
public virtual Task<AudienceSegmentCategory> GetAudienceSegmentCategoryAsync(AudienceSegmentCategoryName name, CancellationToken cancellationToken)
Parameters
Type Name Description
AudienceSegmentCategoryName name

Required. The resource name of the AudienceSegmentCategory. Format: networks/{network_code}/audienceSegmentCategories/{audience_segment_category_id}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<AudienceSegmentCategory>

A Task containing the RPC response.

Sample code
// Create client
AudienceSegmentCategoryServiceClient audienceSegmentCategoryServiceClient = await AudienceSegmentCategoryServiceClient.CreateAsync();
// Initialize request argument(s)
AudienceSegmentCategoryName name = AudienceSegmentCategoryName.FromNetworkCodeAudienceSegmentCategory("[NETWORK_CODE]", "[AUDIENCE_SEGMENT_CATEGORY]");
// Make the request
AudienceSegmentCategory response = await audienceSegmentCategoryServiceClient.GetAudienceSegmentCategoryAsync(name);

GetAudienceSegmentCategoryAsync(GetAudienceSegmentCategoryRequest, CallSettings)

Retrieves a AudienceSegmentCategory object.

Declaration
public virtual Task<AudienceSegmentCategory> GetAudienceSegmentCategoryAsync(GetAudienceSegmentCategoryRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
GetAudienceSegmentCategoryRequest 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<AudienceSegmentCategory>

A Task containing the RPC response.

Sample code
// Create client
AudienceSegmentCategoryServiceClient audienceSegmentCategoryServiceClient = await AudienceSegmentCategoryServiceClient.CreateAsync();
// Initialize request argument(s)
GetAudienceSegmentCategoryRequest request = new GetAudienceSegmentCategoryRequest
{
    AudienceSegmentCategoryName = AudienceSegmentCategoryName.FromNetworkCodeAudienceSegmentCategory("[NETWORK_CODE]", "[AUDIENCE_SEGMENT_CATEGORY]"),
};
// Make the request
AudienceSegmentCategory response = await audienceSegmentCategoryServiceClient.GetAudienceSegmentCategoryAsync(request);

GetAudienceSegmentCategoryAsync(GetAudienceSegmentCategoryRequest, CancellationToken)

Retrieves a AudienceSegmentCategory object.

Declaration
public virtual Task<AudienceSegmentCategory> GetAudienceSegmentCategoryAsync(GetAudienceSegmentCategoryRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
GetAudienceSegmentCategoryRequest 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<AudienceSegmentCategory>

A Task containing the RPC response.

Sample code
// Create client
AudienceSegmentCategoryServiceClient audienceSegmentCategoryServiceClient = await AudienceSegmentCategoryServiceClient.CreateAsync();
// Initialize request argument(s)
GetAudienceSegmentCategoryRequest request = new GetAudienceSegmentCategoryRequest
{
    AudienceSegmentCategoryName = AudienceSegmentCategoryName.FromNetworkCodeAudienceSegmentCategory("[NETWORK_CODE]", "[AUDIENCE_SEGMENT_CATEGORY]"),
};
// Make the request
AudienceSegmentCategory response = await audienceSegmentCategoryServiceClient.GetAudienceSegmentCategoryAsync(request);

GetAudienceSegmentCategoryAsync(string, CallSettings)

Retrieves a AudienceSegmentCategory object.

Declaration
public virtual Task<AudienceSegmentCategory> GetAudienceSegmentCategoryAsync(string name, CallSettings callSettings = null)
Parameters
Type Name Description
string name

Required. The resource name of the AudienceSegmentCategory. Format: networks/{network_code}/audienceSegmentCategories/{audience_segment_category_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<AudienceSegmentCategory>

A Task containing the RPC response.

Sample code
// Create client
AudienceSegmentCategoryServiceClient audienceSegmentCategoryServiceClient = await AudienceSegmentCategoryServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "networks/[NETWORK_CODE]/audienceSegmentCategories/[AUDIENCE_SEGMENT_CATEGORY]";
// Make the request
AudienceSegmentCategory response = await audienceSegmentCategoryServiceClient.GetAudienceSegmentCategoryAsync(name);

GetAudienceSegmentCategoryAsync(string, CancellationToken)

Retrieves a AudienceSegmentCategory object.

Declaration
public virtual Task<AudienceSegmentCategory> GetAudienceSegmentCategoryAsync(string name, CancellationToken cancellationToken)
Parameters
Type Name Description
string name

Required. The resource name of the AudienceSegmentCategory. Format: networks/{network_code}/audienceSegmentCategories/{audience_segment_category_id}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<AudienceSegmentCategory>

A Task containing the RPC response.

Sample code
// Create client
AudienceSegmentCategoryServiceClient audienceSegmentCategoryServiceClient = await AudienceSegmentCategoryServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "networks/[NETWORK_CODE]/audienceSegmentCategories/[AUDIENCE_SEGMENT_CATEGORY]";
// Make the request
AudienceSegmentCategory response = await audienceSegmentCategoryServiceClient.GetAudienceSegmentCategoryAsync(name);

ListAudienceSegmentCategories(ListAudienceSegmentCategoriesRequest, CallSettings)

Lists AudienceSegmentCategory objects.

Declaration
public virtual PagedEnumerable<ListAudienceSegmentCategoriesResponse, AudienceSegmentCategory> ListAudienceSegmentCategories(ListAudienceSegmentCategoriesRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
ListAudienceSegmentCategoriesRequest 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<ListAudienceSegmentCategoriesResponse, AudienceSegmentCategory>

A pageable sequence of AudienceSegmentCategory resources.

Sample code
// Create client
AudienceSegmentCategoryServiceClient audienceSegmentCategoryServiceClient = AudienceSegmentCategoryServiceClient.Create();
// Initialize request argument(s)
ListAudienceSegmentCategoriesRequest request = new ListAudienceSegmentCategoriesRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Filter = "",
    OrderBy = "",
    Skip = 0,
};
// Make the request
PagedEnumerable<ListAudienceSegmentCategoriesResponse, AudienceSegmentCategory> response = audienceSegmentCategoryServiceClient.ListAudienceSegmentCategories(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (AudienceSegmentCategory 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 (ListAudienceSegmentCategoriesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (AudienceSegmentCategory 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<AudienceSegmentCategory> 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 (AudienceSegmentCategory 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;

ListAudienceSegmentCategories(NetworkName, string, int?, CallSettings)

Lists AudienceSegmentCategory objects.

Declaration
public virtual PagedEnumerable<ListAudienceSegmentCategoriesResponse, AudienceSegmentCategory> ListAudienceSegmentCategories(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 AudienceSegmentCategories. Format: networks/{network_code}

string pageToken

The token returned from the previous request. A value of null or an empty string retrieves the first page.

int? pageSize

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerable<ListAudienceSegmentCategoriesResponse, AudienceSegmentCategory>

A pageable sequence of AudienceSegmentCategory resources.

Sample code
// Create client
AudienceSegmentCategoryServiceClient audienceSegmentCategoryServiceClient = AudienceSegmentCategoryServiceClient.Create();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
// Make the request
PagedEnumerable<ListAudienceSegmentCategoriesResponse, AudienceSegmentCategory> response = audienceSegmentCategoryServiceClient.ListAudienceSegmentCategories(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (AudienceSegmentCategory 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 (ListAudienceSegmentCategoriesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (AudienceSegmentCategory 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<AudienceSegmentCategory> 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 (AudienceSegmentCategory 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;

ListAudienceSegmentCategories(string, string, int?, CallSettings)

Lists AudienceSegmentCategory objects.

Declaration
public virtual PagedEnumerable<ListAudienceSegmentCategoriesResponse, AudienceSegmentCategory> ListAudienceSegmentCategories(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 AudienceSegmentCategories. Format: networks/{network_code}

string pageToken

The token returned from the previous request. A value of null or an empty string retrieves the first page.

int? pageSize

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerable<ListAudienceSegmentCategoriesResponse, AudienceSegmentCategory>

A pageable sequence of AudienceSegmentCategory resources.

Sample code
// Create client
AudienceSegmentCategoryServiceClient audienceSegmentCategoryServiceClient = AudienceSegmentCategoryServiceClient.Create();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
// Make the request
PagedEnumerable<ListAudienceSegmentCategoriesResponse, AudienceSegmentCategory> response = audienceSegmentCategoryServiceClient.ListAudienceSegmentCategories(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (AudienceSegmentCategory 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 (ListAudienceSegmentCategoriesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (AudienceSegmentCategory 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<AudienceSegmentCategory> 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 (AudienceSegmentCategory 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;

ListAudienceSegmentCategoriesAsync(ListAudienceSegmentCategoriesRequest, CallSettings)

Lists AudienceSegmentCategory objects.

Declaration
public virtual PagedAsyncEnumerable<ListAudienceSegmentCategoriesResponse, AudienceSegmentCategory> ListAudienceSegmentCategoriesAsync(ListAudienceSegmentCategoriesRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
ListAudienceSegmentCategoriesRequest 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<ListAudienceSegmentCategoriesResponse, AudienceSegmentCategory>

A pageable asynchronous sequence of AudienceSegmentCategory resources.

Sample code
// Create client
AudienceSegmentCategoryServiceClient audienceSegmentCategoryServiceClient = await AudienceSegmentCategoryServiceClient.CreateAsync();
// Initialize request argument(s)
ListAudienceSegmentCategoriesRequest request = new ListAudienceSegmentCategoriesRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Filter = "",
    OrderBy = "",
    Skip = 0,
};
// Make the request
PagedAsyncEnumerable<ListAudienceSegmentCategoriesResponse, AudienceSegmentCategory> response = audienceSegmentCategoryServiceClient.ListAudienceSegmentCategoriesAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await foreach (AudienceSegmentCategory 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 (ListAudienceSegmentCategoriesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (AudienceSegmentCategory 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<AudienceSegmentCategory> 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 (AudienceSegmentCategory 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;

ListAudienceSegmentCategoriesAsync(NetworkName, string, int?, CallSettings)

Lists AudienceSegmentCategory objects.

Declaration
public virtual PagedAsyncEnumerable<ListAudienceSegmentCategoriesResponse, AudienceSegmentCategory> ListAudienceSegmentCategoriesAsync(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 AudienceSegmentCategories. Format: networks/{network_code}

string pageToken

The token returned from the previous request. A value of null or an empty string retrieves the first page.

int? pageSize

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerable<ListAudienceSegmentCategoriesResponse, AudienceSegmentCategory>

A pageable asynchronous sequence of AudienceSegmentCategory resources.

Sample code
// Create client
AudienceSegmentCategoryServiceClient audienceSegmentCategoryServiceClient = await AudienceSegmentCategoryServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
// Make the request
PagedAsyncEnumerable<ListAudienceSegmentCategoriesResponse, AudienceSegmentCategory> response = audienceSegmentCategoryServiceClient.ListAudienceSegmentCategoriesAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await foreach (AudienceSegmentCategory 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 (ListAudienceSegmentCategoriesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (AudienceSegmentCategory 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<AudienceSegmentCategory> 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 (AudienceSegmentCategory 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;

ListAudienceSegmentCategoriesAsync(string, string, int?, CallSettings)

Lists AudienceSegmentCategory objects.

Declaration
public virtual PagedAsyncEnumerable<ListAudienceSegmentCategoriesResponse, AudienceSegmentCategory> ListAudienceSegmentCategoriesAsync(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 AudienceSegmentCategories. Format: networks/{network_code}

string pageToken

The token returned from the previous request. A value of null or an empty string retrieves the first page.

int? pageSize

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerable<ListAudienceSegmentCategoriesResponse, AudienceSegmentCategory>

A pageable asynchronous sequence of AudienceSegmentCategory resources.

Sample code
// Create client
AudienceSegmentCategoryServiceClient audienceSegmentCategoryServiceClient = await AudienceSegmentCategoryServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
// Make the request
PagedAsyncEnumerable<ListAudienceSegmentCategoriesResponse, AudienceSegmentCategory> response = audienceSegmentCategoryServiceClient.ListAudienceSegmentCategoriesAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await foreach (AudienceSegmentCategory 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 (ListAudienceSegmentCategoriesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (AudienceSegmentCategory 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<AudienceSegmentCategory> 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 (AudienceSegmentCategory 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.

In this article
Back to top Generated by DocFX