Cloud Talent Solution V4 API - Class Google::Cloud::Talent::V4::Completion::Rest::Client (v0.13.0)

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

REST 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::V4::Completion::Rest::Client.configure do |config|
  config.timeout = 10.0
end

#complete_query

def complete_query(request, options = nil) -> ::Google::Cloud::Talent::V4::CompleteQueryResponse
def complete_query(tenant: nil, query: nil, language_codes: nil, page_size: nil, company: nil, scope: nil, type: nil) -> ::Google::Cloud::Talent::V4::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::V4::CompleteQueryResponse
Pass arguments to complete_query via a request object, either of type Google::Cloud::Talent::V4::CompleteQueryRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Talent::V4::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(tenant: nil, query: nil, language_codes: nil, page_size: nil, company: nil, scope: nil, type: nil) -> ::Google::Cloud::Talent::V4::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
  • tenant (::String) — Required. Resource name of tenant the completion is performed within.

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

  • 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".

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

Basic example

require "google/cloud/talent/v4"

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

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

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

# The returned object is of type Google::Cloud::Talent::V4::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 REST 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::V4::Completion::Rest::Client.new

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

#universe_domain

def universe_domain() -> String

The effective universe domain

Returns
  • (String)