# Data QnA v1alpha API - Class AutoSuggestionServiceClientImpl (2.0.0-alpha02)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [2.0.0-alpha02 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.AutoSuggestionServiceClientImpl)
- [2.0.0-alpha01](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/2.0.0-alpha01/Google.Cloud.DataQnA.V1Alpha.AutoSuggestionServiceClientImpl)
- [1.0.0-alpha03](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/1.0.0-alpha03/Google.Cloud.DataQnA.V1Alpha.AutoSuggestionServiceClientImpl)

    public sealed class AutoSuggestionServiceClientImpl : AutoSuggestionServiceClient

Reference documentation and code samples for the Data QnA v1alpha API class AutoSuggestionServiceClientImpl.

AutoSuggestionService client wrapper implementation, for convenient use.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> [AutoSuggestionServiceClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.AutoSuggestionServiceClient) \> AutoSuggestionServiceClientImpl

## Inherited Members

[AutoSuggestionServiceClient.DefaultEndpoint](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.AutoSuggestionServiceClient#Google_Cloud_DataQnA_V1Alpha_AutoSuggestionServiceClient_DefaultEndpoint) [AutoSuggestionServiceClient.DefaultScopes](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.AutoSuggestionServiceClient#Google_Cloud_DataQnA_V1Alpha_AutoSuggestionServiceClient_DefaultScopes) [AutoSuggestionServiceClient.ServiceMetadata](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.AutoSuggestionServiceClient#Google_Cloud_DataQnA_V1Alpha_AutoSuggestionServiceClient_ServiceMetadata) [AutoSuggestionServiceClient.CreateAsync(CancellationToken)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.AutoSuggestionServiceClient#Google_Cloud_DataQnA_V1Alpha_AutoSuggestionServiceClient_CreateAsync_System_Threading_CancellationToken_) [AutoSuggestionServiceClient.Create()](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.AutoSuggestionServiceClient#Google_Cloud_DataQnA_V1Alpha_AutoSuggestionServiceClient_Create) [AutoSuggestionServiceClient.ShutdownDefaultChannelsAsync()](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.AutoSuggestionServiceClient#Google_Cloud_DataQnA_V1Alpha_AutoSuggestionServiceClient_ShutdownDefaultChannelsAsync) [AutoSuggestionServiceClient.SuggestQueriesAsync(SuggestQueriesRequest, CancellationToken)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.AutoSuggestionServiceClient#Google_Cloud_DataQnA_V1Alpha_AutoSuggestionServiceClient_SuggestQueriesAsync_Google_Cloud_DataQnA_V1Alpha_SuggestQueriesRequest_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.DataQnA.V1Alpha](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha)

## Assembly

Google.Cloud.DataQnA.V1Alpha.dll

## Remarks

This stateless API provides automatic suggestions for natural language
queries for the data sources in the provided project and location.

The service provides a resourceless operation `suggestQueries` that can be
called to get a list of suggestions for a given incomplete query and scope
(or list of scopes) under which the query is to be interpreted.

There are two types of suggestions, ENTITY for single entity suggestions
and TEMPLATE for full sentences. By default, both types are returned.

Example Request:

    GetSuggestions({
    parent: "locations/us/projects/my-project"
    scopes:
    "//bigquery.googleapis.com/projects/my-project/datasets/my-dataset/tables/my-table"
    query: "top it"
    })

The service will retrieve information based on the given scope(s) and give
suggestions based on that (e.g. "top item" for "top it" if "item" is a known
dimension for the provided scope).

    suggestions {
    suggestion_info {
    annotated_suggestion {
    text_formatted: "top item by sum of usd_revenue_net"
    markups {
    type: DIMENSION
    start_char_index: 4
    length: 4
    }
    markups {
    type: METRIC
    start_char_index: 19
    length: 15
    }
    }
    query_matches {
    start_char_index: 0
    length: 6
    }
    }
    suggestion_type: TEMPLATE
    ranking_score: 0.9
    }
    suggestions {
    suggestion_info {
    annotated_suggestion {
    text_formatted: "item"
    markups {
    type: DIMENSION
    start_char_index: 4
    length: 2
    }
    }
    query_matches {
    start_char_index: 0
    length: 6
    }
    }
    suggestion_type: ENTITY
    ranking_score: 0.8
    }

## Constructors

### AutoSuggestionServiceClientImpl(AutoSuggestionServiceClient, AutoSuggestionServiceSettings, ILogger)

    public AutoSuggestionServiceClientImpl(AutoSuggestionService.AutoSuggestionServiceClient grpcClient, AutoSuggestionServiceSettings settings, ILogger logger)

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

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `grpcClient` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.AutoSuggestionServicehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.AutoSuggestionService.AutoSuggestionServiceClient` The underlying gRPC client. |
| `settings` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.AutoSuggestionServiceSettings` The base [AutoSuggestionServiceSettings](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.AutoSuggestionServiceSettings) 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 AutoSuggestionService.AutoSuggestionServiceClient GrpcClient { get; }

The underlying gRPC AutoSuggestionService client

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.AutoSuggestionServicehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.AutoSuggestionService.AutoSuggestionServiceClient` |   |

**Overrides** [AutoSuggestionServiceClient.GrpcClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.AutoSuggestionServiceClient#Google_Cloud_DataQnA_V1Alpha_AutoSuggestionServiceClient_GrpcClient)

## Methods

### SuggestQueries(SuggestQueriesRequest, CallSettings)

    public override SuggestQueriesResponse SuggestQueries(SuggestQueriesRequest request, CallSettings callSettings = null)

Gets a list of suggestions based on a prefix string.
AutoSuggestion tolerance should be less than 1 second.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.SuggestQueriesRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://github.com/googleapis/gax-dotnet/blob/510f63bbae727cfa4cee5180d0a9916bc2dee248/Google.Api.Gax.Grpc/CallSettings.cs` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.SuggestQueriesResponse` | The RPC response. |

**Overrides** [AutoSuggestionServiceClient.SuggestQueries(SuggestQueriesRequest, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.AutoSuggestionServiceClient#Google_Cloud_DataQnA_V1Alpha_AutoSuggestionServiceClient_SuggestQueries_Google_Cloud_DataQnA_V1Alpha_SuggestQueriesRequest_Google_Api_Gax_Grpc_CallSettings_)

### SuggestQueriesAsync(SuggestQueriesRequest, CallSettings)

    public override Task<SuggestQueriesResponse> SuggestQueriesAsync(SuggestQueriesRequest request, CallSettings callSettings = null)

Gets a list of suggestions based on a prefix string.
AutoSuggestion tolerance should be less than 1 second.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.SuggestQueriesRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://github.com/googleapis/gax-dotnet/blob/510f63bbae727cfa4cee5180d0a9916bc2dee248/Google.Api.Gax.Grpc/CallSettings.cs` 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.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.SuggestQueriesResponse` | A Task containing the RPC response. |

**Overrides** [AutoSuggestionServiceClient.SuggestQueriesAsync(SuggestQueriesRequest, CallSettings)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DataQnA.V1Alpha/latest/Google.Cloud.DataQnA.V1Alpha.AutoSuggestionServiceClient#Google_Cloud_DataQnA_V1Alpha_AutoSuggestionServiceClient_SuggestQueriesAsync_Google_Cloud_DataQnA_V1Alpha_SuggestQueriesRequest_Google_Api_Gax_Grpc_CallSettings_)