completion_service.proto 5.9 KB

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