public sealed class TagKeyName : IResourceName, IEquatable<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 |
StringThe |
Properties
IsKnownPattern
public bool IsKnownPattern { get; }Whether this instance contains a resource name with a known pattern.
| Property Value | |
|---|---|
| Type | Description |
Boolean |
|
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 |
TagKeyName.ResourceNameType |
|
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 |
StringThe |
| 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 |
StringThe |
| 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 |
StringThe |
| 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 |
UnparsedResourceNameThe 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 |
Int32 |
|
Parse(String)
public static TagKeyName Parse(string tagKeyName)Parses the given resource name string into a new TagKeyName instance.
| Parameter | |
|---|---|
| Name | Description |
tagKeyName |
StringThe 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, Boolean)
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 |
StringThe resource name in string form. Must not be |
allowUnparsed |
BooleanIf |
| 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 |
StringThe resource name in string form. Must not be |
result |
TagKeyNameWhen this method returns, the parsed TagKeyName, or |
| Returns | |
|---|---|
| Type | Description |
Boolean |
|
To parse successfully, the resource name must be formatted as one of the following:
tagKeys/{tag_key}
TryParse(String, Boolean, 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 |
StringThe resource name in string form. Must not be |
allowUnparsed |
BooleanIf |
result |
TagKeyNameWhen this method returns, the parsed TagKeyName, or |
| Returns | |
|---|---|
| Type | Description |
Boolean |
|
To parse successfully, the resource name must be formatted as one of the following:
tagKeys/{tag_key}
allowUnparsed is true.
Operators
Equality(TagKeyName, TagKeyName)
public static bool operator ==(TagKeyName a, TagKeyName b)| Parameters | |
|---|---|
| Name | Description |
a |
TagKeyName |
b |
TagKeyName |
| Returns | |
|---|---|
| Type | Description |
Boolean |
|
Inequality(TagKeyName, TagKeyName)
public static bool operator !=(TagKeyName a, TagKeyName b)| Parameters | |
|---|---|
| Name | Description |
a |
TagKeyName |
b |
TagKeyName |
| Returns | |
|---|---|
| Type | Description |
Boolean |
|