lib/google/cloud/talent/v4beta1/job_service_client.rb in google-cloud-talent-0.3.0 vs lib/google/cloud/talent/v4beta1/job_service_client.rb in google-cloud-talent-0.4.0

- old
+ new

@@ -22,13 +22,16 @@ require "json" require "pathname" require "google/gax" +require "google/gax/operation" +require "google/longrunning/operations_client" require "google/cloud/talent/v4beta1/job_service_pb" require "google/cloud/talent/v4beta1/credentials" +require "google/cloud/talent/version" module Google module Cloud module Talent module V4beta1 @@ -73,10 +76,14 @@ ALL_SCOPES = [ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/jobs" ].freeze + class OperationsClient < Google::Longrunning::OperationsClient + self::SERVICE_ADDRESS = JobServiceClient::SERVICE_ADDRESS + self::GRPC_INTERCEPTORS = JobServiceClient::GRPC_INTERCEPTORS + end COMPANY_PATH_TEMPLATE = Google::Gax::PathTemplate.new( "projects/{project}/tenants/{tenant}/companies/{company}" ) @@ -155,19 +162,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. @@ -175,10 +188,22 @@ require "google/gax/grpc" require "google/cloud/talent/v4beta1/job_service_services_pb" credentials ||= Google::Cloud::Talent::V4beta1::Credentials.default + @operations_client = OperationsClient.new( + credentials: credentials, + scopes: scopes, + client_config: client_config, + timeout: timeout, + lib_name: lib_name, + service_address: service_address, + service_port: service_port, + lib_version: lib_version, + metadata: metadata, + ) + if credentials.is_a?(String) || credentials.is_a?(Hash) updater_proc = Google::Cloud::Talent::V4beta1::Credentials.new(credentials).updater_proc end if credentials.is_a?(GRPC::Core::Channel) channel = credentials @@ -191,11 +216,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}" @@ -218,12 +243,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 @job_service_stub = Google::Gax::Grpc.create_stub( service_path, port, chan_creds: chan_creds, @@ -296,33 +321,45 @@ exception_transformer: exception_transformer, params_extractor: proc do |request| {'parent' => request.parent} end ) + @batch_create_jobs = Google::Gax.create_api_call( + @job_service_stub.method(:batch_create_jobs), + defaults["batch_create_jobs"], + exception_transformer: exception_transformer, + params_extractor: proc do |request| + {'parent' => request.parent} + end + ) + @batch_update_jobs = Google::Gax.create_api_call( + @job_service_stub.method(:batch_update_jobs), + defaults["batch_update_jobs"], + exception_transformer: exception_transformer, + params_extractor: proc do |request| + {'parent' => request.parent} + end + ) end # Service calls # Creates a new job. # # Typically, the job becomes searchable within 10 seconds, but it may take # up to 5 minutes. # # @param parent [String] - # Required. + # Required. The resource name of the tenant under which the job is created. # - # The resource name of the tenant under which the job 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 job [Google::Cloud::Talent::V4beta1::Job | Hash] - # Required. - # - # The Job to be created. + # Required. The Job to be created. # A hash of the same form as `Google::Cloud::Talent::V4beta1::Job` # can also be provided. # @param options [Google::Gax::CallOptions] # Overrides the default settings for this call, e.g, timeout, # retries, etc. @@ -356,14 +393,12 @@ # Retrieves the specified job, whose status is OPEN or recently EXPIRED # within the last 90 days. # # @param name [String] - # Required. + # Required. The resource name of the job to retrieve. # - # The resource name of the job to retrieve. - # # The format is # "projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}", for # example, "projects/api-test-project/tenants/foo/jobs/1234". # # Tenant id is optional and the default tenant is used if unspecified, for @@ -398,21 +433,21 @@ # # Typically, updated contents become visible in search results within 10 # seconds, but it may take up to 5 minutes. # # @param job [Google::Cloud::Talent::V4beta1::Job | Hash] - # Required. - # - # The Job to be updated. + # Required. The Job to be updated. # A hash of the same form as `Google::Cloud::Talent::V4beta1::Job` # can also be provided. # @param update_mask [Google::Protobuf::FieldMask | Hash] # Optional but strongly recommended to be provided for the best service # experience. # - # If {Google::Cloud::Talent::V4beta1::UpdateJobRequest#update_mask update_mask} is provided, only the specified fields in - # {Google::Cloud::Talent::V4beta1::UpdateJobRequest#job job} are updated. Otherwise all the fields are updated. + # If {Google::Cloud::Talent::V4beta1::UpdateJobRequest#update_mask update_mask} + # is provided, only the specified fields in + # {Google::Cloud::Talent::V4beta1::UpdateJobRequest#job job} are updated. + # Otherwise all the fields are updated. # # A field mask to restrict the fields that are updated. Only # top level fields of {Google::Cloud::Talent::V4beta1::Job Job} are supported. # A hash of the same form as `Google::Protobuf::FieldMask` # can also be provided. @@ -450,14 +485,12 @@ # # Typically, the job becomes unsearchable within 10 seconds, but it may take # up to 5 minutes. # # @param name [String] - # Required. + # Required. The resource name of the job to be deleted. # - # The resource name of the job to be deleted. - # # The format is # "projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}", for # example, "projects/api-test-project/tenants/foo/jobs/1234". # # Tenant id is optional and the default tenant is used if unspecified, for @@ -489,24 +522,20 @@ end # Lists jobs by filter. # # @param parent [String] - # Required. + # Required. The resource name of the tenant under which the job is created. # - # The resource name of the tenant under which the job 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". # @param filter [String] - # Required. + # Required. The filter string specifies the jobs to be enumerated. # - # The filter string specifies the jobs to be enumerated. - # # Supported operator: =, AND # # The fields eligible for filtering are: # # * `companyName` (Required) @@ -526,15 +555,14 @@ # 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 job_view [Google::Cloud::Talent::V4beta1::JobView] - # Optional. - # - # The desired job attributes returned for jobs in the - # search response. Defaults to {Google::Cloud::Talent::V4beta1::JobView::JOB_VIEW_FULL JobView::JOB_VIEW_FULL} if no value is - # specified. + # Optional. The desired job attributes returned for jobs in the + # search response. Defaults to + # {Google::Cloud::Talent::V4beta1::JobView::JOB_VIEW_FULL JobView::JOB_VIEW_FULL} + # if no value is specified. # @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::Job>] @@ -585,24 +613,20 @@ end # Deletes a list of {Google::Cloud::Talent::V4beta1::Job Job}s by filter. # # @param parent [String] - # Required. + # Required. The resource name of the tenant under which the job is created. # - # The resource name of the tenant under which the job 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". # @param filter [String] - # Required. + # Required. The filter string specifies the jobs to be deleted. # - # The filter string specifies the jobs to be deleted. - # # Supported operator: =, AND # # The fields eligible for filtering are: # # * `companyName` (Required) @@ -639,71 +663,62 @@ req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::BatchDeleteJobsRequest) @batch_delete_jobs.call(req, options, &block) nil end - # Searches for jobs using the provided {Google::Cloud::Talent::V4beta1::SearchJobsRequest SearchJobsRequest}. + # Searches for jobs using the provided + # {Google::Cloud::Talent::V4beta1::SearchJobsRequest SearchJobsRequest}. # - # This call constrains the {Google::Cloud::Talent::V4beta1::Job#visibility visibility} of jobs - # present in the database, and only returns jobs that the caller has - # permission to search against. + # This call constrains the + # {Google::Cloud::Talent::V4beta1::Job#visibility visibility} of jobs present in + # the database, and only returns jobs that the caller has permission to + # search against. # # @param parent [String] - # Required. + # Required. The resource name of the tenant to search within. # - # The resource name of the tenant to search within. - # # 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". # @param request_metadata [Google::Cloud::Talent::V4beta1::RequestMetadata | Hash] - # Required. - # - # The meta information collected about the job searcher, used to improve the - # search quality of the service.. The identifiers, (such as `user_id`) are - # provided by users, and must be unique and consistent. + # Required. The meta information collected about the job searcher, used to + # improve the search quality of the service. The identifiers (such as + # `user_id`) are provided by users, and must be unique and consistent. # A hash of the same form as `Google::Cloud::Talent::V4beta1::RequestMetadata` # can also be provided. # @param search_mode [Google::Cloud::Talent::V4beta1::SearchJobsRequest::SearchMode] - # Optional. + # Optional. Mode of a search. # - # Mode of a search. - # - # Defaults to {Google::Cloud::Talent::V4beta1::SearchJobsRequest::SearchMode::JOB_SEARCH SearchMode::JOB_SEARCH}. + # Defaults to + # {Google::Cloud::Talent::V4beta1::SearchJobsRequest::SearchMode::JOB_SEARCH SearchMode::JOB_SEARCH}. # @param job_query [Google::Cloud::Talent::V4beta1::JobQuery | Hash] - # Optional. - # - # Query used to search against jobs, such as keyword, location filters, etc. + # Optional. Query used to search against jobs, such as keyword, location + # filters, etc. # A hash of the same form as `Google::Cloud::Talent::V4beta1::JobQuery` # can also be provided. # @param enable_broadening [true, false] - # Optional. + # Optional. Controls whether to broaden the search when it produces sparse + # results. Broadened queries append results to the end of the matching + # results list. # - # Controls whether to broaden the search when it produces sparse results. - # Broadened queries append results to the end of the matching results - # list. - # # Defaults to false. # @param require_precise_result_size [true, false] - # Optional. - # - # Controls if the search job request requires the return of a precise - # count of the first 300 results. Setting this to `true` ensures + # Optional. Controls if the search job request requires the return of a + # precise count of the first 300 results. Setting this to `true` ensures # consistency in the number of results per page. Best practice is to set this # value to true if a client allows users to jump directly to a # non-sequential search results page. # # Enabling this flag may adversely impact performance. # # Defaults to false. # @param histogram_queries [Array<Google::Cloud::Talent::V4beta1::HistogramQuery | Hash>] - # Optional. + # Optional. An expression specifies a histogram request against matching + # jobs. # - # An expression specifies a histogram request against matching jobs. - # # Expression syntax is an aggregation function call with histogram facets and # other options. # # Available aggregation function calls are: # * `count(string_histogram_facet)`: Count the number of matching entities, @@ -730,23 +745,34 @@ # with range of [start, end). Note that the end is exclusive, for example, # bucket(1, MAX, "positive number") or bucket(1, 10). # # Job histogram facets: # - # * company_id: histogram by {Job#distributor_company_id}. - # * company_display_name: histogram by {Google::Cloud::Talent::V4beta1::Job#company_display_name Job#company_display_name}. - # * employment_type: histogram by {Google::Cloud::Talent::V4beta1::Job#employment_types Job#employment_types}, for example, + # * company_display_name: histogram by + # {Google::Cloud::Talent::V4beta1::Job#company_display_name Job#company_display_name}. + # * employment_type: histogram by + # {Google::Cloud::Talent::V4beta1::Job#employment_types Job#employment_types}, + # for example, # "FULL_TIME", "PART_TIME". - # * company_size: histogram by {Google::Cloud::Talent::V4beta1::CompanySize CompanySize}, for example, "SMALL", - # "MEDIUM", "BIG". - # * publish_time_in_month: histogram by the {Job#publish_time} in months. + # * company_size: histogram by + # {Google::Cloud::Talent::V4beta1::CompanySize CompanySize}, for example, + # "SMALL", "MEDIUM", "BIG". + # * publish_time_in_month: histogram by the + # {Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job#posting_publish_time} + # in months. # Must specify list of numeric buckets in spec. - # * publish_time_in_year: histogram by the {Job#publish_time} in years. + # * publish_time_in_year: histogram by the + # {Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job#posting_publish_time} + # in years. # Must specify list of numeric buckets in spec. - # * degree_type: histogram by the {Job#degree_type}, for example, + # * degree_types: histogram by the + # {Google::Cloud::Talent::V4beta1::Job#degree_types Job#degree_types}, for + # example, # "Bachelors", "Masters". - # * job_level: histogram by the {Google::Cloud::Talent::V4beta1::Job#job_level Job#job_level}, for example, "Entry + # * job_level: histogram by the + # {Google::Cloud::Talent::V4beta1::Job#job_level Job#job_level}, for example, + # "Entry # Level". # * country: histogram by the country code of jobs, for example, "US", "FR". # * admin1: histogram by the admin1 code of jobs, which is a global # placeholder referring to the state, province, or the particular term a # country uses to define the geographic structure below the country level, @@ -754,56 +780,64 @@ # * city: histogram by a combination of the "city name, admin1 code". For # example, "Mountain View, CA", "New York, NY". # * admin1_country: histogram by a combination of the "admin1 code, country", # for example, "CA, US", "IL, US". # * city_coordinate: histogram by the city center's GPS coordinates (latitude - # and longitude), for example, 37.4038522,-122.0987765. Since the coordinates - # of a city center can change, customers may need to refresh them - # periodically. - # * locale: histogram by the {Google::Cloud::Talent::V4beta1::Job#language_code Job#language_code}, for example, "en-US", + # and longitude), for example, 37.4038522,-122.0987765. Since the + # coordinates of a city center can change, customers may need to refresh + # them periodically. + # * locale: histogram by the + # {Google::Cloud::Talent::V4beta1::Job#language_code Job#language_code}, for + # example, "en-US", # "fr-FR". - # * language: histogram by the language subtag of the {Google::Cloud::Talent::V4beta1::Job#language_code Job#language_code}, + # * language: histogram by the language subtag of the + # {Google::Cloud::Talent::V4beta1::Job#language_code Job#language_code}, # for example, "en", "fr". - # * category: histogram by the {Google::Cloud::Talent::V4beta1::JobCategory JobCategory}, for example, + # * category: histogram by the + # {Google::Cloud::Talent::V4beta1::JobCategory JobCategory}, for example, # "COMPUTER_AND_IT", "HEALTHCARE". - # * base_compensation_unit: histogram by the {CompensationUnit} of base - # salary, for example, "WEEKLY", "MONTHLY". + # * base_compensation_unit: histogram by the + # {Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationUnit CompensationInfo::CompensationUnit} + # of base salary, for example, "WEEKLY", "MONTHLY". # * base_compensation: histogram by the base salary. Must specify list of # numeric buckets to group results by. # * annualized_base_compensation: histogram by the base annualized salary. # Must specify list of numeric buckets to group results by. # * annualized_total_compensation: histogram by the total annualized salary. # Must specify list of numeric buckets to group results by. - # * string_custom_attribute: histogram by string {Google::Cloud::Talent::V4beta1::Job#custom_attributes Job#custom_attributes}. + # * string_custom_attribute: histogram by string + # {Google::Cloud::Talent::V4beta1::Job#custom_attributes Job#custom_attributes}. # Values can be accessed via square bracket notations like # string_custom_attribute["key1"]. - # * numeric_custom_attribute: histogram by numeric {Google::Cloud::Talent::V4beta1::Job#custom_attributes Job#custom_attributes}. + # * numeric_custom_attribute: histogram by numeric + # {Google::Cloud::Talent::V4beta1::Job#custom_attributes Job#custom_attributes}. # Values can be accessed via square bracket notations like # numeric_custom_attribute["key1"]. Must specify list of numeric buckets to # group results by. # # Example expressions: - # * count(admin1) - # * count(base_compensation, [bucket(1000, 10000), bucket(10000, 100000), - # bucket(100000, MAX)]) - # * count(string_custom_attribute["some-string-custom-attribute"]) - # * count(numeric_custom_attribute["some-numeric-custom-attribute"], - # [bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative"]) + # + # * `count(admin1)` + # * `count(base_compensation, [bucket(1000, 10000), bucket(10000, 100000), + # bucket(100000, MAX)])` + # * `count(string_custom_attribute["some-string-custom-attribute"])` + # * `count(numeric_custom_attribute["some-numeric-custom-attribute"], + # [bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative"])` # A hash of the same form as `Google::Cloud::Talent::V4beta1::HistogramQuery` # can also be provided. # @param job_view [Google::Cloud::Talent::V4beta1::JobView] - # Optional. - # - # The desired job attributes returned for jobs in the - # search response. Defaults to {JobView::SMALL} if no value is specified. + # Optional. The desired job attributes returned for jobs in the search + # response. Defaults to + # {Google::Cloud::Talent::V4beta1::JobView::JOB_VIEW_SMALL JobView::JOB_VIEW_SMALL} + # if no value is specified. # @param offset [Integer] - # Optional. + # Optional. An integer that specifies the current offset (that is, starting + # result location, amongst the jobs deemed by the API as relevant) in search + # results. This field is only considered if + # {Google::Cloud::Talent::V4beta1::SearchJobsRequest#page_token page_token} is + # unset. # - # An integer that specifies the current offset (that is, starting result - # location, amongst the jobs deemed by the API as relevant) in search - # results. This field is only considered if {Google::Cloud::Talent::V4beta1::SearchJobsRequest#page_token page_token} is unset. - # # For example, 0 means to return results starting from the first matching # job, and 10 means to return from the 11th job. This can be used for # pagination, (for example, pageSize = 10 and offset = 10 means to return # from the second page). # @param page_size [Integer] @@ -811,99 +845,104 @@ # 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 order_by [String] - # Optional. + # Optional. The criteria determining how search results are sorted. Default + # is + # `"relevance desc"`. # - # The criteria determining how search results are sorted. Default is - # "relevance desc". - # # Supported options are: # - # * "relevance desc": By relevance descending, as determined by the API + # * `"relevance desc"`: By relevance descending, as determined by the API # algorithms. Relevance thresholding of query results is only available # with this ordering. - # * "posting`_`publish`_`time desc": By {Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job#posting_publish_time} + # * `"posting_publish_time desc"`: By + # {Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job#posting_publish_time} # descending. - # * "posting`_`update`_`time desc": By {Google::Cloud::Talent::V4beta1::Job#posting_update_time Job#posting_update_time} + # * `"posting_update_time desc"`: By + # {Google::Cloud::Talent::V4beta1::Job#posting_update_time Job#posting_update_time} # descending. - # * "title": By {Google::Cloud::Talent::V4beta1::Job#title Job#title} ascending. - # * "title desc": By {Google::Cloud::Talent::V4beta1::Job#title Job#title} descending. - # * "annualized`_`base`_`compensation": By job's - # {Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_base_compensation_range CompensationInfo#annualized_base_compensation_range} ascending. Jobs - # whose annualized base compensation is unspecified are put at the end of - # search results. - # * "annualized`_`base`_`compensation desc": By job's - # {Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_base_compensation_range CompensationInfo#annualized_base_compensation_range} descending. Jobs - # whose annualized base compensation is unspecified are put at the end of - # search results. - # * "annualized`_`total`_`compensation": By job's - # {Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_total_compensation_range CompensationInfo#annualized_total_compensation_range} ascending. Jobs - # whose annualized base compensation is unspecified are put at the end of - # search results. - # * "annualized`_`total`_`compensation desc": By job's - # {Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_total_compensation_range CompensationInfo#annualized_total_compensation_range} descending. Jobs - # whose annualized base compensation is unspecified are put at the end of - # search results. - # * "custom`_`ranking desc": By the relevance score adjusted to the - # {SearchJobsRequest#custom_ranking_info#ranking_expression} with weight - # factor assigned by - # {SearchJobsRequest#custom_ranking_info#importance_level} in descending - # order. - # * "location`_`distance": By the distance between the location on jobs and - # locations specified in the - # {SearchJobsRequest#job_query#location_filters}. - # When this order is selected, the - # {SearchJobsRequest#job_query#location_filters} must not be empty. When - # a job has multiple locations, the location closest to one of the locations - # specified in the location filter will be used to calculate location - # distance. Distance is calculated by the distance between two lat/long - # coordinates, with a precision of 10e-4 degrees (11.3 meters). - # Jobs that don't have locations specified will be ranked below jobs having - # locations. - # Diversification strategy is still applied unless explicitly disabled in - # {Google::Cloud::Talent::V4beta1::SearchJobsRequest#diversification_level SearchJobsRequest#diversification_level}. + # * `"title"`: By {Google::Cloud::Talent::V4beta1::Job#title Job#title} + # ascending. + # * `"title desc"`: By {Google::Cloud::Talent::V4beta1::Job#title Job#title} + # descending. + # * `"annualized_base_compensation"`: By job's + # {Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_base_compensation_range CompensationInfo#annualized_base_compensation_range} + # ascending. Jobs whose annualized base compensation is unspecified are put + # at the end of search results. + # * `"annualized_base_compensation desc"`: By job's + # {Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_base_compensation_range CompensationInfo#annualized_base_compensation_range} + # descending. Jobs whose annualized base compensation is unspecified are + # put at the end of search results. + # * `"annualized_total_compensation"`: By job's + # {Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_total_compensation_range CompensationInfo#annualized_total_compensation_range} + # ascending. Jobs whose annualized base compensation is unspecified are put + # at the end of search results. + # * `"annualized_total_compensation desc"`: By job's + # {Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_total_compensation_range CompensationInfo#annualized_total_compensation_range} + # descending. Jobs whose annualized base compensation is unspecified are + # put at the end of search results. + # * `"custom_ranking desc"`: By the relevance score adjusted to the + # {Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo#ranking_expression SearchJobsRequest::CustomRankingInfo#ranking_expression} + # with weight factor assigned by + # {Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo#importance_level SearchJobsRequest::CustomRankingInfo#importance_level} + # in descending order. + # * Location sorting: Use the special syntax to order jobs by distance:<br> + # `"distance_from('Hawaii')"`: Order by distance from Hawaii.<br> + # `"distance_from(19.89, 155.5)"`: Order by distance from a coordinate.<br> + # `"distance_from('Hawaii'), distance_from('Puerto Rico')"`: Order by + # multiple locations. See details below.<br> + # `"distance_from('Hawaii'), distance_from(19.89, 155.5)"`: Order by + # multiple locations. See details below.<br> + # The string can have a maximum of 256 characters. When multiple distance + # centers are provided, a job that is close to any of the distance centers + # would have a high rank. When a job has multiple locations, the job + # location closest to one of the distance centers will be used. Jobs that + # don't have locations will be ranked at the bottom. Distance is calculated + # with a precision of 11.3 meters (37.4 feet). Diversification strategy is + # still applied unless explicitly disabled in + # {Google::Cloud::Talent::V4beta1::SearchJobsRequest#diversification_level diversification_level}. # @param diversification_level [Google::Cloud::Talent::V4beta1::SearchJobsRequest::DiversificationLevel] - # Optional. - # - # Controls whether highly similar jobs are returned next to each other in - # the search results. Jobs are identified as highly similar based on + # Optional. Controls whether highly similar jobs are returned next to each + # other in the search results. Jobs are identified as highly similar based on # their titles, job categories, and locations. Highly similar results are # clustered so that only one representative job of the cluster is # displayed to the job seeker higher up in the results, with the other jobs # being displayed lower down in the results. # - # Defaults to {Google::Cloud::Talent::V4beta1::SearchJobsRequest::DiversificationLevel::SIMPLE DiversificationLevel::SIMPLE} if no value - # is specified. + # Defaults to + # {Google::Cloud::Talent::V4beta1::SearchJobsRequest::DiversificationLevel::SIMPLE DiversificationLevel::SIMPLE} + # if no value is specified. # @param custom_ranking_info [Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo | Hash] - # Optional. - # - # Controls over how job documents get ranked on top of existing relevance - # score (determined by API algorithm). + # Optional. Controls over how job documents get ranked on top of existing + # relevance score (determined by API algorithm). # A hash of the same form as `Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo` # can also be provided. # @param disable_keyword_match [true, false] - # Optional. + # Optional. Controls whether to disable exact keyword match on + # {Google::Cloud::Talent::V4beta1::Job#title Job#title}, + # {Google::Cloud::Talent::V4beta1::Job#description Job#description}, + # {Google::Cloud::Talent::V4beta1::Job#company_display_name Job#company_display_name}, + # {Google::Cloud::Talent::V4beta1::Job#addresses Job#addresses}, + # {Google::Cloud::Talent::V4beta1::Job#qualifications Job#qualifications}. When + # disable keyword match is turned off, a keyword match returns jobs that do + # not match given category filters when there are matching keywords. For + # example, for the query "program manager," a result is returned even if the + # job posting has the title "software developer," which doesn't fall into + # "program manager" ontology, but does have "program manager" appearing in + # its description. # - # Controls whether to disable exact keyword match on {Job#job_title}, - # {Google::Cloud::Talent::V4beta1::Job#description Job#description}, {Google::Cloud::Talent::V4beta1::Job#company_display_name Job#company_display_name}, [Job.locations][0], - # {Google::Cloud::Talent::V4beta1::Job#qualifications Job#qualifications}. When disable keyword match is turned off, a - # keyword match returns jobs that do not match given category filters when - # there are matching keywords. For example, for the query "program manager," - # a result is returned even if the job posting has the title "software - # developer," which doesn't fall into "program manager" ontology, but does - # have "program manager" appearing in its description. - # # For queries like "cloud" that don't contain title or # location specific ontology, jobs with "cloud" keyword matches are returned # regardless of this flag's value. # - # Please use {Company#keyword_searchable_custom_fields} or - # {Company#keyword_searchable_custom_attributes} if company specific - # globally matched custom field/attribute string values is needed. Enabling - # keyword match improves recall of subsequent search requests. + # Use + # {Google::Cloud::Talent::V4beta1::Company#keyword_searchable_job_custom_attributes Company#keyword_searchable_job_custom_attributes} + # if company-specific globally matched custom field/attribute string values + # are needed. Enabling keyword match improves recall of subsequent search + # requests. # # Defaults to false. # @param options [Google::Gax::CallOptions] # Overrides the default settings for this call, e.g, timeout, # retries, etc. @@ -973,76 +1012,67 @@ }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::SearchJobsRequest) @search_jobs.call(req, options, &block) end - # Searches for jobs using the provided {Google::Cloud::Talent::V4beta1::SearchJobsRequest SearchJobsRequest}. + # Searches for jobs using the provided + # {Google::Cloud::Talent::V4beta1::SearchJobsRequest SearchJobsRequest}. # # This API call is intended for the use case of targeting passive job # seekers (for example, job seekers who have signed up to receive email # alerts about potential job opportunities), and has different algorithmic # adjustments that are targeted to passive job seekers. # - # This call constrains the {Google::Cloud::Talent::V4beta1::Job#visibility visibility} of jobs - # present in the database, and only returns jobs the caller has - # permission to search against. + # This call constrains the + # {Google::Cloud::Talent::V4beta1::Job#visibility visibility} of jobs present in + # the database, and only returns jobs the caller has permission to search + # against. # # @param parent [String] - # Required. + # Required. The resource name of the tenant to search within. # - # The resource name of the tenant to search within. - # # 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". # @param request_metadata [Google::Cloud::Talent::V4beta1::RequestMetadata | Hash] - # Required. - # - # The meta information collected about the job searcher, used to improve the - # search quality of the service.. The identifiers, (such as `user_id`) are - # provided by users, and must be unique and consistent. + # Required. The meta information collected about the job searcher, used to + # improve the search quality of the service. The identifiers (such as + # `user_id`) are provided by users, and must be unique and consistent. # A hash of the same form as `Google::Cloud::Talent::V4beta1::RequestMetadata` # can also be provided. # @param search_mode [Google::Cloud::Talent::V4beta1::SearchJobsRequest::SearchMode] - # Optional. + # Optional. Mode of a search. # - # Mode of a search. - # - # Defaults to {Google::Cloud::Talent::V4beta1::SearchJobsRequest::SearchMode::JOB_SEARCH SearchMode::JOB_SEARCH}. + # Defaults to + # {Google::Cloud::Talent::V4beta1::SearchJobsRequest::SearchMode::JOB_SEARCH SearchMode::JOB_SEARCH}. # @param job_query [Google::Cloud::Talent::V4beta1::JobQuery | Hash] - # Optional. - # - # Query used to search against jobs, such as keyword, location filters, etc. + # Optional. Query used to search against jobs, such as keyword, location + # filters, etc. # A hash of the same form as `Google::Cloud::Talent::V4beta1::JobQuery` # can also be provided. # @param enable_broadening [true, false] - # Optional. + # Optional. Controls whether to broaden the search when it produces sparse + # results. Broadened queries append results to the end of the matching + # results list. # - # Controls whether to broaden the search when it produces sparse results. - # Broadened queries append results to the end of the matching results - # list. - # # Defaults to false. # @param require_precise_result_size [true, false] - # Optional. - # - # Controls if the search job request requires the return of a precise - # count of the first 300 results. Setting this to `true` ensures + # Optional. Controls if the search job request requires the return of a + # precise count of the first 300 results. Setting this to `true` ensures # consistency in the number of results per page. Best practice is to set this # value to true if a client allows users to jump directly to a # non-sequential search results page. # # Enabling this flag may adversely impact performance. # # Defaults to false. # @param histogram_queries [Array<Google::Cloud::Talent::V4beta1::HistogramQuery | Hash>] - # Optional. + # Optional. An expression specifies a histogram request against matching + # jobs. # - # An expression specifies a histogram request against matching jobs. - # # Expression syntax is an aggregation function call with histogram facets and # other options. # # Available aggregation function calls are: # * `count(string_histogram_facet)`: Count the number of matching entities, @@ -1069,23 +1099,34 @@ # with range of [start, end). Note that the end is exclusive, for example, # bucket(1, MAX, "positive number") or bucket(1, 10). # # Job histogram facets: # - # * company_id: histogram by {Job#distributor_company_id}. - # * company_display_name: histogram by {Google::Cloud::Talent::V4beta1::Job#company_display_name Job#company_display_name}. - # * employment_type: histogram by {Google::Cloud::Talent::V4beta1::Job#employment_types Job#employment_types}, for example, + # * company_display_name: histogram by + # {Google::Cloud::Talent::V4beta1::Job#company_display_name Job#company_display_name}. + # * employment_type: histogram by + # {Google::Cloud::Talent::V4beta1::Job#employment_types Job#employment_types}, + # for example, # "FULL_TIME", "PART_TIME". - # * company_size: histogram by {Google::Cloud::Talent::V4beta1::CompanySize CompanySize}, for example, "SMALL", - # "MEDIUM", "BIG". - # * publish_time_in_month: histogram by the {Job#publish_time} in months. + # * company_size: histogram by + # {Google::Cloud::Talent::V4beta1::CompanySize CompanySize}, for example, + # "SMALL", "MEDIUM", "BIG". + # * publish_time_in_month: histogram by the + # {Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job#posting_publish_time} + # in months. # Must specify list of numeric buckets in spec. - # * publish_time_in_year: histogram by the {Job#publish_time} in years. + # * publish_time_in_year: histogram by the + # {Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job#posting_publish_time} + # in years. # Must specify list of numeric buckets in spec. - # * degree_type: histogram by the {Job#degree_type}, for example, + # * degree_types: histogram by the + # {Google::Cloud::Talent::V4beta1::Job#degree_types Job#degree_types}, for + # example, # "Bachelors", "Masters". - # * job_level: histogram by the {Google::Cloud::Talent::V4beta1::Job#job_level Job#job_level}, for example, "Entry + # * job_level: histogram by the + # {Google::Cloud::Talent::V4beta1::Job#job_level Job#job_level}, for example, + # "Entry # Level". # * country: histogram by the country code of jobs, for example, "US", "FR". # * admin1: histogram by the admin1 code of jobs, which is a global # placeholder referring to the state, province, or the particular term a # country uses to define the geographic structure below the country level, @@ -1093,56 +1134,64 @@ # * city: histogram by a combination of the "city name, admin1 code". For # example, "Mountain View, CA", "New York, NY". # * admin1_country: histogram by a combination of the "admin1 code, country", # for example, "CA, US", "IL, US". # * city_coordinate: histogram by the city center's GPS coordinates (latitude - # and longitude), for example, 37.4038522,-122.0987765. Since the coordinates - # of a city center can change, customers may need to refresh them - # periodically. - # * locale: histogram by the {Google::Cloud::Talent::V4beta1::Job#language_code Job#language_code}, for example, "en-US", + # and longitude), for example, 37.4038522,-122.0987765. Since the + # coordinates of a city center can change, customers may need to refresh + # them periodically. + # * locale: histogram by the + # {Google::Cloud::Talent::V4beta1::Job#language_code Job#language_code}, for + # example, "en-US", # "fr-FR". - # * language: histogram by the language subtag of the {Google::Cloud::Talent::V4beta1::Job#language_code Job#language_code}, + # * language: histogram by the language subtag of the + # {Google::Cloud::Talent::V4beta1::Job#language_code Job#language_code}, # for example, "en", "fr". - # * category: histogram by the {Google::Cloud::Talent::V4beta1::JobCategory JobCategory}, for example, + # * category: histogram by the + # {Google::Cloud::Talent::V4beta1::JobCategory JobCategory}, for example, # "COMPUTER_AND_IT", "HEALTHCARE". - # * base_compensation_unit: histogram by the {CompensationUnit} of base - # salary, for example, "WEEKLY", "MONTHLY". + # * base_compensation_unit: histogram by the + # {Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationUnit CompensationInfo::CompensationUnit} + # of base salary, for example, "WEEKLY", "MONTHLY". # * base_compensation: histogram by the base salary. Must specify list of # numeric buckets to group results by. # * annualized_base_compensation: histogram by the base annualized salary. # Must specify list of numeric buckets to group results by. # * annualized_total_compensation: histogram by the total annualized salary. # Must specify list of numeric buckets to group results by. - # * string_custom_attribute: histogram by string {Google::Cloud::Talent::V4beta1::Job#custom_attributes Job#custom_attributes}. + # * string_custom_attribute: histogram by string + # {Google::Cloud::Talent::V4beta1::Job#custom_attributes Job#custom_attributes}. # Values can be accessed via square bracket notations like # string_custom_attribute["key1"]. - # * numeric_custom_attribute: histogram by numeric {Google::Cloud::Talent::V4beta1::Job#custom_attributes Job#custom_attributes}. + # * numeric_custom_attribute: histogram by numeric + # {Google::Cloud::Talent::V4beta1::Job#custom_attributes Job#custom_attributes}. # Values can be accessed via square bracket notations like # numeric_custom_attribute["key1"]. Must specify list of numeric buckets to # group results by. # # Example expressions: - # * count(admin1) - # * count(base_compensation, [bucket(1000, 10000), bucket(10000, 100000), - # bucket(100000, MAX)]) - # * count(string_custom_attribute["some-string-custom-attribute"]) - # * count(numeric_custom_attribute["some-numeric-custom-attribute"], - # [bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative"]) + # + # * `count(admin1)` + # * `count(base_compensation, [bucket(1000, 10000), bucket(10000, 100000), + # bucket(100000, MAX)])` + # * `count(string_custom_attribute["some-string-custom-attribute"])` + # * `count(numeric_custom_attribute["some-numeric-custom-attribute"], + # [bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative"])` # A hash of the same form as `Google::Cloud::Talent::V4beta1::HistogramQuery` # can also be provided. # @param job_view [Google::Cloud::Talent::V4beta1::JobView] - # Optional. - # - # The desired job attributes returned for jobs in the - # search response. Defaults to {JobView::SMALL} if no value is specified. + # Optional. The desired job attributes returned for jobs in the search + # response. Defaults to + # {Google::Cloud::Talent::V4beta1::JobView::JOB_VIEW_SMALL JobView::JOB_VIEW_SMALL} + # if no value is specified. # @param offset [Integer] - # Optional. + # Optional. An integer that specifies the current offset (that is, starting + # result location, amongst the jobs deemed by the API as relevant) in search + # results. This field is only considered if + # {Google::Cloud::Talent::V4beta1::SearchJobsRequest#page_token page_token} is + # unset. # - # An integer that specifies the current offset (that is, starting result - # location, amongst the jobs deemed by the API as relevant) in search - # results. This field is only considered if {Google::Cloud::Talent::V4beta1::SearchJobsRequest#page_token page_token} is unset. - # # For example, 0 means to return results starting from the first matching # job, and 10 means to return from the 11th job. This can be used for # pagination, (for example, pageSize = 10 and offset = 10 means to return # from the second page). # @param page_size [Integer] @@ -1150,99 +1199,104 @@ # 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 order_by [String] - # Optional. + # Optional. The criteria determining how search results are sorted. Default + # is + # `"relevance desc"`. # - # The criteria determining how search results are sorted. Default is - # "relevance desc". - # # Supported options are: # - # * "relevance desc": By relevance descending, as determined by the API + # * `"relevance desc"`: By relevance descending, as determined by the API # algorithms. Relevance thresholding of query results is only available # with this ordering. - # * "posting`_`publish`_`time desc": By {Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job#posting_publish_time} + # * `"posting_publish_time desc"`: By + # {Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job#posting_publish_time} # descending. - # * "posting`_`update`_`time desc": By {Google::Cloud::Talent::V4beta1::Job#posting_update_time Job#posting_update_time} + # * `"posting_update_time desc"`: By + # {Google::Cloud::Talent::V4beta1::Job#posting_update_time Job#posting_update_time} # descending. - # * "title": By {Google::Cloud::Talent::V4beta1::Job#title Job#title} ascending. - # * "title desc": By {Google::Cloud::Talent::V4beta1::Job#title Job#title} descending. - # * "annualized`_`base`_`compensation": By job's - # {Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_base_compensation_range CompensationInfo#annualized_base_compensation_range} ascending. Jobs - # whose annualized base compensation is unspecified are put at the end of - # search results. - # * "annualized`_`base`_`compensation desc": By job's - # {Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_base_compensation_range CompensationInfo#annualized_base_compensation_range} descending. Jobs - # whose annualized base compensation is unspecified are put at the end of - # search results. - # * "annualized`_`total`_`compensation": By job's - # {Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_total_compensation_range CompensationInfo#annualized_total_compensation_range} ascending. Jobs - # whose annualized base compensation is unspecified are put at the end of - # search results. - # * "annualized`_`total`_`compensation desc": By job's - # {Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_total_compensation_range CompensationInfo#annualized_total_compensation_range} descending. Jobs - # whose annualized base compensation is unspecified are put at the end of - # search results. - # * "custom`_`ranking desc": By the relevance score adjusted to the - # {SearchJobsRequest#custom_ranking_info#ranking_expression} with weight - # factor assigned by - # {SearchJobsRequest#custom_ranking_info#importance_level} in descending - # order. - # * "location`_`distance": By the distance between the location on jobs and - # locations specified in the - # {SearchJobsRequest#job_query#location_filters}. - # When this order is selected, the - # {SearchJobsRequest#job_query#location_filters} must not be empty. When - # a job has multiple locations, the location closest to one of the locations - # specified in the location filter will be used to calculate location - # distance. Distance is calculated by the distance between two lat/long - # coordinates, with a precision of 10e-4 degrees (11.3 meters). - # Jobs that don't have locations specified will be ranked below jobs having - # locations. - # Diversification strategy is still applied unless explicitly disabled in - # {Google::Cloud::Talent::V4beta1::SearchJobsRequest#diversification_level SearchJobsRequest#diversification_level}. + # * `"title"`: By {Google::Cloud::Talent::V4beta1::Job#title Job#title} + # ascending. + # * `"title desc"`: By {Google::Cloud::Talent::V4beta1::Job#title Job#title} + # descending. + # * `"annualized_base_compensation"`: By job's + # {Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_base_compensation_range CompensationInfo#annualized_base_compensation_range} + # ascending. Jobs whose annualized base compensation is unspecified are put + # at the end of search results. + # * `"annualized_base_compensation desc"`: By job's + # {Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_base_compensation_range CompensationInfo#annualized_base_compensation_range} + # descending. Jobs whose annualized base compensation is unspecified are + # put at the end of search results. + # * `"annualized_total_compensation"`: By job's + # {Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_total_compensation_range CompensationInfo#annualized_total_compensation_range} + # ascending. Jobs whose annualized base compensation is unspecified are put + # at the end of search results. + # * `"annualized_total_compensation desc"`: By job's + # {Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_total_compensation_range CompensationInfo#annualized_total_compensation_range} + # descending. Jobs whose annualized base compensation is unspecified are + # put at the end of search results. + # * `"custom_ranking desc"`: By the relevance score adjusted to the + # {Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo#ranking_expression SearchJobsRequest::CustomRankingInfo#ranking_expression} + # with weight factor assigned by + # {Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo#importance_level SearchJobsRequest::CustomRankingInfo#importance_level} + # in descending order. + # * Location sorting: Use the special syntax to order jobs by distance:<br> + # `"distance_from('Hawaii')"`: Order by distance from Hawaii.<br> + # `"distance_from(19.89, 155.5)"`: Order by distance from a coordinate.<br> + # `"distance_from('Hawaii'), distance_from('Puerto Rico')"`: Order by + # multiple locations. See details below.<br> + # `"distance_from('Hawaii'), distance_from(19.89, 155.5)"`: Order by + # multiple locations. See details below.<br> + # The string can have a maximum of 256 characters. When multiple distance + # centers are provided, a job that is close to any of the distance centers + # would have a high rank. When a job has multiple locations, the job + # location closest to one of the distance centers will be used. Jobs that + # don't have locations will be ranked at the bottom. Distance is calculated + # with a precision of 11.3 meters (37.4 feet). Diversification strategy is + # still applied unless explicitly disabled in + # {Google::Cloud::Talent::V4beta1::SearchJobsRequest#diversification_level diversification_level}. # @param diversification_level [Google::Cloud::Talent::V4beta1::SearchJobsRequest::DiversificationLevel] - # Optional. - # - # Controls whether highly similar jobs are returned next to each other in - # the search results. Jobs are identified as highly similar based on + # Optional. Controls whether highly similar jobs are returned next to each + # other in the search results. Jobs are identified as highly similar based on # their titles, job categories, and locations. Highly similar results are # clustered so that only one representative job of the cluster is # displayed to the job seeker higher up in the results, with the other jobs # being displayed lower down in the results. # - # Defaults to {Google::Cloud::Talent::V4beta1::SearchJobsRequest::DiversificationLevel::SIMPLE DiversificationLevel::SIMPLE} if no value - # is specified. + # Defaults to + # {Google::Cloud::Talent::V4beta1::SearchJobsRequest::DiversificationLevel::SIMPLE DiversificationLevel::SIMPLE} + # if no value is specified. # @param custom_ranking_info [Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo | Hash] - # Optional. - # - # Controls over how job documents get ranked on top of existing relevance - # score (determined by API algorithm). + # Optional. Controls over how job documents get ranked on top of existing + # relevance score (determined by API algorithm). # A hash of the same form as `Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo` # can also be provided. # @param disable_keyword_match [true, false] - # Optional. + # Optional. Controls whether to disable exact keyword match on + # {Google::Cloud::Talent::V4beta1::Job#title Job#title}, + # {Google::Cloud::Talent::V4beta1::Job#description Job#description}, + # {Google::Cloud::Talent::V4beta1::Job#company_display_name Job#company_display_name}, + # {Google::Cloud::Talent::V4beta1::Job#addresses Job#addresses}, + # {Google::Cloud::Talent::V4beta1::Job#qualifications Job#qualifications}. When + # disable keyword match is turned off, a keyword match returns jobs that do + # not match given category filters when there are matching keywords. For + # example, for the query "program manager," a result is returned even if the + # job posting has the title "software developer," which doesn't fall into + # "program manager" ontology, but does have "program manager" appearing in + # its description. # - # Controls whether to disable exact keyword match on {Job#job_title}, - # {Google::Cloud::Talent::V4beta1::Job#description Job#description}, {Google::Cloud::Talent::V4beta1::Job#company_display_name Job#company_display_name}, [Job.locations][0], - # {Google::Cloud::Talent::V4beta1::Job#qualifications Job#qualifications}. When disable keyword match is turned off, a - # keyword match returns jobs that do not match given category filters when - # there are matching keywords. For example, for the query "program manager," - # a result is returned even if the job posting has the title "software - # developer," which doesn't fall into "program manager" ontology, but does - # have "program manager" appearing in its description. - # # For queries like "cloud" that don't contain title or # location specific ontology, jobs with "cloud" keyword matches are returned # regardless of this flag's value. # - # Please use {Company#keyword_searchable_custom_fields} or - # {Company#keyword_searchable_custom_attributes} if company specific - # globally matched custom field/attribute string values is needed. Enabling - # keyword match improves recall of subsequent search requests. + # Use + # {Google::Cloud::Talent::V4beta1::Company#keyword_searchable_job_custom_attributes Company#keyword_searchable_job_custom_attributes} + # if company-specific globally matched custom field/attribute string values + # are needed. Enabling keyword match improves recall of subsequent search + # requests. # # Defaults to false. # @param options [Google::Gax::CallOptions] # Overrides the default settings for this call, e.g, timeout, # retries, etc. @@ -1310,9 +1364,182 @@ custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::SearchJobsRequest) @search_jobs_for_alert.call(req, options, &block) + end + + # Begins executing a batch create jobs operation. + # + # @param parent [String] + # Required. The resource name of the tenant under which the job 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 jobs [Array<Google::Cloud::Talent::V4beta1::Job | Hash>] + # Required. The jobs to be created. + # A hash of the same form as `Google::Cloud::Talent::V4beta1::Job` + # can also be provided. + # @param options [Google::Gax::CallOptions] + # Overrides the default settings for this call, e.g, timeout, + # retries, etc. + # @return [Google::Gax::Operation] + # @raise [Google::Gax::GaxError] if the RPC is aborted. + # @example + # require "google/cloud/talent" + # + # job_client = Google::Cloud::Talent::JobService.new(version: :v4beta1) + # formatted_parent = Google::Cloud::Talent::V4beta1::JobServiceClient.tenant_path("[PROJECT]", "[TENANT]") + # + # # TODO: Initialize `jobs`: + # jobs = [] + # + # # Register a callback during the method call. + # operation = job_client.batch_create_jobs(formatted_parent, jobs) do |op| + # raise op.results.message if op.error? + # op_results = op.results + # # Process the results. + # + # metadata = op.metadata + # # Process the metadata. + # end + # + # # Or use the return value to register a callback. + # operation.on_done do |op| + # raise op.results.message if op.error? + # op_results = op.results + # # Process the results. + # + # metadata = op.metadata + # # Process the metadata. + # end + # + # # Manually reload the operation. + # operation.reload! + # + # # Or block until the operation completes, triggering callbacks on + # # completion. + # operation.wait_until_done! + + def batch_create_jobs \ + parent, + jobs, + options: nil + req = { + parent: parent, + jobs: jobs + }.delete_if { |_, v| v.nil? } + req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::BatchCreateJobsRequest) + operation = Google::Gax::Operation.new( + @batch_create_jobs.call(req, options), + @operations_client, + Google::Cloud::Talent::V4beta1::JobOperationResult, + Google::Cloud::Talent::V4beta1::BatchOperationMetadata, + call_options: options + ) + operation.on_done { |operation| yield(operation) } if block_given? + operation + end + + # Begins executing a batch update jobs operation. + # + # @param parent [String] + # Required. The resource name of the tenant under which the job 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". + # @param jobs [Array<Google::Cloud::Talent::V4beta1::Job | Hash>] + # Required. The jobs to be updated. + # A hash of the same form as `Google::Cloud::Talent::V4beta1::Job` + # can also be provided. + # @param update_mask [Google::Protobuf::FieldMask | Hash] + # Optional but strongly recommended to be provided for the best service + # experience, also increase latency when checking status of batch operation. + # + # If + # {Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest#update_mask update_mask} + # is provided, only the specified fields in + # {Google::Cloud::Talent::V4beta1::Job Job} are updated. Otherwise all the + # fields are updated. + # + # A field mask to restrict the fields that are updated. Only + # top level fields of {Google::Cloud::Talent::V4beta1::Job Job} are supported. + # + # If + # {Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest#update_mask update_mask} + # is provided, The {Google::Cloud::Talent::V4beta1::Job Job} inside + # {JobResult} will only contains fields that is updated, plus the Id of the + # Job. Otherwise, {Google::Cloud::Talent::V4beta1::Job Job} will include all + # fields, which can yield a very large response. + # 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. + # @return [Google::Gax::Operation] + # @raise [Google::Gax::GaxError] if the RPC is aborted. + # @example + # require "google/cloud/talent" + # + # job_client = Google::Cloud::Talent::JobService.new(version: :v4beta1) + # formatted_parent = Google::Cloud::Talent::V4beta1::JobServiceClient.tenant_path("[PROJECT]", "[TENANT]") + # + # # TODO: Initialize `jobs`: + # jobs = [] + # + # # Register a callback during the method call. + # operation = job_client.batch_update_jobs(formatted_parent, jobs) do |op| + # raise op.results.message if op.error? + # op_results = op.results + # # Process the results. + # + # metadata = op.metadata + # # Process the metadata. + # end + # + # # Or use the return value to register a callback. + # operation.on_done do |op| + # raise op.results.message if op.error? + # op_results = op.results + # # Process the results. + # + # metadata = op.metadata + # # Process the metadata. + # end + # + # # Manually reload the operation. + # operation.reload! + # + # # Or block until the operation completes, triggering callbacks on + # # completion. + # operation.wait_until_done! + + def batch_update_jobs \ + parent, + jobs, + update_mask: nil, + options: nil + req = { + parent: parent, + jobs: jobs, + update_mask: update_mask + }.delete_if { |_, v| v.nil? } + req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest) + operation = Google::Gax::Operation.new( + @batch_update_jobs.call(req, options), + @operations_client, + Google::Cloud::Talent::V4beta1::JobOperationResult, + Google::Cloud::Talent::V4beta1::BatchOperationMetadata, + call_options: options + ) + operation.on_done { |operation| yield(operation) } if block_given? + operation end end end end end