Google Cloud Dialogflow v2beta1 API - Class PhoneNumberName (1.0.0-beta22)

public sealed class PhoneNumberName : IResourceName, IEquatable<PhoneNumberName>

Reference documentation and code samples for the Google Cloud Dialogflow v2beta1 API class PhoneNumberName.

Resource name for the PhoneNumber resource.

Inheritance

object > PhoneNumberName

Namespace

Google.Cloud.Dialogflow.V2Beta1

Assembly

Google.Cloud.Dialogflow.V2Beta1.dll

Constructors

PhoneNumberName(string, string)

public PhoneNumberName(string projectId, string phoneNumberId)

Constructs a new instance of a PhoneNumberName class from the component parts of pattern projects/{project}/phoneNumbers/{phone_number}

Parameters
Name Description
projectId string

The Project ID. Must not be null or empty.

phoneNumberId string

The PhoneNumber ID. Must not be null or empty.

Properties

IsKnownPattern

public bool IsKnownPattern { get; }

Whether this instance contains a resource name with a known pattern.

Property Value
Type Description
bool

LocationId

public string LocationId { get; }

The Location ID. May be null, depending on which resource name is contained by this instance.

Property Value
Type Description
string

PhoneNumberId

public string PhoneNumberId { get; }

The PhoneNumber ID. May be null, depending on which resource name is contained by this instance.

Property Value
Type Description
string

ProjectId

public string ProjectId { get; }

The Project ID. May be null, depending on which resource name is contained by this instance.

Property Value
Type Description
string

Type

public PhoneNumberName.ResourceNameType Type { get; }

The PhoneNumberName.ResourceNameType of the contained resource name.

Property Value
Type Description
PhoneNumberNameResourceNameType

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, string)

public static string Format(string projectId, string phoneNumberId)

Formats the IDs into the string representation of this PhoneNumberName with pattern projects/{project}/phoneNumbers/{phone_number}.

Parameters
Name Description
projectId string

The Project ID. Must not be null or empty.

phoneNumberId string

The PhoneNumber ID. Must not be null or empty.

Returns
Type Description
string

The string representation of this PhoneNumberName with pattern projects/{project}/phoneNumbers/{phone_number}.

FormatProjectLocationPhoneNumber(string, string, string)

public static string FormatProjectLocationPhoneNumber(string projectId, string locationId, string phoneNumberId)

Formats the IDs into the string representation of this PhoneNumberName with pattern projects/{project}/locations/{location}/phoneNumbers/{phone_number}.

Parameters
Name Description
projectId string

The Project ID. Must not be null or empty.

locationId string

The Location ID. Must not be null or empty.

phoneNumberId string

The PhoneNumber ID. Must not be null or empty.

Returns
Type Description
string

The string representation of this PhoneNumberName with pattern projects/{project}/locations/{location}/phoneNumbers/{phone_number}.

FormatProjectPhoneNumber(string, string)

public static string FormatProjectPhoneNumber(string projectId, string phoneNumberId)

Formats the IDs into the string representation of this PhoneNumberName with pattern projects/{project}/phoneNumbers/{phone_number}.

Parameters
Name Description
projectId string

The Project ID. Must not be null or empty.

phoneNumberId string

The PhoneNumber ID. Must not be null or empty.

Returns
Type Description
string

The string representation of this PhoneNumberName with pattern projects/{project}/phoneNumbers/{phone_number}.

FromProjectLocationPhoneNumber(string, string, string)

public static PhoneNumberName FromProjectLocationPhoneNumber(string projectId, string locationId, string phoneNumberId)

Creates a PhoneNumberName with the pattern projects/{project}/locations/{location}/phoneNumbers/{phone_number}.

Parameters
Name Description
projectId string

The Project ID. Must not be null or empty.

locationId string

The Location ID. Must not be null or empty.

phoneNumberId string

The PhoneNumber ID. Must not be null or empty.

Returns
Type Description
PhoneNumberName

A new instance of PhoneNumberName constructed from the provided ids.

FromProjectPhoneNumber(string, string)

public static PhoneNumberName FromProjectPhoneNumber(string projectId, string phoneNumberId)

Creates a PhoneNumberName with the pattern projects/{project}/phoneNumbers/{phone_number} .

Parameters
Name Description
projectId string

The Project ID. Must not be null or empty.

phoneNumberId string

The PhoneNumber ID. Must not be null or empty.

Returns
Type Description
PhoneNumberName

A new instance of PhoneNumberName constructed from the provided ids.

FromUnparsed(UnparsedResourceName)

public static PhoneNumberName FromUnparsed(UnparsedResourceName unparsedResourceName)

Creates a PhoneNumberName containing an unparsed resource name.

Parameter
Name Description
unparsedResourceName UnparsedResourceName

The unparsed resource name. Must not be null.

Returns
Type Description
PhoneNumberName

A new instance of PhoneNumberName containing the provided unparsedResourceName.

GetHashCode()

public override int GetHashCode()

Returns a hash code for this resource name.

Returns
Type Description
int
Overrides

Parse(string)

public static PhoneNumberName Parse(string phoneNumberName)

Parses the given resource name string into a new PhoneNumberName instance.

Parameter
Name Description
phoneNumberName string

The resource name in string form. Must not be null.

Returns
Type Description
PhoneNumberName

The parsed PhoneNumberName if successful.

Remarks

To parse successfully, the resource name must be formatted as one of the following:

  • projects/{project}/phoneNumbers/{phone_number}
  • projects/{project}/locations/{location}/phoneNumbers/{phone_number}

Parse(string, bool)

public static PhoneNumberName Parse(string phoneNumberName, bool allowUnparsed)

Parses the given resource name string into a new PhoneNumberName instance; optionally allowing an unparseable resource name.

Parameters
Name Description
phoneNumberName string

The resource name in string form. Must not be null.

allowUnparsed bool

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.

Returns
Type Description
PhoneNumberName

The parsed PhoneNumberName if successful.

Remarks

To parse successfully, the resource name must be formatted as one of the following:

  • projects/{project}/phoneNumbers/{phone_number}
  • projects/{project}/locations/{location}/phoneNumbers/{phone_number}
Or may be in any format if 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.

Overrides

TryParse(string, out PhoneNumberName)

public static bool TryParse(string phoneNumberName, out PhoneNumberName result)

Tries to parse the given resource name string into a new PhoneNumberName instance.

Parameters
Name Description
phoneNumberName string

The resource name in string form. Must not be null.

result PhoneNumberName

When this method returns, the parsed PhoneNumberName, or null if parsing failed.

Returns
Type Description
bool

true if the name was parsed successfully; false otherwise.

Remarks

To parse successfully, the resource name must be formatted as one of the following:

  • projects/{project}/phoneNumbers/{phone_number}
  • projects/{project}/locations/{location}/phoneNumbers/{phone_number}

TryParse(string, bool, out PhoneNumberName)

public static bool TryParse(string phoneNumberName, bool allowUnparsed, out PhoneNumberName result)

Tries to parse the given resource name string into a new PhoneNumberName instance; optionally allowing an unparseable resource name.

Parameters
Name Description
phoneNumberName string

The resource name in string form. Must not be null.

allowUnparsed bool

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.

result PhoneNumberName

When this method returns, the parsed PhoneNumberName, or null if parsing failed.

Returns
Type Description
bool

true if the name was parsed successfully; false otherwise.

Remarks

To parse successfully, the resource name must be formatted as one of the following:

  • projects/{project}/phoneNumbers/{phone_number}
  • projects/{project}/locations/{location}/phoneNumbers/{phone_number}
Or may be in any format if allowUnparsed is true.

Operators

operator ==(PhoneNumberName, PhoneNumberName)

public static bool operator ==(PhoneNumberName a, PhoneNumberName b)

Determines whether two specified resource names have the same value.

Parameters
Name Description
a PhoneNumberName

The first resource name to compare, or null.

b PhoneNumberName

The second resource name to compare, or null.

Returns
Type Description
bool

true if the value of a is the same as the value of b; otherwise, false.

operator !=(PhoneNumberName, PhoneNumberName)

public static bool operator !=(PhoneNumberName a, PhoneNumberName b)

Determines whether two specified resource names have different values.

Parameters
Name Description
a PhoneNumberName

The first resource name to compare, or null.

b PhoneNumberName

The second resource name to compare, or null.

Returns
Type Description
bool

true if the value of a is different from the value of b; otherwise, false.