Reference documentation and code samples for the Cloud Talent Solution V4beta1 API class Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client.
REST client for the CompanyService service.
A service that handles company management, including CRUD and enumeration.
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::Configuration
Configure the CompanyService Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all CompanyService clients ::Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client.configure do |config| config.timeout = 10.0 end
#configure
def configure() { |config| ... } -> Client::Configuration
Configure the CompanyService Client instance.
The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on Client.configure.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
#create_company
def create_company(request, options = nil) -> ::Google::Cloud::Talent::V4beta1::Company
def create_company(parent: nil, company: nil) -> ::Google::Cloud::Talent::V4beta1::Company
Creates a new company entity.
def create_company(request, options = nil) -> ::Google::Cloud::Talent::V4beta1::Company
create_company
via a request object, either of type
Google::Cloud::Talent::V4beta1::CreateCompanyRequest or an equivalent Hash.
- request (::Google::Cloud::Talent::V4beta1::CreateCompanyRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def create_company(parent: nil, company: nil) -> ::Google::Cloud::Talent::V4beta1::Company
create_company
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
parent (::String) — Required. Resource name of the tenant under which the company is created.
The format is "projects/{project_id}/tenants/{tenant_id}", for example, "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant is created, for example, "projects/foo".
- company (::Google::Cloud::Talent::V4beta1::Company, ::Hash) — Required. The company to be created.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Talent::V4beta1::Company)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/talent/v4beta1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Talent::V4beta1::CreateCompanyRequest.new # Call the create_company method. result = client.create_company request # The returned object is of type Google::Cloud::Talent::V4beta1::Company. p result
#delete_company
def delete_company(request, options = nil) -> ::Google::Protobuf::Empty
def delete_company(name: nil) -> ::Google::Protobuf::Empty
Deletes specified company. Prerequisite: The company has no jobs associated with it.
def delete_company(request, options = nil) -> ::Google::Protobuf::Empty
delete_company
via a request object, either of type
DeleteCompanyRequest or an equivalent Hash.
- request (::Google::Cloud::Talent::V4beta1::DeleteCompanyRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def delete_company(name: nil) -> ::Google::Protobuf::Empty
delete_company
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) — Required. The resource name of the company to be deleted.
The format is "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}", for example, "projects/foo/tenants/bar/companies/baz".
If tenant id is unspecified, the default tenant is used, for example, "projects/foo/companies/bar".
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Protobuf::Empty)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/talent/v4beta1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Talent::V4beta1::DeleteCompanyRequest.new # Call the delete_company method. result = client.delete_company request # The returned object is of type Google::Protobuf::Empty. p result
#get_company
def get_company(request, options = nil) -> ::Google::Cloud::Talent::V4beta1::Company
def get_company(name: nil) -> ::Google::Cloud::Talent::V4beta1::Company
Retrieves specified company.
def get_company(request, options = nil) -> ::Google::Cloud::Talent::V4beta1::Company
get_company
via a request object, either of type
GetCompanyRequest or an equivalent Hash.
- request (::Google::Cloud::Talent::V4beta1::GetCompanyRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def get_company(name: nil) -> ::Google::Cloud::Talent::V4beta1::Company
get_company
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) — Required. The resource name of the company to be retrieved.
The format is "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}", for example, "projects/api-test-project/tenants/foo/companies/bar".
If tenant id is unspecified, the default tenant is used, for example, "projects/api-test-project/companies/bar".
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Talent::V4beta1::Company)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/talent/v4beta1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Talent::V4beta1::GetCompanyRequest.new # Call the get_company method. result = client.get_company request # The returned object is of type Google::Cloud::Talent::V4beta1::Company. p result
#initialize
def initialize() { |config| ... } -> Client
Create a new CompanyService REST client object.
- (config) — Configure the CompanyService client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client.new # Create a client using a custom configuration client = ::Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client.new do |config| config.timeout = 10.0 end
#list_companies
def list_companies(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4beta1::Company>
def list_companies(parent: nil, page_token: nil, page_size: nil, require_open_jobs: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4beta1::Company>
Lists all companies associated with the project.
def list_companies(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4beta1::Company>
list_companies
via a request object, either of type
ListCompaniesRequest or an equivalent Hash.
- request (::Google::Cloud::Talent::V4beta1::ListCompaniesRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def list_companies(parent: nil, page_token: nil, page_size: nil, require_open_jobs: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4beta1::Company>
list_companies
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
parent (::String) — Required. Resource name of the tenant under which the company is created.
The format is "projects/{project_id}/tenants/{tenant_id}", for example, "projects/foo/tenant/bar".
If tenant id is unspecified, the default tenant will be used, for example, "projects/foo".
- page_token (::String) — The starting indicator from which to return results.
- page_size (::Integer) — The maximum number of companies to be returned, at most 100. Default is 100 if a non-positive number is provided.
-
require_open_jobs (::Boolean) — Set to true if the companies requested must have open jobs.
Defaults to false.
If true, at most page_size of companies are fetched, among which only those with open jobs are returned.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4beta1::Company>)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4beta1::Company>)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/talent/v4beta1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Talent::V4beta1::ListCompaniesRequest.new # Call the list_companies method. result = client.list_companies request # The returned object is of type Gapic::PagedEnumerable. You can iterate # over elements, and API calls will be issued to fetch pages as needed. result.each do |item| # Each element is of type ::Google::Cloud::Talent::V4beta1::Company. p item end
#update_company
def update_company(request, options = nil) -> ::Google::Cloud::Talent::V4beta1::Company
def update_company(company: nil, update_mask: nil) -> ::Google::Cloud::Talent::V4beta1::Company
Updates specified company.
def update_company(request, options = nil) -> ::Google::Cloud::Talent::V4beta1::Company
update_company
via a request object, either of type
UpdateCompanyRequest or an equivalent Hash.
- request (::Google::Cloud::Talent::V4beta1::UpdateCompanyRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def update_company(company: nil, update_mask: nil) -> ::Google::Cloud::Talent::V4beta1::Company
update_company
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
- company (::Google::Cloud::Talent::V4beta1::Company, ::Hash) — Required. The company resource to replace the current resource in the system.
-
update_mask (::Google::Protobuf::FieldMask, ::Hash) — Strongly recommended for the best service experience.
If update_mask is provided, only the specified fields in company are updated. Otherwise all the fields are updated.
A field mask to specify the company fields to be updated. Only top level fields of Company are supported.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Talent::V4beta1::Company)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/talent/v4beta1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Talent::V4beta1::UpdateCompanyRequest.new # Call the update_company method. result = client.update_company request # The returned object is of type Google::Cloud::Talent::V4beta1::Company. p result