# Google Cloud Asset Inventory v1 API - Class AnalyzerOrgPolicyConstraint.Types.CustomConstraint (3.14.0)

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

- [3.14.0 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Asset.V1/latest/Google.Cloud.Asset.V1.AnalyzerOrgPolicyConstraint.Types.CustomConstraint)
- [3.13.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Asset.V1/3.13.0/Google.Cloud.Asset.V1.AnalyzerOrgPolicyConstraint.Types.CustomConstraint)
- [3.12.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Asset.V1/3.12.0/Google.Cloud.Asset.V1.AnalyzerOrgPolicyConstraint.Types.CustomConstraint)
- [3.11.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Asset.V1/3.11.0/Google.Cloud.Asset.V1.AnalyzerOrgPolicyConstraint.Types.CustomConstraint)
- [3.10.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Asset.V1/3.10.0/Google.Cloud.Asset.V1.AnalyzerOrgPolicyConstraint.Types.CustomConstraint)
- [3.9.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Asset.V1/3.9.0/Google.Cloud.Asset.V1.AnalyzerOrgPolicyConstraint.Types.CustomConstraint)
- [3.8.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Asset.V1/3.8.0/Google.Cloud.Asset.V1.AnalyzerOrgPolicyConstraint.Types.CustomConstraint)
- [3.7.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Asset.V1/3.7.0/Google.Cloud.Asset.V1.AnalyzerOrgPolicyConstraint.Types.CustomConstraint)
- [3.6.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Asset.V1/3.6.0/Google.Cloud.Asset.V1.AnalyzerOrgPolicyConstraint.Types.CustomConstraint)
- [3.5.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Asset.V1/3.5.0/Google.Cloud.Asset.V1.AnalyzerOrgPolicyConstraint.Types.CustomConstraint)
- [3.4.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Asset.V1/3.4.0/Google.Cloud.Asset.V1.AnalyzerOrgPolicyConstraint.Types.CustomConstraint)
- [3.3.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Asset.V1/3.3.0/Google.Cloud.Asset.V1.AnalyzerOrgPolicyConstraint.Types.CustomConstraint)
- [3.2.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Asset.V1/3.2.0/Google.Cloud.Asset.V1.AnalyzerOrgPolicyConstraint.Types.CustomConstraint)
- [3.1.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Asset.V1/3.1.0/Google.Cloud.Asset.V1.AnalyzerOrgPolicyConstraint.Types.CustomConstraint)
- [3.0.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Asset.V1/3.0.0/Google.Cloud.Asset.V1.AnalyzerOrgPolicyConstraint.Types.CustomConstraint)
- [2.11.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Asset.V1/2.11.0/Google.Cloud.Asset.V1.AnalyzerOrgPolicyConstraint.Types.CustomConstraint)
- [2.10.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Asset.V1/2.10.0/Google.Cloud.Asset.V1.AnalyzerOrgPolicyConstraint.Types.CustomConstraint)
- [2.9.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Asset.V1/2.9.0/Google.Cloud.Asset.V1.AnalyzerOrgPolicyConstraint.Types.CustomConstraint)
- [2.8.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Asset.V1/2.8.0/Google.Cloud.Asset.V1.AnalyzerOrgPolicyConstraint.Types.CustomConstraint)
- [2.7.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Asset.V1/2.7.0/Google.Cloud.Asset.V1.AnalyzerOrgPolicyConstraint.Types.CustomConstraint)

    public sealed class AnalyzerOrgPolicyConstraint.Types.CustomConstraint : IMessage<AnalyzerOrgPolicyConstraint.Types.CustomConstraint>, IEquatable<AnalyzerOrgPolicyConstraint.Types.CustomConstraint>, IDeepCloneable<AnalyzerOrgPolicyConstraint.Types.CustomConstraint>, IBufferMessage, IMessage

Reference documentation and code samples for the Google Cloud Asset Inventory v1 API class AnalyzerOrgPolicyConstraint.Types.CustomConstraint.

The definition of a custom constraint.

## Inheritance

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

## Implements

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

## Assembly

Google.Cloud.Asset.V1.dll

## Constructors

### CustomConstraint()

    public CustomConstraint()

### CustomConstraint(CustomConstraint)

    public CustomConstraint(AnalyzerOrgPolicyConstraint.Types.CustomConstraint other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Asset.V1/latest/Google.Cloud.Asset.V1.AnalyzerOrgPolicyConstrainthttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Asset.V1/latest/Google.Cloud.Asset.V1.AnalyzerOrgPolicyConstraint.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Asset.V1/latest/Google.Cloud.Asset.V1.AnalyzerOrgPolicyConstraint.Types.CustomConstraint` |

## Properties

### ActionType

    public AnalyzerOrgPolicyConstraint.Types.CustomConstraint.Types.ActionType ActionType { get; set; }

Allow or deny type.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Asset.V1/latest/Google.Cloud.Asset.V1.AnalyzerOrgPolicyConstrainthttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Asset.V1/latest/Google.Cloud.Asset.V1.AnalyzerOrgPolicyConstraint.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Asset.V1/latest/Google.Cloud.Asset.V1.AnalyzerOrgPolicyConstraint.Types.CustomConstrainthttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Asset.V1/latest/Google.Cloud.Asset.V1.AnalyzerOrgPolicyConstraint.Types.CustomConstraint.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Asset.V1/latest/Google.Cloud.Asset.V1.AnalyzerOrgPolicyConstraint.Types.CustomConstraint.Types.ActionType` |   |

### Condition

    public string Condition { get; set; }

Organization Policy condition/expression. For example:
`resource.instanceName.matches("[production|test]_.*_(\d)+")'` or,
`resource.management.auto_upgrade == true`

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

### Description

    public string Description { get; set; }

Detailed information about this custom policy constraint.

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

### DisplayName

    public string DisplayName { get; set; }

One line display name for the UI.

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

### MethodTypes

    public RepeatedField<AnalyzerOrgPolicyConstraint.Types.CustomConstraint.Types.MethodType> MethodTypes { get; }

All the operations being applied for this constraint.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Collections.RepeatedField-1.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Asset.V1/latest/Google.Cloud.Asset.V1.AnalyzerOrgPolicyConstrainthttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Asset.V1/latest/Google.Cloud.Asset.V1.AnalyzerOrgPolicyConstraint.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Asset.V1/latest/Google.Cloud.Asset.V1.AnalyzerOrgPolicyConstraint.Types.CustomConstrainthttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Asset.V1/latest/Google.Cloud.Asset.V1.AnalyzerOrgPolicyConstraint.Types.CustomConstraint.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Asset.V1/latest/Google.Cloud.Asset.V1.AnalyzerOrgPolicyConstraint.Types.CustomConstraint.Types.MethodType` |   |

### Name

    public string Name { get; set; }

Name of the constraint. This is unique within the organization. Format of
the name should be

- `organizations/{organization_id}/customConstraints/{custom_constraint_id}`

Example :
"organizations/123/customConstraints/custom.createOnlyE2TypeVms"

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

### ResourceTypes

    public RepeatedField<string> ResourceTypes { get; }

The Resource Instance type on which this policy applies to. Format will
be of the form : "\<canonical service name\>/\<type\>" Example:

- `compute.googleapis.com/Instance`.

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