회사 만들기 및 업데이트(v3)

Cloud Talent Solution API에서 회사 리소스는 단일 회사를 나타냅니다. 해당 회사에 속한 모든 채용정보는 그 회사에서 공석인 직책에 대해 만들어진 채용 공고를 의미합니다. 회사 이름, 주소 등의 정보는 물론 Cloud Talent Solution 서비스에 있는 리소스를 내부 데이터베이스에 다시 연결하는 내부 필드도 포함됩니다.

회사 만들기

회사를 생성하려면 둘 이상의 필수 필드를 지정하여 POST 요청을 companies 엔드포인트로 보내십시오. 회사를 만드는 방법에 대한 자세한 내용은 빠른 시작: 회사 및 채용정보 만들기 페이지를 참조하세요.

Java

Cloud Talent Solution 클라이언트 설치 및 생성에 대한 자세한 내용은 Cloud Talent Solution 클라이언트 라이브러리를 참조하세요.


/** Create a company. */
public static Company createCompany(Company companyToBeCreated) throws IOException {
  try {
    CreateCompanyRequest createCompanyRequest =
        new CreateCompanyRequest().setCompany(companyToBeCreated);
    Company companyCreated =
        talentSolutionClient
            .projects()
            .companies()
            .create(DEFAULT_PROJECT_ID, createCompanyRequest)
            .execute();
    System.out.println("Company created: " + companyCreated);
    return companyCreated;
  } catch (IOException e) {
    System.out.println("Got exception while creating company");
    throw e;
  }
}

Python

Cloud Talent Solution 클라이언트 설치 및 생성에 대한 자세한 내용은 Cloud Talent Solution 클라이언트 라이브러리를 참조하세요.

def create_company(client_service, company_to_be_created):
    try:
        request = {"company": company_to_be_created}
        company_created = (
            client_service.projects()
            .companies()
            .create(parent=parent, body=request)
            .execute()
        )
        print("Company created: %s" % company_created)
        return company_created
    except Error as e:
        print("Got exception while creating company")
        raise e

Go

Cloud Talent Solution 클라이언트 설치 및 생성에 대한 자세한 내용은 Cloud Talent Solution 클라이언트 라이브러리를 참조하세요.


// createCompany creates a company as given.
func createCompany(w io.Writer, projectID string, companyToCreate *talent.Company) (*talent.Company, error) {
	ctx := context.Background()

	client, err := google.DefaultClient(ctx, talent.CloudPlatformScope)
	if err != nil {
		return nil, fmt.Errorf("google.DefaultClient: %w", err)
	}
	// Create the jobs service client.
	service, err := talent.New(client)
	if err != nil {
		return nil, fmt.Errorf("talent.New: %w", err)
	}

	parent := "projects/" + projectID
	req := &talent.CreateCompanyRequest{
		Company: companyToCreate,
	}
	company, err := service.Projects.Companies.Create(parent, req).Do()
	if err != nil {
		return nil, fmt.Errorf("failed to create company %q: %w", companyToCreate.DisplayName, err)
	}

	return company, nil
}

필수 입력란

다음 필드는 생성 또는 업데이트 요청에서 필수입니다.

  • displayName: 채용정보와 함께 표시되는 고용주의 이름입니다(예: 'Google LLC').

  • externalId :이 회사의 내부 ID입니다. 이 필드를 통해 내부 식별자를 Google 시스템 내의 회사에 매핑할 수 있습니다. 회사에 별도의 내부 식별자가 없는 경우 이 필드를 displayName과 같은 값으로 설정합니다.

흔히 사용되는 필드

  • headquartersAddress: 회사 본사의 상세 주소로, 채용정보 위치와 다를 수 있습니다. Cloud Talent Solution은 한 회사에 하나의 본사 위치만 받아들입니다. 이 서비스는 주소의 위치정보를 파악하여 derivedInfo.headquartersLocation(출력 전용)에 가능한 한 더 구체적인 위치를 입력합니다.

  • size: MINI에서 GIANT까지 직원 수로 회사의 규모를 나타내는 버킷 값입니다. 열거형과 해당 정의에 대해서는 size 참조 문서를 확인하십시오.

  • eeoText: 이 회사의 모든 채용정보와 관련된 평등 고용 기회 법적 면책조항 텍스트가 포함된 문자열입니다.

  • keywordSearchableJobCustomAttributes: 이 회사의 채용정보에서 색인을 생성하고 일반 키워드 검색으로 검색할 수 있는 customAttributes를 지정합니다.

회사 업데이트

회사를 업데이트하려면 다음 엔드포인트에 PATCH 요청을 보냅니다.

 PATCH https://jobs.googleapis.com/v3/COMPANY_NAME 

여기서 COMPANY_NAME은 회사의 name 필드 값입니다. name은 생성 시, 또한 company.getlist 요청에 의해 반환되는 회사의 고유 ID입니다.

요청의 본문에는 업데이트되지 않는 필드를 포함하여 전체 리소스가 포함되어야 합니다. 이러한 필드는 updateMask에서 설정할 수 있습니다. updateMask에서 설정된 필드만 업데이트되고, 다른 필드의 업데이트는 무시됩니다. updateMask가 설정되지 않은 경우에는 모든 필드가 업데이트됩니다.

Java

Cloud Talent Solution 클라이언트 설치 및 생성에 대한 자세한 내용은 Cloud Talent Solution 클라이언트 라이브러리를 참조하세요.


/** Updates a company. */
public static Company updateCompany(String companyName, Company companyToBeUpdated)
    throws IOException {
  try {
    UpdateCompanyRequest updateCompanyRequest =
        new UpdateCompanyRequest().setCompany(companyToBeUpdated);

    Company companyUpdated =
        talentSolutionClient
            .projects()
            .companies()
            .patch(companyName, updateCompanyRequest)
            .execute();

    System.out.println("Company updated: " + companyUpdated);
    return companyUpdated;
  } catch (IOException e) {
    System.out.println("Got exception while updating company");
    throw e;
  }
}

Python

Cloud Talent Solution 클라이언트 설치 및 생성에 대한 자세한 내용은 Cloud Talent Solution 클라이언트 라이브러리를 참조하세요.

def update_company(client_service, company_name, company_to_be_updated):
    try:
        request = {"company": company_to_be_updated}
        company_updated = (
            client_service.projects()
            .companies()
            .patch(name=company_name, body=request)
            .execute()
        )
        print("Company updated: %s" % company_updated)
        return company_updated
    except Error as e:
        print("Got exception while updating company")
        raise e

Go

Cloud Talent Solution 클라이언트 설치 및 생성에 대한 자세한 내용은 Cloud Talent Solution 클라이언트 라이브러리를 참조하세요.


// updateCompany update a company with all fields.
func updateCompany(w io.Writer, name string, companyToUpdate *talent.Company) (*talent.Company, error) {
	ctx := context.Background()

	client, err := google.DefaultClient(ctx, talent.CloudPlatformScope)
	if err != nil {
		return nil, fmt.Errorf("google.DefaultClient: %w", err)
	}
	// Create the jobs service client.
	service, err := talent.New(client)
	if err != nil {
		return nil, fmt.Errorf("talent.New: %w", err)
	}

	updateCompanyRequest := &talent.UpdateCompanyRequest{
		Company: companyToUpdate,
	}
	company, err := service.Projects.Companies.Patch(name, updateCompanyRequest).Do()
	if err != nil {
		return nil, fmt.Errorf("failed to update company %q: %w", name, err)
	}

	return company, nil
}

updateMask로 회사 업데이트

Java

Cloud Talent Solution 클라이언트 설치 및 생성에 대한 자세한 내용은 Cloud Talent Solution 클라이언트 라이브러리를 참조하세요.


/** Updates a company. */
public static Company updateCompanyWithFieldMask(
    String companyName, String fieldMask, Company companyToBeUpdated) throws IOException {
  try {
    // String foo = String.format("?updateCompanyFields=%s",fieldMask);
    UpdateCompanyRequest updateCompanyRequest =
        new UpdateCompanyRequest().setUpdateMask(fieldMask).setCompany(companyToBeUpdated);

    Company companyUpdated =
        talentSolutionClient
            .projects()
            .companies()
            .patch(companyName, updateCompanyRequest)
            .execute();

    System.out.println("Company updated: " + companyUpdated);
    return companyUpdated;
  } catch (IOException e) {
    System.out.println("Got exception while updating company");
    throw e;
  }
}

Python

Cloud Talent Solution 클라이언트 설치 및 생성에 대한 자세한 내용은 Cloud Talent Solution 클라이언트 라이브러리를 참조하세요.

def update_company_with_field_mask(
    client_service, company_name, company_to_be_updated, field_mask
):
    try:
        request = {"company": company_to_be_updated, "update_mask": field_mask}
        company_updated = (
            client_service.projects()
            .companies()
            .patch(name=company_name, body=request)
            .execute()
        )
        print("Company updated: %s" % company_updated)
        return company_updated
    except Error as e:
        print("Got exception while updating company with field mask")
        raise e

Go

Cloud Talent Solution 클라이언트 설치 및 생성에 대한 자세한 내용은 Cloud Talent Solution 클라이언트 라이브러리를 참조하세요.


// updateCompanyWithMask updates a company with specific fields.
// mask is a comma separated list of top-level fields of talent.Company.
func updateCompanyWithMask(w io.Writer, name string, mask string, companyToUpdate *talent.Company) (*talent.Company, error) {
	ctx := context.Background()

	client, err := google.DefaultClient(ctx, talent.CloudPlatformScope)
	if err != nil {
		return nil, fmt.Errorf("google.DefaultClient: %w", err)
	}
	// Create the jobs service client.
	service, err := talent.New(client)
	if err != nil {
		return nil, fmt.Errorf("talent.New: %w", err)
	}

	req := &talent.UpdateCompanyRequest{
		Company:    companyToUpdate,
		UpdateMask: mask,
	}
	company, err := service.Projects.Companies.Patch(name, req).Do()
	if err != nil {
		return nil, fmt.Errorf("failed to update company %q with mask %q: %w", name, mask, err)
	}

	return company, nil
}

권장사항

회사 기밀 유지

기밀 채용정보를 게시하려는 경우 회사의 필드를 모방하지만 displayName, externalId, 기타 식별 필드를 난독화하는 별도의 회사를 만드는 것이 좋습니다.

최종 고용주가 익명이어야 하는 경우(예: Staffing Agency 사용 사례), externalIddisplayName을 무작위이지만 고유한 값으로 설정하는 것이 좋습니다.