Cloud Talent Solution V4beta1 API - Class Google::Cloud::Talent::V4beta1::Completion::Client (v0.4.6)

Reference documentation and code samples for the Cloud Talent Solution V4beta1 API class Google::Cloud::Talent::V4beta1::Completion::Client.

Client for the Completion service.

A service handles auto completion.

Inherits

  • Object

Methods

.configure

def self.configure() { |config| ... } -> Client::Configuration

Configure the Completion Client class.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter
Example
# Modify the configuration for all Completion clients
::Google::Cloud::Talent::V4beta1::Completion::Client.configure do |config|
  config.timeout = 10.0
end

#complete_query

def complete_query(request, options = nil) -> ::Google::Cloud::Talent::V4beta1::CompleteQueryResponse
def complete_query(parent: nil, query: nil, language_codes: nil, page_size: nil, company: nil, scope: nil, type: nil) -> ::Google::Cloud::Talent::V4beta1::CompleteQueryResponse

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

Overloads
def complete_query(request, options = nil) -> ::Google::Cloud::Talent::V4beta1::CompleteQueryResponse
Pass arguments to complete_query via a request object, either of type Google::Cloud::Talent::V4beta1::CompleteQueryRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Talent::V4beta1::CompleteQueryRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def complete_query(parent: nil, query: nil, language_codes: nil, page_size: nil, company: nil, scope: nil, type: nil) -> ::Google::Cloud::Talent::V4beta1::CompleteQueryResponse
Pass arguments to complete_query via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. Resource name of tenant the completion is performed within.

    The format is "projects/{project_id}/tenants/{tenant_id}", for example, "projects/foo/tenant/bar".

    If tenant id is unspecified, the default tenant is used, for example, "projects/foo".

  • query (::String) — Required. The query used to generate suggestions.

    The maximum number of allowed characters is 255.

  • language_codes (::Array<::String>) — The list of languages of the query. This is the BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see Tags for Identifying Languages.

    The maximum number of allowed characters is 255.

  • page_size (::Integer) — Required. Completion result count.

    The maximum allowed page size is 10.

  • company (::String) — If provided, restricts completion to specified company.

    The format is "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}", for example, "projects/foo/tenants/bar/companies/baz".

    If tenant id is unspecified, the default tenant is used, for example, "projects/foo".

  • scope (::Google::Cloud::Talent::V4beta1::CompleteQueryRequest::CompletionScope) — The scope of the completion. The defaults is CompletionScope.PUBLIC.
  • type (::Google::Cloud::Talent::V4beta1::CompleteQueryRequest::CompletionType) — The completion topic. The default is CompletionType.COMBINED.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/talent/v4beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Talent::V4beta1::Completion::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Talent::V4beta1::CompleteQueryRequest.new

# Call the complete_query method.
result = client.complete_query request

# The returned object is of type Google::Cloud::Talent::V4beta1::CompleteQueryResponse.
p result

#configure

def configure() { |config| ... } -> Client::Configuration

Configure the Completion Client instance.

The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on Client.configure.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter

#initialize

def initialize() { |config| ... } -> Client

Create a new Completion client object.

Yields
  • (config) — Configure the Completion client.
Yield Parameter
Returns
  • (Client) — a new instance of Client
Example
# Create a client using the default configuration
client = ::Google::Cloud::Talent::V4beta1::Completion::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::Talent::V4beta1::Completion::Client.new do |config|
  config.timeout = 10.0
end