Skip to content

Commit 6ff6b49

Browse files
Google APIscopybara-github
authored andcommitted
build: library of v4 jobs onboarded to SAM
PiperOrigin-RevId: 457783072
1 parent 9f4d5b6 commit 6ff6b49

4 files changed

Lines changed: 230 additions & 0 deletions

File tree

google/cloud/talent/v4/common.proto

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,13 +551,22 @@ message RequestMetadata {
551551
// The type of device used by the job seeker at the time of the call to the
552552
// service.
553553
DeviceInfo device_info = 5;
554+
555+
// Delegated user information only used for internal purpose.
556+
DelegatedUserInfo delegated_user_info = 6;
557+
558+
// Enables debugging mode and controls various debug parameters in the search
559+
// process. Internal only.
560+
DebugOptions debug_options = 7;
554561
}
555562

556563
// Additional information returned to client, such as debugging information.
557564
message ResponseMetadata {
558565
// A unique id associated with this call.
559566
// This id is logged for tracking purposes.
560567
string request_id = 1;
568+
569+
DebugInfo debug_info = 2;
561570
}
562571

563572
// Device information collected from the job seeker, candidate, or
@@ -811,6 +820,70 @@ message CompensationInfo {
811820
CompensationRange annualized_total_compensation_range = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
812821
}
813822

823+
// Delegated partner information where for admin or debug purpose, our
824+
// internal source needs to act as a partner to do READ_ONLY operations (for
825+
// example, SearchJobs).
826+
message DelegatedUserInfo {
827+
// The GCP project number of the customer that the caller is acting on
828+
// behalf of.
829+
//
830+
// If both project number and distributor id are provided,
831+
// distributor id has the higher priority.
832+
int64 project_number = 1;
833+
834+
// The pretended distributor id.
835+
//
836+
// If both project number and distributor id are provided,
837+
// distributor id has the higher priority.
838+
string distributor_id = 2;
839+
840+
// The pretended tenant id.
841+
string tenant_id = 3;
842+
}
843+
844+
// Various debug options available for debugging mode. Internal only.
845+
message DebugOptions {
846+
// Specifies the level of debug output. The higher the number, the more
847+
// debug information is returned and printed in backend server logs.
848+
// Current levels are 1-4.
849+
int32 level = 1;
850+
851+
// Specifies which search backend to use. Current available options are:
852+
// st-bti, model-t, and st-muppet.
853+
string searcher = 2;
854+
855+
// Specifies the scoring parameters to override during search. This is
856+
// equivalent to the 'dsp' url parameter in the legacy system. For details,
857+
// consult go/gjobs-scoring-params.
858+
string scoring_parameter_override = 3;
859+
860+
// Overrides the ST sorting/scoring expression.
861+
string st_expression_override = 4;
862+
863+
// Search documents of all tenants (only implemented for job search as of
864+
// 6/14/2019).
865+
google.protobuf.BoolValue search_all_tenant = 5;
866+
867+
// Temporarily added this flag for profile wildcard search
868+
// Flag to indicate whether wildcard search is enabled
869+
google.protobuf.BoolValue enable_wildcard_search = 6;
870+
}
871+
872+
// Debug information.
873+
message DebugInfo {
874+
string query_debug_info = 1;
875+
876+
string moonshine_debug_info = 2;
877+
878+
// Identifiers for the versions of the search algorithm used during
879+
// this API invocation if multiple algorithms are used.
880+
// The default value is empty.
881+
repeated int32 experiment_ids = 3;
882+
883+
// The model id for profiles recommendation.
884+
string recommend_model_id = 4;
885+
}
886+
814887
// Metadata used for long running operations returned by CTS batch APIs.
815888
// It's used to replace [google.longrunning.Operation.metadata][google.longrunning.Operation.metadata].
816889
message BatchOperationMetadata {

google/cloud/talent/v4/job.proto

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,19 @@ message Job {
6868
// order.
6969
repeated Location locations = 1;
7070

71+
// Structured street locations of the job.
72+
//
73+
// Unlike [locations][google.cloud.talent.v4.Job.DerivedInfo.locations], [street_locations][google.cloud.talent.v4.Job.DerivedInfo.street_locations] contains street locations
74+
// inferred from job posting details, e.g. [Job.addresses][google.cloud.talent.v4.Job.addresses],
75+
// [Job.company_display_name][google.cloud.talent.v4.Job.company_display_name], and so on.
76+
//
77+
// Note that the inference of [street_locations][google.cloud.talent.v4.Job.DerivedInfo.street_locations] isn't guaranteed to
78+
// be 100% correct.
79+
//
80+
// [street_locations][google.cloud.talent.v4.Job.DerivedInfo.street_locations] are exactly matched to [Job.addresses][google.cloud.talent.v4.Job.addresses] in the same
81+
// order.
82+
repeated Location street_locations = 2;
83+
7184
// Job categories derived from [Job.title][google.cloud.talent.v4.Job.title] and [Job.description][google.cloud.talent.v4.Job.description].
7285
repeated JobCategory job_categories = 3;
7386
}
@@ -93,6 +106,58 @@ message Job {
93106
HtmlSanitization html_sanitization = 2;
94107
}
95108

109+
// Debugging information for internal users.
110+
message JobDebugInfo {
111+
enum JobStatus {
112+
JOB_DEBUG_INFO_UNSPECIFIED = 0;
113+
114+
EXPIRED = 1;
115+
116+
OPEN = 2;
117+
118+
DELETED = 3;
119+
}
120+
121+
// A belief that a job has particular soc with some probability.
122+
message SocBelief {
123+
string soc_code = 1;
124+
125+
double probability = 2;
126+
127+
int32 svp = 3;
128+
}
129+
130+
// Job Status.
131+
JobStatus status = 1;
132+
133+
// Soc Beliefs.
134+
repeated SocBelief soc_beliefs = 2;
135+
136+
// project id.
137+
string project_id = 3;
138+
139+
// distributor id
140+
string distributor_id = 4;
141+
142+
// tenant id.
143+
string tenant_id = 5;
144+
145+
// project number
146+
int64 project_number = 6;
147+
148+
// Job Classifications
149+
repeated string job_classifications = 7;
150+
151+
// Seniority
152+
string seniority = 8;
153+
154+
// Confidence Scores
155+
repeated double confidence_scores = 9;
156+
157+
// Last Update TIme
158+
google.protobuf.Timestamp last_update_time = 10;
159+
}
160+
96161
// Required during job update.
97162
//
98163
// The resource name for the job. This is generated by the service when a
@@ -347,4 +412,7 @@ message Job {
347412

348413
// Options for job processing.
349414
ProcessingOptions processing_options = 30;
415+
416+
// Debugging information for internal users.
417+
JobDebugInfo job_debug_info = 58;
350418
}

google/cloud/talent/v4/job_service.proto

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import "google/cloud/talent/v4/filters.proto";
2525
import "google/cloud/talent/v4/histogram.proto";
2626
import "google/cloud/talent/v4/job.proto";
2727
import "google/longrunning/operations.proto";
28+
import "google/protobuf/any.proto";
2829
import "google/protobuf/duration.proto";
2930
import "google/protobuf/empty.proto";
3031
import "google/protobuf/field_mask.proto";
@@ -126,6 +127,24 @@ service JobService {
126127
};
127128
}
128129

130+
// Purges all jobs associated with requested target.
131+
//
132+
// Note: Jobs in OPEN status remain searchable until the operation completes.
133+
//
134+
// Note: The operation returned may take hours or longer to complete,
135+
// depending on the number of jobs that need to be deleted.
136+
rpc PurgeJobs(PurgeJobsRequest) returns (google.longrunning.Operation) {
137+
option (google.api.http) = {
138+
post: "/v4/{parent=projects/*}/jobs:purge"
139+
body: "*"
140+
};
141+
option (google.api.method_signature) = "parent,filter";
142+
option (google.longrunning.operation_info) = {
143+
response_type: "PurgeJobsResponse"
144+
metadata_type: "BatchOperationMetadata"
145+
};
146+
}
147+
129148
// Lists jobs by filter.
130149
rpc ListJobs(ListJobsRequest) returns (ListJobsResponse) {
131150
option (google.api.http) = {
@@ -710,6 +729,12 @@ message SearchJobsRequest {
710729
// score (determined by API algorithm).
711730
CustomRankingInfo custom_ranking_info = 14;
712731

732+
// Controls whether to add search debug information
733+
// (sortExpr, partial expressions) into SearchResponse.
734+
//
735+
// Defaults to false.
736+
bool enable_debug_info = 15;
737+
713738
// This field is deprecated. Please use
714739
// [SearchJobsRequest.keyword_match_mode][google.cloud.talent.v4.SearchJobsRequest.keyword_match_mode] going forward.
715740
//
@@ -745,6 +770,10 @@ message SearchJobsRequest {
745770
// Defaults to [KeywordMatchMode.KEYWORD_MATCH_ALL][google.cloud.talent.v4.SearchJobsRequest.KeywordMatchMode.KEYWORD_MATCH_ALL] if no value
746771
// is specified.
747772
KeywordMatchMode keyword_match_mode = 18;
773+
774+
// This field allows us to pass in a MendelDebugInput proto to force mendel
775+
// experiment traffic in FORCEABLE experiments.
776+
google.protobuf.Any mendel_debug_input = 17;
748777
}
749778

750779
// Response for SearchJob method.
@@ -772,6 +801,8 @@ message SearchJobsResponse {
772801
// Commute information which is generated based on specified
773802
// [CommuteFilter][google.cloud.talent.v4.CommuteFilter].
774803
CommuteInfo commute_info = 5;
804+
805+
string debug_info = 6;
775806
}
776807

777808
// Commute details related to this job.
@@ -902,6 +933,39 @@ message BatchDeleteJobsRequest {
902933
}];
903934
}
904935

936+
// Request to purge a set of jobs.
937+
message PurgeJobsRequest {
938+
// Required. The resource name of the project under which the jobs should be deleted.
939+
//
940+
// The format is "projects/{project_id}". For example, "projects/foo".
941+
string parent = 1 [
942+
(google.api.field_behavior) = REQUIRED,
943+
(google.api.resource_reference) = {
944+
type: "cloudresourcemanager.googleapis.com/Project"
945+
}
946+
];
947+
948+
// Required. A filter matching the jobs to be purged.
949+
//
950+
// The filter can be one of the following three parent resources.
951+
// 1. Company. Resource name of the company under which all the jobs should be
952+
// deleted. The format is
953+
// "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}". For
954+
// example, "projects/foo/tenants/bar/companies/baz"
955+
// 2. Tenant. Resource name of the tenant under which all the jobs should be
956+
// deleted. The format is "projects/{project_id}/tenants/{tenant_id}". For
957+
// example, "projects/foo/tenants/bar".
958+
// 3. Project. Resource name of the project under which all the jobs should be
959+
// deleted. The format is "projects/{project_id}". For example,
960+
// "projects/foo/".
961+
string filter = 2 [(google.api.field_behavior) = REQUIRED];
962+
963+
// Actually perform the purge.
964+
// If `force` is set to false, the method will return a sample of
965+
// resource names that will be deleted.
966+
bool force = 3;
967+
}
968+
905969
// Mutation result of a job from a batch operation.
906970
message JobResult {
907971
// Here [Job][google.cloud.talent.v4.Job] only contains basic information including [name][google.cloud.talent.v4.Job.name],
@@ -938,3 +1002,27 @@ message BatchDeleteJobsResponse {
9381002
// until operation status is FINISHED, FAILED or CANCELLED.
9391003
repeated JobResult job_results = 1;
9401004
}
1005+
1006+
// The result of [JobService.PurgeJobs][google.cloud.talent.v4.JobService.PurgeJobs]. It's used to
1007+
// replace [google.longrunning.Operation.response][google.longrunning.Operation.response] in case of success.
1008+
message PurgeJobsResponse {
1009+
// The number of jobs that this request deleted (or, if `force` is false,
1010+
// the number of jobs that will be deleted).
1011+
//
1012+
// Note: This number isn't guaranteed to be accurate.
1013+
// Note: This number might change until operation status is FINISHED, FAILED
1014+
// or CANCELLED.
1015+
int32 purge_count = 1;
1016+
1017+
// A sample of the resource names of jobs that will be deleted.
1018+
// Only populated if `force` is set to false.
1019+
// At most 100 job names are returned as a sample.
1020+
repeated string purge_sample = 2;
1021+
1022+
// List of job purge results from a purge jobs operation.
1023+
// Only populated if `force` is set to true.
1024+
//
1025+
// Note: This may change until operation status is FINISHED, FAILED or
1026+
// CANCELLED.
1027+
repeated JobResult job_results = 3;
1028+
}

google/cloud/talent/v4/jobs_v4.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ types:
1616
- name: google.cloud.talent.v4.BatchDeleteJobsResponse
1717
- name: google.cloud.talent.v4.BatchOperationMetadata
1818
- name: google.cloud.talent.v4.BatchUpdateJobsResponse
19+
- name: google.cloud.talent.v4.PurgeJobsResponse
1920

2021
documentation:
2122
summary: |-

0 commit comments

Comments
 (0)