Discovery Engine v1 API - Class AnswerName (1.5.0)

public sealed class AnswerName : IResourceName, IEquatable<AnswerName>

Reference documentation and code samples for the Discovery Engine v1 API class AnswerName.

Resource name for the Answer resource.

Inheritance

object > AnswerName

Namespace

Google.Cloud.DiscoveryEngine.V1

Assembly

Google.Cloud.DiscoveryEngine.V1.dll

Constructors

AnswerName(string, string, string, string, string)

public AnswerName(string projectId, string locationId, string dataStoreId, string sessionId, string answerId)

Constructs a new instance of a AnswerName class from the component parts of pattern projects/{project}/locations/{location}/dataStores/{data_store}/sessions/{session}/answers/{answer}

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.

dataStoreId string

The DataStore ID. Must not be null or empty.

sessionId string

The Session ID. Must not be null or empty.

answerId string

The Answer ID. Must not be null or empty.

Properties

AnswerId

public string AnswerId { get; }

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

Property Value
Type Description
string

CollectionId

public string CollectionId { get; }

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

Property Value
Type Description
string

DataStoreId

public string DataStoreId { get; }

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

Property Value
Type Description
string

EngineId

public string EngineId { get; }

The Engine 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

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

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

SessionId

public string SessionId { get; }

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

Property Value
Type Description
string

Type

public AnswerName.ResourceNameType Type { get; }

The AnswerName.ResourceNameType of the contained resource name.

Property Value
Type Description
AnswerNameResourceNameType

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

public static string Format(string projectId, string locationId, string dataStoreId, string sessionId, string answerId)

Formats the IDs into the string representation of this AnswerName with pattern projects/{project}/locations/{location}/dataStores/{data_store}/sessions/{session}/answers/{answer}.

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.

dataStoreId string

The DataStore ID. Must not be null or empty.

sessionId string

The Session ID. Must not be null or empty.

answerId string

The Answer ID. Must not be null or empty.

Returns
Type Description
string

The string representation of this AnswerName with pattern projects/{project}/locations/{location}/dataStores/{data_store}/sessions/{session}/answers/{answer}.

FormatProjectLocationCollectionDataStoreSessionAnswer(string, string, string, string, string, string)

public static string FormatProjectLocationCollectionDataStoreSessionAnswer(string projectId, string locationId, string collectionId, string dataStoreId, string sessionId, string answerId)

Formats the IDs into the string representation of this AnswerName with pattern projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/sessions/{session}/answers/{answer} .

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.

collectionId string

The Collection ID. Must not be null or empty.

dataStoreId string

The DataStore ID. Must not be null or empty.

sessionId string

The Session ID. Must not be null or empty.

answerId string

The Answer ID. Must not be null or empty.

Returns
Type Description
string

The string representation of this AnswerName with pattern projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/sessions/{session}/answers/{answer} .

FormatProjectLocationCollectionEngineSessionAnswer(string, string, string, string, string, string)

public static string FormatProjectLocationCollectionEngineSessionAnswer(string projectId, string locationId, string collectionId, string engineId, string sessionId, string answerId)

Formats the IDs into the string representation of this AnswerName with pattern projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}/answers/{answer} .

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.

collectionId string

The Collection ID. Must not be null or empty.

engineId string

The Engine ID. Must not be null or empty.

sessionId string

The Session ID. Must not be null or empty.

answerId string

The Answer ID. Must not be null or empty.

Returns
Type Description
string

The string representation of this AnswerName with pattern projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}/answers/{answer} .

FormatProjectLocationDataStoreSessionAnswer(string, string, string, string, string)

public static string FormatProjectLocationDataStoreSessionAnswer(string projectId, string locationId, string dataStoreId, string sessionId, string answerId)

Formats the IDs into the string representation of this AnswerName with pattern projects/{project}/locations/{location}/dataStores/{data_store}/sessions/{session}/answers/{answer}.

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.

dataStoreId string

The DataStore ID. Must not be null or empty.

sessionId string

The Session ID. Must not be null or empty.

answerId string

The Answer ID. Must not be null or empty.

Returns
Type Description
string

The string representation of this AnswerName with pattern projects/{project}/locations/{location}/dataStores/{data_store}/sessions/{session}/answers/{answer}.

FromProjectLocationCollectionDataStoreSessionAnswer(string, string, string, string, string, string)

public static AnswerName FromProjectLocationCollectionDataStoreSessionAnswer(string projectId, string locationId, string collectionId, string dataStoreId, string sessionId, string answerId)

Creates a AnswerName with the pattern projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/sessions/{session}/answers/{answer} .

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.

collectionId string

The Collection ID. Must not be null or empty.

dataStoreId string

The DataStore ID. Must not be null or empty.

sessionId string

The Session ID. Must not be null or empty.

answerId string

The Answer ID. Must not be null or empty.

Returns
Type Description
AnswerName

A new instance of AnswerName constructed from the provided ids.

FromProjectLocationCollectionEngineSessionAnswer(string, string, string, string, string, string)

public static AnswerName FromProjectLocationCollectionEngineSessionAnswer(string projectId, string locationId, string collectionId, string engineId, string sessionId, string answerId)

Creates a AnswerName with the pattern projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}/answers/{answer} .

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.

collectionId string

The Collection ID. Must not be null or empty.

engineId string

The Engine ID. Must not be null or empty.

sessionId string

The Session ID. Must not be null or empty.

answerId string

The Answer ID. Must not be null or empty.

Returns
Type Description
AnswerName

A new instance of AnswerName constructed from the provided ids.

FromProjectLocationDataStoreSessionAnswer(string, string, string, string, string)

public static AnswerName FromProjectLocationDataStoreSessionAnswer(string projectId, string locationId, string dataStoreId, string sessionId, string answerId)

Creates a AnswerName with the pattern projects/{project}/locations/{location}/dataStores/{data_store}/sessions/{session}/answers/{answer}.

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.

dataStoreId string

The DataStore ID. Must not be null or empty.

sessionId string

The Session ID. Must not be null or empty.

answerId string

The Answer ID. Must not be null or empty.

Returns
Type Description
AnswerName

A new instance of AnswerName constructed from the provided ids.

FromUnparsed(UnparsedResourceName)

public static AnswerName FromUnparsed(UnparsedResourceName unparsedResourceName)

Creates a AnswerName containing an unparsed resource name.

Parameter
Name Description
unparsedResourceName UnparsedResourceName

The unparsed resource name. Must not be null.

Returns
Type Description
AnswerName

A new instance of AnswerName 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 AnswerName Parse(string answerName)

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

Parameter
Name Description
answerName string

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

Returns
Type Description
AnswerName

The parsed AnswerName if successful.

Remarks

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

  • projects/{project}/locations/{location}/dataStores/{data_store}/sessions/{session}/answers/{answer}
  • projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/sessions/{session}/answers/{answer}
  • projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}/answers/{answer}

Parse(string, bool)

public static AnswerName Parse(string answerName, bool allowUnparsed)

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

Parameters
Name Description
answerName 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
AnswerName

The parsed AnswerName if successful.

Remarks

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

  • projects/{project}/locations/{location}/dataStores/{data_store}/sessions/{session}/answers/{answer}
  • projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/sessions/{session}/answers/{answer}
  • projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}/answers/{answer}
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 AnswerName)

public static bool TryParse(string answerName, out AnswerName result)

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

Parameters
Name Description
answerName string

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

result AnswerName

When this method returns, the parsed AnswerName, 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}/locations/{location}/dataStores/{data_store}/sessions/{session}/answers/{answer}
  • projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/sessions/{session}/answers/{answer}
  • projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}/answers/{answer}

TryParse(string, bool, out AnswerName)

public static bool TryParse(string answerName, bool allowUnparsed, out AnswerName result)

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

Parameters
Name Description
answerName 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 AnswerName

When this method returns, the parsed AnswerName, 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}/locations/{location}/dataStores/{data_store}/sessions/{session}/answers/{answer}
  • projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/sessions/{session}/answers/{answer}
  • projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}/answers/{answer}
Or may be in any format if allowUnparsed is true.

Operators

operator ==(AnswerName, AnswerName)

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

Determines whether two specified resource names have the same value.

Parameters
Name Description
a AnswerName

The first resource name to compare, or null.

b AnswerName

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 !=(AnswerName, AnswerName)

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

Determines whether two specified resource names have different values.

Parameters
Name Description
a AnswerName

The first resource name to compare, or null.

b AnswerName

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.