xref: /aosp_15_r20/external/googleapis/google/cloud/talent/v4/job_service.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2023 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto3";
16
17package google.cloud.talent.v4;
18
19import "google/api/annotations.proto";
20import "google/api/client.proto";
21import "google/api/field_behavior.proto";
22import "google/api/resource.proto";
23import "google/cloud/talent/v4/common.proto";
24import "google/cloud/talent/v4/filters.proto";
25import "google/cloud/talent/v4/histogram.proto";
26import "google/cloud/talent/v4/job.proto";
27import "google/longrunning/operations.proto";
28import "google/protobuf/duration.proto";
29import "google/protobuf/empty.proto";
30import "google/protobuf/field_mask.proto";
31import "google/rpc/status.proto";
32
33option go_package = "cloud.google.com/go/talent/apiv4/talentpb;talentpb";
34option java_multiple_files = true;
35option java_outer_classname = "JobServiceProto";
36option java_package = "com.google.cloud.talent.v4";
37option objc_class_prefix = "CTS";
38
39// A service handles job management, including job CRUD, enumeration and search.
40service JobService {
41  option (google.api.default_host) = "jobs.googleapis.com";
42  option (google.api.oauth_scopes) =
43      "https://www.googleapis.com/auth/cloud-platform,"
44      "https://www.googleapis.com/auth/jobs";
45
46  // Creates a new job.
47  //
48  // Typically, the job becomes searchable within 10 seconds, but it may take
49  // up to 5 minutes.
50  rpc CreateJob(CreateJobRequest) returns (Job) {
51    option (google.api.http) = {
52      post: "/v4/{parent=projects/*/tenants/*}/jobs"
53      body: "job"
54    };
55    option (google.api.method_signature) = "parent,job";
56  }
57
58  // Begins executing a batch create jobs operation.
59  rpc BatchCreateJobs(BatchCreateJobsRequest)
60      returns (google.longrunning.Operation) {
61    option (google.api.http) = {
62      post: "/v4/{parent=projects/*/tenants/*}/jobs:batchCreate"
63      body: "*"
64    };
65    option (google.api.method_signature) = "parent,jobs";
66    option (google.longrunning.operation_info) = {
67      response_type: "BatchCreateJobsResponse"
68      metadata_type: "BatchOperationMetadata"
69    };
70  }
71
72  // Retrieves the specified job, whose status is OPEN or recently EXPIRED
73  // within the last 90 days.
74  rpc GetJob(GetJobRequest) returns (Job) {
75    option (google.api.http) = {
76      get: "/v4/{name=projects/*/tenants/*/jobs/*}"
77    };
78    option (google.api.method_signature) = "name";
79  }
80
81  // Updates specified job.
82  //
83  // Typically, updated contents become visible in search results within 10
84  // seconds, but it may take up to 5 minutes.
85  rpc UpdateJob(UpdateJobRequest) returns (Job) {
86    option (google.api.http) = {
87      patch: "/v4/{job.name=projects/*/tenants/*/jobs/*}"
88      body: "job"
89    };
90    option (google.api.method_signature) = "job,update_mask";
91  }
92
93  // Begins executing a batch update jobs operation.
94  rpc BatchUpdateJobs(BatchUpdateJobsRequest)
95      returns (google.longrunning.Operation) {
96    option (google.api.http) = {
97      post: "/v4/{parent=projects/*/tenants/*}/jobs:batchUpdate"
98      body: "*"
99    };
100    option (google.api.method_signature) = "parent,jobs";
101    option (google.longrunning.operation_info) = {
102      response_type: "BatchUpdateJobsResponse"
103      metadata_type: "BatchOperationMetadata"
104    };
105  }
106
107  // Deletes the specified job.
108  //
109  // Typically, the job becomes unsearchable within 10 seconds, but it may take
110  // up to 5 minutes.
111  rpc DeleteJob(DeleteJobRequest) returns (google.protobuf.Empty) {
112    option (google.api.http) = {
113      delete: "/v4/{name=projects/*/tenants/*/jobs/*}"
114    };
115    option (google.api.method_signature) = "name";
116  }
117
118  // Begins executing a batch delete jobs operation.
119  rpc BatchDeleteJobs(BatchDeleteJobsRequest)
120      returns (google.longrunning.Operation) {
121    option (google.api.http) = {
122      post: "/v4/{parent=projects/*/tenants/*}/jobs:batchDelete"
123      body: "*"
124    };
125    option (google.api.method_signature) = "parent,names";
126    option (google.longrunning.operation_info) = {
127      response_type: "BatchDeleteJobsResponse"
128      metadata_type: "BatchOperationMetadata"
129    };
130  }
131
132  // Lists jobs by filter.
133  rpc ListJobs(ListJobsRequest) returns (ListJobsResponse) {
134    option (google.api.http) = {
135      get: "/v4/{parent=projects/*/tenants/*}/jobs"
136    };
137    option (google.api.method_signature) = "parent,filter";
138  }
139
140  // Searches for jobs using the provided
141  // [SearchJobsRequest][google.cloud.talent.v4.SearchJobsRequest].
142  //
143  // This call constrains the
144  // [visibility][google.cloud.talent.v4.Job.visibility] of jobs present in the
145  // database, and only returns jobs that the caller has permission to search
146  // against.
147  rpc SearchJobs(SearchJobsRequest) returns (SearchJobsResponse) {
148    option (google.api.http) = {
149      post: "/v4/{parent=projects/*/tenants/*}/jobs:search"
150      body: "*"
151    };
152  }
153
154  // Searches for jobs using the provided
155  // [SearchJobsRequest][google.cloud.talent.v4.SearchJobsRequest].
156  //
157  // This API call is intended for the use case of targeting passive job
158  // seekers (for example, job seekers who have signed up to receive email
159  // alerts about potential job opportunities), it has different algorithmic
160  // adjustments that are designed to specifically target passive job seekers.
161  //
162  // This call constrains the
163  // [visibility][google.cloud.talent.v4.Job.visibility] of jobs present in the
164  // database, and only returns jobs the caller has permission to search
165  // against.
166  rpc SearchJobsForAlert(SearchJobsRequest) returns (SearchJobsResponse) {
167    option (google.api.http) = {
168      post: "/v4/{parent=projects/*/tenants/*}/jobs:searchForAlert"
169      body: "*"
170    };
171  }
172}
173
174// Create job request.
175message CreateJobRequest {
176  // Required. The resource name of the tenant under which the job is created.
177  //
178  // The format is "projects/{project_id}/tenants/{tenant_id}". For example,
179  // "projects/foo/tenants/bar".
180  string parent = 1 [
181    (google.api.field_behavior) = REQUIRED,
182    (google.api.resource_reference) = { child_type: "jobs.googleapis.com/Job" }
183  ];
184
185  // Required. The Job to be created.
186  Job job = 2 [(google.api.field_behavior) = REQUIRED];
187}
188
189// Get job request.
190message GetJobRequest {
191  // Required. The resource name of the job to retrieve.
192  //
193  // The format is
194  // "projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}". For
195  // example, "projects/foo/tenants/bar/jobs/baz".
196  string name = 1 [
197    (google.api.field_behavior) = REQUIRED,
198    (google.api.resource_reference) = { type: "jobs.googleapis.com/Job" }
199  ];
200}
201
202// Update job request.
203message UpdateJobRequest {
204  // Required. The Job to be updated.
205  Job job = 1 [(google.api.field_behavior) = REQUIRED];
206
207  // Strongly recommended for the best service experience.
208  //
209  // If [update_mask][google.cloud.talent.v4.UpdateJobRequest.update_mask] is
210  // provided, only the specified fields in
211  // [job][google.cloud.talent.v4.UpdateJobRequest.job] are updated. Otherwise
212  // all the fields are updated.
213  //
214  // A field mask to restrict the fields that are updated. Only
215  // top level fields of [Job][google.cloud.talent.v4.Job] are supported.
216  google.protobuf.FieldMask update_mask = 2;
217}
218
219// Delete job request.
220message DeleteJobRequest {
221  // Required. The resource name of the job to be deleted.
222  //
223  // The format is
224  // "projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}". For
225  // example, "projects/foo/tenants/bar/jobs/baz".
226  string name = 1 [
227    (google.api.field_behavior) = REQUIRED,
228    (google.api.resource_reference) = { type: "jobs.googleapis.com/Job" }
229  ];
230}
231
232// An enum that specifies the job attributes that are returned in the
233// [MatchingJob.job][google.cloud.talent.v4.SearchJobsResponse.MatchingJob.job]
234// or [ListJobsResponse.jobs][google.cloud.talent.v4.ListJobsResponse.jobs]
235// fields.
236enum JobView {
237  // Default value.
238  JOB_VIEW_UNSPECIFIED = 0;
239
240  // A ID only view of job, with following attributes:
241  // [Job.name][google.cloud.talent.v4.Job.name],
242  // [Job.requisition_id][google.cloud.talent.v4.Job.requisition_id],
243  // [Job.language_code][google.cloud.talent.v4.Job.language_code].
244  JOB_VIEW_ID_ONLY = 1;
245
246  // A minimal view of the job, with the following attributes:
247  // [Job.name][google.cloud.talent.v4.Job.name],
248  // [Job.requisition_id][google.cloud.talent.v4.Job.requisition_id],
249  // [Job.title][google.cloud.talent.v4.Job.title],
250  // [Job.company][google.cloud.talent.v4.Job.company],
251  // [Job.DerivedInfo.locations][google.cloud.talent.v4.Job.DerivedInfo.locations],
252  // [Job.language_code][google.cloud.talent.v4.Job.language_code].
253  JOB_VIEW_MINIMAL = 2;
254
255  // A small view of the job, with the following attributes in the search
256  // results: [Job.name][google.cloud.talent.v4.Job.name],
257  // [Job.requisition_id][google.cloud.talent.v4.Job.requisition_id],
258  // [Job.title][google.cloud.talent.v4.Job.title],
259  // [Job.company][google.cloud.talent.v4.Job.company],
260  // [Job.DerivedInfo.locations][google.cloud.talent.v4.Job.DerivedInfo.locations],
261  // [Job.visibility][google.cloud.talent.v4.Job.visibility],
262  // [Job.language_code][google.cloud.talent.v4.Job.language_code],
263  // [Job.description][google.cloud.talent.v4.Job.description].
264  JOB_VIEW_SMALL = 3;
265
266  // All available attributes are included in the search results.
267  JOB_VIEW_FULL = 4;
268}
269
270// List jobs request.
271message ListJobsRequest {
272  // Required. The resource name of the tenant under which the job is created.
273  //
274  // The format is "projects/{project_id}/tenants/{tenant_id}". For example,
275  // "projects/foo/tenants/bar".
276  string parent = 1 [
277    (google.api.field_behavior) = REQUIRED,
278    (google.api.resource_reference) = { child_type: "jobs.googleapis.com/Job" }
279  ];
280
281  // Required. The filter string specifies the jobs to be enumerated.
282  //
283  // Supported operator: =, AND
284  //
285  // The fields eligible for filtering are:
286  //
287  // * `companyName`
288  // * `requisitionId`
289  // * `status` Available values: OPEN, EXPIRED, ALL. Defaults to
290  // OPEN if no value is specified.
291  //
292  // At least one of `companyName` and `requisitionId` must present or an
293  // INVALID_ARGUMENT error is thrown.
294  //
295  // Sample Query:
296  //
297  // * companyName = "projects/foo/tenants/bar/companies/baz"
298  // * companyName = "projects/foo/tenants/bar/companies/baz" AND
299  // requisitionId = "req-1"
300  // * companyName = "projects/foo/tenants/bar/companies/baz" AND
301  // status = "EXPIRED"
302  // * requisitionId = "req-1"
303  // * requisitionId = "req-1" AND status = "EXPIRED"
304  string filter = 2 [(google.api.field_behavior) = REQUIRED];
305
306  // The starting point of a query result.
307  string page_token = 3;
308
309  // The maximum number of jobs to be returned per page of results.
310  //
311  // If [job_view][google.cloud.talent.v4.ListJobsRequest.job_view] is set to
312  // [JobView.JOB_VIEW_ID_ONLY][google.cloud.talent.v4.JobView.JOB_VIEW_ID_ONLY],
313  // the maximum allowed page size is 1000. Otherwise, the maximum allowed page
314  // size is 100.
315  //
316  // Default is 100 if empty or a number < 1 is specified.
317  int32 page_size = 4;
318
319  // The desired job attributes returned for jobs in the
320  // search response. Defaults to
321  // [JobView.JOB_VIEW_FULL][google.cloud.talent.v4.JobView.JOB_VIEW_FULL] if no
322  // value is specified.
323  JobView job_view = 5;
324}
325
326// List jobs response.
327message ListJobsResponse {
328  // The Jobs for a given company.
329  //
330  // The maximum number of items returned is based on the limit field
331  // provided in the request.
332  repeated Job jobs = 1;
333
334  // A token to retrieve the next page of results.
335  string next_page_token = 2;
336
337  // Additional information for the API invocation, such as the request
338  // tracking id.
339  ResponseMetadata metadata = 3;
340}
341
342// The Request body of the `SearchJobs` call.
343message SearchJobsRequest {
344  // A string-represented enumeration of the job search mode. The service
345  // operate differently for different modes of service.
346  enum SearchMode {
347    // The mode of the search method isn't specified. The default search
348    // behavior is identical to JOB_SEARCH search behavior.
349    SEARCH_MODE_UNSPECIFIED = 0;
350
351    // The job search matches against all jobs, and featured jobs
352    // (jobs with promotionValue > 0) are not specially handled.
353    JOB_SEARCH = 1;
354
355    // The job search matches only against featured jobs (jobs with a
356    // promotionValue > 0). This method doesn't return any jobs having a
357    // promotionValue <= 0. The search results order is determined by the
358    // promotionValue (jobs with a higher promotionValue are returned higher up
359    // in the search results), with relevance being used as a tiebreaker.
360    FEATURED_JOB_SEARCH = 2;
361  }
362
363  // Controls whether highly similar jobs are returned next to each other in
364  // the search results. Jobs are identified as highly similar based on
365  // their titles, job categories, and locations. Highly similar results are
366  // clustered so that only one representative job of the cluster is
367  // displayed to the job seeker higher up in the results, with the other jobs
368  // being displayed lower down in the results.
369  //
370  // If you are using pageToken to page through the result set,
371  // latency might be lower but we can't guarantee that all results are
372  // returned. If you are using page offset, latency might be higher but all
373  // results are returned.
374  enum DiversificationLevel {
375    // The diversification level isn't specified.
376    DIVERSIFICATION_LEVEL_UNSPECIFIED = 0;
377
378    // Disables diversification. Jobs that would normally be pushed to the last
379    // page would not have their positions altered. This may result in highly
380    // similar jobs appearing in sequence in the search results.
381    DISABLED = 1;
382
383    // Default diversifying behavior. The result list is ordered so that
384    // highly similar results are pushed to the end of the last page of search
385    // results.
386    SIMPLE = 2;
387
388    // Only one job from the same company will be shown at once, other jobs
389    // under same company are pushed to the end of the last page of search
390    // result.
391    ONE_PER_COMPANY = 3;
392
393    // Similar to ONE_PER_COMPANY, but it allows at most two jobs in the
394    // same company to be shown at once, the other jobs under same company are
395    // pushed to the end of the last page of search result.
396    TWO_PER_COMPANY = 4;
397
398    // Similar to ONE_PER_COMPANY, but it allows at most three jobs in the
399    // same company to be shown at once, the other jobs under same company are
400    // dropped.
401    MAX_THREE_PER_COMPANY = 6;
402
403    // The result list is ordered such that somewhat similar results are pushed
404    // to the end of the last page of the search results. This option is
405    // recommended if SIMPLE diversification does not diversify enough.
406    DIVERSIFY_BY_LOOSER_SIMILARITY = 5;
407  }
408
409  // Controls what keyword matching behavior the search has. When keyword
410  // matching is enabled, a keyword match returns jobs that may not match given
411  // category filters when there are matching keywords. For example, for the
412  // query "program manager" with KeywordMatchMode set to KEYWORD_MATCH_ALL, a
413  // job posting with the title "software developer," which doesn't fall into
414  // "program manager" ontology, and "program manager" appearing in its
415  // description will be surfaced.
416  //
417  // For queries like "cloud" that don't contain title or
418  // location specific ontology, jobs with "cloud" keyword matches are returned
419  // regardless of this enum's value.
420  //
421  // Use
422  // [Company.keyword_searchable_job_custom_attributes][google.cloud.talent.v4.Company.keyword_searchable_job_custom_attributes]
423  // if company-specific globally matched custom field/attribute string values
424  // are needed. Enabling keyword match improves recall of subsequent search
425  // requests.
426  enum KeywordMatchMode {
427    // The keyword match option isn't specified. Defaults to
428    // [KeywordMatchMode.KEYWORD_MATCH_ALL][google.cloud.talent.v4.SearchJobsRequest.KeywordMatchMode.KEYWORD_MATCH_ALL]
429    // behavior.
430    KEYWORD_MATCH_MODE_UNSPECIFIED = 0;
431
432    // Disables keyword matching.
433    KEYWORD_MATCH_DISABLED = 1;
434
435    // Enable keyword matching over
436    // [Job.title][google.cloud.talent.v4.Job.title],
437    // [Job.description][google.cloud.talent.v4.Job.description],
438    // [Job.company_display_name][google.cloud.talent.v4.Job.company_display_name],
439    // [Job.addresses][google.cloud.talent.v4.Job.addresses],
440    // [Job.qualifications][google.cloud.talent.v4.Job.qualifications], and
441    // keyword searchable
442    // [Job.custom_attributes][google.cloud.talent.v4.Job.custom_attributes]
443    // fields.
444    KEYWORD_MATCH_ALL = 2;
445
446    // Only enable keyword matching over
447    // [Job.title][google.cloud.talent.v4.Job.title].
448    KEYWORD_MATCH_TITLE_ONLY = 3;
449  }
450
451  // Custom ranking information for
452  // [SearchJobsRequest][google.cloud.talent.v4.SearchJobsRequest].
453  message CustomRankingInfo {
454    // The importance level for
455    // [CustomRankingInfo.ranking_expression][google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo.ranking_expression].
456    enum ImportanceLevel {
457      // Default value if the importance level isn't specified.
458      IMPORTANCE_LEVEL_UNSPECIFIED = 0;
459
460      // The given ranking expression is of None importance, existing relevance
461      // score (determined by API algorithm) dominates job's final ranking
462      // position.
463      NONE = 1;
464
465      // The given ranking expression is of Low importance in terms of job's
466      // final ranking position compared to existing relevance
467      // score (determined by API algorithm).
468      LOW = 2;
469
470      // The given ranking expression is of Mild importance in terms of job's
471      // final ranking position compared to existing relevance
472      // score (determined by API algorithm).
473      MILD = 3;
474
475      // The given ranking expression is of Medium importance in terms of job's
476      // final ranking position compared to existing relevance
477      // score (determined by API algorithm).
478      MEDIUM = 4;
479
480      // The given ranking expression is of High importance in terms of job's
481      // final ranking position compared to existing relevance
482      // score (determined by API algorithm).
483      HIGH = 5;
484
485      // The given ranking expression is of Extreme importance, and dominates
486      // job's final ranking position with existing relevance
487      // score (determined by API algorithm) ignored.
488      EXTREME = 6;
489    }
490
491    // Required. Controls over how important the score of
492    // [CustomRankingInfo.ranking_expression][google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo.ranking_expression]
493    // gets applied to job's final ranking position.
494    //
495    // An error is thrown if not specified.
496    ImportanceLevel importance_level = 1
497        [(google.api.field_behavior) = REQUIRED];
498
499    // Required. Controls over how job documents get ranked on top of existing
500    // relevance score (determined by API algorithm). A combination of the
501    // ranking expression and relevance score is used to determine job's final
502    // ranking position.
503    //
504    // The syntax for this expression is a subset of Google SQL syntax.
505    //
506    // Supported operators are: +, -, *, /, where the left and right side of
507    // the operator is either a numeric
508    // [Job.custom_attributes][google.cloud.talent.v4.Job.custom_attributes]
509    // key, integer/double value or an expression that can be evaluated to a
510    // number.
511    //
512    // Parenthesis are supported to adjust calculation precedence. The
513    // expression must be < 200 characters in length.
514    //
515    // The expression is considered invalid for a job if the expression
516    // references custom attributes that are not populated on the job or if the
517    // expression results in a divide by zero. If an expression is invalid for a
518    // job, that job is demoted to the end of the results.
519    //
520    // Sample ranking expression
521    // (year + 25) * 0.25 - (freshness / 0.5)
522    string ranking_expression = 2 [(google.api.field_behavior) = REQUIRED];
523  }
524
525  // Required. The resource name of the tenant to search within.
526  //
527  // The format is "projects/{project_id}/tenants/{tenant_id}". For example,
528  // "projects/foo/tenants/bar".
529  string parent = 1 [
530    (google.api.field_behavior) = REQUIRED,
531    (google.api.resource_reference) = { child_type: "jobs.googleapis.com/Job" }
532  ];
533
534  // Mode of a search.
535  //
536  // Defaults to
537  // [SearchMode.JOB_SEARCH][google.cloud.talent.v4.SearchJobsRequest.SearchMode.JOB_SEARCH].
538  SearchMode search_mode = 2;
539
540  // Required. The meta information collected about the job searcher, used to
541  // improve the search quality of the service. The identifiers (such as
542  // `user_id`) are provided by users, and must be unique and consistent.
543  RequestMetadata request_metadata = 3 [(google.api.field_behavior) = REQUIRED];
544
545  // Query used to search against jobs, such as keyword, location filters, etc.
546  JobQuery job_query = 4;
547
548  // Controls whether to broaden the search when it produces sparse results.
549  // Broadened queries append results to the end of the matching results
550  // list.
551  //
552  // Defaults to false.
553  bool enable_broadening = 5;
554
555  // An expression specifies a histogram request against matching jobs.
556  //
557  // Expression syntax is an aggregation function call with histogram facets and
558  // other options.
559  //
560  // Available aggregation function calls are:
561  // * `count(string_histogram_facet)`: Count the number of matching entities,
562  // for each distinct attribute value.
563  // * `count(numeric_histogram_facet, list of buckets)`: Count the number of
564  // matching entities within each bucket.
565  //
566  // A maximum of 200 histogram buckets are supported.
567  //
568  // Data types:
569  //
570  // * Histogram facet: facet names with format `[a-zA-Z][a-zA-Z0-9_]+`.
571  // * String: string like "any string with backslash escape for quote(\")."
572  // * Number: whole number and floating point number like 10, -1 and -0.01.
573  // * List: list of elements with comma(,) separator surrounded by square
574  // brackets, for example, [1, 2, 3] and ["one", "two", "three"].
575  //
576  // Built-in constants:
577  //
578  // * MIN (minimum number similar to java Double.MIN_VALUE)
579  // * MAX (maximum number similar to java Double.MAX_VALUE)
580  //
581  // Built-in functions:
582  //
583  // * bucket(start, end[, label]): bucket built-in function creates a bucket
584  // with range of [start, end). Note that the end is exclusive, for example,
585  // bucket(1, MAX, "positive number") or bucket(1, 10).
586  //
587  // Job histogram facets:
588  //
589  // * company_display_name: histogram by
590  // [Job.company_display_name][google.cloud.talent.v4.Job.company_display_name].
591  // * employment_type: histogram by
592  // [Job.employment_types][google.cloud.talent.v4.Job.employment_types], for
593  // example,
594  //   "FULL_TIME", "PART_TIME".
595  // * company_size (DEPRECATED): histogram by
596  // [CompanySize][google.cloud.talent.v4.CompanySize], for example, "SMALL",
597  // "MEDIUM", "BIG".
598  // * publish_time_in_day: histogram by the
599  // [Job.posting_publish_time][google.cloud.talent.v4.Job.posting_publish_time]
600  //   in days.
601  //   Must specify list of numeric buckets in spec.
602  // * publish_time_in_month: histogram by the
603  // [Job.posting_publish_time][google.cloud.talent.v4.Job.posting_publish_time]
604  //   in months.
605  //   Must specify list of numeric buckets in spec.
606  // * publish_time_in_year: histogram by the
607  // [Job.posting_publish_time][google.cloud.talent.v4.Job.posting_publish_time]
608  //   in years.
609  //   Must specify list of numeric buckets in spec.
610  // * degree_types: histogram by the
611  // [Job.degree_types][google.cloud.talent.v4.Job.degree_types], for example,
612  //   "Bachelors", "Masters".
613  // * job_level: histogram by the
614  // [Job.job_level][google.cloud.talent.v4.Job.job_level], for example, "Entry
615  //   Level".
616  // * country: histogram by the country code of jobs, for example, "US", "FR".
617  // * admin1: histogram by the admin1 code of jobs, which is a global
618  //   placeholder referring to the state, province, or the particular term a
619  //   country uses to define the geographic structure below the country level,
620  //   for example, "CA", "IL".
621  // * city: histogram by a combination of the "city name, admin1 code". For
622  //   example,  "Mountain View, CA", "New York, NY".
623  // * admin1_country: histogram by a combination of the "admin1 code, country",
624  //   for example, "CA, US", "IL, US".
625  // * city_coordinate: histogram by the city center's GPS coordinates (latitude
626  //   and longitude), for example, 37.4038522,-122.0987765. Since the
627  //   coordinates of a city center can change, customers may need to refresh
628  //   them periodically.
629  // * locale: histogram by the
630  // [Job.language_code][google.cloud.talent.v4.Job.language_code], for example,
631  // "en-US",
632  //   "fr-FR".
633  // * language: histogram by the language subtag of the
634  // [Job.language_code][google.cloud.talent.v4.Job.language_code],
635  //   for example, "en", "fr".
636  // * category: histogram by the
637  // [JobCategory][google.cloud.talent.v4.JobCategory], for example,
638  //   "COMPUTER_AND_IT", "HEALTHCARE".
639  // * base_compensation_unit: histogram by the
640  //   [CompensationInfo.CompensationUnit][google.cloud.talent.v4.CompensationInfo.CompensationUnit]
641  //   of base salary, for example, "WEEKLY", "MONTHLY".
642  // * base_compensation: histogram by the base salary. Must specify list of
643  //   numeric buckets to group results by.
644  // * annualized_base_compensation: histogram by the base annualized salary.
645  //   Must specify list of numeric buckets to group results by.
646  // * annualized_total_compensation: histogram by the total annualized salary.
647  //   Must specify list of numeric buckets to group results by.
648  // * string_custom_attribute: histogram by string
649  // [Job.custom_attributes][google.cloud.talent.v4.Job.custom_attributes].
650  //   Values can be accessed via square bracket notations like
651  //   string_custom_attribute["key1"].
652  // * numeric_custom_attribute: histogram by numeric
653  // [Job.custom_attributes][google.cloud.talent.v4.Job.custom_attributes].
654  //   Values can be accessed via square bracket notations like
655  //   numeric_custom_attribute["key1"]. Must specify list of numeric buckets to
656  //   group results by.
657  //
658  // Example expressions:
659  //
660  // * `count(admin1)`
661  // * `count(base_compensation, [bucket(1000, 10000), bucket(10000, 100000),
662  // bucket(100000, MAX)])`
663  // * `count(string_custom_attribute["some-string-custom-attribute"])`
664  // * `count(numeric_custom_attribute["some-numeric-custom-attribute"],
665  //   [bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative")])`
666  repeated HistogramQuery histogram_queries = 7;
667
668  // The desired job attributes returned for jobs in the search response.
669  // Defaults to
670  // [JobView.JOB_VIEW_SMALL][google.cloud.talent.v4.JobView.JOB_VIEW_SMALL] if
671  // no value is specified.
672  JobView job_view = 8;
673
674  // An integer that specifies the current offset (that is, starting result
675  // location, amongst the jobs deemed by the API as relevant) in search
676  // results. This field is only considered if
677  // [page_token][google.cloud.talent.v4.SearchJobsRequest.page_token] is unset.
678  //
679  // The maximum allowed value is 5000. Otherwise an error is thrown.
680  //
681  // For example, 0 means to  return results starting from the first matching
682  // job, and 10 means to return from the 11th job. This can be used for
683  // pagination, (for example, pageSize = 10 and offset = 10 means to return
684  // from the second page).
685  int32 offset = 9;
686
687  // A limit on the number of jobs returned in the search results.
688  // Increasing this value above the default value of 10 can increase search
689  // response time. The value can be between 1 and 100.
690  int32 max_page_size = 10;
691
692  // The token specifying the current offset within
693  // search results. See
694  // [SearchJobsResponse.next_page_token][google.cloud.talent.v4.SearchJobsResponse.next_page_token]
695  // for an explanation of how to obtain the next set of query results.
696  string page_token = 11;
697
698  // The criteria determining how search results are sorted. Default is
699  // `"relevance desc"`.
700  //
701  // Supported options are:
702  //
703  // * `"relevance desc"`: By relevance descending, as determined by the API
704  //   algorithms. Relevance thresholding of query results is only available
705  //   with this ordering.
706  // * `"posting_publish_time desc"`: By
707  // [Job.posting_publish_time][google.cloud.talent.v4.Job.posting_publish_time]
708  //   descending.
709  // * `"posting_update_time desc"`: By
710  // [Job.posting_update_time][google.cloud.talent.v4.Job.posting_update_time]
711  //   descending.
712  // * `"title"`: By [Job.title][google.cloud.talent.v4.Job.title] ascending.
713  // * `"title desc"`: By [Job.title][google.cloud.talent.v4.Job.title]
714  // descending.
715  // * `"annualized_base_compensation"`: By job's
716  //   [CompensationInfo.annualized_base_compensation_range][google.cloud.talent.v4.CompensationInfo.annualized_base_compensation_range]
717  //   ascending. Jobs whose annualized base compensation is unspecified are put
718  //   at the end of search results.
719  // * `"annualized_base_compensation desc"`: By job's
720  //   [CompensationInfo.annualized_base_compensation_range][google.cloud.talent.v4.CompensationInfo.annualized_base_compensation_range]
721  //   descending. Jobs whose annualized base compensation is unspecified are
722  //   put at the end of search results.
723  // * `"annualized_total_compensation"`: By job's
724  //   [CompensationInfo.annualized_total_compensation_range][google.cloud.talent.v4.CompensationInfo.annualized_total_compensation_range]
725  //   ascending. Jobs whose annualized base compensation is unspecified are put
726  //   at the end of search results.
727  // * `"annualized_total_compensation desc"`: By job's
728  //   [CompensationInfo.annualized_total_compensation_range][google.cloud.talent.v4.CompensationInfo.annualized_total_compensation_range]
729  //   descending. Jobs whose annualized base compensation is unspecified are
730  //   put at the end of search results.
731  // * `"custom_ranking desc"`: By the relevance score adjusted to the
732  //   [SearchJobsRequest.CustomRankingInfo.ranking_expression][google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo.ranking_expression]
733  //   with weight factor assigned by
734  //   [SearchJobsRequest.CustomRankingInfo.importance_level][google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo.importance_level]
735  //   in descending order.
736  // * Location sorting: Use the special syntax to order jobs by distance:<br>
737  //   `"distance_from('Hawaii')"`: Order by distance from Hawaii.<br>
738  //   `"distance_from(19.89, 155.5)"`: Order by distance from a coordinate.<br>
739  //   `"distance_from('Hawaii'), distance_from('Puerto Rico')"`: Order by
740  //   multiple locations. See details below.<br>
741  //   `"distance_from('Hawaii'), distance_from(19.89, 155.5)"`: Order by
742  //   multiple locations. See details below.<br>
743  //   The string can have a maximum of 256 characters. When multiple distance
744  //   centers are provided, a job that is close to any of the distance centers
745  //   would have a high rank. When a job has multiple locations, the job
746  //   location closest to one of the distance centers will be used. Jobs that
747  //   don't have locations will be ranked at the bottom. Distance is calculated
748  //   with a precision of 11.3 meters (37.4 feet). Diversification strategy is
749  //   still applied unless explicitly disabled in
750  //   [diversification_level][google.cloud.talent.v4.SearchJobsRequest.diversification_level].
751  string order_by = 12;
752
753  // Controls whether highly similar jobs are returned next to each other in
754  // the search results. Jobs are identified as highly similar based on
755  // their titles, job categories, and locations. Highly similar results are
756  // clustered so that only one representative job of the cluster is
757  // displayed to the job seeker higher up in the results, with the other jobs
758  // being displayed lower down in the results.
759  //
760  // Defaults to
761  // [DiversificationLevel.SIMPLE][google.cloud.talent.v4.SearchJobsRequest.DiversificationLevel.SIMPLE]
762  // if no value is specified.
763  DiversificationLevel diversification_level = 13;
764
765  // Controls over how job documents get ranked on top of existing relevance
766  // score (determined by API algorithm).
767  CustomRankingInfo custom_ranking_info = 14;
768
769  // This field is deprecated. Please use
770  // [SearchJobsRequest.keyword_match_mode][google.cloud.talent.v4.SearchJobsRequest.keyword_match_mode]
771  // going forward.
772  //
773  // To migrate, disable_keyword_match set to false maps to
774  // [KeywordMatchMode.KEYWORD_MATCH_ALL][google.cloud.talent.v4.SearchJobsRequest.KeywordMatchMode.KEYWORD_MATCH_ALL],
775  // and disable_keyword_match set to true maps to
776  // [KeywordMatchMode.KEYWORD_MATCH_DISABLED][google.cloud.talent.v4.SearchJobsRequest.KeywordMatchMode.KEYWORD_MATCH_DISABLED].
777  // If
778  // [SearchJobsRequest.keyword_match_mode][google.cloud.talent.v4.SearchJobsRequest.keyword_match_mode]
779  // is set, this field is ignored.
780  //
781  // Controls whether to disable exact keyword match on
782  // [Job.title][google.cloud.talent.v4.Job.title],
783  // [Job.description][google.cloud.talent.v4.Job.description],
784  // [Job.company_display_name][google.cloud.talent.v4.Job.company_display_name],
785  // [Job.addresses][google.cloud.talent.v4.Job.addresses],
786  // [Job.qualifications][google.cloud.talent.v4.Job.qualifications]. When
787  // disable keyword match is turned off, a keyword match returns jobs that do
788  // not match given category filters when there are matching keywords. For
789  // example, for the query "program manager," a result is returned even if the
790  // job posting has the title "software developer," which doesn't fall into
791  // "program manager" ontology, but does have "program manager" appearing in
792  // its description.
793  //
794  // For queries like "cloud" that don't contain title or
795  // location specific ontology, jobs with "cloud" keyword matches are returned
796  // regardless of this flag's value.
797  //
798  // Use
799  // [Company.keyword_searchable_job_custom_attributes][google.cloud.talent.v4.Company.keyword_searchable_job_custom_attributes]
800  // if company-specific globally matched custom field/attribute string values
801  // are needed. Enabling keyword match improves recall of subsequent search
802  // requests.
803  //
804  // Defaults to false.
805  bool disable_keyword_match = 16 [deprecated = true];
806
807  // Controls what keyword match options to use. If both keyword_match_mode and
808  // disable_keyword_match are set, keyword_match_mode will take precedence.
809  //
810  // Defaults to
811  // [KeywordMatchMode.KEYWORD_MATCH_ALL][google.cloud.talent.v4.SearchJobsRequest.KeywordMatchMode.KEYWORD_MATCH_ALL]
812  // if no value is specified.
813  KeywordMatchMode keyword_match_mode = 18;
814}
815
816// Response for SearchJob method.
817message SearchJobsResponse {
818  // Job entry with metadata inside
819  // [SearchJobsResponse][google.cloud.talent.v4.SearchJobsResponse].
820  message MatchingJob {
821    // Job resource that matches the specified
822    // [SearchJobsRequest][google.cloud.talent.v4.SearchJobsRequest].
823    Job job = 1;
824
825    // A summary of the job with core information that's displayed on the search
826    // results listing page.
827    string job_summary = 2;
828
829    // Contains snippets of text from the
830    // [Job.title][google.cloud.talent.v4.Job.title] field most closely matching
831    // a search query's keywords, if available. The matching query keywords are
832    // enclosed in HTML bold tags.
833    string job_title_snippet = 3;
834
835    // Contains snippets of text from the
836    // [Job.description][google.cloud.talent.v4.Job.description] and similar
837    // fields that most closely match a search query's keywords, if available.
838    // All HTML tags in the original fields are stripped when returned in this
839    // field, and matching query keywords are enclosed in HTML bold tags.
840    string search_text_snippet = 4;
841
842    // Commute information which is generated based on specified
843    //  [CommuteFilter][google.cloud.talent.v4.CommuteFilter].
844    CommuteInfo commute_info = 5;
845  }
846
847  // Commute details related to this job.
848  message CommuteInfo {
849    // Location used as the destination in the commute calculation.
850    Location job_location = 1;
851
852    // The number of seconds required to travel to the job location from the
853    // query location. A duration of 0 seconds indicates that the job isn't
854    // reachable within the requested duration, but was returned as part of an
855    // expanded query.
856    google.protobuf.Duration travel_duration = 2;
857  }
858
859  // The Job entities that match the specified
860  // [SearchJobsRequest][google.cloud.talent.v4.SearchJobsRequest].
861  repeated MatchingJob matching_jobs = 1;
862
863  // The histogram results that match with specified
864  // [SearchJobsRequest.histogram_queries][google.cloud.talent.v4.SearchJobsRequest.histogram_queries].
865  repeated HistogramQueryResult histogram_query_results = 2;
866
867  // The token that specifies the starting position of the next page of results.
868  // This field is empty if there are no more results.
869  string next_page_token = 3;
870
871  // The location filters that the service applied to the specified query. If
872  // any filters are lat-lng based, the
873  // [Location.location_type][google.cloud.talent.v4.Location.location_type] is
874  // [Location.LocationType.LOCATION_TYPE_UNSPECIFIED][google.cloud.talent.v4.Location.LocationType.LOCATION_TYPE_UNSPECIFIED].
875  repeated Location location_filters = 4;
876
877  // Number of jobs that match the specified query.
878  //
879  // Note: This size is precise only if the total is less than 100,000.
880  int32 total_size = 6;
881
882  // Additional information for the API invocation, such as the request
883  // tracking id.
884  ResponseMetadata metadata = 7;
885
886  // If query broadening is enabled, we may append additional results from the
887  // broadened query. This number indicates how many of the jobs returned in the
888  // jobs field are from the broadened query. These results are always at the
889  // end of the jobs list. In particular, a value of 0, or if the field isn't
890  // set, all the jobs in the jobs list are from the original
891  // (without broadening) query. If this field is non-zero, subsequent requests
892  // with offset after this result set should contain all broadened results.
893  int32 broadened_query_jobs_count = 8;
894
895  // The spell checking result, and correction.
896  SpellingCorrection spell_correction = 9;
897}
898
899// Request to create a batch of jobs.
900message BatchCreateJobsRequest {
901  // Required. The resource name of the tenant under which the job is created.
902  //
903  // The format is "projects/{project_id}/tenants/{tenant_id}". For example,
904  // "projects/foo/tenants/bar".
905  string parent = 1 [
906    (google.api.field_behavior) = REQUIRED,
907    (google.api.resource_reference) = { child_type: "jobs.googleapis.com/Job" }
908  ];
909
910  // Required. The jobs to be created.
911  // A maximum of 200 jobs can be created in a batch.
912  repeated Job jobs = 2 [(google.api.field_behavior) = REQUIRED];
913}
914
915// Request to update a batch of jobs.
916message BatchUpdateJobsRequest {
917  // Required. The resource name of the tenant under which the job is created.
918  //
919  // The format is "projects/{project_id}/tenants/{tenant_id}". For example,
920  // "projects/foo/tenants/bar".
921  string parent = 1 [
922    (google.api.field_behavior) = REQUIRED,
923    (google.api.resource_reference) = { child_type: "jobs.googleapis.com/Job" }
924  ];
925
926  // Required. The jobs to be updated.
927  // A maximum of 200 jobs can be updated in a batch.
928  repeated Job jobs = 2 [(google.api.field_behavior) = REQUIRED];
929
930  // Strongly recommended for the best service experience. Be aware that it will
931  // also increase latency when checking the status of a batch operation.
932  //
933  // If [update_mask][google.cloud.talent.v4.BatchUpdateJobsRequest.update_mask]
934  // is provided, only the specified fields in [Job][google.cloud.talent.v4.Job]
935  // are updated. Otherwise all the fields are updated.
936  //
937  // A field mask to restrict the fields that are updated. Only
938  // top level fields of [Job][google.cloud.talent.v4.Job] are supported.
939  //
940  // If [update_mask][google.cloud.talent.v4.BatchUpdateJobsRequest.update_mask]
941  // is provided, The [Job][google.cloud.talent.v4.Job] inside
942  // [JobResult][JobOperationResult.JobResult]
943  // will only contains fields that is updated, plus the Id of the Job.
944  // Otherwise,  [Job][google.cloud.talent.v4.Job] will include all fields,
945  // which can yield a very large response.
946  google.protobuf.FieldMask update_mask = 3;
947}
948
949// Request to delete a batch of jobs.
950message BatchDeleteJobsRequest {
951  // Required. The resource name of the tenant under which the job is created.
952  //
953  // The format is "projects/{project_id}/tenants/{tenant_id}". For example,
954  // "projects/foo/tenants/bar".
955  //
956  // The parent of all of the jobs specified in `names` must match this field.
957  string parent = 1 [
958    (google.api.field_behavior) = REQUIRED,
959    (google.api.resource_reference) = { type: "jobs.googleapis.com/Tenant" }
960  ];
961
962  // The names of the jobs to delete.
963  //
964  // The format is "projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}".
965  // For example, "projects/foo/tenants/bar/jobs/baz".
966  //
967  // A maximum of 200 jobs can be deleted in a batch.
968  repeated string names = 2
969      [(google.api.resource_reference) = { type: "jobs.googleapis.com/Job" }];
970}
971
972// Mutation result of a job from a batch operation.
973message JobResult {
974  // Here [Job][google.cloud.talent.v4.Job] only contains basic information
975  // including [name][google.cloud.talent.v4.Job.name],
976  // [company][google.cloud.talent.v4.Job.company],
977  // [language_code][google.cloud.talent.v4.Job.language_code] and
978  // [requisition_id][google.cloud.talent.v4.Job.requisition_id], use getJob
979  // method to retrieve detailed information of the created/updated job.
980  Job job = 1;
981
982  // The status of the job processed. This field is populated if the
983  // processing of the [job][google.cloud.talent.v4.JobResult.job] fails.
984  google.rpc.Status status = 2;
985}
986
987// The result of
988// [JobService.BatchCreateJobs][google.cloud.talent.v4.JobService.BatchCreateJobs].
989// It's used to replace
990// [google.longrunning.Operation.response][google.longrunning.Operation.response]
991// in case of success.
992message BatchCreateJobsResponse {
993  // List of job mutation results from a batch create operation. It can change
994  // until operation status is FINISHED, FAILED or CANCELLED.
995  repeated JobResult job_results = 1;
996}
997
998// The result of
999// [JobService.BatchUpdateJobs][google.cloud.talent.v4.JobService.BatchUpdateJobs].
1000// It's used to replace
1001// [google.longrunning.Operation.response][google.longrunning.Operation.response]
1002// in case of success.
1003message BatchUpdateJobsResponse {
1004  // List of job mutation results from a batch update operation. It can change
1005  // until operation status is FINISHED, FAILED or CANCELLED.
1006  repeated JobResult job_results = 1;
1007}
1008
1009// The result of
1010// [JobService.BatchDeleteJobs][google.cloud.talent.v4.JobService.BatchDeleteJobs].
1011// It's used to replace
1012// [google.longrunning.Operation.response][google.longrunning.Operation.response]
1013// in case of success.
1014message BatchDeleteJobsResponse {
1015  // List of job mutation results from a batch delete operation. It can change
1016  // until operation status is FINISHED, FAILED or CANCELLED.
1017  repeated JobResult job_results = 1;
1018}
1019