profile_service.proto 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467
  1. // Copyright 2020 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. syntax = "proto3";
  15. package google.cloud.talent.v4beta1;
  16. import "google/api/annotations.proto";
  17. import "google/api/client.proto";
  18. import "google/api/field_behavior.proto";
  19. import "google/api/resource.proto";
  20. import "google/cloud/talent/v4beta1/common.proto";
  21. import "google/cloud/talent/v4beta1/filters.proto";
  22. import "google/cloud/talent/v4beta1/histogram.proto";
  23. import "google/cloud/talent/v4beta1/profile.proto";
  24. import "google/longrunning/operations.proto";
  25. import "google/protobuf/any.proto";
  26. import "google/protobuf/empty.proto";
  27. import "google/protobuf/field_mask.proto";
  28. import "google/rpc/status.proto";
  29. option go_package = "google.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent";
  30. option java_multiple_files = true;
  31. option java_outer_classname = "ProfileServiceProto";
  32. option java_package = "com.google.cloud.talent.v4beta1";
  33. option objc_class_prefix = "CTS";
  34. // A service that handles profile management, including profile CRUD,
  35. // enumeration and search.
  36. service ProfileService {
  37. option (google.api.default_host) = "jobs.googleapis.com";
  38. option (google.api.oauth_scopes) =
  39. "https://www.googleapis.com/auth/cloud-platform,"
  40. "https://www.googleapis.com/auth/jobs";
  41. // Lists profiles by filter. The order is unspecified.
  42. rpc ListProfiles(ListProfilesRequest) returns (ListProfilesResponse) {
  43. option (google.api.http) = {
  44. get: "/v4beta1/{parent=projects/*/tenants/*}/profiles"
  45. };
  46. option (google.api.method_signature) = "parent";
  47. }
  48. // Creates and returns a new profile.
  49. rpc CreateProfile(CreateProfileRequest) returns (Profile) {
  50. option (google.api.http) = {
  51. post: "/v4beta1/{parent=projects/*/tenants/*}/profiles"
  52. body: "*"
  53. };
  54. option (google.api.method_signature) = "parent,profile";
  55. }
  56. // Gets the specified profile.
  57. rpc GetProfile(GetProfileRequest) returns (Profile) {
  58. option (google.api.http) = {
  59. get: "/v4beta1/{name=projects/*/tenants/*/profiles/*}"
  60. };
  61. option (google.api.method_signature) = "name";
  62. }
  63. // Updates the specified profile and returns the updated result.
  64. rpc UpdateProfile(UpdateProfileRequest) returns (Profile) {
  65. option (google.api.http) = {
  66. patch: "/v4beta1/{profile.name=projects/*/tenants/*/profiles/*}"
  67. body: "*"
  68. };
  69. option (google.api.method_signature) = "profile";
  70. }
  71. // Deletes the specified profile.
  72. // Prerequisite: The profile has no associated applications or assignments
  73. // associated.
  74. rpc DeleteProfile(DeleteProfileRequest) returns (google.protobuf.Empty) {
  75. option (google.api.http) = {
  76. delete: "/v4beta1/{name=projects/*/tenants/*/profiles/*}"
  77. };
  78. option (google.api.method_signature) = "name";
  79. }
  80. // Searches for profiles within a tenant.
  81. //
  82. // For example, search by raw queries "software engineer in Mountain View" or
  83. // search by structured filters (location filter, education filter, etc.).
  84. //
  85. // See [SearchProfilesRequest][google.cloud.talent.v4beta1.SearchProfilesRequest] for more information.
  86. rpc SearchProfiles(SearchProfilesRequest) returns (SearchProfilesResponse) {
  87. option (google.api.http) = {
  88. post: "/v4beta1/{parent=projects/*/tenants/*}:search"
  89. body: "*"
  90. };
  91. }
  92. }
  93. // List profiles request.
  94. message ListProfilesRequest {
  95. // Required. The resource name of the tenant under which the profile is created.
  96. //
  97. // The format is "projects/{project_id}/tenants/{tenant_id}". For example,
  98. // "projects/foo/tenants/bar".
  99. string parent = 1 [
  100. (google.api.field_behavior) = REQUIRED,
  101. (google.api.resource_reference) = {
  102. child_type: "jobs.googleapis.com/Profile"
  103. }
  104. ];
  105. // The filter string specifies the profiles to be enumerated.
  106. //
  107. // Supported operator: =, AND
  108. //
  109. // The field(s) eligible for filtering are:
  110. //
  111. // * `externalId`
  112. // * `groupId`
  113. //
  114. // externalId and groupId cannot be specified at the same time. If both
  115. // externalId and groupId are provided, the API will return a bad request
  116. // error.
  117. //
  118. // Sample Query:
  119. //
  120. // * externalId = "externalId-1"
  121. // * groupId = "groupId-1"
  122. string filter = 5;
  123. // The token that specifies the current offset (that is, starting result).
  124. //
  125. // Please set the value to [ListProfilesResponse.next_page_token][google.cloud.talent.v4beta1.ListProfilesResponse.next_page_token] to
  126. // continue the list.
  127. string page_token = 2;
  128. // The maximum number of profiles to be returned, at most 100.
  129. //
  130. // Default is 100 unless a positive number smaller than 100 is specified.
  131. int32 page_size = 3;
  132. // A field mask to specify the profile fields to be listed in response.
  133. // All fields are listed if it is unset.
  134. //
  135. // Valid values are:
  136. //
  137. // * name
  138. google.protobuf.FieldMask read_mask = 4;
  139. }
  140. // The List profiles response object.
  141. message ListProfilesResponse {
  142. // Profiles for the specific tenant.
  143. repeated Profile profiles = 1;
  144. // A token to retrieve the next page of results. This is empty if there are no
  145. // more results.
  146. string next_page_token = 2;
  147. }
  148. // Create profile request.
  149. message CreateProfileRequest {
  150. // Required. The name of the tenant this profile belongs to.
  151. //
  152. // The format is "projects/{project_id}/tenants/{tenant_id}". For example,
  153. // "projects/foo/tenants/bar".
  154. string parent = 1 [
  155. (google.api.field_behavior) = REQUIRED,
  156. (google.api.resource_reference) = {
  157. type: "jobs.googleapis.com/Tenant"
  158. }
  159. ];
  160. // Required. The profile to be created.
  161. Profile profile = 2 [(google.api.field_behavior) = REQUIRED];
  162. }
  163. // Get profile request.
  164. message GetProfileRequest {
  165. // Required. Resource name of the profile to get.
  166. //
  167. // The format is
  168. // "projects/{project_id}/tenants/{tenant_id}/profiles/{profile_id}". For
  169. // example, "projects/foo/tenants/bar/profiles/baz".
  170. string name = 1 [
  171. (google.api.field_behavior) = REQUIRED,
  172. (google.api.resource_reference) = {
  173. type: "jobs.googleapis.com/Profile"
  174. }
  175. ];
  176. }
  177. // Update profile request
  178. message UpdateProfileRequest {
  179. // Required. Profile to be updated.
  180. Profile profile = 1 [(google.api.field_behavior) = REQUIRED];
  181. // A field mask to specify the profile fields to update.
  182. //
  183. // A full update is performed if it is unset.
  184. google.protobuf.FieldMask update_mask = 2;
  185. }
  186. // Delete profile request.
  187. message DeleteProfileRequest {
  188. // Required. Resource name of the profile to be deleted.
  189. //
  190. // The format is
  191. // "projects/{project_id}/tenants/{tenant_id}/profiles/{profile_id}". For
  192. // example, "projects/foo/tenants/bar/profiles/baz".
  193. string name = 1 [
  194. (google.api.field_behavior) = REQUIRED,
  195. (google.api.resource_reference) = {
  196. type: "jobs.googleapis.com/Profile"
  197. }
  198. ];
  199. }
  200. // The request body of the `SearchProfiles` call.
  201. message SearchProfilesRequest {
  202. // Required. The resource name of the tenant to search within.
  203. //
  204. // The format is "projects/{project_id}/tenants/{tenant_id}". For example,
  205. // "projects/foo/tenants/bar".
  206. string parent = 1 [
  207. (google.api.field_behavior) = REQUIRED,
  208. (google.api.resource_reference) = {
  209. type: "jobs.googleapis.com/Tenant"
  210. }
  211. ];
  212. // Required. The meta information collected about the profile search user. This is used
  213. // to improve the search quality of the service. These values are provided by
  214. // users, and must be precise and consistent.
  215. RequestMetadata request_metadata = 2 [(google.api.field_behavior) = REQUIRED];
  216. // Search query to execute. See [ProfileQuery][google.cloud.talent.v4beta1.ProfileQuery] for more details.
  217. ProfileQuery profile_query = 3;
  218. // A limit on the number of profiles returned in the search results.
  219. // A value above the default value 10 can increase search response time.
  220. //
  221. // The maximum value allowed is 100. Otherwise an error is thrown.
  222. int32 page_size = 4;
  223. // The pageToken, similar to offset enables users of the API to paginate
  224. // through the search results. To retrieve the first page of results, set the
  225. // pageToken to empty. The search response includes a
  226. // [nextPageToken][google.cloud.talent.v4beta1.SearchProfilesResponse.next_page_token] field that can be
  227. // used to populate the pageToken field for the next page of results. Using
  228. // pageToken instead of offset increases the performance of the API,
  229. // especially compared to larger offset values.
  230. string page_token = 5;
  231. // An integer that specifies the current offset (that is, starting result) in
  232. // search results. This field is only considered if [page_token][google.cloud.talent.v4beta1.SearchProfilesRequest.page_token] is unset.
  233. //
  234. // The maximum allowed value is 5000. Otherwise an error is thrown.
  235. //
  236. // For example, 0 means to search from the first profile, and 10 means to
  237. // search from the 11th profile. This can be used for pagination, for example
  238. // pageSize = 10 and offset = 10 means to search from the second page.
  239. int32 offset = 6;
  240. // This flag controls the spell-check feature. If `false`, the
  241. // service attempts to correct a misspelled query.
  242. //
  243. // For example, "enginee" is corrected to "engineer".
  244. bool disable_spell_check = 7;
  245. // The criteria that determines how search results are sorted.
  246. // Defaults is "relevance desc" if no value is specified.
  247. //
  248. // Supported options are:
  249. //
  250. // * "relevance desc": By descending relevance, as determined by the API
  251. // algorithms.
  252. // * "update_date desc": Sort by [Profile.update_time][google.cloud.talent.v4beta1.Profile.update_time] in descending order
  253. // (recently updated profiles first).
  254. // * "create_date desc": Sort by [Profile.create_time][google.cloud.talent.v4beta1.Profile.create_time] in descending order
  255. // (recently created profiles first).
  256. // * "first_name": Sort by [PersonName.PersonStructuredName.given_name][google.cloud.talent.v4beta1.PersonName.PersonStructuredName.given_name] in
  257. // ascending order.
  258. // * "first_name desc": Sort by [PersonName.PersonStructuredName.given_name][google.cloud.talent.v4beta1.PersonName.PersonStructuredName.given_name]
  259. // in descending order.
  260. // * "last_name": Sort by [PersonName.PersonStructuredName.family_name][google.cloud.talent.v4beta1.PersonName.PersonStructuredName.family_name] in
  261. // ascending order.
  262. // * "last_name desc": Sort by [PersonName.PersonStructuredName.family_name][google.cloud.talent.v4beta1.PersonName.PersonStructuredName.family_name]
  263. // in ascending order.
  264. string order_by = 8;
  265. // When sort by field is based on alphabetical order, sort values case
  266. // sensitively (based on ASCII) when the value is set to true. Default value
  267. // is case in-sensitive sort (false).
  268. bool case_sensitive_sort = 9;
  269. // A list of expressions specifies histogram requests against matching
  270. // profiles for [SearchProfilesRequest][google.cloud.talent.v4beta1.SearchProfilesRequest].
  271. //
  272. // The expression syntax looks like a function definition with parameters.
  273. //
  274. // Function syntax: function_name(histogram_facet[, list of buckets])
  275. //
  276. // Data types:
  277. //
  278. // * Histogram facet: facet names with format [a-zA-Z][a-zA-Z0-9_]+.
  279. // * String: string like "any string with backslash escape for quote(\")."
  280. // * Number: whole number and floating point number like 10, -1 and -0.01.
  281. // * List: list of elements with comma(,) separator surrounded by square
  282. // brackets. For example, [1, 2, 3] and ["one", "two", "three"].
  283. //
  284. // Built-in constants:
  285. //
  286. // * MIN (minimum number similar to java Double.MIN_VALUE)
  287. // * MAX (maximum number similar to java Double.MAX_VALUE)
  288. //
  289. // Built-in functions:
  290. //
  291. // * bucket(start, end[, label])
  292. // Bucket build-in function creates a bucket with range of [start, end). Note
  293. // that the end is exclusive.
  294. // For example, bucket(1, MAX, "positive number") or bucket(1, 10).
  295. //
  296. // Histogram Facets:
  297. //
  298. // * admin1: Admin1 is a global placeholder for referring to state, province,
  299. // or the particular term a country uses to define the geographic structure
  300. // below the country level. Examples include states codes such as "CA", "IL",
  301. // "NY", and provinces, such as "BC".
  302. // * locality: Locality is a global placeholder for referring to city, town,
  303. // or the particular term a country uses to define the geographic structure
  304. // below the admin1 level. Examples include city names such as
  305. // "Mountain View" and "New York".
  306. // * extended_locality: Extended locality is concatenated version of admin1
  307. // and locality with comma separator. For example, "Mountain View, CA" and
  308. // "New York, NY".
  309. // * postal_code: Postal code of profile which follows locale code.
  310. // * country: Country code (ISO-3166-1 alpha-2 code) of profile, such as US,
  311. // JP, GB.
  312. // * job_title: Normalized job titles specified in EmploymentHistory.
  313. // * company_name: Normalized company name of profiles to match on.
  314. // * institution: The school name. For example, "MIT",
  315. // "University of California, Berkeley"
  316. // * degree: Highest education degree in ISCED code. Each value in degree
  317. // covers a specific level of education, without any expansion to upper nor
  318. // lower levels of education degree.
  319. // * experience_in_months: experience in months. 0 means 0 month to 1 month
  320. // (exclusive).
  321. // * application_date: The application date specifies application start dates.
  322. // See [ApplicationDateFilter][google.cloud.talent.v4beta1.ApplicationDateFilter] for more details.
  323. // * application_outcome_notes: The application outcome reason specifies the
  324. // reasons behind the outcome of the job application.
  325. // See [ApplicationOutcomeNotesFilter][google.cloud.talent.v4beta1.ApplicationOutcomeNotesFilter] for more details.
  326. // * application_job_title: The application job title specifies the job
  327. // applied for in the application.
  328. // See [ApplicationJobFilter][google.cloud.talent.v4beta1.ApplicationJobFilter] for more details.
  329. // * hirable_status: Hirable status specifies the profile's hirable status.
  330. // * string_custom_attribute: String custom attributes. Values can be accessed
  331. // via square bracket notation like string_custom_attribute["key1"].
  332. // * numeric_custom_attribute: Numeric custom attributes. Values can be
  333. // accessed via square bracket notation like numeric_custom_attribute["key1"].
  334. //
  335. // Example expressions:
  336. //
  337. // * count(admin1)
  338. // * count(experience_in_months, [bucket(0, 12, "1 year"),
  339. // bucket(12, 36, "1-3 years"), bucket(36, MAX, "3+ years")])
  340. // * count(string_custom_attribute["assigned_recruiter"])
  341. // * count(numeric_custom_attribute["favorite_number"],
  342. // [bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative")])
  343. repeated HistogramQuery histogram_queries = 10;
  344. // An id that uniquely identifies the result set of a
  345. // [SearchProfiles][google.cloud.talent.v4beta1.ProfileService.SearchProfiles] call. The id should be
  346. // retrieved from the
  347. // [SearchProfilesResponse][google.cloud.talent.v4beta1.SearchProfilesResponse] message returned from a previous
  348. // invocation of [SearchProfiles][google.cloud.talent.v4beta1.ProfileService.SearchProfiles].
  349. //
  350. // A result set is an ordered list of search results.
  351. //
  352. // If this field is not set, a new result set is computed based on the
  353. // [profile_query][google.cloud.talent.v4beta1.SearchProfilesRequest.profile_query]. A new [result_set_id][google.cloud.talent.v4beta1.SearchProfilesRequest.result_set_id] is returned as a handle to
  354. // access this result set.
  355. //
  356. // If this field is set, the service will ignore the resource and
  357. // [profile_query][google.cloud.talent.v4beta1.SearchProfilesRequest.profile_query] values, and simply retrieve a page of results from the
  358. // corresponding result set. In this case, one and only one of [page_token][google.cloud.talent.v4beta1.SearchProfilesRequest.page_token]
  359. // or [offset][google.cloud.talent.v4beta1.SearchProfilesRequest.offset] must be set.
  360. //
  361. // A typical use case is to invoke [SearchProfilesRequest][google.cloud.talent.v4beta1.SearchProfilesRequest] without this
  362. // field, then use the resulting [result_set_id][google.cloud.talent.v4beta1.SearchProfilesRequest.result_set_id] in
  363. // [SearchProfilesResponse][google.cloud.talent.v4beta1.SearchProfilesResponse] to page through the results.
  364. string result_set_id = 12;
  365. // This flag is used to indicate whether the service will attempt to
  366. // understand synonyms and terms related to the search query or treat the
  367. // query "as is" when it generates a set of results. By default this flag is
  368. // set to false, thus allowing expanded results to also be returned. For
  369. // example a search for "software engineer" might also return candidates who
  370. // have experience in jobs similar to software engineer positions. By setting
  371. // this flag to true, the service will only attempt to deliver candidates has
  372. // software engineer in his/her global fields by treating "software engineer"
  373. // as a keyword.
  374. //
  375. // It is recommended to provide a feature in the UI (such as a checkbox) to
  376. // allow recruiters to set this flag to true if they intend to search for
  377. // longer boolean strings.
  378. bool strict_keywords_search = 13;
  379. }
  380. // Response of SearchProfiles method.
  381. message SearchProfilesResponse {
  382. // An estimation of the number of profiles that match the specified query.
  383. //
  384. // This number isn't guaranteed to be accurate.
  385. int64 estimated_total_size = 1;
  386. // The spell checking result, and correction.
  387. SpellingCorrection spell_correction = 2;
  388. // Additional information for the API invocation, such as the request
  389. // tracking id.
  390. ResponseMetadata metadata = 3;
  391. // A token to retrieve the next page of results. This is empty if there are no
  392. // more results.
  393. string next_page_token = 4;
  394. // The histogram results that match with specified
  395. // [SearchProfilesRequest.histogram_queries][google.cloud.talent.v4beta1.SearchProfilesRequest.histogram_queries].
  396. repeated HistogramQueryResult histogram_query_results = 5;
  397. // The profile entities that match the specified [SearchProfilesRequest][google.cloud.talent.v4beta1.SearchProfilesRequest].
  398. repeated SummarizedProfile summarized_profiles = 6;
  399. // An id that uniquely identifies the result set of a
  400. // [SearchProfiles][google.cloud.talent.v4beta1.ProfileService.SearchProfiles] call for consistent
  401. // results.
  402. string result_set_id = 7;
  403. }
  404. // Profile entry with metadata inside [SearchProfilesResponse][google.cloud.talent.v4beta1.SearchProfilesResponse].
  405. message SummarizedProfile {
  406. // A list of profiles that are linked by [Profile.group_id][google.cloud.talent.v4beta1.Profile.group_id].
  407. repeated Profile profiles = 1;
  408. // A profile summary shows the profile summary and how the profile matches the
  409. // search query.
  410. //
  411. // In profile summary, the profiles with the same [Profile.group_id][google.cloud.talent.v4beta1.Profile.group_id] are
  412. // merged together. Among profiles, same education/employment records may be
  413. // slightly different but they are merged into one with best efforts.
  414. //
  415. // For example, in one profile the school name is "UC Berkeley" and the field
  416. // study is "Computer Science" and in another one the school name is
  417. // "University of California at Berkeley" and the field study is "CS". The API
  418. // merges these two inputs into one and selects one value for each field. For
  419. // example, the school name in summary is set to "University of California at
  420. // Berkeley" and the field of study is set to "Computer Science".
  421. Profile summary = 2;
  422. }