Cloud Controls Partner v1 API - Class CloudControlsPartnerMonitoringClient (1.0.0-beta01)

public abstract class CloudControlsPartnerMonitoringClient

Reference documentation and code samples for the Cloud Controls Partner v1 API class CloudControlsPartnerMonitoringClient.

CloudControlsPartnerMonitoring client wrapper, for convenient use.

Inheritance

object > CloudControlsPartnerMonitoringClient

Namespace

Google.Cloud.CloudControlsPartner.V1

Assembly

Google.Cloud.CloudControlsPartner.V1.dll

Remarks

Service describing handlers for resources

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

The default endpoint for the CloudControlsPartnerMonitoring service, which is a host of "cloudcontrolspartner.googleapis.com" and a port of 443.

Property Value
Type Description
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default CloudControlsPartnerMonitoring scopes.

Property Value
Type Description
IReadOnlyListstring
Remarks

The default CloudControlsPartnerMonitoring scopes are:

GrpcClient

public virtual CloudControlsPartnerMonitoring.CloudControlsPartnerMonitoringClient GrpcClient { get; }

The underlying gRPC CloudControlsPartnerMonitoring client

Property Value
Type Description
CloudControlsPartnerMonitoringCloudControlsPartnerMonitoringClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
Type Description
ServiceMetadata

Methods

Create()

public static CloudControlsPartnerMonitoringClient Create()

Synchronously creates a CloudControlsPartnerMonitoringClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use CloudControlsPartnerMonitoringClientBuilder.

Returns
Type Description
CloudControlsPartnerMonitoringClient

The created CloudControlsPartnerMonitoringClient.

CreateAsync(CancellationToken)

public static Task<CloudControlsPartnerMonitoringClient> CreateAsync(CancellationToken cancellationToken = default)

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

Parameter
Name Description
cancellationToken CancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
TaskCloudControlsPartnerMonitoringClient

The task representing the created CloudControlsPartnerMonitoringClient.

GetViolation(GetViolationRequest, CallSettings)

public virtual Violation GetViolation(GetViolationRequest request, CallSettings callSettings = null)

Gets details of a single Violation.

Parameters
Name Description
request GetViolationRequest

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
Violation

The RPC response.

Example
// Create client
CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient = CloudControlsPartnerMonitoringClient.Create();
// Initialize request argument(s)
GetViolationRequest request = new GetViolationRequest
{
    ViolationName = ViolationName.FromOrganizationLocationCustomerWorkloadViolation("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]", "[VIOLATION]"),
};
// Make the request
Violation response = cloudControlsPartnerMonitoringClient.GetViolation(request);

GetViolation(ViolationName, CallSettings)

public virtual Violation GetViolation(ViolationName name, CallSettings callSettings = null)

Gets details of a single Violation.

Parameters
Name Description
name ViolationName

Required. Format: organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Violation

The RPC response.

Example
// Create client
CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient = CloudControlsPartnerMonitoringClient.Create();
// Initialize request argument(s)
ViolationName name = ViolationName.FromOrganizationLocationCustomerWorkloadViolation("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]", "[VIOLATION]");
// Make the request
Violation response = cloudControlsPartnerMonitoringClient.GetViolation(name);

GetViolation(string, CallSettings)

public virtual Violation GetViolation(string name, CallSettings callSettings = null)

Gets details of a single Violation.

Parameters
Name Description
name string

Required. Format: organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Violation

The RPC response.

Example
// Create client
CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient = CloudControlsPartnerMonitoringClient.Create();
// Initialize request argument(s)
string name = "organizations/[ORGANIZATION]/locations/[LOCATION]/customers/[CUSTOMER]/workloads/[WORKLOAD]/violations/[VIOLATION]";
// Make the request
Violation response = cloudControlsPartnerMonitoringClient.GetViolation(name);

GetViolationAsync(GetViolationRequest, CallSettings)

public virtual Task<Violation> GetViolationAsync(GetViolationRequest request, CallSettings callSettings = null)

Gets details of a single Violation.

Parameters
Name Description
request GetViolationRequest

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
TaskViolation

A Task containing the RPC response.

Example
// Create client
CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient = await CloudControlsPartnerMonitoringClient.CreateAsync();
// Initialize request argument(s)
GetViolationRequest request = new GetViolationRequest
{
    ViolationName = ViolationName.FromOrganizationLocationCustomerWorkloadViolation("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]", "[VIOLATION]"),
};
// Make the request
Violation response = await cloudControlsPartnerMonitoringClient.GetViolationAsync(request);

GetViolationAsync(GetViolationRequest, CancellationToken)

public virtual Task<Violation> GetViolationAsync(GetViolationRequest request, CancellationToken cancellationToken)

Gets details of a single Violation.

Parameters
Name Description
request GetViolationRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskViolation

A Task containing the RPC response.

Example
// Create client
CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient = await CloudControlsPartnerMonitoringClient.CreateAsync();
// Initialize request argument(s)
GetViolationRequest request = new GetViolationRequest
{
    ViolationName = ViolationName.FromOrganizationLocationCustomerWorkloadViolation("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]", "[VIOLATION]"),
};
// Make the request
Violation response = await cloudControlsPartnerMonitoringClient.GetViolationAsync(request);

GetViolationAsync(ViolationName, CallSettings)

public virtual Task<Violation> GetViolationAsync(ViolationName name, CallSettings callSettings = null)

Gets details of a single Violation.

Parameters
Name Description
name ViolationName

Required. Format: organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskViolation

A Task containing the RPC response.

Example
// Create client
CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient = await CloudControlsPartnerMonitoringClient.CreateAsync();
// Initialize request argument(s)
ViolationName name = ViolationName.FromOrganizationLocationCustomerWorkloadViolation("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]", "[VIOLATION]");
// Make the request
Violation response = await cloudControlsPartnerMonitoringClient.GetViolationAsync(name);

GetViolationAsync(ViolationName, CancellationToken)

public virtual Task<Violation> GetViolationAsync(ViolationName name, CancellationToken cancellationToken)

Gets details of a single Violation.

Parameters
Name Description
name ViolationName

Required. Format: organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskViolation

A Task containing the RPC response.

Example
// Create client
CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient = await CloudControlsPartnerMonitoringClient.CreateAsync();
// Initialize request argument(s)
ViolationName name = ViolationName.FromOrganizationLocationCustomerWorkloadViolation("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]", "[VIOLATION]");
// Make the request
Violation response = await cloudControlsPartnerMonitoringClient.GetViolationAsync(name);

GetViolationAsync(string, CallSettings)

public virtual Task<Violation> GetViolationAsync(string name, CallSettings callSettings = null)

Gets details of a single Violation.

Parameters
Name Description
name string

Required. Format: organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskViolation

A Task containing the RPC response.

Example
// Create client
CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient = await CloudControlsPartnerMonitoringClient.CreateAsync();
// Initialize request argument(s)
string name = "organizations/[ORGANIZATION]/locations/[LOCATION]/customers/[CUSTOMER]/workloads/[WORKLOAD]/violations/[VIOLATION]";
// Make the request
Violation response = await cloudControlsPartnerMonitoringClient.GetViolationAsync(name);

GetViolationAsync(string, CancellationToken)

public virtual Task<Violation> GetViolationAsync(string name, CancellationToken cancellationToken)

Gets details of a single Violation.

Parameters
Name Description
name string

Required. Format: organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskViolation

A Task containing the RPC response.

Example
// Create client
CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient = await CloudControlsPartnerMonitoringClient.CreateAsync();
// Initialize request argument(s)
string name = "organizations/[ORGANIZATION]/locations/[LOCATION]/customers/[CUSTOMER]/workloads/[WORKLOAD]/violations/[VIOLATION]";
// Make the request
Violation response = await cloudControlsPartnerMonitoringClient.GetViolationAsync(name);

ListViolations(ListViolationsRequest, CallSettings)

public virtual PagedEnumerable<ListViolationsResponse, Violation> ListViolations(ListViolationsRequest request, CallSettings callSettings = null)

Lists Violations for a workload Callers may also choose to read across multiple Customers or for a single customer as per AIP-159 by using '-' (the hyphen or dash character) as a wildcard character instead of {customer} & {workload}. Format: organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}

Parameters
Name Description
request ListViolationsRequest

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
PagedEnumerableListViolationsResponseViolation

A pageable sequence of Violation resources.

Example
// Create client
CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient = CloudControlsPartnerMonitoringClient.Create();
// Initialize request argument(s)
ListViolationsRequest request = new ListViolationsRequest
{
    ParentAsWorkloadName = WorkloadName.FromOrganizationLocationCustomerWorkload("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]"),
    Filter = "",
    OrderBy = "",
    Interval = new Interval(),
};
// Make the request
PagedEnumerable<ListViolationsResponse, Violation> response = cloudControlsPartnerMonitoringClient.ListViolations(request);

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

ListViolations(WorkloadName, string, int?, CallSettings)

public virtual PagedEnumerable<ListViolationsResponse, Violation> ListViolations(WorkloadName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists Violations for a workload Callers may also choose to read across multiple Customers or for a single customer as per AIP-159 by using '-' (the hyphen or dash character) as a wildcard character instead of {customer} & {workload}. Format: organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}

Parameters
Name Description
parent WorkloadName

Required. Parent resource Format organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}

pageToken string

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

pageSize int

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
PagedEnumerableListViolationsResponseViolation

A pageable sequence of Violation resources.

Example
// Create client
CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient = CloudControlsPartnerMonitoringClient.Create();
// Initialize request argument(s)
WorkloadName parent = WorkloadName.FromOrganizationLocationCustomerWorkload("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]");
// Make the request
PagedEnumerable<ListViolationsResponse, Violation> response = cloudControlsPartnerMonitoringClient.ListViolations(parent);

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

ListViolations(string, string, int?, CallSettings)

public virtual PagedEnumerable<ListViolationsResponse, Violation> ListViolations(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists Violations for a workload Callers may also choose to read across multiple Customers or for a single customer as per AIP-159 by using '-' (the hyphen or dash character) as a wildcard character instead of {customer} & {workload}. Format: organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}

Parameters
Name Description
parent string

Required. Parent resource Format organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}

pageToken string

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

pageSize int

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
PagedEnumerableListViolationsResponseViolation

A pageable sequence of Violation resources.

Example
// Create client
CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient = CloudControlsPartnerMonitoringClient.Create();
// Initialize request argument(s)
string parent = "organizations/[ORGANIZATION]/locations/[LOCATION]/customers/[CUSTOMER]/workloads/[WORKLOAD]";
// Make the request
PagedEnumerable<ListViolationsResponse, Violation> response = cloudControlsPartnerMonitoringClient.ListViolations(parent);

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

ListViolationsAsync(ListViolationsRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListViolationsResponse, Violation> ListViolationsAsync(ListViolationsRequest request, CallSettings callSettings = null)

Lists Violations for a workload Callers may also choose to read across multiple Customers or for a single customer as per AIP-159 by using '-' (the hyphen or dash character) as a wildcard character instead of {customer} & {workload}. Format: organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}

Parameters
Name Description
request ListViolationsRequest

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
PagedAsyncEnumerableListViolationsResponseViolation

A pageable asynchronous sequence of Violation resources.

Example
// Create client
CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient = await CloudControlsPartnerMonitoringClient.CreateAsync();
// Initialize request argument(s)
ListViolationsRequest request = new ListViolationsRequest
{
    ParentAsWorkloadName = WorkloadName.FromOrganizationLocationCustomerWorkload("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]"),
    Filter = "",
    OrderBy = "",
    Interval = new Interval(),
};
// Make the request
PagedAsyncEnumerable<ListViolationsResponse, Violation> response = cloudControlsPartnerMonitoringClient.ListViolationsAsync(request);

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

ListViolationsAsync(WorkloadName, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListViolationsResponse, Violation> ListViolationsAsync(WorkloadName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists Violations for a workload Callers may also choose to read across multiple Customers or for a single customer as per AIP-159 by using '-' (the hyphen or dash character) as a wildcard character instead of {customer} & {workload}. Format: organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}

Parameters
Name Description
parent WorkloadName

Required. Parent resource Format organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}

pageToken string

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

pageSize int

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
PagedAsyncEnumerableListViolationsResponseViolation

A pageable asynchronous sequence of Violation resources.

Example
// Create client
CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient = await CloudControlsPartnerMonitoringClient.CreateAsync();
// Initialize request argument(s)
WorkloadName parent = WorkloadName.FromOrganizationLocationCustomerWorkload("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]");
// Make the request
PagedAsyncEnumerable<ListViolationsResponse, Violation> response = cloudControlsPartnerMonitoringClient.ListViolationsAsync(parent);

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

ListViolationsAsync(string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListViolationsResponse, Violation> ListViolationsAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists Violations for a workload Callers may also choose to read across multiple Customers or for a single customer as per AIP-159 by using '-' (the hyphen or dash character) as a wildcard character instead of {customer} & {workload}. Format: organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}

Parameters
Name Description
parent string

Required. Parent resource Format organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}

pageToken string

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

pageSize int

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
PagedAsyncEnumerableListViolationsResponseViolation

A pageable asynchronous sequence of Violation resources.

Example
// Create client
CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient = await CloudControlsPartnerMonitoringClient.CreateAsync();
// Initialize request argument(s)
string parent = "organizations/[ORGANIZATION]/locations/[LOCATION]/customers/[CUSTOMER]/workloads/[WORKLOAD]";
// Make the request
PagedAsyncEnumerable<ListViolationsResponse, Violation> response = cloudControlsPartnerMonitoringClient.ListViolationsAsync(parent);

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

public static Task ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.

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.