Generate job (v3)

Generate a job.

Code sample


To learn how to install and use the client library for CTS, see CTS client libraries.

To authenticate to CTS, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

# company_name   = "The resource name of the company listing the job. The format is 'projects/{project_id}/companies/{company_id}'"
# requisition_id = "The posting ID, assigned by the client to identify a job"

require "google/apis/jobs_v3"

jobs = Google::Apis::JobsV3

application_info = uris: [""]
job_generated = requisition_id:   requisition_id,
                              title:            " Lab Technician",
                              company_name:     company_name,
                              employment_types: ["FULL_TIME"],
                              language_code:    "en-US",
                              application_info: application_info,
                              description:      "Design, develop, test, deploy, " +
                                                "maintain and improve software."

# set compensation to 12 USD/hour
compensation_entry = type:   "BASE",
                                                 unit:   "HOURLY",
                                                 amount: ( currency_code: "USD",
                                                                          units:         12)
compensation_info = entries: [compensation_entry]

job_generated.compensation_info = compensation_info
puts "Job generated: #{job_generated.to_json}"

What's next

To search and filter code samples for other Google Cloud products, see the Google Cloud sample browser.