# KMS Inventory v1 API - Class KeyTrackingService.KeyTrackingServiceClient (1.6.0)

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

- [1.6.0 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.Inventory.V1/latest/Google.Cloud.Kms.Inventory.V1.KeyTrackingService.KeyTrackingServiceClient)
- [1.5.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.Inventory.V1/1.5.0/Google.Cloud.Kms.Inventory.V1.KeyTrackingService.KeyTrackingServiceClient)
- [1.4.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.Inventory.V1/1.4.0/Google.Cloud.Kms.Inventory.V1.KeyTrackingService.KeyTrackingServiceClient)
- [1.3.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.Inventory.V1/1.3.0/Google.Cloud.Kms.Inventory.V1.KeyTrackingService.KeyTrackingServiceClient)
- [1.2.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.Inventory.V1/1.2.0/Google.Cloud.Kms.Inventory.V1.KeyTrackingService.KeyTrackingServiceClient)
- [1.1.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.Inventory.V1/1.1.0/Google.Cloud.Kms.Inventory.V1.KeyTrackingService.KeyTrackingServiceClient)
- [1.0.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.Inventory.V1/1.0.0/Google.Cloud.Kms.Inventory.V1.KeyTrackingService.KeyTrackingServiceClient)

    public class KeyTrackingService.KeyTrackingServiceClient : ClientBase<KeyTrackingService.KeyTrackingServiceClient>

Reference documentation and code samples for the KMS Inventory v1 API class KeyTrackingService.KeyTrackingServiceClient.

Client for KeyTrackingService

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> [ClientBase](https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ClientBase.html) \> [ClientBase](https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ClientBase-1.html)[KeyTrackingService](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.Inventory.V1/latest/Google.Cloud.Kms.Inventory.V1.KeyTrackingService)[KeyTrackingServiceClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.Inventory.V1/latest/Google.Cloud.Kms.Inventory.V1.KeyTrackingService.KeyTrackingServiceClient) \> KeyTrackingService.KeyTrackingServiceClient

## Inherited Members

[ClientBase\<KeyTrackingService.KeyTrackingServiceClient\>.WithHost(string)](https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ClientBase-1.html#Grpc_Core_ClientBase_1_WithHost_System_String_) [ClientBase.CallInvoker](https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ClientBase.html#Grpc_Core_ClientBase_CallInvoker) [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)

## Namespace

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

## Assembly

Google.Cloud.Kms.Inventory.V1.dll

## Constructors

### KeyTrackingServiceClient()

    protected KeyTrackingServiceClient()

Protected parameterless constructor to allow creation of test doubles.

### KeyTrackingServiceClient(CallInvoker)

    public KeyTrackingServiceClient(CallInvoker callInvoker)

Creates a new client for KeyTrackingService that uses a custom `CallInvoker`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `callInvoker` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.CallInvoker.html` The callInvoker to use to make remote calls. |

### KeyTrackingServiceClient(ChannelBase)

    public KeyTrackingServiceClient(ChannelBase channel)

Creates a new client for KeyTrackingService

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `channel` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ChannelBase.html` The channel to use to make remote calls. |

### KeyTrackingServiceClient(ClientBaseConfiguration)

    protected KeyTrackingServiceClient(ClientBase.ClientBaseConfiguration configuration)

Protected constructor to allow creation of configured clients.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `configuration` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ClientBase.htmlhttps://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ClientBase.ClientBaseConfiguration.html` The client configuration. |

## Methods

### GetProtectedResourcesSummary(GetProtectedResourcesSummaryRequest, CallOptions)

    public virtual ProtectedResourcesSummary GetProtectedResourcesSummary(GetProtectedResourcesSummaryRequest request, CallOptions options)

Returns aggregate information about the resources protected by the given
Cloud KMS \[CryptoKey\]\[google.cloud.kms.v1.CryptoKey\]. By default,
summary of resources within the same Cloud organization as the key will be
returned, which requires the KMS organization service account to be
configured(refer
<https://docs.cloud.google.com/kms/docs/view-key-usage#required-roles>).
If the KMS organization service account is not configured or key's project
is not part of an organization, set
\[fallback_scope\]\[google.cloud.kms.inventory.v1.GetProtectedResourcesSummaryRequest.fallback_scope\]
to `FALLBACK_SCOPE_PROJECT` to retrieve a summary of protected resources
within the key's project.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.Inventory.V1/latest/Google.Cloud.Kms.Inventory.V1.GetProtectedResourcesSummaryRequest` The request to send to the server. |
| `options` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.CallOptions.html` The options for the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.Inventory.V1/latest/Google.Cloud.Kms.Inventory.V1.ProtectedResourcesSummary` | The response received from the server. |

### GetProtectedResourcesSummary(GetProtectedResourcesSummaryRequest, Metadata, DateTime?, CancellationToken)

    public virtual ProtectedResourcesSummary GetProtectedResourcesSummary(GetProtectedResourcesSummaryRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Returns aggregate information about the resources protected by the given
Cloud KMS \[CryptoKey\]\[google.cloud.kms.v1.CryptoKey\]. By default,
summary of resources within the same Cloud organization as the key will be
returned, which requires the KMS organization service account to be
configured(refer
<https://docs.cloud.google.com/kms/docs/view-key-usage#required-roles>).
If the KMS organization service account is not configured or key's project
is not part of an organization, set
\[fallback_scope\]\[google.cloud.kms.inventory.v1.GetProtectedResourcesSummaryRequest.fallback_scope\]
to `FALLBACK_SCOPE_PROJECT` to retrieve a summary of protected resources
within the key's project.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.Inventory.V1/latest/Google.Cloud.Kms.Inventory.V1.GetProtectedResourcesSummaryRequest` The request to send to the server. |
| `headers` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.Metadata.html` The initial metadata to send with the call. This parameter is optional. |
| `deadline` | `System.DateTime` An optional deadline for the call. The call will be cancelled if deadline is hit. |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` An optional token for canceling the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.Inventory.V1/latest/Google.Cloud.Kms.Inventory.V1.ProtectedResourcesSummary` | The response received from the server. |

### GetProtectedResourcesSummaryAsync(GetProtectedResourcesSummaryRequest, CallOptions)

    public virtual AsyncUnaryCall<ProtectedResourcesSummary> GetProtectedResourcesSummaryAsync(GetProtectedResourcesSummaryRequest request, CallOptions options)

Returns aggregate information about the resources protected by the given
Cloud KMS \[CryptoKey\]\[google.cloud.kms.v1.CryptoKey\]. By default,
summary of resources within the same Cloud organization as the key will be
returned, which requires the KMS organization service account to be
configured(refer
<https://docs.cloud.google.com/kms/docs/view-key-usage#required-roles>).
If the KMS organization service account is not configured or key's project
is not part of an organization, set
\[fallback_scope\]\[google.cloud.kms.inventory.v1.GetProtectedResourcesSummaryRequest.fallback_scope\]
to `FALLBACK_SCOPE_PROJECT` to retrieve a summary of protected resources
within the key's project.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.Inventory.V1/latest/Google.Cloud.Kms.Inventory.V1.GetProtectedResourcesSummaryRequest` The request to send to the server. |
| `options` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.CallOptions.html` The options for the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.AsyncUnaryCall-1.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.Inventory.V1/latest/Google.Cloud.Kms.Inventory.V1.ProtectedResourcesSummary` | The call object. |

### GetProtectedResourcesSummaryAsync(GetProtectedResourcesSummaryRequest, Metadata, DateTime?, CancellationToken)

    public virtual AsyncUnaryCall<ProtectedResourcesSummary> GetProtectedResourcesSummaryAsync(GetProtectedResourcesSummaryRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Returns aggregate information about the resources protected by the given
Cloud KMS \[CryptoKey\]\[google.cloud.kms.v1.CryptoKey\]. By default,
summary of resources within the same Cloud organization as the key will be
returned, which requires the KMS organization service account to be
configured(refer
<https://docs.cloud.google.com/kms/docs/view-key-usage#required-roles>).
If the KMS organization service account is not configured or key's project
is not part of an organization, set
\[fallback_scope\]\[google.cloud.kms.inventory.v1.GetProtectedResourcesSummaryRequest.fallback_scope\]
to `FALLBACK_SCOPE_PROJECT` to retrieve a summary of protected resources
within the key's project.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.Inventory.V1/latest/Google.Cloud.Kms.Inventory.V1.GetProtectedResourcesSummaryRequest` The request to send to the server. |
| `headers` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.Metadata.html` The initial metadata to send with the call. This parameter is optional. |
| `deadline` | `System.DateTime` An optional deadline for the call. The call will be cancelled if deadline is hit. |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` An optional token for canceling the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.AsyncUnaryCall-1.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.Inventory.V1/latest/Google.Cloud.Kms.Inventory.V1.ProtectedResourcesSummary` | The call object. |

### NewInstance(ClientBaseConfiguration)

    protected override KeyTrackingService.KeyTrackingServiceClient NewInstance(ClientBase.ClientBaseConfiguration configuration)

Creates a new instance of client from given `ClientBaseConfiguration`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `configuration` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ClientBase.htmlhttps://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ClientBase.ClientBaseConfiguration.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.Inventory.V1/latest/Google.Cloud.Kms.Inventory.V1.KeyTrackingServicehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.Inventory.V1/latest/Google.Cloud.Kms.Inventory.V1.KeyTrackingService.KeyTrackingServiceClient` |   |

**Overrides** Grpc.Core.ClientBase\<Google.Cloud.Kms.Inventory.V1.KeyTrackingService.KeyTrackingServiceClient\>.NewInstance(Grpc.Core.ClientBase.ClientBaseConfiguration)

### SearchProtectedResources(SearchProtectedResourcesRequest, CallOptions)

    public virtual SearchProtectedResourcesResponse SearchProtectedResources(SearchProtectedResourcesRequest request, CallOptions options)

Returns metadata about the resources protected by the given Cloud KMS
\[CryptoKey\]\[google.cloud.kms.v1.CryptoKey\] in the given Cloud
organization/project.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.Inventory.V1/latest/Google.Cloud.Kms.Inventory.V1.SearchProtectedResourcesRequest` The request to send to the server. |
| `options` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.CallOptions.html` The options for the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.Inventory.V1/latest/Google.Cloud.Kms.Inventory.V1.SearchProtectedResourcesResponse` | The response received from the server. |

### SearchProtectedResources(SearchProtectedResourcesRequest, Metadata, DateTime?, CancellationToken)

    public virtual SearchProtectedResourcesResponse SearchProtectedResources(SearchProtectedResourcesRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Returns metadata about the resources protected by the given Cloud KMS
\[CryptoKey\]\[google.cloud.kms.v1.CryptoKey\] in the given Cloud
organization/project.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.Inventory.V1/latest/Google.Cloud.Kms.Inventory.V1.SearchProtectedResourcesRequest` The request to send to the server. |
| `headers` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.Metadata.html` The initial metadata to send with the call. This parameter is optional. |
| `deadline` | `System.DateTime` An optional deadline for the call. The call will be cancelled if deadline is hit. |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` An optional token for canceling the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.Inventory.V1/latest/Google.Cloud.Kms.Inventory.V1.SearchProtectedResourcesResponse` | The response received from the server. |

### SearchProtectedResourcesAsync(SearchProtectedResourcesRequest, CallOptions)

    public virtual AsyncUnaryCall<SearchProtectedResourcesResponse> SearchProtectedResourcesAsync(SearchProtectedResourcesRequest request, CallOptions options)

Returns metadata about the resources protected by the given Cloud KMS
\[CryptoKey\]\[google.cloud.kms.v1.CryptoKey\] in the given Cloud
organization/project.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.Inventory.V1/latest/Google.Cloud.Kms.Inventory.V1.SearchProtectedResourcesRequest` The request to send to the server. |
| `options` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.CallOptions.html` The options for the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.AsyncUnaryCall-1.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.Inventory.V1/latest/Google.Cloud.Kms.Inventory.V1.SearchProtectedResourcesResponse` | The call object. |

### SearchProtectedResourcesAsync(SearchProtectedResourcesRequest, Metadata, DateTime?, CancellationToken)

    public virtual AsyncUnaryCall<SearchProtectedResourcesResponse> SearchProtectedResourcesAsync(SearchProtectedResourcesRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Returns metadata about the resources protected by the given Cloud KMS
\[CryptoKey\]\[google.cloud.kms.v1.CryptoKey\] in the given Cloud
organization/project.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.Inventory.V1/latest/Google.Cloud.Kms.Inventory.V1.SearchProtectedResourcesRequest` The request to send to the server. |
| `headers` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.Metadata.html` The initial metadata to send with the call. This parameter is optional. |
| `deadline` | `System.DateTime` An optional deadline for the call. The call will be cancelled if deadline is hit. |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` An optional token for canceling the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.AsyncUnaryCall-1.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.Inventory.V1/latest/Google.Cloud.Kms.Inventory.V1.SearchProtectedResourcesResponse` | The call object. |