Class IndexName

public sealed class IndexName : IResourceName, IEquatable<IndexName>

Resource name for the Index resource.

Inheritance

Object > IndexName

Namespace

Google.Cloud.Firestore.Admin.V1

Assembly

Google.Cloud.Firestore.Admin.V1.dll

Constructors

IndexName(String, String, String, String)

public IndexName(string projectId, string databaseId, string collectionId, string indexId)

Constructs a new instance of a IndexName class from the component parts of pattern projects/{project}/databases/{database}/collectionGroups/{collection}/indexes/{index}

Parameters
TypeNameDescription
StringprojectId

The Project ID. Must not be null or empty.

StringdatabaseId

The Database ID. Must not be null or empty.

StringcollectionId

The Collection ID. Must not be null or empty.

StringindexId

The Index ID. Must not be null or empty.

Properties

CollectionId

public string CollectionId { get; }

The Collection ID. Will not be null, unless this instance contains an unparsed resource name.

Property Value
TypeDescription
String

DatabaseId

public string DatabaseId { get; }

The Database ID. Will not be null, unless this instance contains an unparsed resource name.

Property Value
TypeDescription
String

IndexId

public string IndexId { get; }

The Index ID. Will not be null, unless this instance contains an unparsed resource name.

Property Value
TypeDescription
String

IsKnownPattern

public bool IsKnownPattern { get; }

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

Property Value
TypeDescription
Boolean

ProjectId

public string ProjectId { get; }

The Project ID. Will not be null, unless this instance contains an unparsed resource name.

Property Value
TypeDescription
String

Type

public IndexName.ResourceNameType Type { get; }

The IndexName.ResourceNameType of the contained resource name.

Property Value
TypeDescription
IndexName.ResourceNameType

UnparsedResource

public UnparsedResourceName UnparsedResource { get; }

The contained UnparsedResourceName. Only non-null if this instance contains an unparsed resource name.

Property Value
TypeDescription
UnparsedResourceName

Methods

Format(String, String, String, String)

public static string Format(string projectId, string databaseId, string collectionId, string indexId)

Formats the IDs into the string representation of this IndexName with pattern projects/{project}/databases/{database}/collectionGroups/{collection}/indexes/{index}.

Parameters
TypeNameDescription
StringprojectId

The Project ID. Must not be null or empty.

StringdatabaseId

The Database ID. Must not be null or empty.

StringcollectionId

The Collection ID. Must not be null or empty.

StringindexId

The Index ID. Must not be null or empty.

Returns
TypeDescription
String

The string representation of this IndexName with pattern projects/{project}/databases/{database}/collectionGroups/{collection}/indexes/{index}.

FormatProjectDatabaseCollectionIndex(String, String, String, String)

public static string FormatProjectDatabaseCollectionIndex(string projectId, string databaseId, string collectionId, string indexId)

Formats the IDs into the string representation of this IndexName with pattern projects/{project}/databases/{database}/collectionGroups/{collection}/indexes/{index}.

Parameters
TypeNameDescription
StringprojectId

The Project ID. Must not be null or empty.

StringdatabaseId

The Database ID. Must not be null or empty.

StringcollectionId

The Collection ID. Must not be null or empty.

StringindexId

The Index ID. Must not be null or empty.

Returns
TypeDescription
String

The string representation of this IndexName with pattern projects/{project}/databases/{database}/collectionGroups/{collection}/indexes/{index}.

FromProjectDatabaseCollectionIndex(String, String, String, String)

public static IndexName FromProjectDatabaseCollectionIndex(string projectId, string databaseId, string collectionId, string indexId)

Creates a IndexName with the pattern projects/{project}/databases/{database}/collectionGroups/{collection}/indexes/{index}.

Parameters
TypeNameDescription
StringprojectId

The Project ID. Must not be null or empty.

StringdatabaseId

The Database ID. Must not be null or empty.

StringcollectionId

The Collection ID. Must not be null or empty.

StringindexId

The Index ID. Must not be null or empty.

Returns
TypeDescription
IndexName

A new instance of IndexName constructed from the provided ids.

FromUnparsed(UnparsedResourceName)

public static IndexName FromUnparsed(UnparsedResourceName unparsedResourceName)

Creates a IndexName containing an unparsed resource name.

Parameter
TypeNameDescription
UnparsedResourceNameunparsedResourceName

The unparsed resource name. Must not be null.

Returns
TypeDescription
IndexName

A new instance of IndexName containing the provided unparsedResourceName.

GetHashCode()

public override int GetHashCode()

Returns a hash code for this resource name.

Returns
TypeDescription
Int32
Overrides

Parse(String)

public static IndexName Parse(string indexName)

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

Parameter
TypeNameDescription
StringindexName

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

Returns
TypeDescription
IndexName

The parsed IndexName if successful.

Remarks

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

  • projects/{project}/databases/{database}/collectionGroups/{collection}/indexes/{index}

Parse(String, Boolean)

public static IndexName Parse(string indexName, bool allowUnparsed)

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

Parameters
TypeNameDescription
StringindexName

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

BooleanallowUnparsed

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
TypeDescription
IndexName

The parsed IndexName if successful.

Remarks

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

  • projects/{project}/databases/{database}/collectionGroups/{collection}/indexes/{index}
Or may be in any format if allowUnparsed is true.

ToString()

public override string ToString()

The string representation of the resource name.

Returns
TypeDescription
String

The string representation of the resource name.

Overrides

TryParse(String, out IndexName)

public static bool TryParse(string indexName, out IndexName result)

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

Parameters
TypeNameDescription
StringindexName

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

IndexNameresult

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

Returns
TypeDescription
Boolean

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}/databases/{database}/collectionGroups/{collection}/indexes/{index}

TryParse(String, Boolean, out IndexName)

public static bool TryParse(string indexName, bool allowUnparsed, out IndexName result)

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

Parameters
TypeNameDescription
StringindexName

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

BooleanallowUnparsed

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.

IndexNameresult

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

Returns
TypeDescription
Boolean

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}/databases/{database}/collectionGroups/{collection}/indexes/{index}
Or may be in any format if allowUnparsed is true.

Operators

Equality(IndexName, IndexName)

public static bool operator ==(IndexName a, IndexName b)
Parameters
TypeNameDescription
IndexNamea
IndexNameb
Returns
TypeDescription
Boolean

Inequality(IndexName, IndexName)

public static bool operator !=(IndexName a, IndexName b)
Parameters
TypeNameDescription
IndexNamea
IndexNameb
Returns
TypeDescription
Boolean