# KMS Inventory v1 API - Class ProtectedResource (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.ProtectedResource)
- [1.5.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.Inventory.V1/1.5.0/Google.Cloud.Kms.Inventory.V1.ProtectedResource)
- [1.4.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.Inventory.V1/1.4.0/Google.Cloud.Kms.Inventory.V1.ProtectedResource)
- [1.3.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.Inventory.V1/1.3.0/Google.Cloud.Kms.Inventory.V1.ProtectedResource)
- [1.2.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.Inventory.V1/1.2.0/Google.Cloud.Kms.Inventory.V1.ProtectedResource)
- [1.1.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.Inventory.V1/1.1.0/Google.Cloud.Kms.Inventory.V1.ProtectedResource)
- [1.0.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.Inventory.V1/1.0.0/Google.Cloud.Kms.Inventory.V1.ProtectedResource)

    public sealed class ProtectedResource : IMessage<ProtectedResource>, IEquatable<ProtectedResource>, IDeepCloneable<ProtectedResource>, IBufferMessage, IMessage

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

Metadata about a resource protected by a Cloud KMS key.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> ProtectedResource

## Implements

[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[ProtectedResource](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.Inventory.V1/latest/Google.Cloud.Kms.Inventory.V1.ProtectedResource), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[ProtectedResource](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.Inventory.V1/latest/Google.Cloud.Kms.Inventory.V1.ProtectedResource), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[ProtectedResource](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.Inventory.V1/latest/Google.Cloud.Kms.Inventory.V1.ProtectedResource), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html)

## 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.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

### ProtectedResource()

    public ProtectedResource()

### ProtectedResource(ProtectedResource)

    public ProtectedResource(ProtectedResource other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.Inventory.V1/latest/Google.Cloud.Kms.Inventory.V1.ProtectedResource` |

## Properties

### CloudProduct

    public string CloudProduct { get; set; }

The Cloud product that owns the resource.
Example: `compute`

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

### CreateTime

    public Timestamp CreateTime { get; set; }

Output only. The time at which this resource was created. The granularity
is in seconds. Timestamp.nanos will always be 0.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.WellKnownTypes.Timestamp.html` |   |

### CryptoKeyVersion

    public string CryptoKeyVersion { get; set; }

The name of the Cloud KMS
[CryptoKeyVersion](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys.cryptoKeyVersions?hl=en)
used to protect this resource via CMEK. This field is empty if the
Google Cloud product owning the resource does not provide key version data
to Asset Inventory. If there are multiple key versions protecting the
resource, then this is same value as the first element of
crypto_key_versions.

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

### CryptoKeyVersionAsCryptoKeyVersionName

    public CryptoKeyVersionName CryptoKeyVersionAsCryptoKeyVersionName { get; set; }

[CryptoKeyVersionName](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.V1/latest/Google.Cloud.Kms.V1.CryptoKeyVersionName.html)-typed view over the [CryptoKeyVersion](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.Inventory.V1/latest/Google.Cloud.Kms.Inventory.V1.ProtectedResource#Google_Cloud_Kms_Inventory_V1_ProtectedResource_CryptoKeyVersion) resource name
property.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.V1/latest/Google.Cloud.Kms.V1.CryptoKeyVersionName.html` |   |

### CryptoKeyVersions

    public RepeatedField<string> CryptoKeyVersions { get; }

The names of the Cloud KMS
[CryptoKeyVersion](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys.cryptoKeyVersions?hl=en)
used to protect this resource via CMEK. This field is empty if the
Google Cloud product owning the resource does not provide key versions data
to Asset Inventory. The first element of this field is stored in
crypto_key_version.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Collections.RepeatedField-1.htmlhttps://learn.microsoft.com/dotnet/api/system.string` |   |

### CryptoKeyVersionsAsCryptoKeyVersionNames

    public ResourceNameList<CryptoKeyVersionName> CryptoKeyVersionsAsCryptoKeyVersionNames { get; }

[CryptoKeyVersionName](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.V1/latest/Google.Cloud.Kms.V1.CryptoKeyVersionName.html)-typed view over the [CryptoKeyVersions](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.Inventory.V1/latest/Google.Cloud.Kms.Inventory.V1.ProtectedResource#Google_Cloud_Kms_Inventory_V1_ProtectedResource_CryptoKeyVersions) resource name
property.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.ResourceNameList-1.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.V1/latest/Google.Cloud.Kms.V1.CryptoKeyVersionName.html` |   |

### Labels

    public MapField<string, string> Labels { get; }

A key-value pair of the resource's labels (v1) to their values.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Collections.MapField-2.htmlhttps://learn.microsoft.com/dotnet/api/system.stringhttps://learn.microsoft.com/dotnet/api/system.string` |   |

### Location

    public string Location { get; set; }

Location can be `global`, regional like `us-east1`, or zonal like
`us-west1-b`.

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

### Name

    public string Name { get; set; }

The full resource name of the resource.
Example:
`//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.

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

### Project

    public string Project { get; set; }

Format: `projects/{PROJECT_NUMBER}`.

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

### ProjectId

    public string ProjectId { get; set; }

The ID of the project that owns the resource.

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

### ResourceName

    public IResourceName ResourceName { get; set; }

[IResourceName](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.IResourceName.html)-typed view over the [Name](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.Inventory.V1/latest/Google.Cloud.Kms.Inventory.V1.ProtectedResource#Google_Cloud_Kms_Inventory_V1_ProtectedResource_Name) resource name property.

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

### ResourceType

    public string ResourceType { get; set; }

Example: `compute.googleapis.com/Disk`

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