blob: 484017dea8deb9aed364f34a8e0fbc5cb3d35a3e [file] [log] [blame]
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd
syntax = "proto3";
package monorail.v3;
option go_package = "infra/monorailv2/api/v3/api_proto";
import "google/protobuf/empty.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "api/v3/api_proto/project_objects.proto";
// ***ONLY CALL rpcs WITH `status: {ALPHA|STABLE}`***
// rpcs without `status` are not ready.
// Projects service includes all methods needed for managing Projects.
service Projects {
// status: NOT READY
// Creates a new FieldDef (custom field).
//
// Raises:
// NOT_FOUND if some given users do not exist.
// ALREADY_EXISTS if a field with the same name owned by the project
// already exists.
// INVALID_INPUT if there was a problem with the input.
// PERMISSION_DENIED if the user cannot edit the project.
rpc CreateFieldDef (CreateFieldDefRequest) returns (FieldDef) {}
// status: ALPHA
// Gets a ComponentDef given the reference.
//
// Raises:
// INVALID_INPUT if the request is invalid.
// NOT_FOUND if the parent project or the component is not found.
rpc GetComponentDef (GetComponentDefRequest) returns (ComponentDef) {}
// status: ALPHA
// Creates a new ComponentDef.
//
// Raises:
// INVALID_INPUT if the request is invalid.
// ALREADY_EXISTS if the component already exists.
// PERMISSION_DENIED if the user is not allowed to create a/this component.
// NOT_FOUND if the parent project or a component cc or admin is not found.
rpc CreateComponentDef (CreateComponentDefRequest) returns (ComponentDef) {}
// status: ALPHA
// Deletes a ComponentDef.
//
// Raises:
// INVALID_INPUT if the request is invalid.
// PERMISSION_DENIED if the user is not allowed to delete a/this component.
// NOT_FOUND if the component or project is not found.
rpc DeleteComponentDef (DeleteComponentDefRequest) returns (google.protobuf.Empty) {}
// status: NOT READY
// Returns all templates for specified project.
//
// Raises:
// NOT_FOUND if the requested parent project is not found.
// INVALID_ARGUMENT if the given `parent` is not valid.
rpc ListIssueTemplates (ListIssueTemplatesRequest) returns (ListIssueTemplatesResponse) {}
// status: ALPHA
// Returns all field defs for specified project.
//
// Raises:
// NOT_FOUND if the request arent project is not found.
// INVALID_ARGUMENT if the given `parent` is not valid.
rpc ListComponentDefs (ListComponentDefsRequest) returns (ListComponentDefsResponse) {}
// status: NOT READY
// Returns all projects hosted on Monorail.
rpc ListProjects (ListProjectsRequest) returns (ListProjectsResponse) {}
}
// Request message for CreateFieldDef method.
// Next available tag: 3
message CreateFieldDefRequest {
// The project resource where this field will be created.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {type: "api.crbug.com/Project" }];
// The field to create.
// It must have a display_name and a type with its corresponding settings.
FieldDef fielddef = 2 [ (google.api.field_behavior) = REQUIRED ];
}
// Request message for GetComponentDef method.
// Next available tag: 2
message GetComponentDefRequest {
string name = 1 [
(google.api.resource_reference) = { type: "api.crbug.com/ComponentDef" },
(google.api.field_behavior) = REQUIRED ];
}
// Request message for CreateComponentDef method.
// Next available tag: 3
message CreateComponentDefRequest {
// The project resource where this component will be created.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {type: "api.crbug.com/Project" }];
// The component to create.
ComponentDef component_def = 2 [ (google.api.field_behavior) = REQUIRED ];
}
// Request message for DeleteComponentDef method.
// Next available tag: 2
message DeleteComponentDefRequest {
// The component to delete.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {type: "api.crbug.com/ComponentDef"}];
}
// Request message for ListIssueTemplates
// Next available tag: 4
message ListIssueTemplatesRequest {
// The name of the project these templates belong to.
string parent = 1 [
(google.api.resource_reference) = {type: "api.crbug.com/Project"},
(google.api.field_behavior) = REQUIRED ];
// The maximum number of items to return. The service may return fewer than
// this value.
int32 page_size = 2;
// A page token, received from a previous `ListIssueTemplates` call.
// Provide this to retrieve the subsequent page.
// When paginating, all other parameters provided to
// `ListIssueTemplatesRequest` must match the call that provided the token.
string page_token = 3;
}
// Response message for ListIssueTemplates
// Next available tag: 3
message ListIssueTemplatesResponse {
// Templates matching the given request.
repeated IssueTemplate templates = 1;
// A token, which can be sent as `page_token` to retrieve the next page.
// If this field is omitted, there are no subsequent pages.
string next_page_token = 2;
}
// Request message for ListComponentDefs
// Next available tag: 4
message ListComponentDefsRequest {
// The name of the parent project.
string parent = 1 [
(google.api.resource_reference) = {type: "api.crbug.com/Project"},
(google.api.field_behavior) = REQUIRED ];
// The maximum number of items to return. The service may return fewer than
// this value.
int32 page_size = 2;
// A page token, received from a previous `ListComponentDefs` call.
// Provide this to retrieve the subsequent page.
// When paginating, all other parameters provided to
// `ListComponentDefsRequest` must match the call that provided the token.
string page_token = 3;
}
// Response message for ListComponentDefs
// Next available tag: 3
message ListComponentDefsResponse {
// Component defs matching the given request.
repeated ComponentDef component_defs = 1;
// A token which can be sent as `page_token` to retrieve the next page.
// If this field is omitted, there are no subsequent pages.
string next_page_token = 2;
}
// Request message for ListProjects
// Next available tag: 3
message ListProjectsRequest {
// The maximum number of items to return. The service may return fewer than
// this value.
int32 page_size = 1;
// A page token, received from a previous `ListProjects` call.
// Provide this to retrieve the subsequent page.
string page_token = 2;
}
// Response message for ListProjects
// Next available tag: 3
message ListProjectsResponse {
// Projects matching the given request.
repeated Project projects = 1;
// A token, which can be sent as `page_token` to retrieve the next page.
// If this field is omitted, there are no subsequent pages.
string next_page_token = 2;
}