public sealed class TagKeyName : IResourceName, IEquatable<TagKeyName>
Reference documentation and code samples for the Cloud Resource Manager v3 API class TagKeyName.
Resource name for the TagKey
resource.
Namespace
Google.Cloud.ResourceManager.V3Assembly
Google.Cloud.ResourceManager.V3.dll
Constructors
TagKeyName(string)
public TagKeyName(string tagKeyId)
Constructs a new instance of a TagKeyName class from the component parts of pattern
tagKeys/{tag_key}
Parameter | |
---|---|
Name | Description |
tagKeyId |
string The |
Properties
IsKnownPattern
public bool IsKnownPattern { get; }
Whether this instance contains a resource name with a known pattern.
Property Value | |
---|---|
Type | Description |
bool |
TagKeyId
public string TagKeyId { get; }
The TagKey
ID. Will not be null
, unless this instance contains an unparsed resource name.
Property Value | |
---|---|
Type | Description |
string |
Type
public TagKeyName.ResourceNameType Type { get; }
The TagKeyName.ResourceNameType of the contained resource name.
Property Value | |
---|---|
Type | Description |
TagKeyNameResourceNameType |
UnparsedResource
public UnparsedResourceName UnparsedResource { get; }
The contained UnparsedResourceName. Only non-null
if this instance contains an
unparsed resource name.
Property Value | |
---|---|
Type | Description |
UnparsedResourceName |
Methods
Format(string)
public static string Format(string tagKeyId)
Formats the IDs into the string representation of this TagKeyName with pattern
tagKeys/{tag_key}
.
Parameter | |
---|---|
Name | Description |
tagKeyId |
string The |
Returns | |
---|---|
Type | Description |
string |
The string representation of this TagKeyName with pattern |
FormatTagKey(string)
public static string FormatTagKey(string tagKeyId)
Formats the IDs into the string representation of this TagKeyName with pattern
tagKeys/{tag_key}
.
Parameter | |
---|---|
Name | Description |
tagKeyId |
string The |
Returns | |
---|---|
Type | Description |
string |
The string representation of this TagKeyName with pattern |
FromTagKey(string)
public static TagKeyName FromTagKey(string tagKeyId)
Creates a TagKeyName with the pattern tagKeys/{tag_key}
.
Parameter | |
---|---|
Name | Description |
tagKeyId |
string The |
Returns | |
---|---|
Type | Description |
TagKeyName |
A new instance of TagKeyName constructed from the provided ids. |
FromUnparsed(UnparsedResourceName)
public static TagKeyName FromUnparsed(UnparsedResourceName unparsedResourceName)
Creates a TagKeyName containing an unparsed resource name.
Parameter | |
---|---|
Name | Description |
unparsedResourceName |
UnparsedResourceName The unparsed resource name. Must not be |
Returns | |
---|---|
Type | Description |
TagKeyName |
A new instance of TagKeyName containing the provided |
GetHashCode()
public override int GetHashCode()
Returns a hash code for this resource name.
Returns | |
---|---|
Type | Description |
int |
Parse(string)
public static TagKeyName Parse(string tagKeyName)
Parses the given resource name string into a new TagKeyName instance.
Parameter | |
---|---|
Name | Description |
tagKeyName |
string The resource name in string form. Must not be |
Returns | |
---|---|
Type | Description |
TagKeyName |
The parsed TagKeyName if successful. |
To parse successfully, the resource name must be formatted as one of the following:
tagKeys/{tag_key}
Parse(string, bool)
public static TagKeyName Parse(string tagKeyName, bool allowUnparsed)
Parses the given resource name string into a new TagKeyName instance; optionally allowing an unparseable resource name.
Parameters | |
---|---|
Name | Description |
tagKeyName |
string The resource name in string form. Must not be |
allowUnparsed |
bool If |
Returns | |
---|---|
Type | Description |
TagKeyName |
The parsed TagKeyName if successful. |
To parse successfully, the resource name must be formatted as one of the following:
tagKeys/{tag_key}
allowUnparsed
is true
.
ToString()
public override string ToString()
The string representation of the resource name.
Returns | |
---|---|
Type | Description |
string |
The string representation of the resource name. |
TryParse(string, out TagKeyName)
public static bool TryParse(string tagKeyName, out TagKeyName result)
Tries to parse the given resource name string into a new TagKeyName instance.
Parameters | |
---|---|
Name | Description |
tagKeyName |
string The resource name in string form. Must not be |
result |
TagKeyName When this method returns, the parsed TagKeyName, or |
Returns | |
---|---|
Type | Description |
bool |
|
To parse successfully, the resource name must be formatted as one of the following:
tagKeys/{tag_key}
TryParse(string, bool, out TagKeyName)
public static bool TryParse(string tagKeyName, bool allowUnparsed, out TagKeyName result)
Tries to parse the given resource name string into a new TagKeyName instance; optionally allowing an unparseable resource name.
Parameters | |
---|---|
Name | Description |
tagKeyName |
string The resource name in string form. Must not be |
allowUnparsed |
bool If |
result |
TagKeyName When this method returns, the parsed TagKeyName, or |
Returns | |
---|---|
Type | Description |
bool |
|
To parse successfully, the resource name must be formatted as one of the following:
tagKeys/{tag_key}
allowUnparsed
is true
.
Operators
operator ==(TagKeyName, TagKeyName)
public static bool operator ==(TagKeyName a, TagKeyName b)
Determines whether two specified resource names have the same value.
Parameters | |
---|---|
Name | Description |
a |
TagKeyName The first resource name to compare, or null. |
b |
TagKeyName The second resource name to compare, or null. |
Returns | |
---|---|
Type | Description |
bool |
true if the value of |
operator !=(TagKeyName, TagKeyName)
public static bool operator !=(TagKeyName a, TagKeyName b)
Determines whether two specified resource names have different values.
Parameters | |
---|---|
Name | Description |
a |
TagKeyName The first resource name to compare, or null. |
b |
TagKeyName The second resource name to compare, or null. |
Returns | |
---|---|
Type | Description |
bool |
true if the value of |