회사 만들기 및 업데이트

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

회사 만들기

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

Go

import (
	"context"
	"fmt"
	"io"

	talent "cloud.google.com/go/talent/apiv4beta1"
	talentpb "google.golang.org/genproto/googleapis/cloud/talent/v4beta1"
)

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

	// Initializes a companyService client.
	c, err := talent.NewCompanyClient(ctx)
	if err != nil {
		return nil, fmt.Errorf("talent.NewCompanyClient: %v", err)
	}

	// Construct a createCompany request.
	req := &talentpb.CreateCompanyRequest{
		Parent: fmt.Sprintf("projects/%s", projectID),
		Company: &talentpb.Company{
			ExternalId:  externalID,
			DisplayName: displayName,
		},
	}

	resp, err := c.CreateCompany(ctx, req)
	if err != nil {
		return nil, fmt.Errorf("CreateCompany: %v", err)
	}

	fmt.Fprintf(w, "Created company: %q\n", resp.GetName())

	return resp, nil
}

자바

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


import com.google.cloud.talent.v4beta1.Company;
import com.google.cloud.talent.v4beta1.CompanyServiceClient;
import com.google.cloud.talent.v4beta1.CreateCompanyRequest;
import com.google.cloud.talent.v4beta1.TenantName;
import java.io.IOException;

public class JobSearchCreateCompany {

  public static void createCompany() throws IOException {
    // TODO(developer): Replace these variables before running the sample.
    String projectId = "your-project-id";
    String tenantId = "your-tenant-id";
    String displayName = "your-company-display-name";
    String externalId = "your-external-id";
    createCompany(projectId, tenantId, displayName, externalId);
  }

  // Create a company.
  public static void createCompany(
      String projectId, String tenantId, String displayName, String externalId) throws IOException {
    // Initialize client that will be used to send requests. This client only needs to be created
    // once, and can be reused for multiple requests. After completing all of your requests, call
    // the "close" method on the client to safely clean up any remaining background resources.
    try (CompanyServiceClient companyServiceClient = CompanyServiceClient.create()) {
      TenantName parent = TenantName.of(projectId, tenantId);
      Company company =
          Company.newBuilder().setDisplayName(displayName).setExternalId(externalId).build();

      CreateCompanyRequest request =
          CreateCompanyRequest.newBuilder()
              .setParent(parent.toString())
              .setCompany(company)
              .build();

      Company response = companyServiceClient.createCompany(request);
      System.out.println("Created Company");
      System.out.format("Name: %s%n", response.getName());
      System.out.format("Display Name: %s%n", response.getDisplayName());
      System.out.format("External ID: %s%n", response.getExternalId());
    }
  }
}

Python

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


from google.cloud import talent
import six

def create_company(project_id, tenant_id, display_name, external_id):
    """Create Company"""

    client = talent.CompanyServiceClient()

    # project_id = 'Your Google Cloud Project ID'
    # tenant_id = 'Your Tenant ID (using tenancy is optional)'
    # display_name = 'My Company Name'
    # external_id = 'Identifier of this company in my system'

    if isinstance(project_id, six.binary_type):
        project_id = project_id.decode("utf-8")
    if isinstance(tenant_id, six.binary_type):
        tenant_id = tenant_id.decode("utf-8")
    if isinstance(display_name, six.binary_type):
        display_name = display_name.decode("utf-8")
    if isinstance(external_id, six.binary_type):
        external_id = external_id.decode("utf-8")
    parent = f"projects/{project_id}/tenants/{tenant_id}"
    company = {"display_name": display_name, "external_id": external_id}

    response = client.create_company(parent=parent, company=company)
    print("Created Company")
    print("Name: {}".format(response.name))
    print("Display Name: {}".format(response.display_name))
    print("External ID: {}".format(response.external_id))
    return response.name

Ruby

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

require "google/cloud/talent"

# Instantiate a client
company_service = Google::Cloud::Talent.company_service

# project_id = "Your Google Cloud Project ID"
# tenant_id = "Your Tenant ID (using tenancy is optional)"
parent = company_service.tenant_path project: project_id, tenant: tenant_id

# display_name = "My Company Name"
# external_id = "Identifier of this company in my system"
company = { display_name: display_name, external_id: external_id }

response = company_service.create_company parent: parent, company: company
puts "Created Company"
puts "Name: #{response.name}"
puts "Display Name: #{response.display_name}"
puts "External ID: #{response.external_id}"

C#

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

public static object CreateCompany(string projectId, string tenantId, string displayName, string externalId)
{
    CompanyServiceClient companyServiceClient = CompanyServiceClient.Create();
    TenantName tenantName = TenantName.FromProjectTenant(projectId, tenantId);

    Company company = new Company
    {
        DisplayName = displayName,
        ExternalId = externalId
    };

    CreateCompanyRequest request = new CreateCompanyRequest
    {
        ParentAsTenantName = tenantName,
        Company = company
    };

    Company response = companyServiceClient.CreateCompany(request);

    Console.WriteLine("Created Company");
    Console.WriteLine($"Name: {response.Name}");
    Console.WriteLine($"Display Name: {response.DisplayName}");
    Console.WriteLine($"External ID: {response.ExternalId}");
    return 0;
}

필수 필드

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

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

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

흔히 사용되는 필드

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

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

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

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

회사 기밀 유지

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

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

회사 검색

Go

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

import (
	"context"
	"fmt"
	"io"

	talent "cloud.google.com/go/talent/apiv4beta1"
	talentpb "google.golang.org/genproto/googleapis/cloud/talent/v4beta1"
)

// getCompany gets an existing company by its resource name.
func getCompany(w io.Writer, projectID, companyID string) (*talentpb.Company, error) {
	ctx := context.Background()

	// Initialize a companyService client.
	c, err := talent.NewCompanyClient(ctx)
	if err != nil {
		return nil, fmt.Errorf("talent.NewCompanyClient: %v", err)
	}

	// Construct a getCompany request.
	companyName := fmt.Sprintf("projects/%s/companies/%s", projectID, companyID)
	req := &talentpb.GetCompanyRequest{
		// The resource name of the company to be retrieved.
		// The format is "projects/{project_id}/companies/{company_id}".
		Name: companyName,
	}

	resp, err := c.GetCompany(ctx, req)
	if err != nil {
		return nil, fmt.Errorf("GetCompany: %v", err)
	}

	fmt.Fprintf(w, "Company: %q\n", resp.GetName())
	fmt.Fprintf(w, "Company display name: %q\n", resp.GetDisplayName())

	return resp, nil
}

자바

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


import com.google.cloud.talent.v4beta1.Company;
import com.google.cloud.talent.v4beta1.CompanyName;
import com.google.cloud.talent.v4beta1.CompanyServiceClient;
import com.google.cloud.talent.v4beta1.GetCompanyRequest;
import java.io.IOException;

public class JobSearchGetCompany {

  public static void getCompany() throws IOException {
    // TODO(developer): Replace these variables before running the sample.
    String projectId = "your-project-id";
    String tenantId = "your-tenant-id";
    String companyId = "your-company-id";
    getCompany(projectId, tenantId, companyId);
  }

  // Get Company.
  public static void getCompany(String projectId, String tenantId, String companyId)
      throws IOException {
    // Initialize client that will be used to send requests. This client only needs to be created
    // once, and can be reused for multiple requests. After completing all of your requests, call
    // the "close" method on the client to safely clean up any remaining background resources.
    try (CompanyServiceClient companyServiceClient = CompanyServiceClient.create()) {
      CompanyName name = CompanyName.ofProjectTenantCompanyName(projectId, tenantId, companyId);

      GetCompanyRequest request = GetCompanyRequest.newBuilder().setName(name.toString()).build();

      Company response = companyServiceClient.getCompany(request);
      System.out.format("Company name: %s%n", response.getName());
      System.out.format("Display name: %s%n", response.getDisplayName());
    }
  }
}

Python

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


from google.cloud import talent
import six

def get_company(project_id, tenant_id, company_id):
    """Get Company"""

    client = talent.CompanyServiceClient()

    # project_id = 'Your Google Cloud Project ID'
    # tenant_id = 'Your Tenant ID (using tenancy is optional)'
    # company_id = 'Company ID'

    if isinstance(project_id, six.binary_type):
        project_id = project_id.decode("utf-8")
    if isinstance(tenant_id, six.binary_type):
        tenant_id = tenant_id.decode("utf-8")
    if isinstance(company_id, six.binary_type):
        company_id = company_id.decode("utf-8")
    name = client.company_path(project_id, tenant_id, company_id)

    response = client.get_company(name=name)
    print(f"Company name: {response.name}")
    print(f"Display name: {response.display_name}")

Ruby

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

require "google/cloud/talent"

# Instantiate a client
company_service = Google::Cloud::Talent.company_service

# project_id = "Your Google Cloud Project ID"
# tenant_id = "Your Tenant ID (using tenancy is optional)"
# company_id = "Company ID"
formatted_name = company_service.company_path project: project_id,
                                              tenant:  tenant_id,
                                              company: company_id

response = company_service.get_company name: formatted_name
puts "Company name: #{response.name}"
puts "Display name: #{response.display_name}"

C#

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

public static object GetCompany(string projectId, string tenantId, string companyId)
{
    CompanyServiceClient companyServiceClient = CompanyServiceClient.Create();
    CompanyName companyName = CompanyName.FromProjectTenantCompany(projectId, tenantId, companyId);

    GetCompanyRequest request = new GetCompanyRequest
    {
        CompanyName = companyName
    };
    var response = companyServiceClient.GetCompany(request);
    Console.WriteLine($"Company name: {response.Name}");
    Console.WriteLine($"Display name: {response.DisplayName}");
    return 0;
}

회사 나열

Go

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

import (
	"context"
	"fmt"
	"io"

	talent "cloud.google.com/go/talent/apiv4beta1"
	"google.golang.org/api/iterator"
	talentpb "google.golang.org/genproto/googleapis/cloud/talent/v4beta1"
)

// listCompanies lists all companies in the project.
func listCompanies(w io.Writer, projectID string) error {
	ctx := context.Background()

	// Initialize a compnayService client.
	c, err := talent.NewCompanyClient(ctx)
	if err != nil {
		return fmt.Errorf("talent.NewCompanyClient: %v", err)
	}

	// Construct a listCompanies request.
	req := &talentpb.ListCompaniesRequest{
		Parent: "projects/" + projectID,
	}

	it := c.ListCompanies(ctx, req)

	for {
		resp, err := it.Next()
		if err == iterator.Done {
			return nil
		}
		if err != nil {
			return fmt.Errorf("it.Next: %v", err)
		}
		fmt.Fprintf(w, "Listing company: %q\n", resp.GetName())
		fmt.Fprintf(w, "Display name: %v\n", resp.GetDisplayName())
		fmt.Fprintf(w, "External ID: %v\n", resp.GetExternalId())
	}
}

자바

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


import com.google.cloud.talent.v4beta1.Company;
import com.google.cloud.talent.v4beta1.CompanyServiceClient;
import com.google.cloud.talent.v4beta1.ListCompaniesRequest;
import com.google.cloud.talent.v4beta1.TenantName;
import java.io.IOException;

public class JobSearchListCompanies {

  public static void listCompanies() throws IOException {
    // TODO(developer): Replace these variables before running the sample.
    String projectId = "your-project-id";
    String tenantId = "your-tenant-id";
    listCompanies(projectId, tenantId);
  }

  // List Companies.
  public static void listCompanies(String projectId, String tenantId) throws IOException {
    // Initialize client that will be used to send requests. This client only needs to be created
    // once, and can be reused for multiple requests. After completing all of your requests, call
    // the "close" method on the client to safely clean up any remaining background resources.
    try (CompanyServiceClient companyServiceClient = CompanyServiceClient.create()) {
      TenantName parent = TenantName.of(projectId, tenantId);

      ListCompaniesRequest request =
          ListCompaniesRequest.newBuilder().setParent(parent.toString()).build();

      for (Company responseItem : companyServiceClient.listCompanies(request).iterateAll()) {
        System.out.format("Company Name: %s%n", responseItem.getName());
        System.out.format("Display Name: %s%n", responseItem.getDisplayName());
        System.out.format("External ID: %s%n", responseItem.getExternalId());
      }
    }
  }
}

Python

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


from google.cloud import talent
import six

def list_companies(project_id, tenant_id):
    """List Companies"""

    client = talent.CompanyServiceClient()

    # project_id = 'Your Google Cloud Project ID'
    # tenant_id = 'Your Tenant ID (using tenancy is optional)'

    if isinstance(project_id, six.binary_type):
        project_id = project_id.decode("utf-8")
    if isinstance(tenant_id, six.binary_type):
        tenant_id = tenant_id.decode("utf-8")
    parent = f"projects/{project_id}/tenants/{tenant_id}"

    # Iterate over all results
    results = []
    for company in client.list_companies(parent=parent):
        results.append(company.name)
        print(f"Company Name: {company.name}")
        print(f"Display Name: {company.display_name}")
        print(f"External ID: {company.external_id}")
    return results

Ruby

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

require "google/cloud/talent"

# Instantiate a client
company_service = Google::Cloud::Talent.company_service

# project_id = "Your Google Cloud Project ID"
# tenant_id = "Your Tenant ID (using tenancy is optional)"
formatted_parent = company_service.tenant_path project: project_id, tenant: tenant_id

# Iterate over all results.
response = company_service.list_companies parent: formatted_parent
response.each do |element|
  puts "Company Name: #{element.name}"
  puts "Display Name: #{element.display_name}"
  puts "External ID: #{element.external_id}"
end
response

C#

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

public static object ListCompanies(string projectId, string tenantId)
{
    CompanyServiceClient companyServiceClient = CompanyServiceClient.Create();
    TenantName tenantName = TenantName.FromProjectTenant(projectId, tenantId);

    ListCompaniesRequest request = new ListCompaniesRequest
    {
        ParentAsTenantName = tenantName
    };
    var companies = companyServiceClient.ListCompanies(request);
    foreach (var company in companies)
    {
        Console.WriteLine($"Company Name: {company.Name}");
        Console.WriteLine($"Display Name: {company.DisplayName}");
        Console.WriteLine($"External ID: {company.ExternalId}");
    }
    return 0;
}

회사 삭제

Go

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

import (
	"context"
	"fmt"
	"io"

	talent "cloud.google.com/go/talent/apiv4beta1"
	talentpb "google.golang.org/genproto/googleapis/cloud/talent/v4beta1"
)

// deleteCompany deletes an existing company. Companies with
// existing jobs cannot be deleted until those jobs have been deleted.
func deleteCompany(w io.Writer, projectID, companyID string) error {
	ctx := context.Background()

	// Initialize a companyService client.
	c, err := talent.NewCompanyClient(ctx)
	if err != nil {
		return fmt.Errorf("talent.NewCompanyClient: %v", err)
	}

	// Construct a deleteCompany request.
	companyName := fmt.Sprintf("projects/%s/companies/%s", projectID, companyID)
	req := &talentpb.DeleteCompanyRequest{
		// The resource name of the company to be deleted.
		// The format is "projects/{project_id}/companies/{company_id}".
		Name: companyName,
	}

	if err := c.DeleteCompany(ctx, req); err != nil {
		return fmt.Errorf("DeleteCompany(%s): %v", companyName, err)
	}

	fmt.Fprintf(w, "Deleted company: %q\n", companyName)

	return nil
}

자바

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


import com.google.cloud.talent.v4beta1.CompanyName;
import com.google.cloud.talent.v4beta1.CompanyServiceClient;
import com.google.cloud.talent.v4beta1.DeleteCompanyRequest;
import java.io.IOException;

public class JobSearchDeleteCompany {

  public static void deleteCompany() throws IOException {
    // TODO(developer): Replace these variables before running the sample.
    String projectId = "your-project-id";
    String tenantId = "your-tenant-id";
    String companyId = "your-company-id";
    deleteCompany(projectId, tenantId, companyId);
  }

  // Delete Company.
  public static void deleteCompany(String projectId, String tenantId, String companyId)
      throws IOException {
    // Initialize client that will be used to send requests. This client only needs to be created
    // once, and can be reused for multiple requests. After completing all of your requests, call
    // the "close" method on the client to safely clean up any remaining background resources.
    try (CompanyServiceClient companyServiceClient = CompanyServiceClient.create()) {
      CompanyName name = CompanyName.ofProjectTenantCompanyName(projectId, tenantId, companyId);

      DeleteCompanyRequest request =
          DeleteCompanyRequest.newBuilder().setName(name.toString()).build();

      companyServiceClient.deleteCompany(request);
      System.out.println("Deleted company");
    }
  }
}

Python

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


from google.cloud import talent
import six

def delete_company(project_id, tenant_id, company_id):
    """Delete Company"""

    client = talent.CompanyServiceClient()

    # project_id = 'Your Google Cloud Project ID'
    # tenant_id = 'Your Tenant ID (using tenancy is optional)'
    # company_id = 'ID of the company to delete'

    if isinstance(project_id, six.binary_type):
        project_id = project_id.decode("utf-8")
    if isinstance(tenant_id, six.binary_type):
        tenant_id = tenant_id.decode("utf-8")
    if isinstance(company_id, six.binary_type):
        company_id = company_id.decode("utf-8")
    name = client.company_path(project_id, tenant_id, company_id)

    client.delete_company(name=name)
    print("Deleted company")

Ruby

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

require "google/cloud/talent"

# Instantiate a client
company_service = Google::Cloud::Talent.company_service

# project_id = "Your Google Cloud Project ID"
# tenant_id = "Your Tenant ID (using tenancy is optional)"
# company_id = "ID of the company to delete"
formatted_name = company_service.company_path project: project_id,
                                              tenant:  tenant_id,
                                              company: company_id

company_service.delete_company name: formatted_name

puts "Deleted company"

C#

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

public static object DeleteCompany(string projectId, string tenantId, string companyId)
{
    CompanyServiceClient companyServiceClient = CompanyServiceClient.Create();
    CompanyName companyName = CompanyName.FromProjectTenantCompany(projectId, tenantId, companyId);
    DeleteCompanyRequest request = new DeleteCompanyRequest
    {
        CompanyName = companyName
    };

    companyServiceClient.DeleteCompany(request);

    Console.WriteLine("Deleted Company.");
    return 0;
}