public sealed class ContactName : IResourceName, IEquatable<ContactName>
Reference documentation and code samples for the Essential Contacts v1 API class ContactName.
Resource name for the Contact
resource.
Namespace
Google.Cloud.EssentialContacts.V1Assembly
Google.Cloud.EssentialContacts.V1.dll
Constructors
ContactName(string, string)
public ContactName(string projectId, string contactId)
Constructs a new instance of a ContactName class from the component parts of pattern
projects/{project}/contacts/{contact}
Parameters | |
---|---|
Name | Description |
projectId |
string The |
contactId |
string The |
Properties
ContactId
public string ContactId { get; }
The Contact
ID. May be null
, depending on which resource name is contained by this instance.
Property Value | |
---|---|
Type | Description |
string |
FolderId
public string FolderId { get; }
The Folder
ID. May be null
, depending on which resource name is contained by this instance.
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 |
OrganizationId
public string OrganizationId { get; }
The Organization
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 ContactName.ResourceNameType Type { get; }
The ContactName.ResourceNameType of the contained resource name.
Property Value | |
---|---|
Type | Description |
ContactNameResourceNameType |
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 contactId)
Formats the IDs into the string representation of this ContactName with pattern
projects/{project}/contacts/{contact}
.
Parameters | |
---|---|
Name | Description |
projectId |
string The |
contactId |
string The |
Returns | |
---|---|
Type | Description |
string |
The string representation of this ContactName with pattern
|
FormatFolderContact(string, string)
public static string FormatFolderContact(string folderId, string contactId)
Formats the IDs into the string representation of this ContactName with pattern
folders/{folder}/contacts/{contact}
.
Parameters | |
---|---|
Name | Description |
folderId |
string The |
contactId |
string The |
Returns | |
---|---|
Type | Description |
string |
The string representation of this ContactName with pattern
|
FormatOrganizationContact(string, string)
public static string FormatOrganizationContact(string organizationId, string contactId)
Formats the IDs into the string representation of this ContactName with pattern
organizations/{organization}/contacts/{contact}
.
Parameters | |
---|---|
Name | Description |
organizationId |
string The |
contactId |
string The |
Returns | |
---|---|
Type | Description |
string |
The string representation of this ContactName with pattern
|
FormatProjectContact(string, string)
public static string FormatProjectContact(string projectId, string contactId)
Formats the IDs into the string representation of this ContactName with pattern
projects/{project}/contacts/{contact}
.
Parameters | |
---|---|
Name | Description |
projectId |
string The |
contactId |
string The |
Returns | |
---|---|
Type | Description |
string |
The string representation of this ContactName with pattern
|
FromFolderContact(string, string)
public static ContactName FromFolderContact(string folderId, string contactId)
Creates a ContactName with the pattern folders/{folder}/contacts/{contact}
.
Parameters | |
---|---|
Name | Description |
folderId |
string The |
contactId |
string The |
Returns | |
---|---|
Type | Description |
ContactName |
A new instance of ContactName constructed from the provided ids. |
FromOrganizationContact(string, string)
public static ContactName FromOrganizationContact(string organizationId, string contactId)
Creates a ContactName with the pattern organizations/{organization}/contacts/{contact}
.
Parameters | |
---|---|
Name | Description |
organizationId |
string The |
contactId |
string The |
Returns | |
---|---|
Type | Description |
ContactName |
A new instance of ContactName constructed from the provided ids. |
FromProjectContact(string, string)
public static ContactName FromProjectContact(string projectId, string contactId)
Creates a ContactName with the pattern projects/{project}/contacts/{contact}
.
Parameters | |
---|---|
Name | Description |
projectId |
string The |
contactId |
string The |
Returns | |
---|---|
Type | Description |
ContactName |
A new instance of ContactName constructed from the provided ids. |
FromUnparsed(UnparsedResourceName)
public static ContactName FromUnparsed(UnparsedResourceName unparsedResourceName)
Creates a ContactName containing an unparsed resource name.
Parameter | |
---|---|
Name | Description |
unparsedResourceName |
UnparsedResourceName The unparsed resource name. Must not be |
Returns | |
---|---|
Type | Description |
ContactName |
A new instance of ContactName containing the provided |
GetHashCode()
public override int GetHashCode()
Returns a hash code for this resource name.
Returns | |
---|---|
Type | Description |
int |
Parse(string)
public static ContactName Parse(string contactName)
Parses the given resource name string into a new ContactName instance.
Parameter | |
---|---|
Name | Description |
contactName |
string The resource name in string form. Must not be |
Returns | |
---|---|
Type | Description |
ContactName |
The parsed ContactName if successful. |
To parse successfully, the resource name must be formatted as one of the following:
projects/{project}/contacts/{contact}
folders/{folder}/contacts/{contact}
organizations/{organization}/contacts/{contact}
Parse(string, bool)
public static ContactName Parse(string contactName, bool allowUnparsed)
Parses the given resource name string into a new ContactName instance; optionally allowing an unparseable resource name.
Parameters | |
---|---|
Name | Description |
contactName |
string The resource name in string form. Must not be |
allowUnparsed |
bool If |
Returns | |
---|---|
Type | Description |
ContactName |
The parsed ContactName if successful. |
To parse successfully, the resource name must be formatted as one of the following:
projects/{project}/contacts/{contact}
folders/{folder}/contacts/{contact}
organizations/{organization}/contacts/{contact}
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 ContactName)
public static bool TryParse(string contactName, out ContactName result)
Tries to parse the given resource name string into a new ContactName instance.
Parameters | |
---|---|
Name | Description |
contactName |
string The resource name in string form. Must not be |
result |
ContactName When this method returns, the parsed ContactName, or |
Returns | |
---|---|
Type | Description |
bool |
|
To parse successfully, the resource name must be formatted as one of the following:
projects/{project}/contacts/{contact}
folders/{folder}/contacts/{contact}
organizations/{organization}/contacts/{contact}
TryParse(string, bool, out ContactName)
public static bool TryParse(string contactName, bool allowUnparsed, out ContactName result)
Tries to parse the given resource name string into a new ContactName instance; optionally allowing an unparseable resource name.
Parameters | |
---|---|
Name | Description |
contactName |
string The resource name in string form. Must not be |
allowUnparsed |
bool If |
result |
ContactName When this method returns, the parsed ContactName, or |
Returns | |
---|---|
Type | Description |
bool |
|
To parse successfully, the resource name must be formatted as one of the following:
projects/{project}/contacts/{contact}
folders/{folder}/contacts/{contact}
organizations/{organization}/contacts/{contact}
allowUnparsed
is true
.
Operators
operator ==(ContactName, ContactName)
public static bool operator ==(ContactName a, ContactName b)
Determines whether two specified resource names have the same value.
Parameters | |
---|---|
Name | Description |
a |
ContactName The first resource name to compare, or null. |
b |
ContactName The second resource name to compare, or null. |
Returns | |
---|---|
Type | Description |
bool |
true if the value of |
operator !=(ContactName, ContactName)
public static bool operator !=(ContactName a, ContactName b)
Determines whether two specified resource names have different values.
Parameters | |
---|---|
Name | Description |
a |
ContactName The first resource name to compare, or null. |
b |
ContactName The second resource name to compare, or null. |
Returns | |
---|---|
Type | Description |
bool |
true if the value of |