Unternehmen mit Feldmaske aktualisieren (v3)

Unternehmen mit einer Feldmaske aktualisieren.

Codebeispiel

Ruby

Informationen zum Installieren und Verwenden der Clientbibliothek für CTS finden Sie unter CTS-Clientbibliotheken.

Richten Sie Standardanmeldedaten für Anwendungen ein, um sich bei CTS zu authentifizieren. Weitere Informationen finden Sie unter Authentifizierung für eine lokale Entwicklungsumgebung einrichten.

# company_name     = "The name of the company you want to update. The format is "projects/{project_id}/companies/{company_id}""
# field_mask       = "The field mask you want to update"
# company_updated  = "The new company object to be updated"

require "google/apis/jobs_v3"

jobs = Google::Apis::JobsV3
talent_solution_client = jobs::CloudTalentSolutionService.new
# @see
# https://developers.google.com/identity/protocols/application-default-credentials#callingruby
talent_solution_client.authorization = Google::Auth.get_application_default(
  "https://www.googleapis.com/auth/jobs"
)

begin
  update_company_request = jobs::UpdateCompanyRequest.new company:     company_updated,
                                                          update_mask: field_mask
  company_updated = talent_solution_client
                    .patch_project_company(company_name, update_company_request)
  puts "Company updated with filedMask #{update_company_request.update_mask}. "
  puts "Updated company: #{company_updated.to_json}"
  company_updated
rescue StandardError => e
  puts "Exception occurred while updating company with fieldMask: #{e}"
end

Nächste Schritte

Informationen zum Suchen und Filtern von Codebeispielen für andere Google Cloud-Produkte finden Sie im Google Cloud-Beispielbrowser.