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