public sealed class ContactName : IResourceName, IEquatable<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 |
StringThe |
contactId |
StringThe |
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 |
Boolean |
|
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 |
ContactName.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, 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 |
StringThe |
contactId |
StringThe |
| 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 |
StringThe |
contactId |
StringThe |
| 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 |
StringThe |
contactId |
StringThe |
| 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 |
StringThe |
contactId |
StringThe |
| 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 |
StringThe |
contactId |
StringThe |
| 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 |
StringThe |
contactId |
StringThe |
| 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 |
StringThe |
contactId |
StringThe |
| 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 |
UnparsedResourceNameThe 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 |
Int32 |
|
Parse(String)
public static ContactName Parse(string contactName)Parses the given resource name string into a new ContactName instance.
| Parameter | |
|---|---|
| Name | Description |
contactName |
StringThe 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, Boolean)
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 |
StringThe resource name in string form. Must not be |
allowUnparsed |
BooleanIf |
| 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 |
StringThe resource name in string form. Must not be |
result |
ContactNameWhen this method returns, the parsed ContactName, or |
| Returns | |
|---|---|
| Type | Description |
Boolean |
|
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, Boolean, 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 |
StringThe resource name in string form. Must not be |
allowUnparsed |
BooleanIf |
result |
ContactNameWhen this method returns, the parsed ContactName, or |
| Returns | |
|---|---|
| Type | Description |
Boolean |
|
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
Equality(ContactName, ContactName)
public static bool operator ==(ContactName a, ContactName b)| Parameters | |
|---|---|
| Name | Description |
a |
ContactName |
b |
ContactName |
| Returns | |
|---|---|
| Type | Description |
Boolean |
|
Inequality(ContactName, ContactName)
public static bool operator !=(ContactName a, ContactName b)| Parameters | |
|---|---|
| Name | Description |
a |
ContactName |
b |
ContactName |
| Returns | |
|---|---|
| Type | Description |
Boolean |
|