jobs/V3/auto_complete_sample.rb
# Copyright 2018 Google, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.




Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Unless required by applicable law or agreed to in writing software distributed under the License is distributed on an " AS IS " BASIS WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND either express or implied . See the License for the specific language governing permissions and limitations under the License .
def job_discovery_job_title_auto_complete project_id:, company_name:, 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
  type = "JOB_TITLE"
  language_code = "en-US"
  talent_solution_client.complete_project(
    project_id, company_name: company_name, page_size: page_size, query: query,
      language_code: language_code, type: type
  ) do |result, err|
    if err.nil?
      puts "Job title auto complete result: #{result.to_json}"
    else
      puts "Error when auto completing job title. Error message: #{err.to_json}"
    end
  end
end
def job_discovery_job_title_auto_complete project_id : , company_name : , 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 type = "JOB_TITLE" language_code = "en-US" talent_solution_client . complete_project ( project_id , company_name : company_name , page_size : page_size , query : query , language_code : language_code , type : type ) do | result , err | if err . nil? puts "Job title auto complete result: #{result.to_json}" else puts "Error when auto completing job title. Error message: #{err.to_json}" end end end
Copyright 2018 Google, Inc
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Copyright 2018 Google Inc Licensed under the Apache License Version 2 . 0 ( the " License " ) ; you may not use this file except in compliance with the License .
# [START job_discovery_job_title_auto_complete] # project_id     = "Project id required" # company_name   = "The resource name of the company listing the job. The format is "projects/{project_id}/companies/{company_id}"" # query          = "Job title prefix as auto complete query" # [END job_discovery_job_title_auto_complete]
project_id
<not_specific>
company_name
<not_specific>
query
<not_specific>