# Policy Simulator v1 API - Class ResourceContext (1.4.0)

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

- [1.4.0 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.ResourceContext)
- [1.3.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/1.3.0/Google.Cloud.PolicySimulator.V1.ResourceContext)
- [1.2.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/1.2.0/Google.Cloud.PolicySimulator.V1.ResourceContext)
- [1.1.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/1.1.0/Google.Cloud.PolicySimulator.V1.ResourceContext)
- [1.0.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/1.0.0/Google.Cloud.PolicySimulator.V1.ResourceContext)

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

Reference documentation and code samples for the Policy Simulator v1 API class ResourceContext.

ResourceContext provides the context we know about a resource.
It is similar in concept to google.cloud.asset.v1.Resource, but focuses
on the information specifically used by Simulator.

## Inheritance

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

## Implements

[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[ResourceContext](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.ResourceContext), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[ResourceContext](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.ResourceContext), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[ResourceContext](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1.ResourceContext), [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.PolicySimulator.V1](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicySimulator.V1/latest/Google.Cloud.PolicySimulator.V1)

## Assembly

Google.Cloud.PolicySimulator.V1.dll

## Constructors

### ResourceContext()

    public ResourceContext()

### ResourceContext(ResourceContext)

    public ResourceContext(ResourceContext other)

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

## Properties

### Ancestors

    public RepeatedField<string> Ancestors { get; }

The ancestry path of the resource in Google Cloud [resource
hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
represented as a list of relative resource names. An ancestry path starts
with the closest ancestor in the hierarchy and ends at root. If the
resource is a project, folder, or organization, the ancestry path starts
from the resource itself.

Example: `["projects/123456789", "folders/5432", "organizations/1234"]`

| **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` |   |

### AssetType

    public string AssetType { get; set; }

The asset type of the resource as defined by CAIS.

Example: `compute.googleapis.com/Firewall`

See [Supported asset
types](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
for more information.

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

### Resource

    public string Resource { get; set; }

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

See [Resource
names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
for more information.

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