public MapField<string, string> Annotations { get; }
Optional. User annotations. These attributes can only be set and used by
the user, and not by Cloud Deploy. Annotations must meet the following
constraints:
Annotations are key/value pairs.
Valid annotation keys have two segments: an optional prefix and name,
separated by a slash (/).
The name segment is required and must be 63 characters or less,
beginning and ending with an alphanumeric character ([a-z0-9A-Z]) with
dashes (-), underscores (_), dots (.), and alphanumerics between.
The prefix is optional. If specified, the prefix must be a DNS subdomain:
a series of DNS labels separated by dots(.), not longer than 253
characters in total, followed by a slash (/).
The weak etag of the DeployPolicy resource.
This checksum is computed by the server based on the value of other
fields, and may be sent on update and delete requests to ensure the
client has an up-to-date value before proceeding.
Output only. Name of the DeployPolicy. Format is
projects/{project}/locations/{location}/deployPolicies/{deployPolicy}.
The deployPolicy component must match [a-z]([a-z0-9-]{0,61}[a-z0-9])?
public RepeatedField<DeployPolicyResourceSelector> Selectors { get; }
Required. Selected resources to which the policy will be applied. At least
one selector is required. If one selector matches the resource the policy
applies. For example, if there are two selectors and the action being
attempted matches one of them, the policy will apply to that action.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThis webpage provides reference documentation for the \u003ccode\u003eDeployPolicy\u003c/code\u003e class within the Google Cloud Deploy v1 API, which is used to inhibit actions in a Delivery Pipeline or Target.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version of the \u003ccode\u003eDeployPolicy\u003c/code\u003e documentation is 3.4.0, and the page also offers access to documentation for prior versions dating back to 1.0.0.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eDeployPolicy\u003c/code\u003e class implements multiple interfaces, including \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eKey properties of the \u003ccode\u003eDeployPolicy\u003c/code\u003e class include \u003ccode\u003eAnnotations\u003c/code\u003e, \u003ccode\u003eCreateTime\u003c/code\u003e, \u003ccode\u003eDescription\u003c/code\u003e, \u003ccode\u003eRules\u003c/code\u003e, \u003ccode\u003eSelectors\u003c/code\u003e, \u003ccode\u003eSuspended\u003c/code\u003e, and \u003ccode\u003eUpdateTime\u003c/code\u003e, among others, allowing for detailed configuration and control.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eDeployPolicy\u003c/code\u003e resource is defined by its \u003ccode\u003eName\u003c/code\u003e, which follows a specific format that includes project, location, and deploy policy identifiers, with specific character limitations.\u003c/p\u003e\n"]]],[],null,["# Google Cloud Deploy v1 API - Class DeployPolicy (3.6.0)\n\nVersion latestkeyboard_arrow_down\n\n- [3.6.0 (latest)](/dotnet/docs/reference/Google.Cloud.Deploy.V1/latest/Google.Cloud.Deploy.V1.DeployPolicy)\n- [3.5.0](/dotnet/docs/reference/Google.Cloud.Deploy.V1/3.5.0/Google.Cloud.Deploy.V1.DeployPolicy)\n- [3.4.0](/dotnet/docs/reference/Google.Cloud.Deploy.V1/3.4.0/Google.Cloud.Deploy.V1.DeployPolicy)\n- [3.3.0](/dotnet/docs/reference/Google.Cloud.Deploy.V1/3.3.0/Google.Cloud.Deploy.V1.DeployPolicy)\n- [3.2.0](/dotnet/docs/reference/Google.Cloud.Deploy.V1/3.2.0/Google.Cloud.Deploy.V1.DeployPolicy)\n- [3.1.0](/dotnet/docs/reference/Google.Cloud.Deploy.V1/3.1.0/Google.Cloud.Deploy.V1.DeployPolicy)\n- [3.0.0](/dotnet/docs/reference/Google.Cloud.Deploy.V1/3.0.0/Google.Cloud.Deploy.V1.DeployPolicy)\n- [2.19.0](/dotnet/docs/reference/Google.Cloud.Deploy.V1/2.19.0/Google.Cloud.Deploy.V1.DeployPolicy)\n- [2.18.0](/dotnet/docs/reference/Google.Cloud.Deploy.V1/2.18.0/Google.Cloud.Deploy.V1.DeployPolicy)\n- [2.17.0](/dotnet/docs/reference/Google.Cloud.Deploy.V1/2.17.0/Google.Cloud.Deploy.V1.DeployPolicy)\n- [2.16.0](/dotnet/docs/reference/Google.Cloud.Deploy.V1/2.16.0/Google.Cloud.Deploy.V1.DeployPolicy)\n- [2.15.0](/dotnet/docs/reference/Google.Cloud.Deploy.V1/2.15.0/Google.Cloud.Deploy.V1.DeployPolicy)\n- [2.14.0](/dotnet/docs/reference/Google.Cloud.Deploy.V1/2.14.0/Google.Cloud.Deploy.V1.DeployPolicy)\n- [2.13.0](/dotnet/docs/reference/Google.Cloud.Deploy.V1/2.13.0/Google.Cloud.Deploy.V1.DeployPolicy)\n- [2.12.0](/dotnet/docs/reference/Google.Cloud.Deploy.V1/2.12.0/Google.Cloud.Deploy.V1.DeployPolicy)\n- [2.11.0](/dotnet/docs/reference/Google.Cloud.Deploy.V1/2.11.0/Google.Cloud.Deploy.V1.DeployPolicy)\n- [2.10.0](/dotnet/docs/reference/Google.Cloud.Deploy.V1/2.10.0/Google.Cloud.Deploy.V1.DeployPolicy)\n- [2.9.0](/dotnet/docs/reference/Google.Cloud.Deploy.V1/2.9.0/Google.Cloud.Deploy.V1.DeployPolicy)\n- [2.8.0](/dotnet/docs/reference/Google.Cloud.Deploy.V1/2.8.0/Google.Cloud.Deploy.V1.DeployPolicy)\n- [2.7.0](/dotnet/docs/reference/Google.Cloud.Deploy.V1/2.7.0/Google.Cloud.Deploy.V1.DeployPolicy)\n- [2.6.0](/dotnet/docs/reference/Google.Cloud.Deploy.V1/2.6.0/Google.Cloud.Deploy.V1.DeployPolicy)\n- [2.5.0](/dotnet/docs/reference/Google.Cloud.Deploy.V1/2.5.0/Google.Cloud.Deploy.V1.DeployPolicy)\n- [2.4.0](/dotnet/docs/reference/Google.Cloud.Deploy.V1/2.4.0/Google.Cloud.Deploy.V1.DeployPolicy)\n- [2.3.0](/dotnet/docs/reference/Google.Cloud.Deploy.V1/2.3.0/Google.Cloud.Deploy.V1.DeployPolicy)\n- [2.2.0](/dotnet/docs/reference/Google.Cloud.Deploy.V1/2.2.0/Google.Cloud.Deploy.V1.DeployPolicy)\n- [2.1.0](/dotnet/docs/reference/Google.Cloud.Deploy.V1/2.1.0/Google.Cloud.Deploy.V1.DeployPolicy)\n- [2.0.0](/dotnet/docs/reference/Google.Cloud.Deploy.V1/2.0.0/Google.Cloud.Deploy.V1.DeployPolicy)\n- [1.1.0](/dotnet/docs/reference/Google.Cloud.Deploy.V1/1.1.0/Google.Cloud.Deploy.V1.DeployPolicy)\n- [1.0.0](/dotnet/docs/reference/Google.Cloud.Deploy.V1/1.0.0/Google.Cloud.Deploy.V1.DeployPolicy) \n\n public sealed class DeployPolicy : IMessage\u003cDeployPolicy\u003e, IEquatable\u003cDeployPolicy\u003e, IDeepCloneable\u003cDeployPolicy\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Google Cloud Deploy v1 API class DeployPolicy.\n\nA `DeployPolicy` resource in the Cloud Deploy API.\n\nA `DeployPolicy` inhibits manual or automation-driven actions within a\nDelivery Pipeline or Target. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e DeployPolicy \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[DeployPolicy](/dotnet/docs/reference/Google.Cloud.Deploy.V1/latest/Google.Cloud.Deploy.V1.DeployPolicy), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[DeployPolicy](/dotnet/docs/reference/Google.Cloud.Deploy.V1/latest/Google.Cloud.Deploy.V1.DeployPolicy), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[DeployPolicy](/dotnet/docs/reference/Google.Cloud.Deploy.V1/latest/Google.Cloud.Deploy.V1.DeployPolicy), [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) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.Deploy.V1](/dotnet/docs/reference/Google.Cloud.Deploy.V1/latest/Google.Cloud.Deploy.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.Deploy.V1.dll\n\nConstructors\n------------\n\n### DeployPolicy()\n\n public DeployPolicy()\n\n### DeployPolicy(DeployPolicy)\n\n public DeployPolicy(DeployPolicy other)\n\nProperties\n----------\n\n### Annotations\n\n public MapField\u003cstring, string\u003e Annotations { get; }\n\nOptional. User annotations. These attributes can only be set and used by\nthe user, and not by Cloud Deploy. Annotations must meet the following\nconstraints:\n\n- Annotations are key/value pairs.\n- Valid annotation keys have two segments: an optional prefix and name, separated by a slash (`/`).\n- The name segment is required and must be 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between.\n- The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots(`.`), not longer than 253 characters in total, followed by a slash (`/`).\n\nSee\n\u003chttps://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/#syntax-and-character-set\u003e\nfor more details.\n\n### CreateTime\n\n public Timestamp CreateTime { get; set; }\n\nOutput only. Time at which the deploy policy was created.\n\n### DeployPolicyName\n\n public DeployPolicyName DeployPolicyName { get; set; }\n\n[DeployPolicyName](/dotnet/docs/reference/Google.Cloud.Deploy.V1/latest/Google.Cloud.Deploy.V1.DeployPolicyName)-typed view over the [Name](/dotnet/docs/reference/Google.Cloud.Deploy.V1/latest/Google.Cloud.Deploy.V1.DeployPolicy#Google_Cloud_Deploy_V1_DeployPolicy_Name) resource name property.\n\n### Description\n\n public string Description { get; set; }\n\nOptional. Description of the `DeployPolicy`. Max length is 255 characters.\n\n### Etag\n\n public string Etag { get; set; }\n\nThe weak etag of the `DeployPolicy` resource.\nThis checksum is computed by the server based on the value of other\nfields, and may be sent on update and delete requests to ensure the\nclient has an up-to-date value before proceeding.\n\n### Labels\n\n public MapField\u003cstring, string\u003e Labels { get; }\n\nLabels are attributes that can be set and used by both the\nuser and by Cloud Deploy. Labels must meet the following constraints:\n\n- Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes.\n- All characters must use UTF-8 encoding, and international characters are allowed.\n- Keys must start with a lowercase letter or international character.\n- Each resource is limited to a maximum of 64 labels.\n\nBoth keys and values are additionally constrained to be \\\u003c= 128 bytes.\n\n### Name\n\n public string Name { get; set; }\n\nOutput only. Name of the `DeployPolicy`. Format is\n`projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.\nThe `deployPolicy` component must match `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`\n\n### Rules\n\n public RepeatedField\u003cPolicyRule\u003e Rules { get; }\n\nRequired. Rules to apply. At least one rule must be present.\n\n### Selectors\n\n public RepeatedField\u003cDeployPolicyResourceSelector\u003e Selectors { get; }\n\nRequired. Selected resources to which the policy will be applied. At least\none selector is required. If one selector matches the resource the policy\napplies. For example, if there are two selectors and the action being\nattempted matches one of them, the policy will apply to that action.\n\n### Suspended\n\n public bool Suspended { get; set; }\n\nOptional. When suspended, the policy will not prevent actions from\noccurring, even if the action violates the policy.\n\n### Uid\n\n public string Uid { get; set; }\n\nOutput only. Unique identifier of the `DeployPolicy`.\n\n### UpdateTime\n\n public Timestamp UpdateTime { get; set; }\n\nOutput only. Most recent time at which the deploy policy was updated."]]