# Service Control v1 API - Class ServiceControllerClientImpl (2.5.0)

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

- [2.5.0 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/latest/Google.Cloud.ServiceControl.V1.ServiceControllerClientImpl)
- [2.4.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/2.4.0/Google.Cloud.ServiceControl.V1.ServiceControllerClientImpl)
- [2.3.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/2.3.0/Google.Cloud.ServiceControl.V1.ServiceControllerClientImpl)
- [2.2.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/2.2.0/Google.Cloud.ServiceControl.V1.ServiceControllerClientImpl)
- [2.1.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/2.1.0/Google.Cloud.ServiceControl.V1.ServiceControllerClientImpl)
- [2.0.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/2.0.0/Google.Cloud.ServiceControl.V1.ServiceControllerClientImpl)
- [1.4.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/1.4.0/Google.Cloud.ServiceControl.V1.ServiceControllerClientImpl)
- [1.3.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/1.3.0/Google.Cloud.ServiceControl.V1.ServiceControllerClientImpl)
- [1.2.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/1.2.0/Google.Cloud.ServiceControl.V1.ServiceControllerClientImpl)
- [1.1.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/1.1.0/Google.Cloud.ServiceControl.V1.ServiceControllerClientImpl)
- [1.0.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/1.0.0/Google.Cloud.ServiceControl.V1.ServiceControllerClientImpl)

    public sealed class ServiceControllerClientImpl : ServiceControllerClient

Reference documentation and code samples for the Service Control v1 API class ServiceControllerClientImpl.

ServiceController client wrapper implementation, for convenient use.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> [ServiceControllerClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/latest/Google.Cloud.ServiceControl.V1.ServiceControllerClient) \> ServiceControllerClientImpl

## Inherited Members

[ServiceControllerClient.DefaultEndpoint](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/latest/Google.Cloud.ServiceControl.V1.ServiceControllerClient#Google_Cloud_ServiceControl_V1_ServiceControllerClient_DefaultEndpoint) [ServiceControllerClient.DefaultScopes](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/latest/Google.Cloud.ServiceControl.V1.ServiceControllerClient#Google_Cloud_ServiceControl_V1_ServiceControllerClient_DefaultScopes) [ServiceControllerClient.ServiceMetadata](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/latest/Google.Cloud.ServiceControl.V1.ServiceControllerClient#Google_Cloud_ServiceControl_V1_ServiceControllerClient_ServiceMetadata) [ServiceControllerClient.CreateAsync(CancellationToken)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/latest/Google.Cloud.ServiceControl.V1.ServiceControllerClient#Google_Cloud_ServiceControl_V1_ServiceControllerClient_CreateAsync_System_Threading_CancellationToken_) [ServiceControllerClient.Create()](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/latest/Google.Cloud.ServiceControl.V1.ServiceControllerClient#Google_Cloud_ServiceControl_V1_ServiceControllerClient_Create) [ServiceControllerClient.ShutdownDefaultChannelsAsync()](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/latest/Google.Cloud.ServiceControl.V1.ServiceControllerClient#Google_Cloud_ServiceControl_V1_ServiceControllerClient_ShutdownDefaultChannelsAsync) [ServiceControllerClient.CheckAsync(CheckRequest, CancellationToken)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/latest/Google.Cloud.ServiceControl.V1.ServiceControllerClient#Google_Cloud_ServiceControl_V1_ServiceControllerClient_CheckAsync_Google_Cloud_ServiceControl_V1_CheckRequest_System_Threading_CancellationToken_) [ServiceControllerClient.ReportAsync(ReportRequest, CancellationToken)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/latest/Google.Cloud.ServiceControl.V1.ServiceControllerClient#Google_Cloud_ServiceControl_V1_ServiceControllerClient_ReportAsync_Google_Cloud_ServiceControl_V1_ReportRequest_System_Threading_CancellationToken_) [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

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

## Assembly

Google.Cloud.ServiceControl.V1.dll

## Remarks

[Google Service Control API](https://docs.cloud.google.com/service-control/overview)

Lets clients check and report operations against a [managed
service](https://cloud.google.com/service-management/reference/rpc/google.api/servicemanagement.v1#google.api.servicemanagement.v1.ManagedService).

## Constructors

### ServiceControllerClientImpl(ServiceControllerClient, ServiceControllerSettings, ILogger)

    public ServiceControllerClientImpl(ServiceController.ServiceControllerClient grpcClient, ServiceControllerSettings settings, ILogger logger)

Constructs a client wrapper for the ServiceController service, with the specified gRPC client and settings.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `grpcClient` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/latest/Google.Cloud.ServiceControl.V1.ServiceControllerhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/latest/Google.Cloud.ServiceControl.V1.ServiceController.ServiceControllerClient` The underlying gRPC client. |
| `settings` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/latest/Google.Cloud.ServiceControl.V1.ServiceControllerSettings` The base [ServiceControllerSettings](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/latest/Google.Cloud.ServiceControl.V1.ServiceControllerSettings) used within this client. |
| `logger` | `https://learn.microsoft.com/dotnet/api/microsoft.extensions.logging.ilogger` Optional [ILogger](https://learn.microsoft.com/dotnet/api/microsoft.extensions.logging.ilogger) to use within this client. |

## Properties

### GrpcClient

    public override ServiceController.ServiceControllerClient GrpcClient { get; }

The underlying gRPC ServiceController client

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/latest/Google.Cloud.ServiceControl.V1.ServiceControllerhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/latest/Google.Cloud.ServiceControl.V1.ServiceController.ServiceControllerClient` |   |

**Overrides** [ServiceControllerClient.GrpcClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/latest/Google.Cloud.ServiceControl.V1.ServiceControllerClient#Google_Cloud_ServiceControl_V1_ServiceControllerClient_GrpcClient)

## Methods

### Check(CheckRequest, CallSettings)

    public override CheckResponse Check(CheckRequest request, CallSettings callSettings = null)

Checks whether an operation on a service should be allowed to proceed
based on the configuration of the service and related policies. It must be
called before the operation is executed.

If feasible, the client should cache the check results and reuse them for
60 seconds. In case of any server errors, the client should rely on the
cached results for much longer time to avoid outage.
WARNING: There is general 60s delay for the configuration and policy
propagation, therefore callers MUST NOT depend on the `Check` method having
the latest policy information.

NOTE: the \[CheckRequest\]\[google.api.servicecontrol.v1.CheckRequest\] has
the size limit (wire-format byte size) of 1MB.

This method requires the `servicemanagement.services.check` permission
on the specified service. For more information, see
[Cloud IAM](https://cloud.google.com/iam).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/latest/Google.Cloud.ServiceControl.V1.CheckRequest` 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.ServiceControl.V1/latest/Google.Cloud.ServiceControl.V1.CheckResponse` | The RPC response. |

**Overrides** [ServiceControllerClient.Check(CheckRequest, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/latest/Google.Cloud.ServiceControl.V1.ServiceControllerClient#Google_Cloud_ServiceControl_V1_ServiceControllerClient_Check_Google_Cloud_ServiceControl_V1_CheckRequest_Google_Api_Gax_Grpc_CallSettings_)

### CheckAsync(CheckRequest, CallSettings)

    public override Task<CheckResponse> CheckAsync(CheckRequest request, CallSettings callSettings = null)

Checks whether an operation on a service should be allowed to proceed
based on the configuration of the service and related policies. It must be
called before the operation is executed.

If feasible, the client should cache the check results and reuse them for
60 seconds. In case of any server errors, the client should rely on the
cached results for much longer time to avoid outage.
WARNING: There is general 60s delay for the configuration and policy
propagation, therefore callers MUST NOT depend on the `Check` method having
the latest policy information.

NOTE: the \[CheckRequest\]\[google.api.servicecontrol.v1.CheckRequest\] has
the size limit (wire-format byte size) of 1MB.

This method requires the `servicemanagement.services.check` permission
on the specified service. For more information, see
[Cloud IAM](https://cloud.google.com/iam).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/latest/Google.Cloud.ServiceControl.V1.CheckRequest` 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.ServiceControl.V1/latest/Google.Cloud.ServiceControl.V1.CheckResponse` | A Task containing the RPC response. |

**Overrides** [ServiceControllerClient.CheckAsync(CheckRequest, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/latest/Google.Cloud.ServiceControl.V1.ServiceControllerClient#Google_Cloud_ServiceControl_V1_ServiceControllerClient_CheckAsync_Google_Cloud_ServiceControl_V1_CheckRequest_Google_Api_Gax_Grpc_CallSettings_)

### Report(ReportRequest, CallSettings)

    public override ReportResponse Report(ReportRequest request, CallSettings callSettings = null)

Reports operation results to Google Service Control, such as logs and
metrics. It should be called after an operation is completed.

If feasible, the client should aggregate reporting data for up to 5
seconds to reduce API traffic. Limiting aggregation to 5 seconds is to
reduce data loss during client crashes. Clients should carefully choose
the aggregation time window to avoid data loss risk more than 0.01%
for business and compliance reasons.

NOTE: the \[ReportRequest\]\[google.api.servicecontrol.v1.ReportRequest\] has
the size limit (wire-format byte size) of 1MB.

This method requires the `servicemanagement.services.report` permission
on the specified service. For more information, see
[Google Cloud IAM](https://cloud.google.com/iam).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/latest/Google.Cloud.ServiceControl.V1.ReportRequest` 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.ServiceControl.V1/latest/Google.Cloud.ServiceControl.V1.ReportResponse` | The RPC response. |

**Overrides** [ServiceControllerClient.Report(ReportRequest, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/latest/Google.Cloud.ServiceControl.V1.ServiceControllerClient#Google_Cloud_ServiceControl_V1_ServiceControllerClient_Report_Google_Cloud_ServiceControl_V1_ReportRequest_Google_Api_Gax_Grpc_CallSettings_)

### ReportAsync(ReportRequest, CallSettings)

    public override Task<ReportResponse> ReportAsync(ReportRequest request, CallSettings callSettings = null)

Reports operation results to Google Service Control, such as logs and
metrics. It should be called after an operation is completed.

If feasible, the client should aggregate reporting data for up to 5
seconds to reduce API traffic. Limiting aggregation to 5 seconds is to
reduce data loss during client crashes. Clients should carefully choose
the aggregation time window to avoid data loss risk more than 0.01%
for business and compliance reasons.

NOTE: the \[ReportRequest\]\[google.api.servicecontrol.v1.ReportRequest\] has
the size limit (wire-format byte size) of 1MB.

This method requires the `servicemanagement.services.report` permission
on the specified service. For more information, see
[Google Cloud IAM](https://cloud.google.com/iam).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/latest/Google.Cloud.ServiceControl.V1.ReportRequest` 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.ServiceControl.V1/latest/Google.Cloud.ServiceControl.V1.ReportResponse` | A Task containing the RPC response. |

**Overrides** [ServiceControllerClient.ReportAsync(ReportRequest, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/latest/Google.Cloud.ServiceControl.V1.ServiceControllerClient#Google_Cloud_ServiceControl_V1_ServiceControllerClient_ReportAsync_Google_Cloud_ServiceControl_V1_ReportRequest_Google_Api_Gax_Grpc_CallSettings_)