// Copyright (C) 2023 The Licensing Authors // SPDX-License-Identifier: MIT // // This file attempts to follow common styles and design patterns described by // Google Cloud based on their extensive use of protocol buffers. // // - See here for more: https://cloud.google.com/apis/design/design_patterns // syntax = "proto3"; package contributors.v1; import "google/api/annotations.proto"; enum Role { ROLE_UNSPECIFIED = 0; ROLE_OWNER = 1; } message Contributor { string id = 1; string product_id = 2; string email = 3; Role role = 4; } message ListRequest { string product_id = 5; } message ListResponse { repeated Contributor contributors = 5; } message InviteRequest { Contributor contributor = 1; } message InviteResponse {} message UpdateRequest { Contributor contributor = 1; } message UpdateResponse {} message RevokeRequest { string product_id = 1; string contributor_id = 2; } message RevokeResponse {} service ContributorService { rpc List(ListRequest) returns (ListResponse) { option (google.api.http) = { get: "/v1/products/{product_id}/contributors" }; }; rpc Invite(InviteRequest) returns (InviteResponse) { option (google.api.http) = { post: "/v1/products/{contributor.product_id}/contributors" body: "*" }; }; rpc Update(UpdateRequest) returns (UpdateResponse) { option (google.api.http) = { post: "/v1/products/{contributor.product_id}/contributors/{contributor.id}" body: "*" }; }; rpc Revoke(RevokeRequest) returns (RevokeResponse) { option (google.api.http) = { delete: "/v1/products/{product_id}/contributors/{contributor_id}" }; }; }