Copybara | 854996b | 2021-09-07 19:36:02 +0000 | [diff] [blame] | 1 | // 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 | |
| 6 | syntax = "proto3"; |
| 7 | |
| 8 | package monorail.v3; |
| 9 | |
Adrià Vilanova Martínez | ac4a644 | 2022-05-15 19:05:13 +0200 | [diff] [blame] | 10 | option go_package = "infra/monorailv2/api/v3/api_proto"; |
Copybara | 854996b | 2021-09-07 19:36:02 +0000 | [diff] [blame] | 11 | |
| 12 | import "google/protobuf/empty.proto"; |
| 13 | import "google/api/field_behavior.proto"; |
| 14 | import "google/api/resource.proto"; |
| 15 | import "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. |
| 21 | service 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 |
Adrià Vilanova Martínez | f5e1039 | 2021-12-07 22:55:40 +0100 | [diff] [blame] | 34 | // Gets a ComponentDef given the reference. |
| 35 | // |
| 36 | // Raises: |
| 37 | // INVALID_INPUT if the request is invalid. |
| 38 | // NOT_FOUND if the parent project or the component is not found. |
| 39 | rpc GetComponentDef (GetComponentDefRequest) returns (ComponentDef) {} |
| 40 | |
| 41 | // status: ALPHA |
Copybara | 854996b | 2021-09-07 19:36:02 +0000 | [diff] [blame] | 42 | // Creates a new ComponentDef. |
| 43 | // |
| 44 | // Raises: |
| 45 | // INVALID_INPUT if the request is invalid. |
| 46 | // ALREADY_EXISTS if the component already exists. |
| 47 | // PERMISSION_DENIED if the user is not allowed to create a/this component. |
| 48 | // NOT_FOUND if the parent project or a component cc or admin is not found. |
| 49 | rpc CreateComponentDef (CreateComponentDefRequest) returns (ComponentDef) {} |
| 50 | |
| 51 | // status: ALPHA |
| 52 | // Deletes a ComponentDef. |
| 53 | // |
| 54 | // Raises: |
| 55 | // INVALID_INPUT if the request is invalid. |
| 56 | // PERMISSION_DENIED if the user is not allowed to delete a/this component. |
| 57 | // NOT_FOUND if the component or project is not found. |
| 58 | rpc DeleteComponentDef (DeleteComponentDefRequest) returns (google.protobuf.Empty) {} |
| 59 | |
| 60 | // status: NOT READY |
| 61 | // Returns all templates for specified project. |
| 62 | // |
| 63 | // Raises: |
| 64 | // NOT_FOUND if the requested parent project is not found. |
| 65 | // INVALID_ARGUMENT if the given `parent` is not valid. |
| 66 | rpc ListIssueTemplates (ListIssueTemplatesRequest) returns (ListIssueTemplatesResponse) {} |
| 67 | |
| 68 | // status: ALPHA |
| 69 | // Returns all field defs for specified project. |
| 70 | // |
| 71 | // Raises: |
| 72 | // NOT_FOUND if the request arent project is not found. |
| 73 | // INVALID_ARGUMENT if the given `parent` is not valid. |
| 74 | rpc ListComponentDefs (ListComponentDefsRequest) returns (ListComponentDefsResponse) {} |
| 75 | |
| 76 | // status: NOT READY |
| 77 | // Returns all projects hosted on Monorail. |
| 78 | rpc ListProjects (ListProjectsRequest) returns (ListProjectsResponse) {} |
| 79 | } |
| 80 | |
| 81 | // Request message for CreateFieldDef method. |
| 82 | // Next available tag: 3 |
| 83 | message CreateFieldDefRequest { |
| 84 | // The project resource where this field will be created. |
| 85 | string parent = 1 [ |
| 86 | (google.api.field_behavior) = REQUIRED, |
| 87 | (google.api.resource_reference) = {type: "api.crbug.com/Project" }]; |
| 88 | // The field to create. |
| 89 | // It must have a display_name and a type with its corresponding settings. |
| 90 | FieldDef fielddef = 2 [ (google.api.field_behavior) = REQUIRED ]; |
| 91 | } |
| 92 | |
Adrià Vilanova Martínez | f5e1039 | 2021-12-07 22:55:40 +0100 | [diff] [blame] | 93 | // Request message for GetComponentDef method. |
| 94 | // Next available tag: 2 |
| 95 | message GetComponentDefRequest { |
| 96 | string name = 1 [ |
| 97 | (google.api.resource_reference) = { type: "api.crbug.com/ComponentDef" }, |
| 98 | (google.api.field_behavior) = REQUIRED ]; |
| 99 | } |
| 100 | |
Copybara | 854996b | 2021-09-07 19:36:02 +0000 | [diff] [blame] | 101 | // Request message for CreateComponentDef method. |
| 102 | // Next available tag: 3 |
| 103 | message CreateComponentDefRequest { |
| 104 | // The project resource where this component will be created. |
| 105 | string parent = 1 [ |
| 106 | (google.api.field_behavior) = REQUIRED, |
| 107 | (google.api.resource_reference) = {type: "api.crbug.com/Project" }]; |
| 108 | // The component to create. |
| 109 | ComponentDef component_def = 2 [ (google.api.field_behavior) = REQUIRED ]; |
| 110 | } |
| 111 | |
| 112 | // Request message for DeleteComponentDef method. |
| 113 | // Next available tag: 2 |
| 114 | message DeleteComponentDefRequest { |
| 115 | // The component to delete. |
| 116 | string name = 1 [ |
| 117 | (google.api.field_behavior) = REQUIRED, |
| 118 | (google.api.resource_reference) = {type: "api.crbug.com/ComponentDef"}]; |
| 119 | } |
| 120 | |
| 121 | // Request message for ListIssueTemplates |
| 122 | // Next available tag: 4 |
| 123 | message ListIssueTemplatesRequest { |
| 124 | // The name of the project these templates belong to. |
| 125 | string parent = 1 [ |
| 126 | (google.api.resource_reference) = {type: "api.crbug.com/Project"}, |
| 127 | (google.api.field_behavior) = REQUIRED ]; |
| 128 | // The maximum number of items to return. The service may return fewer than |
| 129 | // this value. |
| 130 | int32 page_size = 2; |
| 131 | // A page token, received from a previous `ListIssueTemplates` call. |
| 132 | // Provide this to retrieve the subsequent page. |
| 133 | // When paginating, all other parameters provided to |
| 134 | // `ListIssueTemplatesRequest` must match the call that provided the token. |
| 135 | string page_token = 3; |
| 136 | } |
| 137 | |
| 138 | // Response message for ListIssueTemplates |
| 139 | // Next available tag: 3 |
| 140 | message ListIssueTemplatesResponse { |
| 141 | // Templates matching the given request. |
| 142 | repeated IssueTemplate templates = 1; |
| 143 | // A token, which can be sent as `page_token` to retrieve the next page. |
| 144 | // If this field is omitted, there are no subsequent pages. |
| 145 | string next_page_token = 2; |
| 146 | } |
| 147 | |
| 148 | // Request message for ListComponentDefs |
| 149 | // Next available tag: 4 |
| 150 | message ListComponentDefsRequest { |
| 151 | // The name of the parent project. |
| 152 | string parent = 1 [ |
| 153 | (google.api.resource_reference) = {type: "api.crbug.com/Project"}, |
| 154 | (google.api.field_behavior) = REQUIRED ]; |
| 155 | // The maximum number of items to return. The service may return fewer than |
| 156 | // this value. |
| 157 | int32 page_size = 2; |
| 158 | // A page token, received from a previous `ListComponentDefs` call. |
| 159 | // Provide this to retrieve the subsequent page. |
| 160 | // When paginating, all other parameters provided to |
| 161 | // `ListComponentDefsRequest` must match the call that provided the token. |
| 162 | string page_token = 3; |
| 163 | } |
| 164 | |
| 165 | // Response message for ListComponentDefs |
| 166 | // Next available tag: 3 |
| 167 | message ListComponentDefsResponse { |
| 168 | // Component defs matching the given request. |
| 169 | repeated ComponentDef component_defs = 1; |
| 170 | // A token which can be sent as `page_token` to retrieve the next page. |
| 171 | // If this field is omitted, there are no subsequent pages. |
| 172 | string next_page_token = 2; |
| 173 | } |
| 174 | |
| 175 | // Request message for ListProjects |
| 176 | // Next available tag: 3 |
| 177 | message ListProjectsRequest { |
| 178 | // The maximum number of items to return. The service may return fewer than |
| 179 | // this value. |
| 180 | int32 page_size = 1; |
| 181 | // A page token, received from a previous `ListProjects` call. |
| 182 | // Provide this to retrieve the subsequent page. |
| 183 | string page_token = 2; |
| 184 | } |
| 185 | |
| 186 | // Response message for ListProjects |
| 187 | // Next available tag: 3 |
| 188 | message ListProjectsResponse { |
| 189 | // Projects matching the given request. |
| 190 | repeated Project projects = 1; |
| 191 | // A token, which can be sent as `page_token` to retrieve the next page. |
| 192 | // If this field is omitted, there are no subsequent pages. |
| 193 | string next_page_token = 2; |
| 194 | } |