public abstract class CompletionClient
Completion client wrapper, for convenient use.
Derived Types
Namespace
Google.Cloud.Talent.V4Beta1Assembly
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 |
String |
DefaultScopes
public static IReadOnlyList<string> DefaultScopes { get; }
The default Completion scopes.
Property Value | |
---|---|
Type | Description |
IReadOnlyList<String> |
The default Completion scopes are:
GrpcClient
public virtual Completion.CompletionClient GrpcClient { get; }
The underlying gRPC Completion client
Property Value | |
---|---|
Type | Description |
Completion.CompletionClient |
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 | CompleteQueryRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If 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
{
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 | CompleteQueryRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<CompleteQueryResponse> | A Task containing the RPC response. |
// 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 | CompleteQueryRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<CompleteQueryResponse> | A Task containing the RPC response. |
// 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 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(CancellationToken))
Asynchronously creates a CompletionClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use CompletionClientBuilder.
Parameter | |
---|---|
Name | Description |
cancellationToken | CancellationToken The CancellationToken to use while creating the client. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
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.