company_service.proto 6.3 KB

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