// 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 packages.v1; import "google/api/annotations.proto"; message Package { string id = 1; string product_id = 2; string name = 3; } message ListRequest { string product_id = 5; } message ListResponse { repeated Package packages = 5; } message CreateRequest { Package package = 1; } message CreateResponse {} message ReadRequest { string product_id = 1; string package_name = 2; } message ReadResponse { Package package = 1; } message UpdateRequest { Package package = 1; } message UpdateResponse {} message DeleteRequest { string product_id = 1; string package_name = 2; } message DeleteResponse {} service PackageService { rpc List(ListRequest) returns (ListResponse) { option (google.api.http) = { get: "/v1/products/{product_id}/packages" }; }; rpc Create(CreateRequest) returns (CreateResponse) { option (google.api.http) = { post: "/v1/products/{package.product_id}/packages" body: "*" }; }; rpc Read(ReadRequest) returns (ReadResponse) { option (google.api.http) = { get: "/v1/products/{product_id}/packages/{package_name}" }; }; rpc Update(UpdateRequest) returns (UpdateResponse) { option (google.api.http) = { post: "/v1/products/{package.product_id}/packages/{package.name}" body: "*" }; }; rpc Delete(DeleteRequest) returns (DeleteResponse) { option (google.api.http) = { delete: "/v1/products/{product_id}/packages/{package_name}" }; }; }