public abstract class ConversationsClient
Reference documentation and code samples for the Google Cloud Dialogflow v2 API class ConversationsClient.
Conversations client wrapper, for convenient use.
Derived Types
Namespace
Google.Cloud.Dialogflow.V2Assembly
Google.Cloud.Dialogflow.V2.dll
Remarks
Service for managing [Conversations][google.cloud.dialogflow.v2.Conversation].
Properties
DefaultEndpoint
public static string DefaultEndpoint { get; }
The default endpoint for the Conversations service, which is a host of "dialogflow.googleapis.com" and a port of 443.
Property Value | |
---|---|
Type | Description |
String |
DefaultScopes
public static IReadOnlyList<string> DefaultScopes { get; }
The default Conversations scopes.
Property Value | |
---|---|
Type | Description |
IReadOnlyList<String> |
The default Conversations scopes are:
GrpcClient
public virtual Conversations.ConversationsClient GrpcClient { get; }
The underlying gRPC Conversations client
Property Value | |
---|---|
Type | Description |
Conversations.ConversationsClient |
LocationsClient
public virtual LocationsClient LocationsClient { get; }
The LocationsClient associated with this client.
Property Value | |
---|---|
Type | Description |
LocationsClient |
ServiceMetadata
public static ServiceMetadata ServiceMetadata { get; }
The service metadata associated with this client type.
Property Value | |
---|---|
Type | Description |
ServiceMetadata |
Methods
CompleteConversation(CompleteConversationRequest, CallSettings)
public virtual Conversation CompleteConversation(CompleteConversationRequest request, CallSettings callSettings = null)
Completes the specified conversation. Finished conversations are purged from the database after 30 days.
Parameters | |
---|---|
Name | Description |
request | CompleteConversationRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Conversation | The RPC response. |
// Create client
ConversationsClient conversationsClient = ConversationsClient.Create();
// Initialize request argument(s)
CompleteConversationRequest request = new CompleteConversationRequest
{
ConversationName = ConversationName.FromProjectConversation("[PROJECT]", "[CONVERSATION]"),
};
// Make the request
Conversation response = conversationsClient.CompleteConversation(request);
CompleteConversation(ConversationName, CallSettings)
public virtual Conversation CompleteConversation(ConversationName name, CallSettings callSettings = null)
Completes the specified conversation. Finished conversations are purged from the database after 30 days.
Parameters | |
---|---|
Name | Description |
name | ConversationName Required. Resource identifier of the conversation to close.
Format: |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Conversation | The RPC response. |
// Create client
ConversationsClient conversationsClient = ConversationsClient.Create();
// Initialize request argument(s)
ConversationName name = ConversationName.FromProjectConversation("[PROJECT]", "[CONVERSATION]");
// Make the request
Conversation response = conversationsClient.CompleteConversation(name);
CompleteConversation(String, CallSettings)
public virtual Conversation CompleteConversation(string name, CallSettings callSettings = null)
Completes the specified conversation. Finished conversations are purged from the database after 30 days.
Parameters | |
---|---|
Name | Description |
name | String Required. Resource identifier of the conversation to close.
Format: |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Conversation | The RPC response. |
// Create client
ConversationsClient conversationsClient = ConversationsClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/conversations/[CONVERSATION]";
// Make the request
Conversation response = conversationsClient.CompleteConversation(name);
CompleteConversationAsync(CompleteConversationRequest, CallSettings)
public virtual Task<Conversation> CompleteConversationAsync(CompleteConversationRequest request, CallSettings callSettings = null)
Completes the specified conversation. Finished conversations are purged from the database after 30 days.
Parameters | |
---|---|
Name | Description |
request | CompleteConversationRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Conversation> | A Task containing the RPC response. |
// Create client
ConversationsClient conversationsClient = await ConversationsClient.CreateAsync();
// Initialize request argument(s)
CompleteConversationRequest request = new CompleteConversationRequest
{
ConversationName = ConversationName.FromProjectConversation("[PROJECT]", "[CONVERSATION]"),
};
// Make the request
Conversation response = await conversationsClient.CompleteConversationAsync(request);
CompleteConversationAsync(CompleteConversationRequest, CancellationToken)
public virtual Task<Conversation> CompleteConversationAsync(CompleteConversationRequest request, CancellationToken cancellationToken)
Completes the specified conversation. Finished conversations are purged from the database after 30 days.
Parameters | |
---|---|
Name | Description |
request | CompleteConversationRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Conversation> | A Task containing the RPC response. |
// Create client
ConversationsClient conversationsClient = await ConversationsClient.CreateAsync();
// Initialize request argument(s)
CompleteConversationRequest request = new CompleteConversationRequest
{
ConversationName = ConversationName.FromProjectConversation("[PROJECT]", "[CONVERSATION]"),
};
// Make the request
Conversation response = await conversationsClient.CompleteConversationAsync(request);
CompleteConversationAsync(ConversationName, CallSettings)
public virtual Task<Conversation> CompleteConversationAsync(ConversationName name, CallSettings callSettings = null)
Completes the specified conversation. Finished conversations are purged from the database after 30 days.
Parameters | |
---|---|
Name | Description |
name | ConversationName Required. Resource identifier of the conversation to close.
Format: |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Conversation> | A Task containing the RPC response. |
// Create client
ConversationsClient conversationsClient = await ConversationsClient.CreateAsync();
// Initialize request argument(s)
ConversationName name = ConversationName.FromProjectConversation("[PROJECT]", "[CONVERSATION]");
// Make the request
Conversation response = await conversationsClient.CompleteConversationAsync(name);
CompleteConversationAsync(ConversationName, CancellationToken)
public virtual Task<Conversation> CompleteConversationAsync(ConversationName name, CancellationToken cancellationToken)
Completes the specified conversation. Finished conversations are purged from the database after 30 days.
Parameters | |
---|---|
Name | Description |
name | ConversationName Required. Resource identifier of the conversation to close.
Format: |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Conversation> | A Task containing the RPC response. |
// Create client
ConversationsClient conversationsClient = await ConversationsClient.CreateAsync();
// Initialize request argument(s)
ConversationName name = ConversationName.FromProjectConversation("[PROJECT]", "[CONVERSATION]");
// Make the request
Conversation response = await conversationsClient.CompleteConversationAsync(name);
CompleteConversationAsync(String, CallSettings)
public virtual Task<Conversation> CompleteConversationAsync(string name, CallSettings callSettings = null)
Completes the specified conversation. Finished conversations are purged from the database after 30 days.
Parameters | |
---|---|
Name | Description |
name | String Required. Resource identifier of the conversation to close.
Format: |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Conversation> | A Task containing the RPC response. |
// Create client
ConversationsClient conversationsClient = await ConversationsClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/conversations/[CONVERSATION]";
// Make the request
Conversation response = await conversationsClient.CompleteConversationAsync(name);
CompleteConversationAsync(String, CancellationToken)
public virtual Task<Conversation> CompleteConversationAsync(string name, CancellationToken cancellationToken)
Completes the specified conversation. Finished conversations are purged from the database after 30 days.
Parameters | |
---|---|
Name | Description |
name | String Required. Resource identifier of the conversation to close.
Format: |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Conversation> | A Task containing the RPC response. |
// Create client
ConversationsClient conversationsClient = await ConversationsClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/conversations/[CONVERSATION]";
// Make the request
Conversation response = await conversationsClient.CompleteConversationAsync(name);
Create()
public static ConversationsClient Create()
Synchronously creates a ConversationsClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use ConversationsClientBuilder.
Returns | |
---|---|
Type | Description |
ConversationsClient | The created ConversationsClient. |
CreateAsync(CancellationToken)
public static Task<ConversationsClient> CreateAsync(CancellationToken cancellationToken = default(CancellationToken))
Asynchronously creates a ConversationsClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use ConversationsClientBuilder.
Parameter | |
---|---|
Name | Description |
cancellationToken | CancellationToken The CancellationToken to use while creating the client. |
Returns | |
---|---|
Type | Description |
Task<ConversationsClient> | The task representing the created ConversationsClient. |
CreateConversation(LocationName, Conversation, CallSettings)
public virtual Conversation CreateConversation(LocationName parent, Conversation conversation, CallSettings callSettings = null)
Creates a new conversation. Conversations are auto-completed after 24 hours.
Conversation Lifecycle: There are two stages during a conversation: Automated Agent Stage and Assist Stage.
For Automated Agent Stage, there will be a dialogflow agent responding to user queries.
For Assist Stage, there's no dialogflow agent responding to user queries. But we will provide suggestions which are generated from conversation.
If [Conversation.conversation_profile][google.cloud.dialogflow.v2.Conversation.conversation_profile] is configured for a dialogflow
agent, conversation will start from Automated Agent Stage
, otherwise, it
will start from Assist Stage
. And during Automated Agent Stage
, once an
[Intent][google.cloud.dialogflow.v2.Intent] with [Intent.live_agent_handoff][google.cloud.dialogflow.v2.Intent.live_agent_handoff] is triggered, conversation
will transfer to Assist Stage.
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. Resource identifier of the project creating the conversation.
Format: |
conversation | Conversation Required. The conversation to create. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Conversation | The RPC response. |
// Create client
ConversationsClient conversationsClient = ConversationsClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Conversation conversation = new Conversation();
// Make the request
Conversation response = conversationsClient.CreateConversation(parent, conversation);
CreateConversation(ProjectName, Conversation, CallSettings)
public virtual Conversation CreateConversation(ProjectName parent, Conversation conversation, CallSettings callSettings = null)
Creates a new conversation. Conversations are auto-completed after 24 hours.
Conversation Lifecycle: There are two stages during a conversation: Automated Agent Stage and Assist Stage.
For Automated Agent Stage, there will be a dialogflow agent responding to user queries.
For Assist Stage, there's no dialogflow agent responding to user queries. But we will provide suggestions which are generated from conversation.
If [Conversation.conversation_profile][google.cloud.dialogflow.v2.Conversation.conversation_profile] is configured for a dialogflow
agent, conversation will start from Automated Agent Stage
, otherwise, it
will start from Assist Stage
. And during Automated Agent Stage
, once an
[Intent][google.cloud.dialogflow.v2.Intent] with [Intent.live_agent_handoff][google.cloud.dialogflow.v2.Intent.live_agent_handoff] is triggered, conversation
will transfer to Assist Stage.
Parameters | |
---|---|
Name | Description |
parent | ProjectName Required. Resource identifier of the project creating the conversation.
Format: |
conversation | Conversation Required. The conversation to create. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Conversation | The RPC response. |
// Create client
ConversationsClient conversationsClient = ConversationsClient.Create();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
Conversation conversation = new Conversation();
// Make the request
Conversation response = conversationsClient.CreateConversation(parent, conversation);
CreateConversation(CreateConversationRequest, CallSettings)
public virtual Conversation CreateConversation(CreateConversationRequest request, CallSettings callSettings = null)
Creates a new conversation. Conversations are auto-completed after 24 hours.
Conversation Lifecycle: There are two stages during a conversation: Automated Agent Stage and Assist Stage.
For Automated Agent Stage, there will be a dialogflow agent responding to user queries.
For Assist Stage, there's no dialogflow agent responding to user queries. But we will provide suggestions which are generated from conversation.
If [Conversation.conversation_profile][google.cloud.dialogflow.v2.Conversation.conversation_profile] is configured for a dialogflow
agent, conversation will start from Automated Agent Stage
, otherwise, it
will start from Assist Stage
. And during Automated Agent Stage
, once an
[Intent][google.cloud.dialogflow.v2.Intent] with [Intent.live_agent_handoff][google.cloud.dialogflow.v2.Intent.live_agent_handoff] is triggered, conversation
will transfer to Assist Stage.
Parameters | |
---|---|
Name | Description |
request | CreateConversationRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Conversation | The RPC response. |
// Create client
ConversationsClient conversationsClient = ConversationsClient.Create();
// Initialize request argument(s)
CreateConversationRequest request = new CreateConversationRequest
{
ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
Conversation = new Conversation(),
ConversationId = "",
};
// Make the request
Conversation response = conversationsClient.CreateConversation(request);
CreateConversation(String, Conversation, CallSettings)
public virtual Conversation CreateConversation(string parent, Conversation conversation, CallSettings callSettings = null)
Creates a new conversation. Conversations are auto-completed after 24 hours.
Conversation Lifecycle: There are two stages during a conversation: Automated Agent Stage and Assist Stage.
For Automated Agent Stage, there will be a dialogflow agent responding to user queries.
For Assist Stage, there's no dialogflow agent responding to user queries. But we will provide suggestions which are generated from conversation.
If [Conversation.conversation_profile][google.cloud.dialogflow.v2.Conversation.conversation_profile] is configured for a dialogflow
agent, conversation will start from Automated Agent Stage
, otherwise, it
will start from Assist Stage
. And during Automated Agent Stage
, once an
[Intent][google.cloud.dialogflow.v2.Intent] with [Intent.live_agent_handoff][google.cloud.dialogflow.v2.Intent.live_agent_handoff] is triggered, conversation
will transfer to Assist Stage.
Parameters | |
---|---|
Name | Description |
parent | String Required. Resource identifier of the project creating the conversation.
Format: |
conversation | Conversation Required. The conversation to create. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Conversation | The RPC response. |
// Create client
ConversationsClient conversationsClient = ConversationsClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
Conversation conversation = new Conversation();
// Make the request
Conversation response = conversationsClient.CreateConversation(parent, conversation);
CreateConversationAsync(LocationName, Conversation, CallSettings)
public virtual Task<Conversation> CreateConversationAsync(LocationName parent, Conversation conversation, CallSettings callSettings = null)
Creates a new conversation. Conversations are auto-completed after 24 hours.
Conversation Lifecycle: There are two stages during a conversation: Automated Agent Stage and Assist Stage.
For Automated Agent Stage, there will be a dialogflow agent responding to user queries.
For Assist Stage, there's no dialogflow agent responding to user queries. But we will provide suggestions which are generated from conversation.
If [Conversation.conversation_profile][google.cloud.dialogflow.v2.Conversation.conversation_profile] is configured for a dialogflow
agent, conversation will start from Automated Agent Stage
, otherwise, it
will start from Assist Stage
. And during Automated Agent Stage
, once an
[Intent][google.cloud.dialogflow.v2.Intent] with [Intent.live_agent_handoff][google.cloud.dialogflow.v2.Intent.live_agent_handoff] is triggered, conversation
will transfer to Assist Stage.
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. Resource identifier of the project creating the conversation.
Format: |
conversation | Conversation Required. The conversation to create. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Conversation> | A Task containing the RPC response. |
// Create client
ConversationsClient conversationsClient = await ConversationsClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Conversation conversation = new Conversation();
// Make the request
Conversation response = await conversationsClient.CreateConversationAsync(parent, conversation);
CreateConversationAsync(LocationName, Conversation, CancellationToken)
public virtual Task<Conversation> CreateConversationAsync(LocationName parent, Conversation conversation, CancellationToken cancellationToken)
Creates a new conversation. Conversations are auto-completed after 24 hours.
Conversation Lifecycle: There are two stages during a conversation: Automated Agent Stage and Assist Stage.
For Automated Agent Stage, there will be a dialogflow agent responding to user queries.
For Assist Stage, there's no dialogflow agent responding to user queries. But we will provide suggestions which are generated from conversation.
If [Conversation.conversation_profile][google.cloud.dialogflow.v2.Conversation.conversation_profile] is configured for a dialogflow
agent, conversation will start from Automated Agent Stage
, otherwise, it
will start from Assist Stage
. And during Automated Agent Stage
, once an
[Intent][google.cloud.dialogflow.v2.Intent] with [Intent.live_agent_handoff][google.cloud.dialogflow.v2.Intent.live_agent_handoff] is triggered, conversation
will transfer to Assist Stage.
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. Resource identifier of the project creating the conversation.
Format: |
conversation | Conversation Required. The conversation to create. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Conversation> | A Task containing the RPC response. |
// Create client
ConversationsClient conversationsClient = await ConversationsClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Conversation conversation = new Conversation();
// Make the request
Conversation response = await conversationsClient.CreateConversationAsync(parent, conversation);
CreateConversationAsync(ProjectName, Conversation, CallSettings)
public virtual Task<Conversation> CreateConversationAsync(ProjectName parent, Conversation conversation, CallSettings callSettings = null)
Creates a new conversation. Conversations are auto-completed after 24 hours.
Conversation Lifecycle: There are two stages during a conversation: Automated Agent Stage and Assist Stage.
For Automated Agent Stage, there will be a dialogflow agent responding to user queries.
For Assist Stage, there's no dialogflow agent responding to user queries. But we will provide suggestions which are generated from conversation.
If [Conversation.conversation_profile][google.cloud.dialogflow.v2.Conversation.conversation_profile] is configured for a dialogflow
agent, conversation will start from Automated Agent Stage
, otherwise, it
will start from Assist Stage
. And during Automated Agent Stage
, once an
[Intent][google.cloud.dialogflow.v2.Intent] with [Intent.live_agent_handoff][google.cloud.dialogflow.v2.Intent.live_agent_handoff] is triggered, conversation
will transfer to Assist Stage.
Parameters | |
---|---|
Name | Description |
parent | ProjectName Required. Resource identifier of the project creating the conversation.
Format: |
conversation | Conversation Required. The conversation to create. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Conversation> | A Task containing the RPC response. |
// Create client
ConversationsClient conversationsClient = await ConversationsClient.CreateAsync();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
Conversation conversation = new Conversation();
// Make the request
Conversation response = await conversationsClient.CreateConversationAsync(parent, conversation);
CreateConversationAsync(ProjectName, Conversation, CancellationToken)
public virtual Task<Conversation> CreateConversationAsync(ProjectName parent, Conversation conversation, CancellationToken cancellationToken)
Creates a new conversation. Conversations are auto-completed after 24 hours.
Conversation Lifecycle: There are two stages during a conversation: Automated Agent Stage and Assist Stage.
For Automated Agent Stage, there will be a dialogflow agent responding to user queries.
For Assist Stage, there's no dialogflow agent responding to user queries. But we will provide suggestions which are generated from conversation.
If [Conversation.conversation_profile][google.cloud.dialogflow.v2.Conversation.conversation_profile] is configured for a dialogflow
agent, conversation will start from Automated Agent Stage
, otherwise, it
will start from Assist Stage
. And during Automated Agent Stage
, once an
[Intent][google.cloud.dialogflow.v2.Intent] with [Intent.live_agent_handoff][google.cloud.dialogflow.v2.Intent.live_agent_handoff] is triggered, conversation
will transfer to Assist Stage.
Parameters | |
---|---|
Name | Description |
parent | ProjectName Required. Resource identifier of the project creating the conversation.
Format: |
conversation | Conversation Required. The conversation to create. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Conversation> | A Task containing the RPC response. |
// Create client
ConversationsClient conversationsClient = await ConversationsClient.CreateAsync();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
Conversation conversation = new Conversation();
// Make the request
Conversation response = await conversationsClient.CreateConversationAsync(parent, conversation);
CreateConversationAsync(CreateConversationRequest, CallSettings)
public virtual Task<Conversation> CreateConversationAsync(CreateConversationRequest request, CallSettings callSettings = null)
Creates a new conversation. Conversations are auto-completed after 24 hours.
Conversation Lifecycle: There are two stages during a conversation: Automated Agent Stage and Assist Stage.
For Automated Agent Stage, there will be a dialogflow agent responding to user queries.
For Assist Stage, there's no dialogflow agent responding to user queries. But we will provide suggestions which are generated from conversation.
If [Conversation.conversation_profile][google.cloud.dialogflow.v2.Conversation.conversation_profile] is configured for a dialogflow
agent, conversation will start from Automated Agent Stage
, otherwise, it
will start from Assist Stage
. And during Automated Agent Stage
, once an
[Intent][google.cloud.dialogflow.v2.Intent] with [Intent.live_agent_handoff][google.cloud.dialogflow.v2.Intent.live_agent_handoff] is triggered, conversation
will transfer to Assist Stage.
Parameters | |
---|---|
Name | Description |
request | CreateConversationRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Conversation> | A Task containing the RPC response. |
// Create client
ConversationsClient conversationsClient = await ConversationsClient.CreateAsync();
// Initialize request argument(s)
CreateConversationRequest request = new CreateConversationRequest
{
ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
Conversation = new Conversation(),
ConversationId = "",
};
// Make the request
Conversation response = await conversationsClient.CreateConversationAsync(request);
CreateConversationAsync(CreateConversationRequest, CancellationToken)
public virtual Task<Conversation> CreateConversationAsync(CreateConversationRequest request, CancellationToken cancellationToken)
Creates a new conversation. Conversations are auto-completed after 24 hours.
Conversation Lifecycle: There are two stages during a conversation: Automated Agent Stage and Assist Stage.
For Automated Agent Stage, there will be a dialogflow agent responding to user queries.
For Assist Stage, there's no dialogflow agent responding to user queries. But we will provide suggestions which are generated from conversation.
If [Conversation.conversation_profile][google.cloud.dialogflow.v2.Conversation.conversation_profile] is configured for a dialogflow
agent, conversation will start from Automated Agent Stage
, otherwise, it
will start from Assist Stage
. And during Automated Agent Stage
, once an
[Intent][google.cloud.dialogflow.v2.Intent] with [Intent.live_agent_handoff][google.cloud.dialogflow.v2.Intent.live_agent_handoff] is triggered, conversation
will transfer to Assist Stage.
Parameters | |
---|---|
Name | Description |
request | CreateConversationRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Conversation> | A Task containing the RPC response. |
// Create client
ConversationsClient conversationsClient = await ConversationsClient.CreateAsync();
// Initialize request argument(s)
CreateConversationRequest request = new CreateConversationRequest
{
ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
Conversation = new Conversation(),
ConversationId = "",
};
// Make the request
Conversation response = await conversationsClient.CreateConversationAsync(request);
CreateConversationAsync(String, Conversation, CallSettings)
public virtual Task<Conversation> CreateConversationAsync(string parent, Conversation conversation, CallSettings callSettings = null)
Creates a new conversation. Conversations are auto-completed after 24 hours.
Conversation Lifecycle: There are two stages during a conversation: Automated Agent Stage and Assist Stage.
For Automated Agent Stage, there will be a dialogflow agent responding to user queries.
For Assist Stage, there's no dialogflow agent responding to user queries. But we will provide suggestions which are generated from conversation.
If [Conversation.conversation_profile][google.cloud.dialogflow.v2.Conversation.conversation_profile] is configured for a dialogflow
agent, conversation will start from Automated Agent Stage
, otherwise, it
will start from Assist Stage
. And during Automated Agent Stage
, once an
[Intent][google.cloud.dialogflow.v2.Intent] with [Intent.live_agent_handoff][google.cloud.dialogflow.v2.Intent.live_agent_handoff] is triggered, conversation
will transfer to Assist Stage.
Parameters | |
---|---|
Name | Description |
parent | String Required. Resource identifier of the project creating the conversation.
Format: |
conversation | Conversation Required. The conversation to create. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Conversation> | A Task containing the RPC response. |
// Create client
ConversationsClient conversationsClient = await ConversationsClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
Conversation conversation = new Conversation();
// Make the request
Conversation response = await conversationsClient.CreateConversationAsync(parent, conversation);
CreateConversationAsync(String, Conversation, CancellationToken)
public virtual Task<Conversation> CreateConversationAsync(string parent, Conversation conversation, CancellationToken cancellationToken)
Creates a new conversation. Conversations are auto-completed after 24 hours.
Conversation Lifecycle: There are two stages during a conversation: Automated Agent Stage and Assist Stage.
For Automated Agent Stage, there will be a dialogflow agent responding to user queries.
For Assist Stage, there's no dialogflow agent responding to user queries. But we will provide suggestions which are generated from conversation.
If [Conversation.conversation_profile][google.cloud.dialogflow.v2.Conversation.conversation_profile] is configured for a dialogflow
agent, conversation will start from Automated Agent Stage
, otherwise, it
will start from Assist Stage
. And during Automated Agent Stage
, once an
[Intent][google.cloud.dialogflow.v2.Intent] with [Intent.live_agent_handoff][google.cloud.dialogflow.v2.Intent.live_agent_handoff] is triggered, conversation
will transfer to Assist Stage.
Parameters | |
---|---|
Name | Description |
parent | String Required. Resource identifier of the project creating the conversation.
Format: |
conversation | Conversation Required. The conversation to create. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Conversation> | A Task containing the RPC response. |
// Create client
ConversationsClient conversationsClient = await ConversationsClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
Conversation conversation = new Conversation();
// Make the request
Conversation response = await conversationsClient.CreateConversationAsync(parent, conversation);
GetConversation(ConversationName, CallSettings)
public virtual Conversation GetConversation(ConversationName name, CallSettings callSettings = null)
Retrieves the specific conversation.
Parameters | |
---|---|
Name | Description |
name | ConversationName Required. The name of the conversation. Format:
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Conversation | The RPC response. |
// Create client
ConversationsClient conversationsClient = ConversationsClient.Create();
// Initialize request argument(s)
ConversationName name = ConversationName.FromProjectConversation("[PROJECT]", "[CONVERSATION]");
// Make the request
Conversation response = conversationsClient.GetConversation(name);
GetConversation(GetConversationRequest, CallSettings)
public virtual Conversation GetConversation(GetConversationRequest request, CallSettings callSettings = null)
Retrieves the specific conversation.
Parameters | |
---|---|
Name | Description |
request | GetConversationRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Conversation | The RPC response. |
// Create client
ConversationsClient conversationsClient = ConversationsClient.Create();
// Initialize request argument(s)
GetConversationRequest request = new GetConversationRequest
{
ConversationName = ConversationName.FromProjectConversation("[PROJECT]", "[CONVERSATION]"),
};
// Make the request
Conversation response = conversationsClient.GetConversation(request);
GetConversation(String, CallSettings)
public virtual Conversation GetConversation(string name, CallSettings callSettings = null)
Retrieves the specific conversation.
Parameters | |
---|---|
Name | Description |
name | String Required. The name of the conversation. Format:
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Conversation | The RPC response. |
// Create client
ConversationsClient conversationsClient = ConversationsClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/conversations/[CONVERSATION]";
// Make the request
Conversation response = conversationsClient.GetConversation(name);
GetConversationAsync(ConversationName, CallSettings)
public virtual Task<Conversation> GetConversationAsync(ConversationName name, CallSettings callSettings = null)
Retrieves the specific conversation.
Parameters | |
---|---|
Name | Description |
name | ConversationName Required. The name of the conversation. Format:
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Conversation> | A Task containing the RPC response. |
// Create client
ConversationsClient conversationsClient = await ConversationsClient.CreateAsync();
// Initialize request argument(s)
ConversationName name = ConversationName.FromProjectConversation("[PROJECT]", "[CONVERSATION]");
// Make the request
Conversation response = await conversationsClient.GetConversationAsync(name);
GetConversationAsync(ConversationName, CancellationToken)
public virtual Task<Conversation> GetConversationAsync(ConversationName name, CancellationToken cancellationToken)
Retrieves the specific conversation.
Parameters | |
---|---|
Name | Description |
name | ConversationName Required. The name of the conversation. Format:
|
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Conversation> | A Task containing the RPC response. |
// Create client
ConversationsClient conversationsClient = await ConversationsClient.CreateAsync();
// Initialize request argument(s)
ConversationName name = ConversationName.FromProjectConversation("[PROJECT]", "[CONVERSATION]");
// Make the request
Conversation response = await conversationsClient.GetConversationAsync(name);
GetConversationAsync(GetConversationRequest, CallSettings)
public virtual Task<Conversation> GetConversationAsync(GetConversationRequest request, CallSettings callSettings = null)
Retrieves the specific conversation.
Parameters | |
---|---|
Name | Description |
request | GetConversationRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Conversation> | A Task containing the RPC response. |
// Create client
ConversationsClient conversationsClient = await ConversationsClient.CreateAsync();
// Initialize request argument(s)
GetConversationRequest request = new GetConversationRequest
{
ConversationName = ConversationName.FromProjectConversation("[PROJECT]", "[CONVERSATION]"),
};
// Make the request
Conversation response = await conversationsClient.GetConversationAsync(request);
GetConversationAsync(GetConversationRequest, CancellationToken)
public virtual Task<Conversation> GetConversationAsync(GetConversationRequest request, CancellationToken cancellationToken)
Retrieves the specific conversation.
Parameters | |
---|---|
Name | Description |
request | GetConversationRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Conversation> | A Task containing the RPC response. |
// Create client
ConversationsClient conversationsClient = await ConversationsClient.CreateAsync();
// Initialize request argument(s)
GetConversationRequest request = new GetConversationRequest
{
ConversationName = ConversationName.FromProjectConversation("[PROJECT]", "[CONVERSATION]"),
};
// Make the request
Conversation response = await conversationsClient.GetConversationAsync(request);
GetConversationAsync(String, CallSettings)
public virtual Task<Conversation> GetConversationAsync(string name, CallSettings callSettings = null)
Retrieves the specific conversation.
Parameters | |
---|---|
Name | Description |
name | String Required. The name of the conversation. Format:
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Conversation> | A Task containing the RPC response. |
// Create client
ConversationsClient conversationsClient = await ConversationsClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/conversations/[CONVERSATION]";
// Make the request
Conversation response = await conversationsClient.GetConversationAsync(name);
GetConversationAsync(String, CancellationToken)
public virtual Task<Conversation> GetConversationAsync(string name, CancellationToken cancellationToken)
Retrieves the specific conversation.
Parameters | |
---|---|
Name | Description |
name | String Required. The name of the conversation. Format:
|
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Conversation> | A Task containing the RPC response. |
// Create client
ConversationsClient conversationsClient = await ConversationsClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/conversations/[CONVERSATION]";
// Make the request
Conversation response = await conversationsClient.GetConversationAsync(name);
ListConversations(LocationName, String, Nullable<Int32>, CallSettings)
public virtual PagedEnumerable<ListConversationsResponse, Conversation> ListConversations(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Returns the list of all conversations in the specified project.
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. The project from which to list all conversation.
Format: |
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerable<ListConversationsResponse, Conversation> | A pageable sequence of Conversation resources. |
// Create client
ConversationsClient conversationsClient = ConversationsClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedEnumerable<ListConversationsResponse, Conversation> response = conversationsClient.ListConversations(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (Conversation item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListConversationsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Conversation item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Conversation> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Conversation item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListConversations(ProjectName, String, Nullable<Int32>, CallSettings)
public virtual PagedEnumerable<ListConversationsResponse, Conversation> ListConversations(ProjectName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Returns the list of all conversations in the specified project.
Parameters | |
---|---|
Name | Description |
parent | ProjectName Required. The project from which to list all conversation.
Format: |
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerable<ListConversationsResponse, Conversation> | A pageable sequence of Conversation resources. |
// Create client
ConversationsClient conversationsClient = ConversationsClient.Create();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
// Make the request
PagedEnumerable<ListConversationsResponse, Conversation> response = conversationsClient.ListConversations(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (Conversation item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListConversationsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Conversation item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Conversation> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Conversation item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListConversations(ListConversationsRequest, CallSettings)
public virtual PagedEnumerable<ListConversationsResponse, Conversation> ListConversations(ListConversationsRequest request, CallSettings callSettings = null)
Returns the list of all conversations in the specified project.
Parameters | |
---|---|
Name | Description |
request | ListConversationsRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerable<ListConversationsResponse, Conversation> | A pageable sequence of Conversation resources. |
// Create client
ConversationsClient conversationsClient = ConversationsClient.Create();
// Initialize request argument(s)
ListConversationsRequest request = new ListConversationsRequest
{
ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
Filter = "",
};
// Make the request
PagedEnumerable<ListConversationsResponse, Conversation> response = conversationsClient.ListConversations(request);
// Iterate over all response items, lazily performing RPCs as required
foreach (Conversation item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListConversationsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Conversation item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Conversation> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Conversation item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListConversations(String, String, Nullable<Int32>, CallSettings)
public virtual PagedEnumerable<ListConversationsResponse, Conversation> ListConversations(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Returns the list of all conversations in the specified project.
Parameters | |
---|---|
Name | Description |
parent | String Required. The project from which to list all conversation.
Format: |
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerable<ListConversationsResponse, Conversation> | A pageable sequence of Conversation resources. |
// Create client
ConversationsClient conversationsClient = ConversationsClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
// Make the request
PagedEnumerable<ListConversationsResponse, Conversation> response = conversationsClient.ListConversations(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (Conversation item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListConversationsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Conversation item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Conversation> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Conversation item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListConversationsAsync(LocationName, String, Nullable<Int32>, CallSettings)
public virtual PagedAsyncEnumerable<ListConversationsResponse, Conversation> ListConversationsAsync(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Returns the list of all conversations in the specified project.
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. The project from which to list all conversation.
Format: |
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerable<ListConversationsResponse, Conversation> | A pageable asynchronous sequence of Conversation resources. |
// Create client
ConversationsClient conversationsClient = await ConversationsClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedAsyncEnumerable<ListConversationsResponse, Conversation> response = conversationsClient.ListConversationsAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Conversation item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListConversationsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Conversation item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Conversation> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Conversation item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListConversationsAsync(ProjectName, String, Nullable<Int32>, CallSettings)
public virtual PagedAsyncEnumerable<ListConversationsResponse, Conversation> ListConversationsAsync(ProjectName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Returns the list of all conversations in the specified project.
Parameters | |
---|---|
Name | Description |
parent | ProjectName Required. The project from which to list all conversation.
Format: |
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerable<ListConversationsResponse, Conversation> | A pageable asynchronous sequence of Conversation resources. |
// Create client
ConversationsClient conversationsClient = await ConversationsClient.CreateAsync();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
// Make the request
PagedAsyncEnumerable<ListConversationsResponse, Conversation> response = conversationsClient.ListConversationsAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Conversation item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListConversationsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Conversation item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Conversation> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Conversation item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListConversationsAsync(ListConversationsRequest, CallSettings)
public virtual PagedAsyncEnumerable<ListConversationsResponse, Conversation> ListConversationsAsync(ListConversationsRequest request, CallSettings callSettings = null)
Returns the list of all conversations in the specified project.
Parameters | |
---|---|
Name | Description |
request | ListConversationsRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerable<ListConversationsResponse, Conversation> | A pageable asynchronous sequence of Conversation resources. |
// Create client
ConversationsClient conversationsClient = await ConversationsClient.CreateAsync();
// Initialize request argument(s)
ListConversationsRequest request = new ListConversationsRequest
{
ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
Filter = "",
};
// Make the request
PagedAsyncEnumerable<ListConversationsResponse, Conversation> response = conversationsClient.ListConversationsAsync(request);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Conversation item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListConversationsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Conversation item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Conversation> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Conversation item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListConversationsAsync(String, String, Nullable<Int32>, CallSettings)
public virtual PagedAsyncEnumerable<ListConversationsResponse, Conversation> ListConversationsAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Returns the list of all conversations in the specified project.
Parameters | |
---|---|
Name | Description |
parent | String Required. The project from which to list all conversation.
Format: |
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerable<ListConversationsResponse, Conversation> | A pageable asynchronous sequence of Conversation resources. |
// Create client
ConversationsClient conversationsClient = await ConversationsClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
// Make the request
PagedAsyncEnumerable<ListConversationsResponse, Conversation> response = conversationsClient.ListConversationsAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Conversation item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListConversationsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Conversation item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Conversation> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Conversation item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListMessages(ConversationName, String, Nullable<Int32>, CallSettings)
public virtual PagedEnumerable<ListMessagesResponse, Message> ListMessages(ConversationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists messages that belong to a given conversation.
messages
are ordered by create_time
in descending order. To fetch
updates without duplication, send request with filter
create_time_epoch_microseconds >
[first item's create_time of previous request]
and empty page_token.
Parameters | |
---|---|
Name | Description |
parent | ConversationName Required. The name of the conversation to list messages for.
Format: |
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerable<ListMessagesResponse, Message> | A pageable sequence of Message resources. |
// Create client
ConversationsClient conversationsClient = ConversationsClient.Create();
// Initialize request argument(s)
ConversationName parent = ConversationName.FromProjectConversation("[PROJECT]", "[CONVERSATION]");
// Make the request
PagedEnumerable<ListMessagesResponse, Message> response = conversationsClient.ListMessages(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (Message item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListMessagesResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Message item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Message> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Message item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListMessages(ListMessagesRequest, CallSettings)
public virtual PagedEnumerable<ListMessagesResponse, Message> ListMessages(ListMessagesRequest request, CallSettings callSettings = null)
Lists messages that belong to a given conversation.
messages
are ordered by create_time
in descending order. To fetch
updates without duplication, send request with filter
create_time_epoch_microseconds >
[first item's create_time of previous request]
and empty page_token.
Parameters | |
---|---|
Name | Description |
request | ListMessagesRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerable<ListMessagesResponse, Message> | A pageable sequence of Message resources. |
// Create client
ConversationsClient conversationsClient = ConversationsClient.Create();
// Initialize request argument(s)
ListMessagesRequest request = new ListMessagesRequest
{
ParentAsConversationName = ConversationName.FromProjectConversation("[PROJECT]", "[CONVERSATION]"),
Filter = "",
};
// Make the request
PagedEnumerable<ListMessagesResponse, Message> response = conversationsClient.ListMessages(request);
// Iterate over all response items, lazily performing RPCs as required
foreach (Message item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListMessagesResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Message item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Message> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Message item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListMessages(String, String, Nullable<Int32>, CallSettings)
public virtual PagedEnumerable<ListMessagesResponse, Message> ListMessages(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists messages that belong to a given conversation.
messages
are ordered by create_time
in descending order. To fetch
updates without duplication, send request with filter
create_time_epoch_microseconds >
[first item's create_time of previous request]
and empty page_token.
Parameters | |
---|---|
Name | Description |
parent | String Required. The name of the conversation to list messages for.
Format: |
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerable<ListMessagesResponse, Message> | A pageable sequence of Message resources. |
// Create client
ConversationsClient conversationsClient = ConversationsClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/conversations/[CONVERSATION]";
// Make the request
PagedEnumerable<ListMessagesResponse, Message> response = conversationsClient.ListMessages(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (Message item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListMessagesResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Message item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Message> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Message item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListMessagesAsync(ConversationName, String, Nullable<Int32>, CallSettings)
public virtual PagedAsyncEnumerable<ListMessagesResponse, Message> ListMessagesAsync(ConversationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists messages that belong to a given conversation.
messages
are ordered by create_time
in descending order. To fetch
updates without duplication, send request with filter
create_time_epoch_microseconds >
[first item's create_time of previous request]
and empty page_token.
Parameters | |
---|---|
Name | Description |
parent | ConversationName Required. The name of the conversation to list messages for.
Format: |
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerable<ListMessagesResponse, Message> | A pageable asynchronous sequence of Message resources. |
// Create client
ConversationsClient conversationsClient = await ConversationsClient.CreateAsync();
// Initialize request argument(s)
ConversationName parent = ConversationName.FromProjectConversation("[PROJECT]", "[CONVERSATION]");
// Make the request
PagedAsyncEnumerable<ListMessagesResponse, Message> response = conversationsClient.ListMessagesAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Message item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListMessagesResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Message item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Message> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Message item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListMessagesAsync(ListMessagesRequest, CallSettings)
public virtual PagedAsyncEnumerable<ListMessagesResponse, Message> ListMessagesAsync(ListMessagesRequest request, CallSettings callSettings = null)
Lists messages that belong to a given conversation.
messages
are ordered by create_time
in descending order. To fetch
updates without duplication, send request with filter
create_time_epoch_microseconds >
[first item's create_time of previous request]
and empty page_token.
Parameters | |
---|---|
Name | Description |
request | ListMessagesRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerable<ListMessagesResponse, Message> | A pageable asynchronous sequence of Message resources. |
// Create client
ConversationsClient conversationsClient = await ConversationsClient.CreateAsync();
// Initialize request argument(s)
ListMessagesRequest request = new ListMessagesRequest
{
ParentAsConversationName = ConversationName.FromProjectConversation("[PROJECT]", "[CONVERSATION]"),
Filter = "",
};
// Make the request
PagedAsyncEnumerable<ListMessagesResponse, Message> response = conversationsClient.ListMessagesAsync(request);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Message item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListMessagesResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Message item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Message> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Message item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListMessagesAsync(String, String, Nullable<Int32>, CallSettings)
public virtual PagedAsyncEnumerable<ListMessagesResponse, Message> ListMessagesAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists messages that belong to a given conversation.
messages
are ordered by create_time
in descending order. To fetch
updates without duplication, send request with filter
create_time_epoch_microseconds >
[first item's create_time of previous request]
and empty page_token.
Parameters | |
---|---|
Name | Description |
parent | String Required. The name of the conversation to list messages for.
Format: |
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerable<ListMessagesResponse, Message> | A pageable asynchronous sequence of Message resources. |
// Create client
ConversationsClient conversationsClient = await ConversationsClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/conversations/[CONVERSATION]";
// Make the request
PagedAsyncEnumerable<ListMessagesResponse, Message> response = conversationsClient.ListMessagesAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Message item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListMessagesResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Message item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Message> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Message item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ShutdownDefaultChannelsAsync()
public static Task ShutdownDefaultChannelsAsync()
Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.
Returns | |
---|---|
Type | Description |
Task | A task representing the asynchronous shutdown operation. |
After calling this method, further calls to Create() and CreateAsync(CancellationToken) will create new channels, which could in turn be shut down by another call to this method.