Generar trabajo (v3)

Genera un trabajo.

Muestra de código

Ruby

Para obtener información sobre cómo instalar y usar la biblioteca cliente de CTS, consulta las bibliotecas cliente de CTS.

Para autenticarte en CTS, configura las credenciales predeterminadas de la aplicación. Si deseas obtener más información, consulta Configura la autenticación para un entorno de desarrollo local.

# 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 = jobs::ApplicationInfo.new uris: ["http://careers.google.com"]
job_generated = jobs::Job.new 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 = jobs::CompensationEntry.new type:   "BASE",
                                                 unit:   "HOURLY",
                                                 amount: (jobs::Money.new currency_code: "USD",
                                                                          units:         12)
compensation_info = jobs::CompensationInfo.new entries: [compensation_entry]

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

¿Qué sigue?

Para buscar y filtrar muestras de código para otros productos de Google Cloud, consulta el navegador de muestra de Google Cloud.