public sealed class AccountName : IResourceName, IEquatable<AccountName>Reference documentation and code samples for the Cloud Channel v1 API class AccountName.
Resource name for the Account resource.
Namespace
Google.Cloud.Channel.V1Assembly
Google.Cloud.Channel.V1.dll
Constructors
AccountName(string)
public AccountName(string accountId)Constructs a new instance of a AccountName class from the component parts of pattern
accounts/{account}
| Parameter | |
|---|---|
| Name | Description |
accountId |
stringThe |
Properties
AccountId
public string AccountId { get; }The Account ID. Will not be null, unless this instance contains an unparsed resource name.
| Property Value | |
|---|---|
| Type | Description |
string |
|
IsKnownPattern
public bool IsKnownPattern { get; }Whether this instance contains a resource name with a known pattern.
| Property Value | |
|---|---|
| Type | Description |
bool |
|
Type
public AccountName.ResourceNameType Type { get; }The AccountName.ResourceNameType of the contained resource name.
| Property Value | |
|---|---|
| Type | Description |
AccountNameResourceNameType |
|
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 accountId)Formats the IDs into the string representation of this AccountName with pattern
accounts/{account}.
| Parameter | |
|---|---|
| Name | Description |
accountId |
stringThe |
| Returns | |
|---|---|
| Type | Description |
string |
The string representation of this AccountName with pattern |
FormatAccount(string)
public static string FormatAccount(string accountId)Formats the IDs into the string representation of this AccountName with pattern
accounts/{account}.
| Parameter | |
|---|---|
| Name | Description |
accountId |
stringThe |
| Returns | |
|---|---|
| Type | Description |
string |
The string representation of this AccountName with pattern |
FromAccount(string)
public static AccountName FromAccount(string accountId)Creates a AccountName with the pattern accounts/{account}.
| Parameter | |
|---|---|
| Name | Description |
accountId |
stringThe |
| Returns | |
|---|---|
| Type | Description |
AccountName |
A new instance of AccountName constructed from the provided ids. |
FromUnparsed(UnparsedResourceName)
public static AccountName FromUnparsed(UnparsedResourceName unparsedResourceName)Creates a AccountName containing an unparsed resource name.
| Parameter | |
|---|---|
| Name | Description |
unparsedResourceName |
UnparsedResourceNameThe unparsed resource name. Must not be |
| Returns | |
|---|---|
| Type | Description |
AccountName |
A new instance of AccountName containing the provided |
GetHashCode()
public override int GetHashCode()Returns a hash code for this resource name.
| Returns | |
|---|---|
| Type | Description |
int |
|
Parse(string)
public static AccountName Parse(string accountName)Parses the given resource name string into a new AccountName instance.
| Parameter | |
|---|---|
| Name | Description |
accountName |
stringThe resource name in string form. Must not be |
| Returns | |
|---|---|
| Type | Description |
AccountName |
The parsed AccountName if successful. |
To parse successfully, the resource name must be formatted as one of the following:
accounts/{account}
Parse(string, bool)
public static AccountName Parse(string accountName, bool allowUnparsed)Parses the given resource name string into a new AccountName instance; optionally allowing an unparseable resource name.
| Parameters | |
|---|---|
| Name | Description |
accountName |
stringThe resource name in string form. Must not be |
allowUnparsed |
boolIf |
| Returns | |
|---|---|
| Type | Description |
AccountName |
The parsed AccountName if successful. |
To parse successfully, the resource name must be formatted as one of the following:
accounts/{account}
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 AccountName)
public static bool TryParse(string accountName, out AccountName result)Tries to parse the given resource name string into a new AccountName instance.
| Parameters | |
|---|---|
| Name | Description |
accountName |
stringThe resource name in string form. Must not be |
result |
AccountNameWhen this method returns, the parsed AccountName, or |
| Returns | |
|---|---|
| Type | Description |
bool |
|
To parse successfully, the resource name must be formatted as one of the following:
accounts/{account}
TryParse(string, bool, out AccountName)
public static bool TryParse(string accountName, bool allowUnparsed, out AccountName result)Tries to parse the given resource name string into a new AccountName instance; optionally allowing an unparseable resource name.
| Parameters | |
|---|---|
| Name | Description |
accountName |
stringThe resource name in string form. Must not be |
allowUnparsed |
boolIf |
result |
AccountNameWhen this method returns, the parsed AccountName, or |
| Returns | |
|---|---|
| Type | Description |
bool |
|
To parse successfully, the resource name must be formatted as one of the following:
accounts/{account}
allowUnparsed is true.
Operators
operator ==(AccountName, AccountName)
public static bool operator ==(AccountName a, AccountName b)Determines whether two specified resource names have the same value.
| Parameters | |
|---|---|
| Name | Description |
a |
AccountNameThe first resource name to compare, or null. |
b |
AccountNameThe second resource name to compare, or null. |
| Returns | |
|---|---|
| Type | Description |
bool |
true if the value of |
operator !=(AccountName, AccountName)
public static bool operator !=(AccountName a, AccountName b)Determines whether two specified resource names have different values.
| Parameters | |
|---|---|
| Name | Description |
a |
AccountNameThe first resource name to compare, or null. |
b |
AccountNameThe second resource name to compare, or null. |
| Returns | |
|---|---|
| Type | Description |
bool |
true if the value of |