Class CompletionClient (2.0.0)

public abstract class CompletionClient

Completion client wrapper, for convenient use.

Inheritance

Object > CompletionClient

Derived Types

Namespace

Google.Cloud.Talent.V4

Assembly

Google.Cloud.Talent.V4.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
TypeDescription
String

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default Completion scopes.

Property Value
TypeDescription
IReadOnlyList<String>
Remarks

GrpcClient

public virtual Completion.CompletionClient GrpcClient { get; }

The underlying gRPC Completion client

Property Value
TypeDescription
Completion.CompletionClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
TypeDescription
ServiceMetadata

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
NameDescription
requestCompleteQueryRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
CompleteQueryResponse

The RPC response.

Example
// Create client
CompletionClient completionClient = CompletionClient.Create();
// Initialize request argument(s)
CompleteQueryRequest request = new CompleteQueryRequest
{
    TenantAsTenantName = 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
NameDescription
requestCompleteQueryRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<CompleteQueryResponse>

A Task containing the RPC response.

Example
// Create client
CompletionClient completionClient = await CompletionClient.CreateAsync();
// Initialize request argument(s)
CompleteQueryRequest request = new CompleteQueryRequest
{
    TenantAsTenantName = 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
NameDescription
requestCompleteQueryRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<CompleteQueryResponse>

A Task containing the RPC response.

Example
// Create client
CompletionClient completionClient = await CompletionClient.CreateAsync();
// Initialize request argument(s)
CompleteQueryRequest request = new CompleteQueryRequest
{
    TenantAsTenantName = 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 using the default credentials, endpoint and settings. To specify custom credentials or other settings, use CompletionClientBuilder.

Returns
TypeDescription
CompletionClient

The created CompletionClient.

CreateAsync(CancellationToken)

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

Asynchronously creates a CompletionClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use CompletionClientBuilder.

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
Task<CompletionClient>

The task representing the created CompletionClient.

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
TypeDescription
Task

A task representing the asynchronous shutdown operation.

Remarks

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.