2023-12-28 23:45:50 +00:00
|
|
|
// Copyright (C) 2023 The Licensing Authors
|
|
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
|
2023-12-28 22:50:20 +00:00
|
|
|
//
|
|
|
|
// 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
|
|
|
|
//
|
2023-12-28 23:45:50 +00:00
|
|
|
|
2023-12-28 22:50:20 +00:00
|
|
|
syntax = "proto3";
|
|
|
|
|
2023-12-28 23:45:50 +00:00
|
|
|
package contributors.v1;
|
2023-12-28 22:50:20 +00:00
|
|
|
|
2023-12-29 20:01:47 +00:00
|
|
|
import "google/api/annotations.proto";
|
|
|
|
|
2023-12-31 19:41:06 +00:00
|
|
|
enum Role {
|
|
|
|
ROLE_UNSPECIFIED = 0;
|
|
|
|
ROLE_OWNER = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message Contributor {
|
|
|
|
string id = 1;
|
|
|
|
string product_id = 2;
|
|
|
|
string email = 3;
|
|
|
|
Role role = 4;
|
|
|
|
}
|
|
|
|
|
2023-12-29 22:15:52 +00:00
|
|
|
message ListRequest {
|
2023-12-31 19:41:06 +00:00
|
|
|
string product_id = 5;
|
2023-12-29 22:15:52 +00:00
|
|
|
}
|
|
|
|
|
2023-12-31 19:41:06 +00:00
|
|
|
message ListResponse {
|
|
|
|
repeated Contributor contributors = 5;
|
|
|
|
}
|
2023-12-29 20:01:47 +00:00
|
|
|
|
2023-12-31 19:41:06 +00:00
|
|
|
message InviteRequest {
|
|
|
|
Contributor contributor = 1;
|
2023-12-29 22:15:52 +00:00
|
|
|
}
|
|
|
|
|
2023-12-31 19:41:06 +00:00
|
|
|
message InviteResponse {}
|
2023-12-29 20:01:47 +00:00
|
|
|
|
2023-12-29 22:15:52 +00:00
|
|
|
message UpdateRequest {
|
2023-12-31 19:41:06 +00:00
|
|
|
Contributor contributor = 1;
|
2023-12-29 22:15:52 +00:00
|
|
|
}
|
|
|
|
|
2023-12-29 20:01:47 +00:00
|
|
|
message UpdateResponse {}
|
|
|
|
|
2023-12-31 19:41:06 +00:00
|
|
|
message RevokeRequest {
|
2023-12-29 22:15:52 +00:00
|
|
|
string product_id = 1;
|
|
|
|
string contributor_id = 2;
|
|
|
|
}
|
|
|
|
|
2023-12-31 19:41:06 +00:00
|
|
|
message RevokeResponse {}
|
2023-12-29 20:01:47 +00:00
|
|
|
|
2023-12-28 22:50:20 +00:00
|
|
|
service ContributorService {
|
2023-12-29 20:01:47 +00:00
|
|
|
rpc List(ListRequest) returns (ListResponse) {
|
|
|
|
option (google.api.http) = {
|
|
|
|
get: "/v1/products/{product_id}/contributors"
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-12-31 19:41:06 +00:00
|
|
|
rpc Invite(InviteRequest) returns (InviteResponse) {
|
2023-12-29 20:01:47 +00:00
|
|
|
option (google.api.http) = {
|
2023-12-31 19:41:06 +00:00
|
|
|
post: "/v1/products/{contributor.product_id}/contributors"
|
2023-12-29 20:01:47 +00:00
|
|
|
body: "*"
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
rpc Update(UpdateRequest) returns (UpdateResponse) {
|
|
|
|
option (google.api.http) = {
|
2023-12-31 19:41:06 +00:00
|
|
|
post: "/v1/products/{contributor.product_id}/contributors/{contributor.id}"
|
2023-12-29 20:01:47 +00:00
|
|
|
body: "*"
|
|
|
|
};
|
|
|
|
};
|
2023-12-28 22:50:20 +00:00
|
|
|
|
2023-12-31 19:41:06 +00:00
|
|
|
rpc Revoke(RevokeRequest) returns (RevokeResponse) {
|
2023-12-29 20:01:47 +00:00
|
|
|
option (google.api.http) = {
|
|
|
|
delete: "/v1/products/{product_id}/contributors/{contributor_id}"
|
|
|
|
};
|
|
|
|
};
|
2023-12-28 22:50:20 +00:00
|
|
|
}
|