# Google Cloud Talent Solution v4beta1 API - Class CompletionClient (3.0.0-beta07)

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

- [3.0.0-beta07 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4Beta1/latest/Google.Cloud.Talent.V4Beta1.CompletionClient)
- [3.0.0-beta06](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4Beta1/3.0.0-beta06/Google.Cloud.Talent.V4Beta1.CompletionClient)
- [2.0.0-beta07](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4Beta1/2.0.0-beta07/Google.Cloud.Talent.V4Beta1.CompletionClient)

    public abstract class CompletionClient

Reference documentation and code samples for the Google Cloud Talent Solution v4beta1 API class CompletionClient.

Completion client wrapper, for convenient use.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> CompletionClient

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Derived Types

[CompletionClientImpl](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4Beta1/latest/Google.Cloud.Talent.V4Beta1.CompletionClientImpl)

## Namespace

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

## Assembly

Google.Cloud.Talent.V4Beta1.dll

## Remarks

A service handles auto completion.

## Properties

### DefaultEndpoint

    public static string DefaultEndpoint { get; }

The default endpoint for the Completion service, which is a host of "jobs.googleapis.com" and a port of 443.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### DefaultScopes

    public static IReadOnlyList<string> DefaultScopes { get; }

The default Completion scopes.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist-1https://learn.microsoft.com/dotnet/api/system.string` |   |

**Remarks** The default Completion scopes are:

- <https://www.googleapis.com/auth/cloud-platform>
- <https://www.googleapis.com/auth/jobs>

<br />

### GrpcClient

    public virtual Completion.CompletionClient GrpcClient { get; }

The underlying gRPC Completion client

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4Beta1/latest/Google.Cloud.Talent.V4Beta1.Completionhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4Beta1/latest/Google.Cloud.Talent.V4Beta1.Completion.CompletionClient` |   |

### ServiceMetadata

    public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.ServiceMetadata.html` |   |

## Methods

### CompleteQuery(CompleteQueryRequest, CallSettings)

    public virtual CompleteQueryResponse CompleteQuery(CompleteQueryRequest request, CallSettings callSettings = null)

Completes the specified prefix with keyword suggestions.
Intended for use by a job search auto-complete search box.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4Beta1/latest/Google.Cloud.Talent.V4Beta1.CompleteQueryRequest` 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.Talent.V4Beta1/latest/Google.Cloud.Talent.V4Beta1.CompleteQueryResponse` | The RPC response. |

**Example**

    // Create client
    CompletionClient completionClient = CompletionClient.Create();
    // Initialize request argument(s)
    CompleteQueryRequest request = new CompleteQueryRequest
    {
        ParentAsTenantName = TenantName.FromProjectTenant("[PROJECT]", "[TENANT]"),
        Query = "",
        LanguageCodes = { "", },
        PageSize = 0,
        CompanyAsCompanyName = CompanyName.FromProjectTenantCompany("[PROJECT]", "[TENANT]", "[COMPANY]"),
        Scope = CompleteQueryRequest.Types.CompletionScope.Unspecified,
        Type = CompleteQueryRequest.Types.CompletionType.Unspecified,
    };
    // Make the request
    CompleteQueryResponse response = completionClient.CompleteQuery(request);

### CompleteQueryAsync(CompleteQueryRequest, CallSettings)

    public virtual Task<CompleteQueryResponse> CompleteQueryAsync(CompleteQueryRequest request, CallSettings callSettings = null)

Completes the specified prefix with keyword suggestions.
Intended for use by a job search auto-complete search box.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4Beta1/latest/Google.Cloud.Talent.V4Beta1.CompleteQueryRequest` 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.Talent.V4Beta1/latest/Google.Cloud.Talent.V4Beta1.CompleteQueryResponse` | A Task containing the RPC response. |

**Example**

    // Create client
    CompletionClient completionClient = await CompletionClient.CreateAsync();
    // Initialize request argument(s)
    CompleteQueryRequest request = new CompleteQueryRequest
    {
        ParentAsTenantName = TenantName.FromProjectTenant("[PROJECT]", "[TENANT]"),
        Query = "",
        LanguageCodes = { "", },
        PageSize = 0,
        CompanyAsCompanyName = CompanyName.FromProjectTenantCompany("[PROJECT]", "[TENANT]", "[COMPANY]"),
        Scope = CompleteQueryRequest.Types.CompletionScope.Unspecified,
        Type = CompleteQueryRequest.Types.CompletionType.Unspecified,
    };
    // Make the request
    CompleteQueryResponse response = await completionClient.CompleteQueryAsync(request);

### CompleteQueryAsync(CompleteQueryRequest, CancellationToken)

    public virtual Task<CompleteQueryResponse> CompleteQueryAsync(CompleteQueryRequest request, CancellationToken cancellationToken)

Completes the specified prefix with keyword suggestions.
Intended for use by a job search auto-complete search box.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4Beta1/latest/Google.Cloud.Talent.V4Beta1.CompleteQueryRequest` The request object containing all of the parameters for the API call. |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` A [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use for this RPC. |

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

**Example**

    // Create client
    CompletionClient completionClient = await CompletionClient.CreateAsync();
    // Initialize request argument(s)
    CompleteQueryRequest request = new CompleteQueryRequest
    {
        ParentAsTenantName = TenantName.FromProjectTenant("[PROJECT]", "[TENANT]"),
        Query = "",
        LanguageCodes = { "", },
        PageSize = 0,
        CompanyAsCompanyName = CompanyName.FromProjectTenantCompany("[PROJECT]", "[TENANT]", "[COMPANY]"),
        Scope = CompleteQueryRequest.Types.CompletionScope.Unspecified,
        Type = CompleteQueryRequest.Types.CompletionType.Unspecified,
    };
    // Make the request
    CompleteQueryResponse response = await completionClient.CompleteQueryAsync(request);

### Create()

    public static CompletionClient Create()

Synchronously creates a [CompletionClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4Beta1/latest/Google.Cloud.Talent.V4Beta1.CompletionClient) using the default credentials, endpoint and settings.
To specify custom credentials or other settings, use [CompletionClientBuilder](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4Beta1/latest/Google.Cloud.Talent.V4Beta1.CompletionClientBuilder).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4Beta1/latest/Google.Cloud.Talent.V4Beta1.CompletionClient` | The created [CompletionClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4Beta1/latest/Google.Cloud.Talent.V4Beta1.CompletionClient). |

### CreateAsync(CancellationToken)

    public static Task<CompletionClient> CreateAsync(CancellationToken cancellationToken = default)

Asynchronously creates a [CompletionClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4Beta1/latest/Google.Cloud.Talent.V4Beta1.CompletionClient) using the default credentials, endpoint and
settings. To specify custom credentials or other settings, use [CompletionClientBuilder](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4Beta1/latest/Google.Cloud.Talent.V4Beta1.CompletionClientBuilder).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` The [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use while creating the client. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4Beta1/latest/Google.Cloud.Talent.V4Beta1.CompletionClient` | The task representing the created [CompletionClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4Beta1/latest/Google.Cloud.Talent.V4Beta1.CompletionClient). |

### ShutdownDefaultChannelsAsync()

    public static Task ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by [Create()](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4Beta1/latest/Google.Cloud.Talent.V4Beta1.CompletionClient#Google_Cloud_Talent_V4Beta1_CompletionClient_Create) and
[CreateAsync(CancellationToken)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4Beta1/latest/Google.Cloud.Talent.V4Beta1.CompletionClient#Google_Cloud_Talent_V4Beta1_CompletionClient_CreateAsync_System_Threading_CancellationToken_). Channels which weren't automatically created are not
affected.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task` | A task representing the asynchronous shutdown operation. |

**Remarks** After calling this method, further calls to [Create()](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4Beta1/latest/Google.Cloud.Talent.V4Beta1.CompletionClient#Google_Cloud_Talent_V4Beta1_CompletionClient_Create) and
[CreateAsync(CancellationToken)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4Beta1/latest/Google.Cloud.Talent.V4Beta1.CompletionClient#Google_Cloud_Talent_V4Beta1_CompletionClient_CreateAsync_System_Threading_CancellationToken_) will create new channels, which could in turn be shut down
by another call to this method.