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