Class ContextName
Resource name for the Context
resource.
Inherited Members
Namespace: Google.Cloud.Dialogflow.V2
Assembly: Google.Cloud.Dialogflow.V2.dll
Syntax
public sealed class ContextName : IResourceName, IEquatable<ContextName>
Constructors
ContextName(string, string, string)
Constructs a new instance of a ContextName class from the component parts of pattern
projects/{project}/agent/sessions/{session}/contexts/{context}
Declaration
public ContextName(string projectId, string sessionId, string contextId)
Parameters
Type | Name | Description |
---|---|---|
string | projectId | The |
string | sessionId | The |
string | contextId | The |
Properties
ContextId
The Context
ID. May be null
, depending on which resource name is contained by this instance.
Declaration
public string ContextId { get; }
Property Value
Type | Description |
---|---|
string |
EnvironmentId
The Environment
ID. May be null
, depending on which resource name is contained by this
instance.
Declaration
public string EnvironmentId { get; }
Property Value
Type | Description |
---|---|
string |
IsKnownPattern
Whether this instance contains a resource name with a known pattern.
Declaration
public bool IsKnownPattern { get; }
Property Value
Type | Description |
---|---|
bool |
Implements
LocationId
The Location
ID. May be null
, depending on which resource name is contained by this instance.
Declaration
public string LocationId { get; }
Property Value
Type | Description |
---|---|
string |
ProjectId
The Project
ID. May be null
, depending on which resource name is contained by this instance.
Declaration
public string ProjectId { get; }
Property Value
Type | Description |
---|---|
string |
SessionId
The Session
ID. May be null
, depending on which resource name is contained by this instance.
Declaration
public string SessionId { get; }
Property Value
Type | Description |
---|---|
string |
Type
The ContextName.ResourceNameType of the contained resource name.
Declaration
public ContextName.ResourceNameType Type { get; }
Property Value
Type | Description |
---|---|
ContextName.ResourceNameType |
UnparsedResource
The contained UnparsedResourceName. Only non-null
if this instance contains an
unparsed resource name.
Declaration
public UnparsedResourceName UnparsedResource { get; }
Property Value
Type | Description |
---|---|
UnparsedResourceName |
UserId
The User
ID. May be null
, depending on which resource name is contained by this instance.
Declaration
public string UserId { get; }
Property Value
Type | Description |
---|---|
string |
Methods
Format(string, string, string)
Formats the IDs into the string representation of this ContextName with pattern
projects/{project}/agent/sessions/{session}/contexts/{context}
.
Declaration
public static string Format(string projectId, string sessionId, string contextId)
Parameters
Type | Name | Description |
---|---|---|
string | projectId | The |
string | sessionId | The |
string | contextId | The |
Returns
Type | Description |
---|---|
string | The string representation of this ContextName with pattern
|
FormatProjectEnvironmentUserSessionContext(string, string, string, string, string)
Formats the IDs into the string representation of this ContextName with pattern
projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}
.
Declaration
public static string FormatProjectEnvironmentUserSessionContext(string projectId, string environmentId, string userId, string sessionId, string contextId)
Parameters
Type | Name | Description |
---|---|---|
string | projectId | The |
string | environmentId | The |
string | userId | The |
string | sessionId | The |
string | contextId | The |
Returns
Type | Description |
---|---|
string | The string representation of this ContextName with pattern
|
FormatProjectLocationEnvironmentUserSessionContext(string, string, string, string, string, string)
Formats the IDs into the string representation of this ContextName with pattern
projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}
.
Declaration
public static string FormatProjectLocationEnvironmentUserSessionContext(string projectId, string locationId, string environmentId, string userId, string sessionId, string contextId)
Parameters
Type | Name | Description |
---|---|---|
string | projectId | The |
string | locationId | The |
string | environmentId | The |
string | userId | The |
string | sessionId | The |
string | contextId | The |
Returns
Type | Description |
---|---|
string | The string representation of this ContextName with pattern
|
FormatProjectLocationSessionContext(string, string, string, string)
Formats the IDs into the string representation of this ContextName with pattern
projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context}
.
Declaration
public static string FormatProjectLocationSessionContext(string projectId, string locationId, string sessionId, string contextId)
Parameters
Type | Name | Description |
---|---|---|
string | projectId | The |
string | locationId | The |
string | sessionId | The |
string | contextId | The |
Returns
Type | Description |
---|---|
string | The string representation of this ContextName with pattern
|
FormatProjectSessionContext(string, string, string)
Formats the IDs into the string representation of this ContextName with pattern
projects/{project}/agent/sessions/{session}/contexts/{context}
.
Declaration
public static string FormatProjectSessionContext(string projectId, string sessionId, string contextId)
Parameters
Type | Name | Description |
---|---|---|
string | projectId | The |
string | sessionId | The |
string | contextId | The |
Returns
Type | Description |
---|---|
string | The string representation of this ContextName with pattern
|
FromProjectEnvironmentUserSessionContext(string, string, string, string, string)
Creates a ContextName with the pattern
projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}
.
Declaration
public static ContextName FromProjectEnvironmentUserSessionContext(string projectId, string environmentId, string userId, string sessionId, string contextId)
Parameters
Type | Name | Description |
---|---|---|
string | projectId | The |
string | environmentId | The |
string | userId | The |
string | sessionId | The |
string | contextId | The |
Returns
Type | Description |
---|---|
ContextName | A new instance of ContextName constructed from the provided ids. |
FromProjectLocationEnvironmentUserSessionContext(string, string, string, string, string, string)
Creates a ContextName with the pattern
projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}
.
Declaration
public static ContextName FromProjectLocationEnvironmentUserSessionContext(string projectId, string locationId, string environmentId, string userId, string sessionId, string contextId)
Parameters
Type | Name | Description |
---|---|---|
string | projectId | The |
string | locationId | The |
string | environmentId | The |
string | userId | The |
string | sessionId | The |
string | contextId | The |
Returns
Type | Description |
---|---|
ContextName | A new instance of ContextName constructed from the provided ids. |
FromProjectLocationSessionContext(string, string, string, string)
Creates a ContextName with the pattern
projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context}
.
Declaration
public static ContextName FromProjectLocationSessionContext(string projectId, string locationId, string sessionId, string contextId)
Parameters
Type | Name | Description |
---|---|---|
string | projectId | The |
string | locationId | The |
string | sessionId | The |
string | contextId | The |
Returns
Type | Description |
---|---|
ContextName | A new instance of ContextName constructed from the provided ids. |
FromProjectSessionContext(string, string, string)
Creates a ContextName with the pattern
projects/{project}/agent/sessions/{session}/contexts/{context}
.
Declaration
public static ContextName FromProjectSessionContext(string projectId, string sessionId, string contextId)
Parameters
Type | Name | Description |
---|---|---|
string | projectId | The |
string | sessionId | The |
string | contextId | The |
Returns
Type | Description |
---|---|
ContextName | A new instance of ContextName constructed from the provided ids. |
FromUnparsed(UnparsedResourceName)
Creates a ContextName containing an unparsed resource name.
Declaration
public static ContextName FromUnparsed(UnparsedResourceName unparsedResourceName)
Parameters
Type | Name | Description |
---|---|---|
UnparsedResourceName | unparsedResourceName | The unparsed resource name. Must not be |
Returns
Type | Description |
---|---|
ContextName | A new instance of ContextName containing the provided |
GetHashCode()
Returns a hash code for this resource name.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int |
Overrides
Parse(string)
Parses the given resource name string into a new ContextName instance.
Declaration
public static ContextName Parse(string contextName)
Parameters
Type | Name | Description |
---|---|---|
string | contextName | The resource name in string form. Must not be |
Returns
Type | Description |
---|---|
ContextName | The parsed ContextName if successful. |
Remarks
To parse successfully, the resource name must be formatted as one of the following:
projects/{project}/agent/sessions/{session}/contexts/{context}
projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}
projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context}
projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}
Parse(string, bool)
Parses the given resource name string into a new ContextName instance; optionally allowing an unparseable resource name.
Declaration
public static ContextName Parse(string contextName, bool allowUnparsed)
Parameters
Type | Name | Description |
---|---|---|
string | contextName | The resource name in string form. Must not be |
bool | allowUnparsed | If |
Returns
Type | Description |
---|---|
ContextName | The parsed ContextName if successful. |
Remarks
To parse successfully, the resource name must be formatted as one of the following:
projects/{project}/agent/sessions/{session}/contexts/{context}
projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}
projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context}
projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}
allowUnparsed
is true
.
ToString()
The string representation of the resource name.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | The string representation of the resource name. |
Overrides
Implements
TryParse(string, out ContextName)
Tries to parse the given resource name string into a new ContextName instance.
Declaration
public static bool TryParse(string contextName, out ContextName result)
Parameters
Type | Name | Description |
---|---|---|
string | contextName | The resource name in string form. Must not be |
ContextName | result | When this method returns, the parsed ContextName, or |
Returns
Type | Description |
---|---|
bool |
|
Remarks
To parse successfully, the resource name must be formatted as one of the following:
projects/{project}/agent/sessions/{session}/contexts/{context}
projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}
projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context}
projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}
TryParse(string, bool, out ContextName)
Tries to parse the given resource name string into a new ContextName instance; optionally allowing an unparseable resource name.
Declaration
public static bool TryParse(string contextName, bool allowUnparsed, out ContextName result)
Parameters
Type | Name | Description |
---|---|---|
string | contextName | The resource name in string form. Must not be |
bool | allowUnparsed | If |
ContextName | result | When this method returns, the parsed ContextName, or |
Returns
Type | Description |
---|---|
bool |
|
Remarks
To parse successfully, the resource name must be formatted as one of the following:
projects/{project}/agent/sessions/{session}/contexts/{context}
projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}
projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context}
projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}
allowUnparsed
is true
.
Operators
operator ==(ContextName, ContextName)
Determines whether two specified resource names have the same value.
Declaration
public static bool operator ==(ContextName a, ContextName b)
Parameters
Type | Name | Description |
---|---|---|
ContextName | a | The first resource name to compare, or null. |
ContextName | b | The second resource name to compare, or null. |
Returns
Type | Description |
---|---|
bool | true if the value of |
operator !=(ContextName, ContextName)
Determines whether two specified resource names have different values.
Declaration
public static bool operator !=(ContextName a, ContextName b)
Parameters
Type | Name | Description |
---|---|---|
ContextName | a | The first resource name to compare, or null. |
ContextName | b | The second resource name to compare, or null. |
Returns
Type | Description |
---|---|
bool | true if the value of |