If true will successfully store an unparseable resource name into the UnparsedResource
property; otherwise will throw an ArgumentException if an unparseable resource name is
specified.
If true will successfully store an unparseable resource name into the UnparsedResource
property; otherwise will throw an ArgumentException if an unparseable resource name is
specified.
[[["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-08 UTC."],[[["\u003cp\u003eThis webpage provides reference documentation for the \u003ccode\u003ePolicyName\u003c/code\u003e class within the Google Cloud Run Admin v2 API, specifically for .NET development.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ePolicyName\u003c/code\u003e class is used to represent resource names for the \u003ccode\u003ePolicy\u003c/code\u003e resource and includes methods for parsing, formatting, and constructing resource names.\u003c/p\u003e\n"],["\u003cp\u003eThe documentation lists available versions of the \u003ccode\u003ePolicyName\u003c/code\u003e class, ranging from the latest version 2.13.0 down to version 1.0.0-beta02, indicating a history of updates.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ePolicyName\u003c/code\u003e class can be constructed using a Project ID, and supports two patterns: \u003ccode\u003eprojects/{project}/policy\u003c/code\u003e and \u003ccode\u003elocations/{location}/policy\u003c/code\u003e, which are utilized for the construction of the string representation.\u003c/p\u003e\n"],["\u003cp\u003eThis class also offers methods for handling unparsed resource names, allowing for flexibility when dealing with various resource name formats.\u003c/p\u003e\n"]]],[],null,["# Cloud Run Admin v2 API - Class PolicyName (2.16.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.16.0 (latest)](/dotnet/docs/reference/Google.Cloud.Run.V2/latest/Google.Cloud.Run.V2.PolicyName)\n- [2.15.0](/dotnet/docs/reference/Google.Cloud.Run.V2/2.15.0/Google.Cloud.Run.V2.PolicyName)\n- [2.14.0](/dotnet/docs/reference/Google.Cloud.Run.V2/2.14.0/Google.Cloud.Run.V2.PolicyName)\n- [2.13.0](/dotnet/docs/reference/Google.Cloud.Run.V2/2.13.0/Google.Cloud.Run.V2.PolicyName)\n- [2.12.0](/dotnet/docs/reference/Google.Cloud.Run.V2/2.12.0/Google.Cloud.Run.V2.PolicyName)\n- [2.11.0](/dotnet/docs/reference/Google.Cloud.Run.V2/2.11.0/Google.Cloud.Run.V2.PolicyName)\n- [2.10.0](/dotnet/docs/reference/Google.Cloud.Run.V2/2.10.0/Google.Cloud.Run.V2.PolicyName)\n- [2.9.0](/dotnet/docs/reference/Google.Cloud.Run.V2/2.9.0/Google.Cloud.Run.V2.PolicyName)\n- [2.8.0](/dotnet/docs/reference/Google.Cloud.Run.V2/2.8.0/Google.Cloud.Run.V2.PolicyName)\n- [2.7.0](/dotnet/docs/reference/Google.Cloud.Run.V2/2.7.0/Google.Cloud.Run.V2.PolicyName)\n- [2.6.0](/dotnet/docs/reference/Google.Cloud.Run.V2/2.6.0/Google.Cloud.Run.V2.PolicyName)\n- [2.5.0](/dotnet/docs/reference/Google.Cloud.Run.V2/2.5.0/Google.Cloud.Run.V2.PolicyName)\n- [2.4.0](/dotnet/docs/reference/Google.Cloud.Run.V2/2.4.0/Google.Cloud.Run.V2.PolicyName)\n- [2.3.0](/dotnet/docs/reference/Google.Cloud.Run.V2/2.3.0/Google.Cloud.Run.V2.PolicyName)\n- [2.2.0](/dotnet/docs/reference/Google.Cloud.Run.V2/2.2.0/Google.Cloud.Run.V2.PolicyName)\n- [2.1.0](/dotnet/docs/reference/Google.Cloud.Run.V2/2.1.0/Google.Cloud.Run.V2.PolicyName)\n- [2.0.0](/dotnet/docs/reference/Google.Cloud.Run.V2/2.0.0/Google.Cloud.Run.V2.PolicyName)\n- [1.0.0-beta02](/dotnet/docs/reference/Google.Cloud.Run.V2/1.0.0-beta02/Google.Cloud.Run.V2.PolicyName) \n\n public sealed class PolicyName : IResourceName, IEquatable\u003cPolicyName\u003e\n\nReference documentation and code samples for the Cloud Run Admin v2 API class PolicyName.\n\nResource name for the `Policy` resource. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e PolicyName \n\nImplements\n----------\n\n[IResourceName](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.IResourceName.html), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[PolicyName](/dotnet/docs/reference/Google.Cloud.Run.V2/latest/Google.Cloud.Run.V2.PolicyName) \n\nInherited Members\n-----------------\n\n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype)\n\nNamespace\n---------\n\n[Google.Cloud.Run.V2](/dotnet/docs/reference/Google.Cloud.Run.V2/latest/Google.Cloud.Run.V2)\n\nAssembly\n--------\n\nGoogle.Cloud.Run.V2.dll\n\nConstructors\n------------\n\n### PolicyName(string)\n\n public PolicyName(string projectId)\n\nConstructs a new instance of a [PolicyName](/dotnet/docs/reference/Google.Cloud.Run.V2/latest/Google.Cloud.Run.V2.PolicyName) class from the component parts of pattern\n`projects/{project}/policy`\n\nProperties\n----------\n\n### IsKnownPattern\n\n public bool IsKnownPattern { get; }\n\nWhether this instance contains a resource name with a known pattern.\n\n### LocationId\n\n public string LocationId { get; }\n\nThe `Location` ID. May be `null`, depending on which resource name is contained by this instance.\n\n### ProjectId\n\n public string ProjectId { get; }\n\nThe `Project` ID. May be `null`, depending on which resource name is contained by this instance.\n\n### Type\n\n public PolicyName.ResourceNameType Type { get; }\n\nThe [PolicyName.ResourceNameType](/dotnet/docs/reference/Google.Cloud.Run.V2/latest/Google.Cloud.Run.V2.PolicyName.ResourceNameType) of the contained resource name.\n\n### UnparsedResource\n\n public UnparsedResourceName UnparsedResource { get; }\n\nThe contained [UnparsedResourceName](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.UnparsedResourceName.html). Only non-`null` if this instance contains an\nunparsed resource name.\n\nMethods\n-------\n\n### Format(string)\n\n public static string Format(string projectId)\n\nFormats the IDs into the string representation of this [PolicyName](/dotnet/docs/reference/Google.Cloud.Run.V2/latest/Google.Cloud.Run.V2.PolicyName) with pattern\n`projects/{project}/policy`.\n\n### FormatLocation(string)\n\n public static string FormatLocation(string locationId)\n\nFormats the IDs into the string representation of this [PolicyName](/dotnet/docs/reference/Google.Cloud.Run.V2/latest/Google.Cloud.Run.V2.PolicyName) with pattern\n`locations/{location}/policy`.\n\n### FormatProject(string)\n\n public static string FormatProject(string projectId)\n\nFormats the IDs into the string representation of this [PolicyName](/dotnet/docs/reference/Google.Cloud.Run.V2/latest/Google.Cloud.Run.V2.PolicyName) with pattern\n`projects/{project}/policy`.\n\n### FromLocation(string)\n\n public static PolicyName FromLocation(string locationId)\n\nCreates a [PolicyName](/dotnet/docs/reference/Google.Cloud.Run.V2/latest/Google.Cloud.Run.V2.PolicyName) with the pattern `locations/{location}/policy`.\n\n### FromProject(string)\n\n public static PolicyName FromProject(string projectId)\n\nCreates a [PolicyName](/dotnet/docs/reference/Google.Cloud.Run.V2/latest/Google.Cloud.Run.V2.PolicyName) with the pattern `projects/{project}/policy`.\n\n### FromUnparsed(UnparsedResourceName)\n\n public static PolicyName FromUnparsed(UnparsedResourceName unparsedResourceName)\n\nCreates a [PolicyName](/dotnet/docs/reference/Google.Cloud.Run.V2/latest/Google.Cloud.Run.V2.PolicyName) containing an unparsed resource name.\n\n### GetHashCode()\n\n public override int GetHashCode()\n\nReturns a hash code for this resource name.\n\n**Overrides** \n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode)\n\n### Parse(string)\n\n public static PolicyName Parse(string policyName)\n\nParses the given resource name string into a new [PolicyName](/dotnet/docs/reference/Google.Cloud.Run.V2/latest/Google.Cloud.Run.V2.PolicyName) instance.\n\n**Remarks** \nTo parse successfully, the resource name must be formatted as one of the following:\n\n- `projects/{project}/policy`\n- `locations/{location}/policy`\n\n\u003cbr /\u003e\n\n### Parse(string, bool)\n\n public static PolicyName Parse(string policyName, bool allowUnparsed)\n\nParses the given resource name string into a new [PolicyName](/dotnet/docs/reference/Google.Cloud.Run.V2/latest/Google.Cloud.Run.V2.PolicyName) instance; optionally allowing an\nunparseable resource name.\n\n**Remarks** \nTo parse successfully, the resource name must be formatted as one of the following:\n\n- `projects/{project}/policy`\n- `locations/{location}/policy`\n\nOr may be in any format if `allowUnparsed` is `true`.\n\n\u003cbr /\u003e\n\n### ToString()\n\n public override string ToString()\n\nThe string representation of the resource name.\n\n**Overrides** \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\n### TryParse(string, out PolicyName)\n\n public static bool TryParse(string policyName, out PolicyName result)\n\nTries to parse the given resource name string into a new [PolicyName](/dotnet/docs/reference/Google.Cloud.Run.V2/latest/Google.Cloud.Run.V2.PolicyName) instance.\n\n**Remarks** \nTo parse successfully, the resource name must be formatted as one of the following:\n\n- `projects/{project}/policy`\n- `locations/{location}/policy`\n\n\u003cbr /\u003e\n\n### TryParse(string, bool, out PolicyName)\n\n public static bool TryParse(string policyName, bool allowUnparsed, out PolicyName result)\n\nTries to parse the given resource name string into a new [PolicyName](/dotnet/docs/reference/Google.Cloud.Run.V2/latest/Google.Cloud.Run.V2.PolicyName) instance; optionally\nallowing an unparseable resource name.\n\n**Remarks** \nTo parse successfully, the resource name must be formatted as one of the following:\n\n- `projects/{project}/policy`\n- `locations/{location}/policy`\n\nOr may be in any format if `allowUnparsed` is `true`.\n\n\u003cbr /\u003e\n\nOperators\n---------\n\n### operator ==(PolicyName, PolicyName)\n\n public static bool operator ==(PolicyName a, PolicyName b)\n\nDetermines whether two specified resource names have the same value.\n\n### operator !=(PolicyName, PolicyName)\n\n public static bool operator !=(PolicyName a, PolicyName b)\n\nDetermines whether two specified resource names have different values."]]