1
proto/licenses/v1/service.proto
mya f068352bf7
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
feat: fill out apis
2023-12-31 13:41:06 -06:00

61 lines
1.1 KiB
Protocol Buffer

// 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 licenses.v1;
import "google/api/annotations.proto";
message License {
string id = 1;
string product_id = 2;
string package_name = 3;
}
message ListRequest {}
message ListResponse {
repeated License licenses = 1;
}
message PurchaseRequest {
License license = 1;
}
message PurchaseResponse {}
message CancelRequest {
string license_id = 1;
}
message CancelResponse {}
service LicenseService {
rpc List(ListRequest) returns (ListResponse) {
option (google.api.http) = {
get: "/v1/licenses"
};
};
rpc Purchase(PurchaseRequest) returns (PurchaseResponse) {
option (google.api.http) = {
post: "/v1/licenses"
body: "*"
};
};
rpc Cancel(CancelRequest) returns (CancelResponse) {
option (google.api.http) = {
delete: "/v1/licenses/{license_id}"
};
};
}