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