# Cloud Controls Partner v1 API - Class CloudControlsPartnerMonitoringClient (1.3.0)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [1.3.0 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/latest/Google.Cloud.CloudControlsPartner.V1.CloudControlsPartnerMonitoringClient)
- [1.2.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/1.2.0/Google.Cloud.CloudControlsPartner.V1.CloudControlsPartnerMonitoringClient)
- [1.1.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/1.1.0/Google.Cloud.CloudControlsPartner.V1.CloudControlsPartnerMonitoringClient)
- [1.0.0-beta02](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/1.0.0-beta02/Google.Cloud.CloudControlsPartner.V1.CloudControlsPartnerMonitoringClient)

    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](https://learn.microsoft.com/dotnet/api/system.object) \> CloudControlsPartnerMonitoringClient

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Derived Types

[CloudControlsPartnerMonitoringClientImpl](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/latest/Google.Cloud.CloudControlsPartner.V1.CloudControlsPartnerMonitoringClientImpl)

## Namespace

[Google.Cloud.CloudControlsPartner.V1](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/latest/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** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### DefaultScopes

    public static IReadOnlyList<string> DefaultScopes { get; }

The default CloudControlsPartnerMonitoring scopes.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist-1https://learn.microsoft.com/dotnet/api/system.string` |   |

**Remarks** The default CloudControlsPartnerMonitoring scopes are:

- <https://www.googleapis.com/auth/cloud-platform>

<br />

### GrpcClient

    public virtual CloudControlsPartnerMonitoring.CloudControlsPartnerMonitoringClient GrpcClient { get; }

The underlying gRPC CloudControlsPartnerMonitoring client

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/latest/Google.Cloud.CloudControlsPartner.V1.CloudControlsPartnerMonitoringhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/latest/Google.Cloud.CloudControlsPartner.V1.CloudControlsPartnerMonitoring.CloudControlsPartnerMonitoringClient` |   |

### ServiceMetadata

    public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.ServiceMetadata.html` |   |

## Methods

### Create()

    public static CloudControlsPartnerMonitoringClient Create()

Synchronously creates a [CloudControlsPartnerMonitoringClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/latest/Google.Cloud.CloudControlsPartner.V1.CloudControlsPartnerMonitoringClient) using the default credentials,
endpoint and settings. To specify custom credentials or other settings, use
[CloudControlsPartnerMonitoringClientBuilder](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/latest/Google.Cloud.CloudControlsPartner.V1.CloudControlsPartnerMonitoringClientBuilder).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/latest/Google.Cloud.CloudControlsPartner.V1.CloudControlsPartnerMonitoringClient` | The created [CloudControlsPartnerMonitoringClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/latest/Google.Cloud.CloudControlsPartner.V1.CloudControlsPartnerMonitoringClient). |

### CreateAsync(CancellationToken)

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

Asynchronously creates a [CloudControlsPartnerMonitoringClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/latest/Google.Cloud.CloudControlsPartner.V1.CloudControlsPartnerMonitoringClient) using the default credentials,
endpoint and settings. To specify custom credentials or other settings, use
[CloudControlsPartnerMonitoringClientBuilder](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/latest/Google.Cloud.CloudControlsPartner.V1.CloudControlsPartnerMonitoringClientBuilder).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` The [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use while creating the client. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/latest/Google.Cloud.CloudControlsPartner.V1.CloudControlsPartnerMonitoringClient` | The task representing the created [CloudControlsPartnerMonitoringClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/latest/Google.Cloud.CloudControlsPartner.V1.CloudControlsPartnerMonitoringClient). |

### GetViolation(GetViolationRequest, CallSettings)

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

Gets details of a single Violation.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/latest/Google.Cloud.CloudControlsPartner.V1.GetViolationRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/latest/Google.Cloud.CloudControlsPartner.V1.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` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/latest/Google.Cloud.CloudControlsPartner.V1.ViolationName` Required. Format: `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}` |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/latest/Google.Cloud.CloudControlsPartner.V1.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` | `https://learn.microsoft.com/dotnet/api/system.string` Required. Format: `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}` |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/latest/Google.Cloud.CloudControlsPartner.V1.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` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/latest/Google.Cloud.CloudControlsPartner.V1.GetViolationRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/latest/Google.Cloud.CloudControlsPartner.V1.Violation` | 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` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/latest/Google.Cloud.CloudControlsPartner.V1.GetViolationRequest` The request object containing all of the parameters for the API call. |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` A [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use for this RPC. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/latest/Google.Cloud.CloudControlsPartner.V1.Violation` | 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` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/latest/Google.Cloud.CloudControlsPartner.V1.ViolationName` Required. Format: `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}` |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/latest/Google.Cloud.CloudControlsPartner.V1.Violation` | 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` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/latest/Google.Cloud.CloudControlsPartner.V1.ViolationName` Required. Format: `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}` |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` A [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use for this RPC. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/latest/Google.Cloud.CloudControlsPartner.V1.Violation` | 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` | `https://learn.microsoft.com/dotnet/api/system.string` Required. Format: `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}` |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/latest/Google.Cloud.CloudControlsPartner.V1.Violation` | 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` | `https://learn.microsoft.com/dotnet/api/system.string` Required. Format: `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}` |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` A [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use for this RPC. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/latest/Google.Cloud.CloudControlsPartner.V1.Violation` | 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](https://google.aip.dev/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` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/latest/Google.Cloud.CloudControlsPartner.V1.ListViolationsRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.PagedEnumerable-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/latest/Google.Cloud.CloudControlsPartner.V1.ListViolationsResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/latest/Google.Cloud.CloudControlsPartner.V1.Violation` | A pageable sequence of [Violation](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/latest/Google.Cloud.CloudControlsPartner.V1.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](https://google.aip.dev/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` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/latest/Google.Cloud.CloudControlsPartner.V1.WorkloadName` Required. Parent resource Format `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}` |
| `pageToken` | `https://learn.microsoft.com/dotnet/api/system.string` The token returned from the previous request. A value of `null` or an empty string retrieves the first page. |
| `pageSize` | `https://learn.microsoft.com/dotnet/api/system.int32` 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` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.PagedEnumerable-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/latest/Google.Cloud.CloudControlsPartner.V1.ListViolationsResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/latest/Google.Cloud.CloudControlsPartner.V1.Violation` | A pageable sequence of [Violation](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/latest/Google.Cloud.CloudControlsPartner.V1.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](https://google.aip.dev/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` | `https://learn.microsoft.com/dotnet/api/system.string` Required. Parent resource Format `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}` |
| `pageToken` | `https://learn.microsoft.com/dotnet/api/system.string` The token returned from the previous request. A value of `null` or an empty string retrieves the first page. |
| `pageSize` | `https://learn.microsoft.com/dotnet/api/system.int32` 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` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.PagedEnumerable-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/latest/Google.Cloud.CloudControlsPartner.V1.ListViolationsResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/latest/Google.Cloud.CloudControlsPartner.V1.Violation` | A pageable sequence of [Violation](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/latest/Google.Cloud.CloudControlsPartner.V1.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](https://google.aip.dev/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` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/latest/Google.Cloud.CloudControlsPartner.V1.ListViolationsRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.PagedAsyncEnumerable-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/latest/Google.Cloud.CloudControlsPartner.V1.ListViolationsResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/latest/Google.Cloud.CloudControlsPartner.V1.Violation` | A pageable asynchronous sequence of [Violation](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/latest/Google.Cloud.CloudControlsPartner.V1.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](https://google.aip.dev/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` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/latest/Google.Cloud.CloudControlsPartner.V1.WorkloadName` Required. Parent resource Format `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}` |
| `pageToken` | `https://learn.microsoft.com/dotnet/api/system.string` The token returned from the previous request. A value of `null` or an empty string retrieves the first page. |
| `pageSize` | `https://learn.microsoft.com/dotnet/api/system.int32` 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` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.PagedAsyncEnumerable-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/latest/Google.Cloud.CloudControlsPartner.V1.ListViolationsResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/latest/Google.Cloud.CloudControlsPartner.V1.Violation` | A pageable asynchronous sequence of [Violation](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/latest/Google.Cloud.CloudControlsPartner.V1.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](https://google.aip.dev/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` | `https://learn.microsoft.com/dotnet/api/system.string` Required. Parent resource Format `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}` |
| `pageToken` | `https://learn.microsoft.com/dotnet/api/system.string` The token returned from the previous request. A value of `null` or an empty string retrieves the first page. |
| `pageSize` | `https://learn.microsoft.com/dotnet/api/system.int32` 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` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.PagedAsyncEnumerable-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/latest/Google.Cloud.CloudControlsPartner.V1.ListViolationsResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/latest/Google.Cloud.CloudControlsPartner.V1.Violation` | A pageable asynchronous sequence of [Violation](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/latest/Google.Cloud.CloudControlsPartner.V1.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()](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/latest/Google.Cloud.CloudControlsPartner.V1.CloudControlsPartnerMonitoringClient#Google_Cloud_CloudControlsPartner_V1_CloudControlsPartnerMonitoringClient_Create) and
[CreateAsync(CancellationToken)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/latest/Google.Cloud.CloudControlsPartner.V1.CloudControlsPartnerMonitoringClient#Google_Cloud_CloudControlsPartner_V1_CloudControlsPartnerMonitoringClient_CreateAsync_System_Threading_CancellationToken_). Channels which weren't automatically created are not
affected.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task` | A task representing the asynchronous shutdown operation. |

**Remarks** After calling this method, further calls to [Create()](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/latest/Google.Cloud.CloudControlsPartner.V1.CloudControlsPartnerMonitoringClient#Google_Cloud_CloudControlsPartner_V1_CloudControlsPartnerMonitoringClient_Create) and
[CreateAsync(CancellationToken)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudControlsPartner.V1/latest/Google.Cloud.CloudControlsPartner.V1.CloudControlsPartnerMonitoringClient#Google_Cloud_CloudControlsPartner_V1_CloudControlsPartnerMonitoringClient_CreateAsync_System_Threading_CancellationToken_) will create new channels, which could in turn be shut down
by another call to this method.