Generate job with custom attributes (v3)

Generate a job with custom attributes.

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
talent_solution_client =
# @see
talent_solution_client.authorization = Google::Auth.get_application_default(
# Constructs custom attributes map
custom_attributes = {}
# First custom attribute
custom_attributes["someFieldName1"] = string_values: ["value1"],
                                                                filterable:    true
# Second custom attribute
custom_attributes["someFieldName2"] = long_values: [256],
                                                                filterable:  true
# Creates job with custom attributes
job_generated = requisition_id:    requisition_id,
                title:             " Lab Technician",
                company_name:      company_name,
                application_info:  ( uris: [""]),
                description:       "Design, develop, test, deploy, maintain and improve software.",
                custom_attributes: custom_attributes

puts "Featured 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.