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