From 3c9c50965813d707b056559793f1a3c8ba2f6497 Mon Sep 17 00:00:00 2001 From: Edward McFarlane <3036610+emcfarlane@users.noreply.github.com> Date: Mon, 25 Nov 2024 21:23:01 +0000 Subject: [PATCH] Add ResourceService for v1beta1 Plugins (#135) This adds the `ResourceService` for the `buf.registry.plugin.v1beta1` Plugins package. --- .../plugin/v1beta1/resource_service.proto | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 buf/registry/plugin/v1beta1/resource_service.proto diff --git a/buf/registry/plugin/v1beta1/resource_service.proto b/buf/registry/plugin/v1beta1/resource_service.proto new file mode 100644 index 0000000..2730d83 --- /dev/null +++ b/buf/registry/plugin/v1beta1/resource_service.proto @@ -0,0 +1,45 @@ +// Copyright 2023-2024 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package buf.registry.plugin.v1beta1; + +import "buf/registry/plugin/v1beta1/resource.proto"; +import "buf/validate/validate.proto"; + +option go_package = "buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/plugin/v1beta1"; + +// Operate on Resources. +service ResourceService { + // Get Resources. + rpc GetResources(GetResourcesRequest) returns (GetResourcesResponse) { + option idempotency_level = NO_SIDE_EFFECTS; + } +} + +message GetResourcesRequest { + // References to request a Resource for. + // + // See the documentation on ResourceRef for resource resolution details. + repeated ResourceRef resource_refs = 1 [ + (buf.validate.field).repeated.min_items = 1, + (buf.validate.field).repeated.max_items = 250 + ]; +} + +message GetResourcesResponse { + // The found Resources in the same order as requested. + repeated Resource resources = 1 [(buf.validate.field).repeated.min_items = 1]; +}