# Google Cloud Dialogflow v2 API - Class SessionsClientImpl (4.30.0)

4.30.0 (latest) 4.29.0 4.28.0 4.27.0 4.26.0 4.25.0 4.24.0 4.23.0 4.22.0 4.21.0 4.20.0 4.19.0 4.18.0 4.17.0 4.16.0 4.15.0 4.14.0 4.13.0 4.12.0 4.11.0 4.10.0 4.9.0 4.8.0 4.7.0 4.6.0 4.5.0 4.4.0 4.3.0 4.2.0 4.1.0 4.0.0 3.11.0 3.10.0 3.9.0 3.8.0 3.7.0 3.6.0 3.5.0 3.4.0 3.3.0 3.2.0

    public sealed class SessionsClientImpl : SessionsClient

Reference documentation and code samples for the Google Cloud Dialogflow v2 API class SessionsClientImpl.

Sessions client wrapper implementation, for convenient use.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> [SessionsClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.SessionsClient) \> SessionsClientImpl

## Inherited Members

[SessionsClient.DefaultEndpoint](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.SessionsClient#Google_Cloud_Dialogflow_V2_SessionsClient_DefaultEndpoint) [SessionsClient.DefaultScopes](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.SessionsClient#Google_Cloud_Dialogflow_V2_SessionsClient_DefaultScopes) [SessionsClient.ServiceMetadata](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.SessionsClient#Google_Cloud_Dialogflow_V2_SessionsClient_ServiceMetadata) [SessionsClient.CreateAsync(CancellationToken)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.SessionsClient#Google_Cloud_Dialogflow_V2_SessionsClient_CreateAsync_System_Threading_CancellationToken_) [SessionsClient.Create()](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.SessionsClient#Google_Cloud_Dialogflow_V2_SessionsClient_Create) [SessionsClient.ShutdownDefaultChannelsAsync()](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.SessionsClient#Google_Cloud_Dialogflow_V2_SessionsClient_ShutdownDefaultChannelsAsync) [SessionsClient.DetectIntentAsync(DetectIntentRequest, CancellationToken)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.SessionsClient#Google_Cloud_Dialogflow_V2_SessionsClient_DetectIntentAsync_Google_Cloud_Dialogflow_V2_DetectIntentRequest_System_Threading_CancellationToken_) [SessionsClient.DetectIntent(string, QueryInput, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.SessionsClient#Google_Cloud_Dialogflow_V2_SessionsClient_DetectIntent_System_String_Google_Cloud_Dialogflow_V2_QueryInput_Google_Api_Gax_Grpc_CallSettings_) [SessionsClient.DetectIntentAsync(string, QueryInput, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.SessionsClient#Google_Cloud_Dialogflow_V2_SessionsClient_DetectIntentAsync_System_String_Google_Cloud_Dialogflow_V2_QueryInput_Google_Api_Gax_Grpc_CallSettings_) [SessionsClient.DetectIntentAsync(string, QueryInput, CancellationToken)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.SessionsClient#Google_Cloud_Dialogflow_V2_SessionsClient_DetectIntentAsync_System_String_Google_Cloud_Dialogflow_V2_QueryInput_System_Threading_CancellationToken_) [SessionsClient.DetectIntent(SessionName, QueryInput, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.SessionsClient#Google_Cloud_Dialogflow_V2_SessionsClient_DetectIntent_Google_Cloud_Dialogflow_V2_SessionName_Google_Cloud_Dialogflow_V2_QueryInput_Google_Api_Gax_Grpc_CallSettings_) [SessionsClient.DetectIntentAsync(SessionName, QueryInput, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.SessionsClient#Google_Cloud_Dialogflow_V2_SessionsClient_DetectIntentAsync_Google_Cloud_Dialogflow_V2_SessionName_Google_Cloud_Dialogflow_V2_QueryInput_Google_Api_Gax_Grpc_CallSettings_) [SessionsClient.DetectIntentAsync(SessionName, QueryInput, CancellationToken)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.SessionsClient#Google_Cloud_Dialogflow_V2_SessionsClient_DetectIntentAsync_Google_Cloud_Dialogflow_V2_SessionName_Google_Cloud_Dialogflow_V2_QueryInput_System_Threading_CancellationToken_) [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.Dialogflow.V2](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2)

## Assembly

Google.Cloud.Dialogflow.V2.dll

## Remarks

A service used for session interactions.

For more information, see the [API interactions
guide](https://cloud.google.com/dialogflow/docs/api-overview).

## Constructors

### SessionsClientImpl(SessionsClient, SessionsSettings, ILogger)

    public SessionsClientImpl(Sessions.SessionsClient grpcClient, SessionsSettings settings, ILogger logger)

Constructs a client wrapper for the Sessions service, with the specified gRPC client and settings.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `grpcClient` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.Sessionshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.Sessions.SessionsClient` The underlying gRPC client. |
| `settings` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.SessionsSettings` The base [SessionsSettings](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.SessionsSettings) used within this client. |
| `logger` | `https://learn.microsoft.com/dotnet/api/microsoft.extensions.logging.ilogger` Optional [ILogger](https://learn.microsoft.com/dotnet/api/microsoft.extensions.logging.ilogger) to use within this client. |

## Properties

### GrpcClient

    public override Sessions.SessionsClient GrpcClient { get; }

The underlying gRPC Sessions client

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.Sessionshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.Sessions.SessionsClient` |   |

**Overrides** [SessionsClient.GrpcClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.SessionsClient#Google_Cloud_Dialogflow_V2_SessionsClient_GrpcClient)

### LocationsClient

    public override LocationsClient LocationsClient { get; }

The [LocationsClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Location/latest/Google.Cloud.Location.LocationsClient.html) associated with this client.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Location/latest/Google.Cloud.Location.LocationsClient.html` |   |

**Overrides** [SessionsClient.LocationsClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.SessionsClient#Google_Cloud_Dialogflow_V2_SessionsClient_LocationsClient)

## Methods

### DetectIntent(DetectIntentRequest, CallSettings)

    public override DetectIntentResponse DetectIntent(DetectIntentRequest request, CallSettings callSettings = null)

Processes a natural language query and returns structured, actionable data
as a result. This method is not idempotent, because it may cause contexts
and session entity types to be updated, which in turn might affect
results of future queries.

If you might use
[Agent Assist](https://cloud.google.com/dialogflow/docs/#aa)
or other CCAI products now or in the future, consider using
\[AnalyzeContent\]\[google.cloud.dialogflow.v2.Participants.AnalyzeContent\]
instead of `DetectIntent`. `AnalyzeContent` has additional
functionality for Agent Assist and other CCAI products.

Note: Always use agent versions for production traffic.
See [Versions and
environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.DetectIntentRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.DetectIntentResponse` | The RPC response. |

**Overrides** [SessionsClient.DetectIntent(DetectIntentRequest, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.SessionsClient#Google_Cloud_Dialogflow_V2_SessionsClient_DetectIntent_Google_Cloud_Dialogflow_V2_DetectIntentRequest_Google_Api_Gax_Grpc_CallSettings_)

### DetectIntentAsync(DetectIntentRequest, CallSettings)

    public override Task<DetectIntentResponse> DetectIntentAsync(DetectIntentRequest request, CallSettings callSettings = null)

Processes a natural language query and returns structured, actionable data
as a result. This method is not idempotent, because it may cause contexts
and session entity types to be updated, which in turn might affect
results of future queries.

If you might use
[Agent Assist](https://cloud.google.com/dialogflow/docs/#aa)
or other CCAI products now or in the future, consider using
\[AnalyzeContent\]\[google.cloud.dialogflow.v2.Participants.AnalyzeContent\]
instead of `DetectIntent`. `AnalyzeContent` has additional
functionality for Agent Assist and other CCAI products.

Note: Always use agent versions for production traffic.
See [Versions and
environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.DetectIntentRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.DetectIntentResponse` | A Task containing the RPC response. |

**Overrides** [SessionsClient.DetectIntentAsync(DetectIntentRequest, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.SessionsClient#Google_Cloud_Dialogflow_V2_SessionsClient_DetectIntentAsync_Google_Cloud_Dialogflow_V2_DetectIntentRequest_Google_Api_Gax_Grpc_CallSettings_)

### StreamingDetectIntent(CallSettings, BidirectionalStreamingSettings)

    public override SessionsClient.StreamingDetectIntentStream StreamingDetectIntent(CallSettings callSettings = null, BidirectionalStreamingSettings streamingSettings = null)

Processes a natural language query in audio format in a streaming fashion
and returns structured, actionable data as a result. This method is only
available via the gRPC API (not REST).

If you might use
[Agent Assist](https://cloud.google.com/dialogflow/docs/#aa)
or other CCAI products now or in the future, consider using
\[StreamingAnalyzeContent\]\[google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent\]
instead of `StreamingDetectIntent`. `StreamingAnalyzeContent` has
additional functionality for Agent Assist and other CCAI products.

Note: Always use agent versions for production traffic.
See [Versions and
environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |
| `streamingSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.BidirectionalStreamingSettings.html` If not null, applies streaming overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.SessionsClienthttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.SessionsClient.StreamingDetectIntentStream` | The client-server stream. |

**Overrides** [SessionsClient.StreamingDetectIntent(CallSettings, BidirectionalStreamingSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.SessionsClient#Google_Cloud_Dialogflow_V2_SessionsClient_StreamingDetectIntent_Google_Api_Gax_Grpc_CallSettings_Google_Api_Gax_Grpc_BidirectionalStreamingSettings_)