blob: d90206791a70f606b86ade8ad9408edd111802a0 [file] [log] [blame]
Copybara854996b2021-09-07 19:36:02 +00001// Copyright 2020 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file or at
4// https://developers.google.com/open-source/licenses/bsd
5
6syntax = "proto3";
7
8package monorail.v3;
9
10option go_package = "api/v3/api_proto";
11
12import "google/protobuf/empty.proto";
13import "google/api/field_behavior.proto";
14import "google/api/resource.proto";
15import "api/v3/api_proto/project_objects.proto";
16
17// ***ONLY CALL rpcs WITH `status: {ALPHA|STABLE}`***
18// rpcs without `status` are not ready.
19
20// Projects service includes all methods needed for managing Projects.
21service Projects {
22 // status: NOT READY
23 // Creates a new FieldDef (custom field).
24 //
25 // Raises:
26 // NOT_FOUND if some given users do not exist.
27 // ALREADY_EXISTS if a field with the same name owned by the project
28 // already exists.
29 // INVALID_INPUT if there was a problem with the input.
30 // PERMISSION_DENIED if the user cannot edit the project.
31 rpc CreateFieldDef (CreateFieldDefRequest) returns (FieldDef) {}
32
33 // status: ALPHA
34 // Creates a new ComponentDef.
35 //
36 // Raises:
37 // INVALID_INPUT if the request is invalid.
38 // ALREADY_EXISTS if the component already exists.
39 // PERMISSION_DENIED if the user is not allowed to create a/this component.
40 // NOT_FOUND if the parent project or a component cc or admin is not found.
41 rpc CreateComponentDef (CreateComponentDefRequest) returns (ComponentDef) {}
42
43 // status: ALPHA
44 // Deletes a ComponentDef.
45 //
46 // Raises:
47 // INVALID_INPUT if the request is invalid.
48 // PERMISSION_DENIED if the user is not allowed to delete a/this component.
49 // NOT_FOUND if the component or project is not found.
50 rpc DeleteComponentDef (DeleteComponentDefRequest) returns (google.protobuf.Empty) {}
51
52 // status: NOT READY
53 // Returns all templates for specified project.
54 //
55 // Raises:
56 // NOT_FOUND if the requested parent project is not found.
57 // INVALID_ARGUMENT if the given `parent` is not valid.
58 rpc ListIssueTemplates (ListIssueTemplatesRequest) returns (ListIssueTemplatesResponse) {}
59
60 // status: ALPHA
61 // Returns all field defs for specified project.
62 //
63 // Raises:
64 // NOT_FOUND if the request arent project is not found.
65 // INVALID_ARGUMENT if the given `parent` is not valid.
66 rpc ListComponentDefs (ListComponentDefsRequest) returns (ListComponentDefsResponse) {}
67
68 // status: NOT READY
69 // Returns all projects hosted on Monorail.
70 rpc ListProjects (ListProjectsRequest) returns (ListProjectsResponse) {}
71}
72
73// Request message for CreateFieldDef method.
74// Next available tag: 3
75message CreateFieldDefRequest {
76 // The project resource where this field will be created.
77 string parent = 1 [
78 (google.api.field_behavior) = REQUIRED,
79 (google.api.resource_reference) = {type: "api.crbug.com/Project" }];
80 // The field to create.
81 // It must have a display_name and a type with its corresponding settings.
82 FieldDef fielddef = 2 [ (google.api.field_behavior) = REQUIRED ];
83}
84
85// Request message for CreateComponentDef method.
86// Next available tag: 3
87message CreateComponentDefRequest {
88 // The project resource where this component will be created.
89 string parent = 1 [
90 (google.api.field_behavior) = REQUIRED,
91 (google.api.resource_reference) = {type: "api.crbug.com/Project" }];
92 // The component to create.
93 ComponentDef component_def = 2 [ (google.api.field_behavior) = REQUIRED ];
94}
95
96// Request message for DeleteComponentDef method.
97// Next available tag: 2
98message DeleteComponentDefRequest {
99 // The component to delete.
100 string name = 1 [
101 (google.api.field_behavior) = REQUIRED,
102 (google.api.resource_reference) = {type: "api.crbug.com/ComponentDef"}];
103}
104
105// Request message for ListIssueTemplates
106// Next available tag: 4
107message ListIssueTemplatesRequest {
108 // The name of the project these templates belong to.
109 string parent = 1 [
110 (google.api.resource_reference) = {type: "api.crbug.com/Project"},
111 (google.api.field_behavior) = REQUIRED ];
112 // The maximum number of items to return. The service may return fewer than
113 // this value.
114 int32 page_size = 2;
115 // A page token, received from a previous `ListIssueTemplates` call.
116 // Provide this to retrieve the subsequent page.
117 // When paginating, all other parameters provided to
118 // `ListIssueTemplatesRequest` must match the call that provided the token.
119 string page_token = 3;
120}
121
122// Response message for ListIssueTemplates
123// Next available tag: 3
124message ListIssueTemplatesResponse {
125 // Templates matching the given request.
126 repeated IssueTemplate templates = 1;
127 // A token, which can be sent as `page_token` to retrieve the next page.
128 // If this field is omitted, there are no subsequent pages.
129 string next_page_token = 2;
130}
131
132// Request message for ListComponentDefs
133// Next available tag: 4
134message ListComponentDefsRequest {
135 // The name of the parent project.
136 string parent = 1 [
137 (google.api.resource_reference) = {type: "api.crbug.com/Project"},
138 (google.api.field_behavior) = REQUIRED ];
139 // The maximum number of items to return. The service may return fewer than
140 // this value.
141 int32 page_size = 2;
142 // A page token, received from a previous `ListComponentDefs` call.
143 // Provide this to retrieve the subsequent page.
144 // When paginating, all other parameters provided to
145 // `ListComponentDefsRequest` must match the call that provided the token.
146 string page_token = 3;
147}
148
149// Response message for ListComponentDefs
150// Next available tag: 3
151message ListComponentDefsResponse {
152 // Component defs matching the given request.
153 repeated ComponentDef component_defs = 1;
154 // A token which can be sent as `page_token` to retrieve the next page.
155 // If this field is omitted, there are no subsequent pages.
156 string next_page_token = 2;
157}
158
159// Request message for ListProjects
160// Next available tag: 3
161message ListProjectsRequest {
162 // The maximum number of items to return. The service may return fewer than
163 // this value.
164 int32 page_size = 1;
165 // A page token, received from a previous `ListProjects` call.
166 // Provide this to retrieve the subsequent page.
167 string page_token = 2;
168}
169
170// Response message for ListProjects
171// Next available tag: 3
172message ListProjectsResponse {
173 // Projects matching the given request.
174 repeated Project projects = 1;
175 // A token, which can be sent as `page_token` to retrieve the next page.
176 // If this field is omitted, there are no subsequent pages.
177 string next_page_token = 2;
178}