lib/google/cloud/talent/v4beta1/company_service_client.rb in google-cloud-talent-0.3.0 vs lib/google/cloud/talent/v4beta1/company_service_client.rb in google-cloud-talent-0.4.0
- old
+ new
@@ -25,10 +25,11 @@
require "google/gax"
require "google/cloud/talent/v4beta1/company_service_pb"
require "google/cloud/talent/v4beta1/credentials"
+require "google/cloud/talent/version"
module Google
module Cloud
module Talent
module V4beta1
@@ -128,19 +129,25 @@
# or the specified config is missing data points.
# @param timeout [Numeric]
# The default timeout, in seconds, for calls made through this client.
# @param metadata [Hash]
# Default metadata to be sent with each request. This can be overridden on a per call basis.
+ # @param service_address [String]
+ # Override for the service hostname, or `nil` to leave as the default.
+ # @param service_port [Integer]
+ # Override for the service port, or `nil` to leave as the default.
# @param exception_transformer [Proc]
# An optional proc that intercepts any exceptions raised during an API call to inject
# custom error handling.
def initialize \
credentials: nil,
scopes: ALL_SCOPES,
client_config: {},
timeout: DEFAULT_TIMEOUT,
metadata: nil,
+ service_address: nil,
+ service_port: nil,
exception_transformer: nil,
lib_name: nil,
lib_version: ""
# These require statements are intentionally placed here to initialize
# the gRPC module only when it's required.
@@ -164,11 +171,11 @@
end
if credentials.is_a?(Google::Auth::Credentials)
updater_proc = credentials.updater_proc
end
- package_version = Gem.loaded_specs['google-cloud-talent'].version.version
+ package_version = Google::Cloud::Talent::VERSION
google_api_client = "gl-ruby/#{RUBY_VERSION}"
google_api_client << " #{lib_name}/#{lib_version}" if lib_name
google_api_client << " gapic/#{package_version} gax/#{Google::Gax::VERSION}"
google_api_client << " grpc/#{GRPC::VERSION}"
@@ -191,12 +198,12 @@
metadata: headers
)
end
# Allow overriding the service path/port in subclasses.
- service_path = self.class::SERVICE_ADDRESS
- port = self.class::DEFAULT_SERVICE_PORT
+ service_path = service_address || self.class::SERVICE_ADDRESS
+ port = service_port || self.class::DEFAULT_SERVICE_PORT
interceptors = self.class::GRPC_INTERCEPTORS
@company_service_stub = Google::Gax::Grpc.create_stub(
service_path,
port,
chan_creds: chan_creds,
@@ -252,23 +259,19 @@
# Service calls
# Creates a new company entity.
#
# @param parent [String]
- # Required.
+ # Required. Resource name of the tenant under which the company is created.
#
- # Resource name of the tenant under which the company is created.
- #
# The format is "projects/{project_id}/tenants/{tenant_id}", for example,
# "projects/api-test-project/tenant/foo".
#
# Tenant id is optional and a default tenant is created if unspecified, for
# example, "projects/api-test-project".
# @param company [Google::Cloud::Talent::V4beta1::Company | Hash]
- # Required.
- #
- # The company to be created.
+ # Required. The company to be created.
# A hash of the same form as `Google::Cloud::Talent::V4beta1::Company`
# can also be provided.
# @param options [Google::Gax::CallOptions]
# Overrides the default settings for this call, e.g, timeout,
# retries, etc.
@@ -301,14 +304,12 @@
end
# Retrieves specified company.
#
# @param name [String]
- # Required.
+ # Required. The resource name of the company to be retrieved.
#
- # 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".
#
# Tenant id is optional and the default tenant is used if unspecified, for
@@ -340,24 +341,27 @@
end
# Updates specified company.
#
# @param company [Google::Cloud::Talent::V4beta1::Company | Hash]
- # Required.
- #
- # The company resource to replace the current resource in the system.
+ # Required. The company resource to replace the current resource in the
+ # system.
# A hash of the same form as `Google::Cloud::Talent::V4beta1::Company`
# can also be provided.
# @param update_mask [Google::Protobuf::FieldMask | Hash]
# Optional but strongly recommended for the best service
# experience.
#
- # If {Google::Cloud::Talent::V4beta1::UpdateCompanyRequest#update_mask update_mask} is provided, only the specified fields in
- # {Google::Cloud::Talent::V4beta1::UpdateCompanyRequest#company company} are updated. Otherwise all the fields are updated.
+ # If
+ # {Google::Cloud::Talent::V4beta1::UpdateCompanyRequest#update_mask update_mask}
+ # is provided, only the specified fields in
+ # {Google::Cloud::Talent::V4beta1::UpdateCompanyRequest#company 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 {Google::Cloud::Talent::V4beta1::Company Company} are supported.
+ # top level fields of {Google::Cloud::Talent::V4beta1::Company Company} are
+ # supported.
# A hash of the same form as `Google::Protobuf::FieldMask`
# can also be provided.
# @param options [Google::Gax::CallOptions]
# Overrides the default settings for this call, e.g, timeout,
# retries, etc.
@@ -390,14 +394,12 @@
# Deletes specified company.
# Prerequisite: The company has no jobs associated with it.
#
# @param name [String]
- # Required.
+ # Required. The resource name of the company to be deleted.
#
- # The resource name of the company to be deleted.
- #
# The format is
# "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}", for
# example, "projects/api-test-project/tenants/foo/companies/bar".
#
# Tenant id is optional and the default tenant is used if unspecified, for
@@ -429,14 +431,12 @@
end
# Lists all companies associated with the project.
#
# @param parent [String]
- # Required.
+ # Required. Resource name of the tenant under which the company is created.
#
- # Resource name of the tenant under which the company is created.
- #
# The format is "projects/{project_id}/tenants/{tenant_id}", for example,
# "projects/api-test-project/tenant/foo".
#
# Tenant id is optional and the default tenant is used if unspecified, for
# example, "projects/api-test-project".
@@ -445,17 +445,16 @@
# response. If page streaming is performed per-resource, this
# parameter does not affect the return value. If page streaming is
# performed per-page, this determines the maximum number of
# resources in a page.
# @param require_open_jobs [true, false]
- # Optional.
+ # Optional. Set to true if the companies requested must have open jobs.
#
- # Set to true if the companies requested must have open jobs.
- #
# Defaults to false.
#
- # If true, at most {Google::Cloud::Talent::V4beta1::ListCompaniesRequest#page_size page_size} of companies are fetched, among which
- # only those with open jobs are returned.
+ # If true, at most
+ # {Google::Cloud::Talent::V4beta1::ListCompaniesRequest#page_size page_size} of
+ # companies are fetched, among which only those with open jobs are returned.
# @param options [Google::Gax::CallOptions]
# Overrides the default settings for this call, e.g, timeout,
# retries, etc.
# @yield [result, operation] Access the result along with the RPC operation
# @yieldparam result [Google::Gax::PagedEnumerable<Google::Cloud::Talent::V4beta1::Company>]