public abstract class CompletionClientReference documentation and code samples for the Google Cloud Talent Solution v4 API class CompletionClient.
Completion client wrapper, for convenient use.
Derived Types
Namespace
Google.Cloud.Talent.V4Assembly
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 | |
|---|---|
| Type | Description |
string |
|
DefaultScopes
public static IReadOnlyList<string> DefaultScopes { get; }The default Completion scopes.
| Property Value | |
|---|---|
| Type | Description |
IReadOnlyListstring |
|
The default Completion scopes are:
GrpcClient
public virtual Completion.CompletionClient GrpcClient { get; }The underlying gRPC Completion client
| Property Value | |
|---|---|
| Type | Description |
CompletionCompletionClient |
|
ServiceMetadata
public static ServiceMetadata ServiceMetadata { get; }The service metadata associated with this client type.
| Property Value | |
|---|---|
| Type | Description |
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 | |
|---|---|
| Name | Description |
request |
CompleteQueryRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
CompleteQueryResponse |
The RPC response. |
// 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 | |
|---|---|
| Name | Description |
request |
CompleteQueryRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskCompleteQueryResponse |
A Task containing the RPC response. |
// 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 | |
|---|---|
| Name | Description |
request |
CompleteQueryRequestThe request object containing all of the parameters for the API call. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskCompleteQueryResponse |
A Task containing the RPC response. |
// 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 | |
|---|---|
| Type | Description |
CompletionClient |
The created CompletionClient. |
CreateAsync(CancellationToken)
public static Task<CompletionClient> CreateAsync(CancellationToken cancellationToken = default)Asynchronously creates a CompletionClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use CompletionClientBuilder.
| Parameter | |
|---|---|
| Name | Description |
cancellationToken |
CancellationTokenThe CancellationToken to use while creating the client. |
| Returns | |
|---|---|
| Type | Description |
TaskCompletionClient |
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 | |
|---|---|
| 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.