completion_service.proto 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. // Copyright 2022 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.v4;
  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/v4/common.proto";
  21. option go_package = "google.golang.org/genproto/googleapis/cloud/talent/v4;talent";
  22. option java_multiple_files = true;
  23. option java_outer_classname = "CompletionServiceProto";
  24. option java_package = "com.google.cloud.talent.v4";
  25. option objc_class_prefix = "CTS";
  26. // A service handles auto completion.
  27. service Completion {
  28. option (google.api.default_host) = "jobs.googleapis.com";
  29. option (google.api.oauth_scopes) =
  30. "https://www.googleapis.com/auth/cloud-platform,"
  31. "https://www.googleapis.com/auth/jobs";
  32. // Completes the specified prefix with keyword suggestions.
  33. // Intended for use by a job search auto-complete search box.
  34. rpc CompleteQuery(CompleteQueryRequest) returns (CompleteQueryResponse) {
  35. option (google.api.http) = {
  36. get: "/v4/{tenant=projects/*/tenants/*}:completeQuery"
  37. };
  38. }
  39. }
  40. // Auto-complete parameters.
  41. message CompleteQueryRequest {
  42. // Enum to specify the scope of completion.
  43. enum CompletionScope {
  44. // Default value.
  45. COMPLETION_SCOPE_UNSPECIFIED = 0;
  46. // Suggestions are based only on the data provided by the client.
  47. TENANT = 1;
  48. // Suggestions are based on all jobs data in the system that's visible to
  49. // the client
  50. PUBLIC = 2;
  51. }
  52. // Enum to specify auto-completion topics.
  53. enum CompletionType {
  54. // Default value.
  55. COMPLETION_TYPE_UNSPECIFIED = 0;
  56. // Suggest job titles for jobs autocomplete.
  57. //
  58. // For [CompletionType.JOB_TITLE][google.cloud.talent.v4.CompleteQueryRequest.CompletionType.JOB_TITLE] type, only open jobs with the same
  59. // [language_codes][google.cloud.talent.v4.CompleteQueryRequest.language_codes] are returned.
  60. JOB_TITLE = 1;
  61. // Suggest company names for jobs autocomplete.
  62. //
  63. // For [CompletionType.COMPANY_NAME][google.cloud.talent.v4.CompleteQueryRequest.CompletionType.COMPANY_NAME] type,
  64. // only companies having open jobs with the same [language_codes][google.cloud.talent.v4.CompleteQueryRequest.language_codes] are
  65. // returned.
  66. COMPANY_NAME = 2;
  67. // Suggest both job titles and company names for jobs autocomplete.
  68. //
  69. // For [CompletionType.COMBINED][google.cloud.talent.v4.CompleteQueryRequest.CompletionType.COMBINED] type, only open jobs with the same
  70. // [language_codes][google.cloud.talent.v4.CompleteQueryRequest.language_codes] or companies having open jobs with the same
  71. // [language_codes][google.cloud.talent.v4.CompleteQueryRequest.language_codes] are returned.
  72. COMBINED = 3;
  73. }
  74. // Required. Resource name of tenant the completion is performed within.
  75. //
  76. // The format is "projects/{project_id}/tenants/{tenant_id}", for example,
  77. // "projects/foo/tenants/bar".
  78. string tenant = 1 [
  79. (google.api.field_behavior) = REQUIRED,
  80. (google.api.resource_reference) = {
  81. type: "jobs.googleapis.com/Tenant"
  82. }
  83. ];
  84. // Required. The query used to generate suggestions.
  85. //
  86. // The maximum number of allowed characters is 255.
  87. string query = 2 [(google.api.field_behavior) = REQUIRED];
  88. // The list of languages of the query. This is
  89. // the BCP-47 language code, such as "en-US" or "sr-Latn".
  90. // For more information, see
  91. // [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47).
  92. //
  93. // The maximum number of allowed characters is 255.
  94. repeated string language_codes = 3;
  95. // Required. Completion result count.
  96. //
  97. // The maximum allowed page size is 10.
  98. int32 page_size = 4 [(google.api.field_behavior) = REQUIRED];
  99. // If provided, restricts completion to specified company.
  100. //
  101. // The format is
  102. // "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}", for
  103. // example, "projects/foo/tenants/bar/companies/baz".
  104. string company = 5 [(google.api.resource_reference) = {
  105. type: "jobs.googleapis.com/Company"
  106. }];
  107. // The scope of the completion. The defaults is [CompletionScope.PUBLIC][google.cloud.talent.v4.CompleteQueryRequest.CompletionScope.PUBLIC].
  108. CompletionScope scope = 6;
  109. // The completion topic. The default is [CompletionType.COMBINED][google.cloud.talent.v4.CompleteQueryRequest.CompletionType.COMBINED].
  110. CompletionType type = 7;
  111. }
  112. // Response of auto-complete query.
  113. message CompleteQueryResponse {
  114. // Resource that represents completion results.
  115. message CompletionResult {
  116. // The suggestion for the query.
  117. string suggestion = 1;
  118. // The completion topic.
  119. CompleteQueryRequest.CompletionType type = 2;
  120. // The URI of the company image for
  121. // [COMPANY_NAME][google.cloud.talent.v4.CompleteQueryRequest.CompletionType.COMPANY_NAME].
  122. string image_uri = 3;
  123. }
  124. // Results of the matching job/company candidates.
  125. repeated CompletionResult completion_results = 1;
  126. // Additional information for the API invocation, such as the request
  127. // tracking id.
  128. ResponseMetadata metadata = 2;
  129. }