키워드 자동 완성(v3)

검색 키워드 프리픽스를 자동 완성합니다.

코드 샘플

Ruby

# project_id     = "Project id required"
# company_name   = "The company's name which the job belongs to. The format is "projects/{project_id}/companies/{company_id}""
# query          = "Keyword prefix as auto complete query"

require "google/apis/jobs_v3"

jobs = Google::Apis::JobsV3
talent_solution_client = jobs::CloudTalentSolutionService.new
talent_solution_client.authorization = Google::Auth.get_application_default(
  "https://www.googleapis.com/auth/jobs"
)

page_size = 10
language_code = "en-US"
result = talent_solution_client.complete_project(
  project_id, company_name: company_name, page_size: page_size, query: query,
  language_code: language_code
) do |result, err|
  if err.nil?
    puts "Default auto complete result: #{result.to_json}"
  else
    puts "Error when auto completing. Error message: #{err.to_json}"
  end
end

다음 단계

다른 Google Cloud 제품의 코드 샘플을 검색하고 필터링하려면 Google Cloud 샘플 브라우저를 참조하세요.