company_service.proto 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  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. import "google/cloud/talent/v4beta1/company.proto";
  22. import "google/protobuf/empty.proto";
  23. import "google/protobuf/field_mask.proto";
  24. option go_package = "google.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent";
  25. option java_multiple_files = true;
  26. option java_outer_classname = "CompanyServiceProto";
  27. option java_package = "com.google.cloud.talent.v4beta1";
  28. option objc_class_prefix = "CTS";
  29. // A service that handles company management, including CRUD and enumeration.
  30. service CompanyService {
  31. option (google.api.default_host) = "jobs.googleapis.com";
  32. option (google.api.oauth_scopes) =
  33. "https://www.googleapis.com/auth/cloud-platform,"
  34. "https://www.googleapis.com/auth/jobs";
  35. // Creates a new company entity.
  36. rpc CreateCompany(CreateCompanyRequest) returns (Company) {
  37. option (google.api.http) = {
  38. post: "/v4beta1/{parent=projects/*/tenants/*}/companies"
  39. body: "*"
  40. additional_bindings {
  41. post: "/v4beta1/{parent=projects/*}/companies"
  42. body: "*"
  43. }
  44. };
  45. option (google.api.method_signature) = "parent,company";
  46. }
  47. // Retrieves specified company.
  48. rpc GetCompany(GetCompanyRequest) returns (Company) {
  49. option (google.api.http) = {
  50. get: "/v4beta1/{name=projects/*/tenants/*/companies/*}"
  51. additional_bindings {
  52. get: "/v4beta1/{name=projects/*/companies/*}"
  53. }
  54. };
  55. option (google.api.method_signature) = "name";
  56. }
  57. // Updates specified company.
  58. rpc UpdateCompany(UpdateCompanyRequest) returns (Company) {
  59. option (google.api.http) = {
  60. patch: "/v4beta1/{company.name=projects/*/tenants/*/companies/*}"
  61. body: "*"
  62. additional_bindings {
  63. patch: "/v4beta1/{company.name=projects/*/companies/*}"
  64. body: "*"
  65. }
  66. };
  67. option (google.api.method_signature) = "company";
  68. }
  69. // Deletes specified company.
  70. // Prerequisite: The company has no jobs associated with it.
  71. rpc DeleteCompany(DeleteCompanyRequest) returns (google.protobuf.Empty) {
  72. option (google.api.http) = {
  73. delete: "/v4beta1/{name=projects/*/tenants/*/companies/*}"
  74. additional_bindings {
  75. delete: "/v4beta1/{name=projects/*/companies/*}"
  76. }
  77. };
  78. option (google.api.method_signature) = "name";
  79. }
  80. // Lists all companies associated with the project.
  81. rpc ListCompanies(ListCompaniesRequest) returns (ListCompaniesResponse) {
  82. option (google.api.http) = {
  83. get: "/v4beta1/{parent=projects/*/tenants/*}/companies"
  84. additional_bindings {
  85. get: "/v4beta1/{parent=projects/*}/companies"
  86. }
  87. };
  88. option (google.api.method_signature) = "parent";
  89. }
  90. }
  91. // The Request of the CreateCompany method.
  92. message CreateCompanyRequest {
  93. // Required. Resource name of the tenant under which the company is created.
  94. //
  95. // The format is "projects/{project_id}/tenants/{tenant_id}", for example,
  96. // "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant
  97. // is created, for example, "projects/foo".
  98. string parent = 1 [
  99. (google.api.field_behavior) = REQUIRED,
  100. (google.api.resource_reference) = {
  101. child_type: "jobs.googleapis.com/Company"
  102. }
  103. ];
  104. // Required. The company to be created.
  105. Company company = 2 [(google.api.field_behavior) = REQUIRED];
  106. }
  107. // Request for getting a company by name.
  108. message GetCompanyRequest {
  109. // Required. The resource name of the company to be retrieved.
  110. //
  111. // The format is
  112. // "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}", for
  113. // example, "projects/api-test-project/tenants/foo/companies/bar".
  114. //
  115. // If tenant id is unspecified, the default tenant is used, for
  116. // example, "projects/api-test-project/companies/bar".
  117. string name = 1 [
  118. (google.api.field_behavior) = REQUIRED,
  119. (google.api.resource_reference) = {
  120. type: "jobs.googleapis.com/Company"
  121. }
  122. ];
  123. }
  124. // Request for updating a specified company.
  125. message UpdateCompanyRequest {
  126. // Required. The company resource to replace the current resource in the system.
  127. Company company = 1 [(google.api.field_behavior) = REQUIRED];
  128. // Strongly recommended for the best service experience.
  129. //
  130. // If [update_mask][google.cloud.talent.v4beta1.UpdateCompanyRequest.update_mask] is provided, only the specified fields in
  131. // [company][google.cloud.talent.v4beta1.UpdateCompanyRequest.company] are updated. Otherwise all the fields are updated.
  132. //
  133. // A field mask to specify the company fields to be updated. Only
  134. // top level fields of [Company][google.cloud.talent.v4beta1.Company] are supported.
  135. google.protobuf.FieldMask update_mask = 2;
  136. }
  137. // Request to delete a company.
  138. message DeleteCompanyRequest {
  139. // Required. The resource name of the company to be deleted.
  140. //
  141. // The format is
  142. // "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}", for
  143. // example, "projects/foo/tenants/bar/companies/baz".
  144. //
  145. // If tenant id is unspecified, the default tenant is used, for
  146. // example, "projects/foo/companies/bar".
  147. string name = 1 [
  148. (google.api.field_behavior) = REQUIRED,
  149. (google.api.resource_reference) = {
  150. type: "jobs.googleapis.com/Company"
  151. }
  152. ];
  153. }
  154. // List companies for which the client has ACL visibility.
  155. message ListCompaniesRequest {
  156. // Required. Resource name of the tenant under which the company is created.
  157. //
  158. // The format is "projects/{project_id}/tenants/{tenant_id}", for example,
  159. // "projects/foo/tenant/bar".
  160. //
  161. // If tenant id is unspecified, the default tenant will be used, for
  162. // example, "projects/foo".
  163. string parent = 1 [
  164. (google.api.field_behavior) = REQUIRED,
  165. (google.api.resource_reference) = {
  166. child_type: "jobs.googleapis.com/Company"
  167. }
  168. ];
  169. // The starting indicator from which to return results.
  170. string page_token = 2;
  171. // The maximum number of companies to be returned, at most 100.
  172. // Default is 100 if a non-positive number is provided.
  173. int32 page_size = 3;
  174. // Set to true if the companies requested must have open jobs.
  175. //
  176. // Defaults to false.
  177. //
  178. // If true, at most [page_size][google.cloud.talent.v4beta1.ListCompaniesRequest.page_size] of companies are fetched, among which
  179. // only those with open jobs are returned.
  180. bool require_open_jobs = 4;
  181. }
  182. // The List companies response object.
  183. message ListCompaniesResponse {
  184. // Companies for the current client.
  185. repeated Company companies = 1;
  186. // A token to retrieve the next page of results.
  187. string next_page_token = 2;
  188. // Additional information for the API invocation, such as the request
  189. // tracking id.
  190. ResponseMetadata metadata = 3;
  191. }