tenant_service.proto 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  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/tenant.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 = "TenantServiceProto";
  27. option java_package = "com.google.cloud.talent.v4beta1";
  28. option objc_class_prefix = "CTS";
  29. // A service that handles tenant management, including CRUD and enumeration.
  30. service TenantService {
  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 tenant entity.
  36. rpc CreateTenant(CreateTenantRequest) returns (Tenant) {
  37. option (google.api.http) = {
  38. post: "/v4beta1/{parent=projects/*}/tenants"
  39. body: "*"
  40. };
  41. option (google.api.method_signature) = "parent,tenant";
  42. }
  43. // Retrieves specified tenant.
  44. rpc GetTenant(GetTenantRequest) returns (Tenant) {
  45. option (google.api.http) = {
  46. get: "/v4beta1/{name=projects/*/tenants/*}"
  47. };
  48. option (google.api.method_signature) = "name";
  49. }
  50. // Updates specified tenant.
  51. rpc UpdateTenant(UpdateTenantRequest) returns (Tenant) {
  52. option (google.api.http) = {
  53. patch: "/v4beta1/{tenant.name=projects/*/tenants/*}"
  54. body: "*"
  55. };
  56. option (google.api.method_signature) = "tenant";
  57. }
  58. // Deletes specified tenant.
  59. rpc DeleteTenant(DeleteTenantRequest) returns (google.protobuf.Empty) {
  60. option (google.api.http) = {
  61. delete: "/v4beta1/{name=projects/*/tenants/*}"
  62. };
  63. option (google.api.method_signature) = "name";
  64. }
  65. // Lists all tenants associated with the project.
  66. rpc ListTenants(ListTenantsRequest) returns (ListTenantsResponse) {
  67. option (google.api.http) = {
  68. get: "/v4beta1/{parent=projects/*}/tenants"
  69. };
  70. option (google.api.method_signature) = "parent";
  71. }
  72. }
  73. // The Request of the CreateTenant method.
  74. message CreateTenantRequest {
  75. // Required. Resource name of the project under which the tenant is created.
  76. //
  77. // The format is "projects/{project_id}", for example,
  78. // "projects/foo".
  79. string parent = 1 [
  80. (google.api.field_behavior) = REQUIRED,
  81. (google.api.resource_reference) = {
  82. type: "cloudresourcemanager.googleapis.com/Project"
  83. }
  84. ];
  85. // Required. The tenant to be created.
  86. Tenant tenant = 2 [(google.api.field_behavior) = REQUIRED];
  87. }
  88. // Request for getting a tenant by name.
  89. message GetTenantRequest {
  90. // Required. The resource name of the tenant to be retrieved.
  91. //
  92. // The format is "projects/{project_id}/tenants/{tenant_id}", for example,
  93. // "projects/foo/tenants/bar".
  94. string name = 1 [
  95. (google.api.field_behavior) = REQUIRED,
  96. (google.api.resource_reference) = {
  97. type: "jobs.googleapis.com/Tenant"
  98. }
  99. ];
  100. }
  101. // Request for updating a specified tenant.
  102. message UpdateTenantRequest {
  103. // Required. The tenant resource to replace the current resource in the system.
  104. Tenant tenant = 1 [(google.api.field_behavior) = REQUIRED];
  105. // Strongly recommended for the best service experience.
  106. //
  107. // If [update_mask][google.cloud.talent.v4beta1.UpdateTenantRequest.update_mask] is provided, only the specified fields in
  108. // [tenant][google.cloud.talent.v4beta1.UpdateTenantRequest.tenant] are updated. Otherwise all the fields are updated.
  109. //
  110. // A field mask to specify the tenant fields to be updated. Only
  111. // top level fields of [Tenant][google.cloud.talent.v4beta1.Tenant] are supported.
  112. google.protobuf.FieldMask update_mask = 2;
  113. }
  114. // Request to delete a tenant.
  115. message DeleteTenantRequest {
  116. // Required. The resource name of the tenant to be deleted.
  117. //
  118. // The format is "projects/{project_id}/tenants/{tenant_id}", for example,
  119. // "projects/foo/tenants/bar".
  120. string name = 1 [
  121. (google.api.field_behavior) = REQUIRED,
  122. (google.api.resource_reference) = {
  123. type: "jobs.googleapis.com/Tenant"
  124. }
  125. ];
  126. }
  127. // List tenants for which the client has ACL visibility.
  128. message ListTenantsRequest {
  129. // Required. Resource name of the project under which the tenant is created.
  130. //
  131. // The format is "projects/{project_id}", for example,
  132. // "projects/foo".
  133. string parent = 1 [
  134. (google.api.field_behavior) = REQUIRED,
  135. (google.api.resource_reference) = {
  136. type: "cloudresourcemanager.googleapis.com/Project"
  137. }
  138. ];
  139. // The starting indicator from which to return results.
  140. string page_token = 2;
  141. // The maximum number of tenants to be returned, at most 100.
  142. // Default is 100 if a non-positive number is provided.
  143. int32 page_size = 3;
  144. }
  145. // The List tenants response object.
  146. message ListTenantsResponse {
  147. // Tenants for the current client.
  148. repeated Tenant tenants = 1;
  149. // A token to retrieve the next page of results.
  150. string next_page_token = 2;
  151. // Additional information for the API invocation, such as the request
  152. // tracking id.
  153. ResponseMetadata metadata = 3;
  154. }