From 991a002fccce7433fc78c27fc127e3baeedb2534 Mon Sep 17 00:00:00 2001 From: Semir Patel Date: Mon, 8 May 2023 12:26:19 -0500 Subject: [PATCH] resource: List resources by owner (#17190) --- .../services/resource/list_by_owner.go | 70 +++ .../services/resource/list_by_owner_test.go | 174 ++++++ .../services/resource/mock_Backend.go | 12 +- .../rate_limit_mappings.gen.go | 1 + internal/storage/conformance/conformance.go | 20 +- internal/storage/inmem/backend.go | 6 +- internal/storage/inmem/store.go | 11 +- internal/storage/raft/backend.go | 6 +- internal/storage/storage.go | 16 +- proto-public/pbresource/resource.pb.binary.go | 20 + proto-public/pbresource/resource.pb.go | 505 +++++++++++------- proto-public/pbresource/resource.proto | 21 + proto-public/pbresource/resource_grpc.pb.go | 42 ++ 13 files changed, 688 insertions(+), 216 deletions(-) create mode 100644 agent/grpc-external/services/resource/list_by_owner.go create mode 100644 agent/grpc-external/services/resource/list_by_owner_test.go diff --git a/agent/grpc-external/services/resource/list_by_owner.go b/agent/grpc-external/services/resource/list_by_owner.go new file mode 100644 index 000000000000..2cc203e72c30 --- /dev/null +++ b/agent/grpc-external/services/resource/list_by_owner.go @@ -0,0 +1,70 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package resource + +import ( + "context" + + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "github.com/hashicorp/consul/acl" + "github.com/hashicorp/consul/proto-public/pbresource" +) + +func (s *Server) ListByOwner(ctx context.Context, req *pbresource.ListByOwnerRequest) (*pbresource.ListByOwnerResponse, error) { + if err := validateListByOwnerRequest(req); err != nil { + return nil, err + } + + _, err := s.resolveType(req.Owner.Type) + if err != nil { + return nil, err + } + + children, err := s.Backend.ListByOwner(ctx, req.Owner) + if err != nil { + return nil, status.Errorf(codes.Internal, "failed list by owner: %v", err) + } + + authz, err := s.getAuthorizer(tokenFromContext(ctx)) + if err != nil { + return nil, err + } + + result := make([]*pbresource.Resource, 0) + for _, child := range children { + reg, err := s.resolveType(child.Id.Type) + if err != nil { + return nil, err + } + + // ACL filter + err = reg.ACLs.Read(authz, child.Id) + switch { + case acl.IsErrPermissionDenied(err): + continue + case err != nil: + return nil, status.Errorf(codes.Internal, "failed read acl: %v", err) + } + + result = append(result, child) + } + return &pbresource.ListByOwnerResponse{Resources: result}, nil +} + +func validateListByOwnerRequest(req *pbresource.ListByOwnerRequest) error { + if req.Owner == nil { + return status.Errorf(codes.InvalidArgument, "owner is required") + } + + if err := validateId(req.Owner, "owner"); err != nil { + return err + } + + if req.Owner.Uid == "" { + return status.Errorf(codes.InvalidArgument, "owner uid is required") + } + return nil +} diff --git a/agent/grpc-external/services/resource/list_by_owner_test.go b/agent/grpc-external/services/resource/list_by_owner_test.go new file mode 100644 index 000000000000..19fe799caf08 --- /dev/null +++ b/agent/grpc-external/services/resource/list_by_owner_test.go @@ -0,0 +1,174 @@ +// // Copyright (c) HashiCorp, Inc. +// // SPDX-License-Identifier: MPL-2.0 + +package resource + +import ( + "context" + "fmt" + "testing" + + "github.com/hashicorp/consul/acl" + "github.com/hashicorp/consul/internal/resource/demo" + "github.com/hashicorp/consul/proto-public/pbresource" + "github.com/hashicorp/consul/proto/private/prototest" + + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func TestListByOwner_InputValidation(t *testing.T) { + server := testServer(t) + client := testClient(t, server) + + demo.RegisterTypes(server.Registry) + + testCases := map[string]func(*pbresource.ListByOwnerRequest){ + "no owner": func(req *pbresource.ListByOwnerRequest) { req.Owner = nil }, + "no type": func(req *pbresource.ListByOwnerRequest) { req.Owner.Type = nil }, + "no tenancy": func(req *pbresource.ListByOwnerRequest) { req.Owner.Tenancy = nil }, + "no name": func(req *pbresource.ListByOwnerRequest) { req.Owner.Name = "" }, + "no uid": func(req *pbresource.ListByOwnerRequest) { req.Owner.Uid = "" }, + // clone necessary to not pollute DefaultTenancy + "tenancy partition not default": func(req *pbresource.ListByOwnerRequest) { + req.Owner.Tenancy = clone(req.Owner.Tenancy) + req.Owner.Tenancy.Partition = "" + }, + "tenancy namespace not default": func(req *pbresource.ListByOwnerRequest) { + req.Owner.Tenancy = clone(req.Owner.Tenancy) + req.Owner.Tenancy.Namespace = "" + }, + "tenancy peername not local": func(req *pbresource.ListByOwnerRequest) { + req.Owner.Tenancy = clone(req.Owner.Tenancy) + req.Owner.Tenancy.PeerName = "" + }, + } + for desc, modFn := range testCases { + t.Run(desc, func(t *testing.T) { + res, err := demo.GenerateV2Artist() + require.NoError(t, err) + + req := &pbresource.ListByOwnerRequest{Owner: res.Id} + modFn(req) + + _, err = client.ListByOwner(testContext(t), req) + require.Error(t, err) + require.Equal(t, codes.InvalidArgument.String(), status.Code(err).String()) + }) + } +} + +func TestListByOwner_TypeNotRegistered(t *testing.T) { + server := testServer(t) + client := testClient(t, server) + + _, err := client.ListByOwner(context.Background(), &pbresource.ListByOwnerRequest{ + Owner: &pbresource.ID{ + Type: demo.TypeV2Artist, + Tenancy: demo.TenancyDefault, + Uid: "bogus", + Name: "bogus", + }, + }) + require.Error(t, err) + require.Equal(t, codes.InvalidArgument.String(), status.Code(err).String()) + require.Contains(t, err.Error(), "resource type demo.v2.artist not registered") +} + +func TestListByOwner_Empty(t *testing.T) { + server := testServer(t) + demo.RegisterTypes(server.Registry) + client := testClient(t, server) + + res, err := demo.GenerateV2Artist() + require.NoError(t, err) + + rsp1, err := client.Write(testContext(t), &pbresource.WriteRequest{Resource: res}) + require.NoError(t, err) + + rsp2, err := client.ListByOwner(testContext(t), &pbresource.ListByOwnerRequest{Owner: rsp1.Resource.Id}) + require.NoError(t, err) + require.Empty(t, rsp2.Resources) +} + +func TestListByOwner_Many(t *testing.T) { + server := testServer(t) + demo.RegisterTypes(server.Registry) + client := testClient(t, server) + + res, err := demo.GenerateV2Artist() + require.NoError(t, err) + + rsp1, err := client.Write(testContext(t), &pbresource.WriteRequest{Resource: res}) + artist := rsp1.Resource + require.NoError(t, err) + + albums := make([]*pbresource.Resource, 10) + for i := 0; i < len(albums); i++ { + album, err := demo.GenerateV2Album(artist.Id) + require.NoError(t, err) + + // Prevent test flakes if the generated names collide. + album.Id.Name = fmt.Sprintf("%s-%d", artist.Id.Name, i) + + rsp2, err := client.Write(testContext(t), &pbresource.WriteRequest{Resource: album}) + require.NoError(t, err) + albums[i] = rsp2.Resource + } + + rsp3, err := client.ListByOwner(testContext(t), &pbresource.ListByOwnerRequest{ + Owner: artist.Id, + }) + require.NoError(t, err) + prototest.AssertElementsMatch(t, albums, rsp3.Resources) +} + +func TestListByOwner_ACL_PerTypeDenied(t *testing.T) { + authz := AuthorizerFrom(t, `key_prefix "resource/demo.v2.album/" { policy = "deny" }`) + _, rsp, err := roundTripListByOwner(t, authz) + + // verify resource filtered out, hence no results + require.NoError(t, err) + require.Empty(t, rsp.Resources) +} + +func TestListByOwner_ACL_PerTypeAllowed(t *testing.T) { + authz := AuthorizerFrom(t, `key_prefix "resource/demo.v2.album/" { policy = "read" }`) + album, rsp, err := roundTripListByOwner(t, authz) + + // verify resource not filtered out + require.NoError(t, err) + require.Len(t, rsp.Resources, 1) + prototest.AssertDeepEqual(t, album, rsp.Resources[0]) +} + +// roundtrip a ListByOwner which attempts to return a single resource +func roundTripListByOwner(t *testing.T, authz acl.Authorizer) (*pbresource.Resource, *pbresource.ListByOwnerResponse, error) { + server := testServer(t) + client := testClient(t, server) + demo.RegisterTypes(server.Registry) + + artist, err := demo.GenerateV2Artist() + require.NoError(t, err) + + rsp1, err := client.Write(testContext(t), &pbresource.WriteRequest{Resource: artist}) + artist = rsp1.Resource + require.NoError(t, err) + + album, err := demo.GenerateV2Album(artist.Id) + require.NoError(t, err) + + rsp2, err := client.Write(testContext(t), &pbresource.WriteRequest{Resource: album}) + album = rsp2.Resource + require.NoError(t, err) + + mockACLResolver := &MockACLResolver{} + mockACLResolver.On("ResolveTokenAndDefaultMeta", mock.Anything, mock.Anything, mock.Anything). + Return(authz, nil) + server.ACLResolver = mockACLResolver + + rsp3, err := client.ListByOwner(testContext(t), &pbresource.ListByOwnerRequest{Owner: artist.Id}) + return album, rsp3, err +} diff --git a/agent/grpc-external/services/resource/mock_Backend.go b/agent/grpc-external/services/resource/mock_Backend.go index eb133455d173..fbc88a592bb4 100644 --- a/agent/grpc-external/services/resource/mock_Backend.go +++ b/agent/grpc-external/services/resource/mock_Backend.go @@ -56,20 +56,20 @@ func (_m *MockBackend) List(ctx context.Context, consistency storage.ReadConsist return r0, r1 } -// OwnerReferences provides a mock function with given fields: ctx, id -func (_m *MockBackend) OwnerReferences(ctx context.Context, id *pbresource.ID) ([]*pbresource.ID, error) { +// ListByOwner provides a mock function with given fields: ctx, id +func (_m *MockBackend) ListByOwner(ctx context.Context, id *pbresource.ID) ([]*pbresource.Resource, error) { ret := _m.Called(ctx, id) - var r0 []*pbresource.ID + var r0 []*pbresource.Resource var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *pbresource.ID) ([]*pbresource.ID, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *pbresource.ID) ([]*pbresource.Resource, error)); ok { return rf(ctx, id) } - if rf, ok := ret.Get(0).(func(context.Context, *pbresource.ID) []*pbresource.ID); ok { + if rf, ok := ret.Get(0).(func(context.Context, *pbresource.ID) []*pbresource.Resource); ok { r0 = rf(ctx, id) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).([]*pbresource.ID) + r0 = ret.Get(0).([]*pbresource.Resource) } } diff --git a/agent/grpc-middleware/rate_limit_mappings.gen.go b/agent/grpc-middleware/rate_limit_mappings.gen.go index 4d08ca0e75a8..fc73aa9d9cf2 100644 --- a/agent/grpc-middleware/rate_limit_mappings.gen.go +++ b/agent/grpc-middleware/rate_limit_mappings.gen.go @@ -28,6 +28,7 @@ var rpcRateLimitSpecs = map[string]rate.OperationSpec{ "/hashicorp.consul.internal.storage.raft.ForwardingService/Write": {Type: rate.OperationTypeExempt, Category: rate.OperationCategoryResource}, "/hashicorp.consul.resource.ResourceService/Delete": {Type: rate.OperationTypeWrite, Category: rate.OperationCategoryResource}, "/hashicorp.consul.resource.ResourceService/List": {Type: rate.OperationTypeRead, Category: rate.OperationCategoryResource}, + "/hashicorp.consul.resource.ResourceService/ListByOwner": {Type: rate.OperationTypeRead, Category: rate.OperationCategoryResource}, "/hashicorp.consul.resource.ResourceService/Read": {Type: rate.OperationTypeRead, Category: rate.OperationCategoryResource}, "/hashicorp.consul.resource.ResourceService/WatchList": {Type: rate.OperationTypeRead, Category: rate.OperationCategoryResource}, "/hashicorp.consul.resource.ResourceService/Write": {Type: rate.OperationTypeWrite, Category: rate.OperationCategoryResource}, diff --git a/internal/storage/conformance/conformance.go b/internal/storage/conformance/conformance.go index d2b5d3e6df9f..22356a88a9c1 100644 --- a/internal/storage/conformance/conformance.go +++ b/internal/storage/conformance/conformance.go @@ -39,7 +39,7 @@ func Test(t *testing.T, opts TestOptions) { t.Run("Read", func(t *testing.T) { testRead(t, opts) }) t.Run("CAS Write", func(t *testing.T) { testCASWrite(t, opts) }) t.Run("CAS Delete", func(t *testing.T) { testCASDelete(t, opts) }) - t.Run("OwnerReferences", func(t *testing.T) { testOwnerReferences(t, opts) }) + t.Run("ListByOwner", func(t *testing.T) { testListByOwner(t, opts) }) testListWatch(t, opts) } @@ -518,7 +518,7 @@ func testListWatch(t *testing.T, opts TestOptions) { }) } -func testOwnerReferences(t *testing.T, opts TestOptions) { +func testListByOwner(t *testing.T, opts TestOptions) { backend := opts.NewBackend(t) ctx := testContext(t) @@ -555,9 +555,9 @@ func testOwnerReferences(t *testing.T, opts TestOptions) { require.NoError(t, err) eventually(t, func(t testingT) { - refs, err := backend.OwnerReferences(ctx, owner.Id) + res, err := backend.ListByOwner(ctx, owner.Id) require.NoError(t, err) - prototest.AssertElementsMatch(t, refs, []*pbresource.ID{r1.Id, r2.Id}) + prototest.AssertElementsMatch(t, res, []*pbresource.Resource{r1, r2}) }) t.Run("references are anchored to a specific uid", func(t *testing.T) { @@ -565,9 +565,9 @@ func testOwnerReferences(t *testing.T, opts TestOptions) { id.Uid = "different" eventually(t, func(t testingT) { - refs, err := backend.OwnerReferences(ctx, id) + res, err := backend.ListByOwner(ctx, id) require.NoError(t, err) - require.Empty(t, refs) + require.Empty(t, res) }) }) @@ -575,9 +575,9 @@ func testOwnerReferences(t *testing.T, opts TestOptions) { require.NoError(t, backend.DeleteCAS(ctx, owner.Id, owner.Version)) eventually(t, func(t testingT) { - refs, err := backend.OwnerReferences(ctx, owner.Id) + res, err := backend.ListByOwner(ctx, owner.Id) require.NoError(t, err) - prototest.AssertElementsMatch(t, refs, []*pbresource.ID{r1.Id, r2.Id}) + prototest.AssertElementsMatch(t, res, []*pbresource.Resource{r1, r2}) }) }) @@ -585,9 +585,9 @@ func testOwnerReferences(t *testing.T, opts TestOptions) { require.NoError(t, backend.DeleteCAS(ctx, r2.Id, r2.Version)) eventually(t, func(t testingT) { - refs, err := backend.OwnerReferences(ctx, owner.Id) + res, err := backend.ListByOwner(ctx, owner.Id) require.NoError(t, err) - prototest.AssertElementsMatch(t, refs, []*pbresource.ID{r1.Id}) + prototest.AssertElementsMatch(t, res, []*pbresource.Resource{r1}) }) }) } diff --git a/internal/storage/inmem/backend.go b/internal/storage/inmem/backend.go index 83e67d8928af..fc22aa5ace81 100644 --- a/internal/storage/inmem/backend.go +++ b/internal/storage/inmem/backend.go @@ -70,7 +70,7 @@ func (b *Backend) WatchList(_ context.Context, resType storage.UnversionedType, return b.store.WatchList(resType, tenancy, namePrefix) } -// OwnerReferences implements the storage.Backend interface. -func (b *Backend) OwnerReferences(_ context.Context, id *pbresource.ID) ([]*pbresource.ID, error) { - return b.store.OwnerReferences(id) +// ListByOwner implements the storage.Backend interface. +func (b *Backend) ListByOwner(_ context.Context, id *pbresource.ID) ([]*pbresource.Resource, error) { + return b.store.ListByOwner(id) } diff --git a/internal/storage/inmem/store.go b/internal/storage/inmem/store.go index 4778ed153cba..5c50b1c138a3 100644 --- a/internal/storage/inmem/store.go +++ b/internal/storage/inmem/store.go @@ -259,11 +259,10 @@ func (s *Store) WatchList(typ storage.UnversionedType, ten *pbresource.Tenancy, }, nil } -// OwnerReferences returns the IDs of resources owned by the resource with the -// given ID. +// ListByOwner returns resources owned by the resource with the given ID. // // For more information, see the storage.Backend documentation. -func (s *Store) OwnerReferences(id *pbresource.ID) ([]*pbresource.ID, error) { +func (s *Store) ListByOwner(id *pbresource.ID) ([]*pbresource.Resource, error) { tx := s.txn(false) defer tx.Abort() @@ -272,11 +271,11 @@ func (s *Store) OwnerReferences(id *pbresource.ID) ([]*pbresource.ID, error) { return nil, err } - var refs []*pbresource.ID + var res []*pbresource.Resource for v := iter.Next(); v != nil; v = iter.Next() { - refs = append(refs, v.(*pbresource.Resource).Id) + res = append(res, v.(*pbresource.Resource)) } - return refs, nil + return res, nil } func (s *Store) txn(write bool) *memdb.Txn { diff --git a/internal/storage/raft/backend.go b/internal/storage/raft/backend.go index f6afa4e4fd02..387e35973c71 100644 --- a/internal/storage/raft/backend.go +++ b/internal/storage/raft/backend.go @@ -217,9 +217,9 @@ func (b *Backend) WatchList(_ context.Context, resType storage.UnversionedType, return b.store.WatchList(resType, tenancy, namePrefix) } -// OwnerReferences implements the storage.Backend interface. -func (b *Backend) OwnerReferences(_ context.Context, id *pbresource.ID) ([]*pbresource.ID, error) { - return b.store.OwnerReferences(id) +// ListByOwner implements the storage.Backend interface. +func (b *Backend) ListByOwner(_ context.Context, id *pbresource.ID) ([]*pbresource.Resource, error) { + return b.store.ListByOwner(id) } // Apply is called by the FSM with the bytes of a Raft log entry, with Consul's diff --git a/internal/storage/storage.go b/internal/storage/storage.go index dc1e72c7fa5f..24a763e39547 100644 --- a/internal/storage/storage.go +++ b/internal/storage/storage.go @@ -244,33 +244,33 @@ type Backend interface { // events about writes that they then cannot read. In other words, it is *not* // linearizable. // - // There's a similar guarantee between WatchList and OwnerReferences, see the - // OwnerReferences docs for more information. + // There's a similar guarantee between WatchList and ListByOwner, see the + // ListByOwner docs for more information. // // See List docs for details about Tenancy Wildcard and GroupVersion. // // [monotonic reads]: https://jepsen.io/consistency/models/monotonic-reads WatchList(ctx context.Context, resType UnversionedType, tenancy *pbresource.Tenancy, namePrefix string) (Watch, error) - // OwnerReferences returns the IDs of resources owned by the resource with the - // given ID. It is typically used to implement cascading deletion. + // ListByOwner returns resources owned by the resource with the given ID. It + // is typically used to implement cascading deletion. // // # Consistency // - // OwnerReferences may return stale results, but guarnantees [monotonic reads] + // ListByOwner may return stale results, but guarantees [monotonic reads] // with events received from WatchList. In practice, this means that if you // learn that a resource has been deleted through a watch event, the results - // you receive from OwnerReferences will contain all references that existed + // you receive from ListByOwner will represent all references that existed // at the time the owner was deleted. It doesn't make any guarantees about // references that are created *after* the owner was deleted, though, so you // must either prevent that from happening (e.g. by performing a consistent // read of the owner in the write-path, which has its own ordering/correctness - // challenges), or by calling OwnerReferences after the expected window of + // challenges), or by calling ListByOwner after the expected window of // inconsistency (e.g. deferring cascading deletion, or doing a second pass // an hour later). // // [montonic reads]: https://jepsen.io/consistency/models/monotonic-reads - OwnerReferences(ctx context.Context, id *pbresource.ID) ([]*pbresource.ID, error) + ListByOwner(ctx context.Context, id *pbresource.ID) ([]*pbresource.Resource, error) } // Watch represents a watch on a given set of resources. Call Next to get the diff --git a/proto-public/pbresource/resource.pb.binary.go b/proto-public/pbresource/resource.pb.binary.go index 4f6c4a382fa1..0548452feb75 100644 --- a/proto-public/pbresource/resource.pb.binary.go +++ b/proto-public/pbresource/resource.pb.binary.go @@ -127,6 +127,26 @@ func (msg *ListResponse) UnmarshalBinary(b []byte) error { return proto.Unmarshal(b, msg) } +// MarshalBinary implements encoding.BinaryMarshaler +func (msg *ListByOwnerRequest) MarshalBinary() ([]byte, error) { + return proto.Marshal(msg) +} + +// UnmarshalBinary implements encoding.BinaryUnmarshaler +func (msg *ListByOwnerRequest) UnmarshalBinary(b []byte) error { + return proto.Unmarshal(b, msg) +} + +// MarshalBinary implements encoding.BinaryMarshaler +func (msg *ListByOwnerResponse) MarshalBinary() ([]byte, error) { + return proto.Marshal(msg) +} + +// UnmarshalBinary implements encoding.BinaryUnmarshaler +func (msg *ListByOwnerResponse) UnmarshalBinary(b []byte) error { + return proto.Unmarshal(b, msg) +} + // MarshalBinary implements encoding.BinaryMarshaler func (msg *WriteRequest) MarshalBinary() ([]byte, error) { return proto.Marshal(msg) diff --git a/proto-public/pbresource/resource.pb.go b/proto-public/pbresource/resource.pb.go index 397d423440c5..d05a2b8f972b 100644 --- a/proto-public/pbresource/resource.pb.go +++ b/proto-public/pbresource/resource.pb.go @@ -133,7 +133,7 @@ func (x WatchEvent_Operation) Number() protoreflect.EnumNumber { // Deprecated: Use WatchEvent_Operation.Descriptor instead. func (WatchEvent_Operation) EnumDescriptor() ([]byte, []int) { - return file_pbresource_resource_proto_rawDescGZIP(), []int{19, 0} + return file_pbresource_resource_proto_rawDescGZIP(), []int{21, 0} } // Type describes a resource's type. It follows the GVK (Group Version Kind) @@ -988,6 +988,103 @@ func (x *ListResponse) GetResources() []*Resource { return nil } +// ListByOwnerRequest contains the parameters to the ListByOwner endpoint. +type ListByOwnerRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Owner *ID `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` +} + +func (x *ListByOwnerRequest) Reset() { + *x = ListByOwnerRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_pbresource_resource_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListByOwnerRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListByOwnerRequest) ProtoMessage() {} + +func (x *ListByOwnerRequest) ProtoReflect() protoreflect.Message { + mi := &file_pbresource_resource_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListByOwnerRequest.ProtoReflect.Descriptor instead. +func (*ListByOwnerRequest) Descriptor() ([]byte, []int) { + return file_pbresource_resource_proto_rawDescGZIP(), []int{12} +} + +func (x *ListByOwnerRequest) GetOwner() *ID { + if x != nil { + return x.Owner + } + return nil +} + +// ListByOwnerResponse contains the results of calling the ListByOwner endpoint. +type ListByOwnerResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Resources that were listed. + Resources []*Resource `protobuf:"bytes,1,rep,name=resources,proto3" json:"resources,omitempty"` +} + +func (x *ListByOwnerResponse) Reset() { + *x = ListByOwnerResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_pbresource_resource_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListByOwnerResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListByOwnerResponse) ProtoMessage() {} + +func (x *ListByOwnerResponse) ProtoReflect() protoreflect.Message { + mi := &file_pbresource_resource_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListByOwnerResponse.ProtoReflect.Descriptor instead. +func (*ListByOwnerResponse) Descriptor() ([]byte, []int) { + return file_pbresource_resource_proto_rawDescGZIP(), []int{13} +} + +func (x *ListByOwnerResponse) GetResources() []*Resource { + if x != nil { + return x.Resources + } + return nil +} + // WriteRequest contains the parameters to the Write endpoint. type WriteRequest struct { state protoimpl.MessageState @@ -1001,7 +1098,7 @@ type WriteRequest struct { func (x *WriteRequest) Reset() { *x = WriteRequest{} if protoimpl.UnsafeEnabled { - mi := &file_pbresource_resource_proto_msgTypes[12] + mi := &file_pbresource_resource_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1014,7 +1111,7 @@ func (x *WriteRequest) String() string { func (*WriteRequest) ProtoMessage() {} func (x *WriteRequest) ProtoReflect() protoreflect.Message { - mi := &file_pbresource_resource_proto_msgTypes[12] + mi := &file_pbresource_resource_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1027,7 +1124,7 @@ func (x *WriteRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use WriteRequest.ProtoReflect.Descriptor instead. func (*WriteRequest) Descriptor() ([]byte, []int) { - return file_pbresource_resource_proto_rawDescGZIP(), []int{12} + return file_pbresource_resource_proto_rawDescGZIP(), []int{14} } func (x *WriteRequest) GetResource() *Resource { @@ -1050,7 +1147,7 @@ type WriteResponse struct { func (x *WriteResponse) Reset() { *x = WriteResponse{} if protoimpl.UnsafeEnabled { - mi := &file_pbresource_resource_proto_msgTypes[13] + mi := &file_pbresource_resource_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1063,7 +1160,7 @@ func (x *WriteResponse) String() string { func (*WriteResponse) ProtoMessage() {} func (x *WriteResponse) ProtoReflect() protoreflect.Message { - mi := &file_pbresource_resource_proto_msgTypes[13] + mi := &file_pbresource_resource_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1076,7 +1173,7 @@ func (x *WriteResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use WriteResponse.ProtoReflect.Descriptor instead. func (*WriteResponse) Descriptor() ([]byte, []int) { - return file_pbresource_resource_proto_rawDescGZIP(), []int{13} + return file_pbresource_resource_proto_rawDescGZIP(), []int{15} } func (x *WriteResponse) GetResource() *Resource { @@ -1113,7 +1210,7 @@ type WriteStatusRequest struct { func (x *WriteStatusRequest) Reset() { *x = WriteStatusRequest{} if protoimpl.UnsafeEnabled { - mi := &file_pbresource_resource_proto_msgTypes[14] + mi := &file_pbresource_resource_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1126,7 +1223,7 @@ func (x *WriteStatusRequest) String() string { func (*WriteStatusRequest) ProtoMessage() {} func (x *WriteStatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_pbresource_resource_proto_msgTypes[14] + mi := &file_pbresource_resource_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1139,7 +1236,7 @@ func (x *WriteStatusRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use WriteStatusRequest.ProtoReflect.Descriptor instead. func (*WriteStatusRequest) Descriptor() ([]byte, []int) { - return file_pbresource_resource_proto_rawDescGZIP(), []int{14} + return file_pbresource_resource_proto_rawDescGZIP(), []int{16} } func (x *WriteStatusRequest) GetId() *ID { @@ -1183,7 +1280,7 @@ type WriteStatusResponse struct { func (x *WriteStatusResponse) Reset() { *x = WriteStatusResponse{} if protoimpl.UnsafeEnabled { - mi := &file_pbresource_resource_proto_msgTypes[15] + mi := &file_pbresource_resource_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1196,7 +1293,7 @@ func (x *WriteStatusResponse) String() string { func (*WriteStatusResponse) ProtoMessage() {} func (x *WriteStatusResponse) ProtoReflect() protoreflect.Message { - mi := &file_pbresource_resource_proto_msgTypes[15] + mi := &file_pbresource_resource_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1209,7 +1306,7 @@ func (x *WriteStatusResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use WriteStatusResponse.ProtoReflect.Descriptor instead. func (*WriteStatusResponse) Descriptor() ([]byte, []int) { - return file_pbresource_resource_proto_rawDescGZIP(), []int{15} + return file_pbresource_resource_proto_rawDescGZIP(), []int{17} } func (x *WriteStatusResponse) GetResource() *Resource { @@ -1236,7 +1333,7 @@ type DeleteRequest struct { func (x *DeleteRequest) Reset() { *x = DeleteRequest{} if protoimpl.UnsafeEnabled { - mi := &file_pbresource_resource_proto_msgTypes[16] + mi := &file_pbresource_resource_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1249,7 +1346,7 @@ func (x *DeleteRequest) String() string { func (*DeleteRequest) ProtoMessage() {} func (x *DeleteRequest) ProtoReflect() protoreflect.Message { - mi := &file_pbresource_resource_proto_msgTypes[16] + mi := &file_pbresource_resource_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1262,7 +1359,7 @@ func (x *DeleteRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead. func (*DeleteRequest) Descriptor() ([]byte, []int) { - return file_pbresource_resource_proto_rawDescGZIP(), []int{16} + return file_pbresource_resource_proto_rawDescGZIP(), []int{18} } func (x *DeleteRequest) GetId() *ID { @@ -1289,7 +1386,7 @@ type DeleteResponse struct { func (x *DeleteResponse) Reset() { *x = DeleteResponse{} if protoimpl.UnsafeEnabled { - mi := &file_pbresource_resource_proto_msgTypes[17] + mi := &file_pbresource_resource_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1302,7 +1399,7 @@ func (x *DeleteResponse) String() string { func (*DeleteResponse) ProtoMessage() {} func (x *DeleteResponse) ProtoReflect() protoreflect.Message { - mi := &file_pbresource_resource_proto_msgTypes[17] + mi := &file_pbresource_resource_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1315,7 +1412,7 @@ func (x *DeleteResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteResponse.ProtoReflect.Descriptor instead. func (*DeleteResponse) Descriptor() ([]byte, []int) { - return file_pbresource_resource_proto_rawDescGZIP(), []int{17} + return file_pbresource_resource_proto_rawDescGZIP(), []int{19} } // WatchListRequest contains the parameters to the WatchList endpoint. @@ -1337,7 +1434,7 @@ type WatchListRequest struct { func (x *WatchListRequest) Reset() { *x = WatchListRequest{} if protoimpl.UnsafeEnabled { - mi := &file_pbresource_resource_proto_msgTypes[18] + mi := &file_pbresource_resource_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1350,7 +1447,7 @@ func (x *WatchListRequest) String() string { func (*WatchListRequest) ProtoMessage() {} func (x *WatchListRequest) ProtoReflect() protoreflect.Message { - mi := &file_pbresource_resource_proto_msgTypes[18] + mi := &file_pbresource_resource_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1363,7 +1460,7 @@ func (x *WatchListRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use WatchListRequest.ProtoReflect.Descriptor instead. func (*WatchListRequest) Descriptor() ([]byte, []int) { - return file_pbresource_resource_proto_rawDescGZIP(), []int{18} + return file_pbresource_resource_proto_rawDescGZIP(), []int{20} } func (x *WatchListRequest) GetType() *Type { @@ -1402,7 +1499,7 @@ type WatchEvent struct { func (x *WatchEvent) Reset() { *x = WatchEvent{} if protoimpl.UnsafeEnabled { - mi := &file_pbresource_resource_proto_msgTypes[19] + mi := &file_pbresource_resource_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1415,7 +1512,7 @@ func (x *WatchEvent) String() string { func (*WatchEvent) ProtoMessage() {} func (x *WatchEvent) ProtoReflect() protoreflect.Message { - mi := &file_pbresource_resource_proto_msgTypes[19] + mi := &file_pbresource_resource_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1428,7 +1525,7 @@ func (x *WatchEvent) ProtoReflect() protoreflect.Message { // Deprecated: Use WatchEvent.ProtoReflect.Descriptor instead. func (*WatchEvent) Descriptor() ([]byte, []int) { - return file_pbresource_resource_proto_rawDescGZIP(), []int{19} + return file_pbresource_resource_proto_rawDescGZIP(), []int{21} } func (x *WatchEvent) GetOperation() WatchEvent_Operation { @@ -1574,122 +1671,140 @@ var file_pbresource_resource_proto_rawDesc = []byte{ 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x09, 0x72, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x22, 0x4f, 0x0a, 0x0c, 0x57, 0x72, 0x69, 0x74, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x68, 0x61, 0x73, - 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x2e, 0x72, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, - 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0x50, 0x0a, 0x0d, 0x57, 0x72, 0x69, - 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a, 0x08, 0x72, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x68, - 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x2e, - 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0xaa, 0x01, 0x0a, 0x12, - 0x57, 0x72, 0x69, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, - 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x75, - 0x6c, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x49, 0x44, 0x52, 0x02, 0x69, - 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x6b, - 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x39, 0x0a, - 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x22, 0x49, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, + 0x42, 0x79, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x33, + 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, - 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x56, 0x0a, 0x13, 0x57, 0x72, 0x69, 0x74, - 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x49, 0x44, 0x52, 0x05, 0x6f, 0x77, + 0x6e, 0x65, 0x72, 0x22, 0x58, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x79, 0x4f, 0x77, 0x6e, + 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x09, 0x72, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, + 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, + 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x22, 0x4f, 0x0a, + 0x0c, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, + 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x23, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x63, 0x6f, 0x6e, 0x73, + 0x75, 0x6c, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0x50, + 0x0a, 0x0d, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x22, 0x58, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x2d, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, - 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, - 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x49, 0x44, 0x52, 0x02, 0x69, 0x64, - 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x10, 0x0a, 0x0e, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xa6, 0x01, 0x0a, - 0x10, 0x57, 0x61, 0x74, 0x63, 0x68, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x33, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1f, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x63, 0x6f, 0x6e, 0x73, - 0x75, 0x6c, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x54, 0x79, 0x70, 0x65, - 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x3c, 0x0a, 0x07, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x63, - 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, - 0x6f, 0x72, 0x70, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x2e, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x63, 0x79, 0x52, 0x07, 0x74, 0x65, 0x6e, - 0x61, 0x6e, 0x63, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x6e, 0x61, 0x6d, 0x65, 0x5f, 0x70, 0x72, 0x65, - 0x66, 0x69, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6e, 0x61, 0x6d, 0x65, 0x50, - 0x72, 0x65, 0x66, 0x69, 0x78, 0x22, 0xf0, 0x01, 0x0a, 0x0a, 0x57, 0x61, 0x74, 0x63, 0x68, 0x45, - 0x76, 0x65, 0x6e, 0x74, 0x12, 0x4d, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2f, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, - 0x6f, 0x72, 0x70, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x2e, 0x57, 0x61, 0x74, 0x63, 0x68, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x4f, - 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x3f, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, - 0x70, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x22, 0x52, 0x0a, 0x09, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x19, 0x0a, 0x15, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, - 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, - 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x50, 0x53, 0x45, 0x52, 0x54, - 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, - 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x10, 0x02, 0x32, 0x8b, 0x05, 0x0a, 0x0f, 0x52, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x61, 0x0a, 0x04, - 0x52, 0x65, 0x61, 0x64, 0x12, 0x26, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, + 0x22, 0xaa, 0x01, 0x0a, 0x12, 0x57, 0x72, 0x69, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, + 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, + 0x49, 0x44, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, + 0x65, 0x79, 0x12, 0x39, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x63, + 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x56, 0x0a, + 0x13, 0x57, 0x72, 0x69, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, + 0x72, 0x70, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0x58, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x63, + 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x49, + 0x44, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, + 0x10, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0xa6, 0x01, 0x0a, 0x10, 0x57, 0x61, 0x74, 0x63, 0x68, 0x4c, 0x69, 0x73, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x33, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x68, + 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x3c, 0x0a, 0x07, 0x74, + 0x65, 0x6e, 0x61, 0x6e, 0x63, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x68, + 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x2e, + 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x63, 0x79, + 0x52, 0x07, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x63, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x6e, 0x61, 0x6d, + 0x65, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, + 0x6e, 0x61, 0x6d, 0x65, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x22, 0xf0, 0x01, 0x0a, 0x0a, 0x57, + 0x61, 0x74, 0x63, 0x68, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x4d, 0x0a, 0x09, 0x6f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2f, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x2e, - 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x08, 0xe2, 0x86, 0x04, 0x04, 0x08, 0x02, 0x10, 0x0b, 0x12, - 0x64, 0x0a, 0x05, 0x57, 0x72, 0x69, 0x74, 0x65, 0x12, 0x27, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, + 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x57, 0x61, 0x74, 0x63, 0x68, 0x45, 0x76, + 0x65, 0x6e, 0x74, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x6f, + 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3f, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x68, 0x61, 0x73, + 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x2e, 0x72, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, + 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0x52, 0x0a, 0x09, 0x4f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x15, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, + 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, + 0x00, 0x12, 0x14, 0x0a, 0x10, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, + 0x50, 0x53, 0x45, 0x52, 0x54, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x4f, 0x50, 0x45, 0x52, 0x41, + 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x10, 0x02, 0x32, 0x83, 0x06, + 0x0a, 0x0f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x12, 0x61, 0x0a, 0x04, 0x52, 0x65, 0x61, 0x64, 0x12, 0x26, 0x2e, 0x68, 0x61, 0x73, 0x68, + 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x2e, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x27, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x63, 0x6f, + 0x6e, 0x73, 0x75, 0x6c, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x52, 0x65, + 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x08, 0xe2, 0x86, 0x04, 0x04, + 0x08, 0x02, 0x10, 0x0b, 0x12, 0x64, 0x0a, 0x05, 0x57, 0x72, 0x69, 0x74, 0x65, 0x12, 0x27, 0x2e, + 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, + 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, + 0x72, 0x70, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x08, 0xe2, 0x86, 0x04, 0x04, 0x08, 0x03, 0x10, 0x0b, 0x12, 0x76, 0x0a, 0x0b, 0x57, 0x72, + 0x69, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x2d, 0x2e, 0x68, 0x61, 0x73, 0x68, + 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x2e, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x2e, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x28, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x63, 0x6f, - 0x6e, 0x73, 0x75, 0x6c, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x57, 0x72, - 0x69, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x08, 0xe2, 0x86, 0x04, - 0x04, 0x08, 0x03, 0x10, 0x0b, 0x12, 0x76, 0x0a, 0x0b, 0x57, 0x72, 0x69, 0x74, 0x65, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x12, 0x2d, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, + 0x75, 0x72, 0x63, 0x65, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x08, 0xe2, 0x86, 0x04, 0x04, 0x08, 0x03, + 0x10, 0x0b, 0x12, 0x61, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x26, 0x2e, 0x68, 0x61, 0x73, + 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x2e, 0x72, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x63, + 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x08, 0xe2, 0x86, 0x04, + 0x04, 0x08, 0x02, 0x10, 0x0b, 0x12, 0x76, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x79, 0x4f, + 0x77, 0x6e, 0x65, 0x72, 0x12, 0x2d, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x79, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, - 0x57, 0x72, 0x69, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x08, 0xe2, 0x86, 0x04, 0x04, 0x08, 0x03, 0x10, 0x0b, 0x12, 0x61, 0x0a, - 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x26, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, - 0x70, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, - 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, - 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x08, 0xe2, 0x86, 0x04, 0x04, 0x08, 0x02, 0x10, 0x0b, - 0x12, 0x67, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x28, 0x2e, 0x68, 0x61, 0x73, - 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x2e, 0x72, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, - 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x08, 0xe2, 0x86, 0x04, 0x04, 0x08, 0x03, 0x10, 0x0b, 0x12, 0x6b, 0x0a, 0x09, 0x57, 0x61, 0x74, - 0x63, 0x68, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x2b, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, - 0x72, 0x70, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x2e, 0x57, 0x61, 0x74, 0x63, 0x68, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x42, 0x79, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x08, 0xe2, 0x86, 0x04, 0x04, 0x08, 0x02, 0x10, 0x0b, 0x12, 0x67, 0x0a, + 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x28, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, + 0x6f, 0x72, 0x70, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x29, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x63, 0x6f, + 0x6e, 0x73, 0x75, 0x6c, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x08, 0xe2, 0x86, + 0x04, 0x04, 0x08, 0x03, 0x10, 0x0b, 0x12, 0x6b, 0x0a, 0x09, 0x57, 0x61, 0x74, 0x63, 0x68, 0x4c, + 0x69, 0x73, 0x74, 0x12, 0x2b, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, - 0x57, 0x61, 0x74, 0x63, 0x68, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x22, 0x08, 0xe2, 0x86, 0x04, 0x04, - 0x08, 0x02, 0x10, 0x0b, 0x30, 0x01, 0x42, 0xe9, 0x01, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x68, - 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x2e, - 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x0d, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x33, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2f, - 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2d, 0x70, 0x75, 0x62, - 0x6c, 0x69, 0x63, 0x2f, 0x70, 0x62, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0xa2, 0x02, - 0x03, 0x48, 0x43, 0x52, 0xaa, 0x02, 0x19, 0x48, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, - 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0xca, 0x02, 0x19, 0x48, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x5c, 0x43, 0x6f, 0x6e, - 0x73, 0x75, 0x6c, 0x5c, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0xe2, 0x02, 0x25, 0x48, - 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x5c, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x5c, - 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1b, 0x48, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, - 0x3a, 0x3a, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x3a, 0x3a, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x57, 0x61, 0x74, 0x63, 0x68, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x25, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x63, 0x6f, 0x6e, + 0x73, 0x75, 0x6c, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x57, 0x61, 0x74, + 0x63, 0x68, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x22, 0x08, 0xe2, 0x86, 0x04, 0x04, 0x08, 0x02, 0x10, + 0x0b, 0x30, 0x01, 0x42, 0xe9, 0x01, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x68, 0x61, 0x73, 0x68, + 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x2e, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x0d, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x33, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2f, 0x63, 0x6f, 0x6e, + 0x73, 0x75, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2d, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, + 0x2f, 0x70, 0x62, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0xa2, 0x02, 0x03, 0x48, 0x43, + 0x52, 0xaa, 0x02, 0x19, 0x48, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x43, 0x6f, + 0x6e, 0x73, 0x75, 0x6c, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0xca, 0x02, 0x19, + 0x48, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x5c, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6c, + 0x5c, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0xe2, 0x02, 0x25, 0x48, 0x61, 0x73, 0x68, + 0x69, 0x63, 0x6f, 0x72, 0x70, 0x5c, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x5c, 0x52, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x1b, 0x48, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x3a, 0x3a, 0x43, + 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x3a, 0x3a, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1705,7 +1820,7 @@ func file_pbresource_resource_proto_rawDescGZIP() []byte { } var file_pbresource_resource_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_pbresource_resource_proto_msgTypes = make([]protoimpl.MessageInfo, 22) +var file_pbresource_resource_proto_msgTypes = make([]protoimpl.MessageInfo, 24) var file_pbresource_resource_proto_goTypes = []interface{}{ (Condition_State)(0), // 0: hashicorp.consul.resource.Condition.State (WatchEvent_Operation)(0), // 1: hashicorp.consul.resource.WatchEvent.Operation @@ -1721,26 +1836,28 @@ var file_pbresource_resource_proto_goTypes = []interface{}{ (*ReadResponse)(nil), // 11: hashicorp.consul.resource.ReadResponse (*ListRequest)(nil), // 12: hashicorp.consul.resource.ListRequest (*ListResponse)(nil), // 13: hashicorp.consul.resource.ListResponse - (*WriteRequest)(nil), // 14: hashicorp.consul.resource.WriteRequest - (*WriteResponse)(nil), // 15: hashicorp.consul.resource.WriteResponse - (*WriteStatusRequest)(nil), // 16: hashicorp.consul.resource.WriteStatusRequest - (*WriteStatusResponse)(nil), // 17: hashicorp.consul.resource.WriteStatusResponse - (*DeleteRequest)(nil), // 18: hashicorp.consul.resource.DeleteRequest - (*DeleteResponse)(nil), // 19: hashicorp.consul.resource.DeleteResponse - (*WatchListRequest)(nil), // 20: hashicorp.consul.resource.WatchListRequest - (*WatchEvent)(nil), // 21: hashicorp.consul.resource.WatchEvent - nil, // 22: hashicorp.consul.resource.Resource.MetadataEntry - nil, // 23: hashicorp.consul.resource.Resource.StatusEntry - (*anypb.Any)(nil), // 24: google.protobuf.Any + (*ListByOwnerRequest)(nil), // 14: hashicorp.consul.resource.ListByOwnerRequest + (*ListByOwnerResponse)(nil), // 15: hashicorp.consul.resource.ListByOwnerResponse + (*WriteRequest)(nil), // 16: hashicorp.consul.resource.WriteRequest + (*WriteResponse)(nil), // 17: hashicorp.consul.resource.WriteResponse + (*WriteStatusRequest)(nil), // 18: hashicorp.consul.resource.WriteStatusRequest + (*WriteStatusResponse)(nil), // 19: hashicorp.consul.resource.WriteStatusResponse + (*DeleteRequest)(nil), // 20: hashicorp.consul.resource.DeleteRequest + (*DeleteResponse)(nil), // 21: hashicorp.consul.resource.DeleteResponse + (*WatchListRequest)(nil), // 22: hashicorp.consul.resource.WatchListRequest + (*WatchEvent)(nil), // 23: hashicorp.consul.resource.WatchEvent + nil, // 24: hashicorp.consul.resource.Resource.MetadataEntry + nil, // 25: hashicorp.consul.resource.Resource.StatusEntry + (*anypb.Any)(nil), // 26: google.protobuf.Any } var file_pbresource_resource_proto_depIdxs = []int32{ 2, // 0: hashicorp.consul.resource.ID.type:type_name -> hashicorp.consul.resource.Type 3, // 1: hashicorp.consul.resource.ID.tenancy:type_name -> hashicorp.consul.resource.Tenancy 4, // 2: hashicorp.consul.resource.Resource.id:type_name -> hashicorp.consul.resource.ID 4, // 3: hashicorp.consul.resource.Resource.owner:type_name -> hashicorp.consul.resource.ID - 22, // 4: hashicorp.consul.resource.Resource.metadata:type_name -> hashicorp.consul.resource.Resource.MetadataEntry - 23, // 5: hashicorp.consul.resource.Resource.status:type_name -> hashicorp.consul.resource.Resource.StatusEntry - 24, // 6: hashicorp.consul.resource.Resource.data:type_name -> google.protobuf.Any + 24, // 4: hashicorp.consul.resource.Resource.metadata:type_name -> hashicorp.consul.resource.Resource.MetadataEntry + 25, // 5: hashicorp.consul.resource.Resource.status:type_name -> hashicorp.consul.resource.Resource.StatusEntry + 26, // 6: hashicorp.consul.resource.Resource.data:type_name -> google.protobuf.Any 7, // 7: hashicorp.consul.resource.Status.conditions:type_name -> hashicorp.consul.resource.Condition 0, // 8: hashicorp.consul.resource.Condition.state:type_name -> hashicorp.consul.resource.Condition.State 8, // 9: hashicorp.consul.resource.Condition.resource:type_name -> hashicorp.consul.resource.Reference @@ -1752,34 +1869,38 @@ var file_pbresource_resource_proto_depIdxs = []int32{ 2, // 15: hashicorp.consul.resource.ListRequest.type:type_name -> hashicorp.consul.resource.Type 3, // 16: hashicorp.consul.resource.ListRequest.tenancy:type_name -> hashicorp.consul.resource.Tenancy 5, // 17: hashicorp.consul.resource.ListResponse.resources:type_name -> hashicorp.consul.resource.Resource - 5, // 18: hashicorp.consul.resource.WriteRequest.resource:type_name -> hashicorp.consul.resource.Resource - 5, // 19: hashicorp.consul.resource.WriteResponse.resource:type_name -> hashicorp.consul.resource.Resource - 4, // 20: hashicorp.consul.resource.WriteStatusRequest.id:type_name -> hashicorp.consul.resource.ID - 6, // 21: hashicorp.consul.resource.WriteStatusRequest.status:type_name -> hashicorp.consul.resource.Status - 5, // 22: hashicorp.consul.resource.WriteStatusResponse.resource:type_name -> hashicorp.consul.resource.Resource - 4, // 23: hashicorp.consul.resource.DeleteRequest.id:type_name -> hashicorp.consul.resource.ID - 2, // 24: hashicorp.consul.resource.WatchListRequest.type:type_name -> hashicorp.consul.resource.Type - 3, // 25: hashicorp.consul.resource.WatchListRequest.tenancy:type_name -> hashicorp.consul.resource.Tenancy - 1, // 26: hashicorp.consul.resource.WatchEvent.operation:type_name -> hashicorp.consul.resource.WatchEvent.Operation - 5, // 27: hashicorp.consul.resource.WatchEvent.resource:type_name -> hashicorp.consul.resource.Resource - 6, // 28: hashicorp.consul.resource.Resource.StatusEntry.value:type_name -> hashicorp.consul.resource.Status - 10, // 29: hashicorp.consul.resource.ResourceService.Read:input_type -> hashicorp.consul.resource.ReadRequest - 14, // 30: hashicorp.consul.resource.ResourceService.Write:input_type -> hashicorp.consul.resource.WriteRequest - 16, // 31: hashicorp.consul.resource.ResourceService.WriteStatus:input_type -> hashicorp.consul.resource.WriteStatusRequest - 12, // 32: hashicorp.consul.resource.ResourceService.List:input_type -> hashicorp.consul.resource.ListRequest - 18, // 33: hashicorp.consul.resource.ResourceService.Delete:input_type -> hashicorp.consul.resource.DeleteRequest - 20, // 34: hashicorp.consul.resource.ResourceService.WatchList:input_type -> hashicorp.consul.resource.WatchListRequest - 11, // 35: hashicorp.consul.resource.ResourceService.Read:output_type -> hashicorp.consul.resource.ReadResponse - 15, // 36: hashicorp.consul.resource.ResourceService.Write:output_type -> hashicorp.consul.resource.WriteResponse - 17, // 37: hashicorp.consul.resource.ResourceService.WriteStatus:output_type -> hashicorp.consul.resource.WriteStatusResponse - 13, // 38: hashicorp.consul.resource.ResourceService.List:output_type -> hashicorp.consul.resource.ListResponse - 19, // 39: hashicorp.consul.resource.ResourceService.Delete:output_type -> hashicorp.consul.resource.DeleteResponse - 21, // 40: hashicorp.consul.resource.ResourceService.WatchList:output_type -> hashicorp.consul.resource.WatchEvent - 35, // [35:41] is the sub-list for method output_type - 29, // [29:35] is the sub-list for method input_type - 29, // [29:29] is the sub-list for extension type_name - 29, // [29:29] is the sub-list for extension extendee - 0, // [0:29] is the sub-list for field type_name + 4, // 18: hashicorp.consul.resource.ListByOwnerRequest.owner:type_name -> hashicorp.consul.resource.ID + 5, // 19: hashicorp.consul.resource.ListByOwnerResponse.resources:type_name -> hashicorp.consul.resource.Resource + 5, // 20: hashicorp.consul.resource.WriteRequest.resource:type_name -> hashicorp.consul.resource.Resource + 5, // 21: hashicorp.consul.resource.WriteResponse.resource:type_name -> hashicorp.consul.resource.Resource + 4, // 22: hashicorp.consul.resource.WriteStatusRequest.id:type_name -> hashicorp.consul.resource.ID + 6, // 23: hashicorp.consul.resource.WriteStatusRequest.status:type_name -> hashicorp.consul.resource.Status + 5, // 24: hashicorp.consul.resource.WriteStatusResponse.resource:type_name -> hashicorp.consul.resource.Resource + 4, // 25: hashicorp.consul.resource.DeleteRequest.id:type_name -> hashicorp.consul.resource.ID + 2, // 26: hashicorp.consul.resource.WatchListRequest.type:type_name -> hashicorp.consul.resource.Type + 3, // 27: hashicorp.consul.resource.WatchListRequest.tenancy:type_name -> hashicorp.consul.resource.Tenancy + 1, // 28: hashicorp.consul.resource.WatchEvent.operation:type_name -> hashicorp.consul.resource.WatchEvent.Operation + 5, // 29: hashicorp.consul.resource.WatchEvent.resource:type_name -> hashicorp.consul.resource.Resource + 6, // 30: hashicorp.consul.resource.Resource.StatusEntry.value:type_name -> hashicorp.consul.resource.Status + 10, // 31: hashicorp.consul.resource.ResourceService.Read:input_type -> hashicorp.consul.resource.ReadRequest + 16, // 32: hashicorp.consul.resource.ResourceService.Write:input_type -> hashicorp.consul.resource.WriteRequest + 18, // 33: hashicorp.consul.resource.ResourceService.WriteStatus:input_type -> hashicorp.consul.resource.WriteStatusRequest + 12, // 34: hashicorp.consul.resource.ResourceService.List:input_type -> hashicorp.consul.resource.ListRequest + 14, // 35: hashicorp.consul.resource.ResourceService.ListByOwner:input_type -> hashicorp.consul.resource.ListByOwnerRequest + 20, // 36: hashicorp.consul.resource.ResourceService.Delete:input_type -> hashicorp.consul.resource.DeleteRequest + 22, // 37: hashicorp.consul.resource.ResourceService.WatchList:input_type -> hashicorp.consul.resource.WatchListRequest + 11, // 38: hashicorp.consul.resource.ResourceService.Read:output_type -> hashicorp.consul.resource.ReadResponse + 17, // 39: hashicorp.consul.resource.ResourceService.Write:output_type -> hashicorp.consul.resource.WriteResponse + 19, // 40: hashicorp.consul.resource.ResourceService.WriteStatus:output_type -> hashicorp.consul.resource.WriteStatusResponse + 13, // 41: hashicorp.consul.resource.ResourceService.List:output_type -> hashicorp.consul.resource.ListResponse + 15, // 42: hashicorp.consul.resource.ResourceService.ListByOwner:output_type -> hashicorp.consul.resource.ListByOwnerResponse + 21, // 43: hashicorp.consul.resource.ResourceService.Delete:output_type -> hashicorp.consul.resource.DeleteResponse + 23, // 44: hashicorp.consul.resource.ResourceService.WatchList:output_type -> hashicorp.consul.resource.WatchEvent + 38, // [38:45] is the sub-list for method output_type + 31, // [31:38] is the sub-list for method input_type + 31, // [31:31] is the sub-list for extension type_name + 31, // [31:31] is the sub-list for extension extendee + 0, // [0:31] is the sub-list for field type_name } func init() { file_pbresource_resource_proto_init() } @@ -1933,7 +2054,7 @@ func file_pbresource_resource_proto_init() { } } file_pbresource_resource_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WriteRequest); i { + switch v := v.(*ListByOwnerRequest); i { case 0: return &v.state case 1: @@ -1945,7 +2066,7 @@ func file_pbresource_resource_proto_init() { } } file_pbresource_resource_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WriteResponse); i { + switch v := v.(*ListByOwnerResponse); i { case 0: return &v.state case 1: @@ -1957,7 +2078,7 @@ func file_pbresource_resource_proto_init() { } } file_pbresource_resource_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WriteStatusRequest); i { + switch v := v.(*WriteRequest); i { case 0: return &v.state case 1: @@ -1969,7 +2090,7 @@ func file_pbresource_resource_proto_init() { } } file_pbresource_resource_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WriteStatusResponse); i { + switch v := v.(*WriteResponse); i { case 0: return &v.state case 1: @@ -1981,7 +2102,7 @@ func file_pbresource_resource_proto_init() { } } file_pbresource_resource_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteRequest); i { + switch v := v.(*WriteStatusRequest); i { case 0: return &v.state case 1: @@ -1993,7 +2114,7 @@ func file_pbresource_resource_proto_init() { } } file_pbresource_resource_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteResponse); i { + switch v := v.(*WriteStatusResponse); i { case 0: return &v.state case 1: @@ -2005,7 +2126,7 @@ func file_pbresource_resource_proto_init() { } } file_pbresource_resource_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WatchListRequest); i { + switch v := v.(*DeleteRequest); i { case 0: return &v.state case 1: @@ -2017,6 +2138,30 @@ func file_pbresource_resource_proto_init() { } } file_pbresource_resource_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pbresource_resource_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WatchListRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pbresource_resource_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*WatchEvent); i { case 0: return &v.state @@ -2035,7 +2180,7 @@ func file_pbresource_resource_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_pbresource_resource_proto_rawDesc, NumEnums: 2, - NumMessages: 22, + NumMessages: 24, NumExtensions: 0, NumServices: 1, }, diff --git a/proto-public/pbresource/resource.proto b/proto-public/pbresource/resource.proto index b5609bbc11a6..b3f7a039cd75 100644 --- a/proto-public/pbresource/resource.proto +++ b/proto-public/pbresource/resource.proto @@ -289,6 +289,16 @@ service ResourceService { }; } + // List resources of a given owner. + // + // Results are eventually consistent (see ResourceService docs for more info). + rpc ListByOwner(ListByOwnerRequest) returns (ListByOwnerResponse) { + option (hashicorp.consul.internal.ratelimit.spec) = { + operation_type: OPERATION_TYPE_READ, + operation_category: OPERATION_CATEGORY_RESOURCE + }; + } + // Delete a resource by ID. // // Deleting a non-existent resource will return a successful response for @@ -361,6 +371,17 @@ message ListResponse { repeated Resource resources = 1; } +// ListByOwnerRequest contains the parameters to the ListByOwner endpoint. +message ListByOwnerRequest { + ID owner = 1; +} + +// ListByOwnerResponse contains the results of calling the ListByOwner endpoint. +message ListByOwnerResponse { + // Resources that were listed. + repeated Resource resources = 1; +} + // WriteRequest contains the parameters to the Write endpoint. message WriteRequest { // Resource to write. diff --git a/proto-public/pbresource/resource_grpc.pb.go b/proto-public/pbresource/resource_grpc.pb.go index 59ecbcb0debe..af51fba75bdd 100644 --- a/proto-public/pbresource/resource_grpc.pb.go +++ b/proto-public/pbresource/resource_grpc.pb.go @@ -68,6 +68,10 @@ type ResourceServiceClient interface { // // Results are eventually consistent (see ResourceService docs for more info). List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) + // List resources of a given owner. + // + // Results are eventually consistent (see ResourceService docs for more info). + ListByOwner(ctx context.Context, in *ListByOwnerRequest, opts ...grpc.CallOption) (*ListByOwnerResponse, error) // Delete a resource by ID. // // Deleting a non-existent resource will return a successful response for @@ -141,6 +145,15 @@ func (c *resourceServiceClient) List(ctx context.Context, in *ListRequest, opts return out, nil } +func (c *resourceServiceClient) ListByOwner(ctx context.Context, in *ListByOwnerRequest, opts ...grpc.CallOption) (*ListByOwnerResponse, error) { + out := new(ListByOwnerResponse) + err := c.cc.Invoke(ctx, "/hashicorp.consul.resource.ResourceService/ListByOwner", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *resourceServiceClient) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) { out := new(DeleteResponse) err := c.cc.Invoke(ctx, "/hashicorp.consul.resource.ResourceService/Delete", in, out, opts...) @@ -232,6 +245,10 @@ type ResourceServiceServer interface { // // Results are eventually consistent (see ResourceService docs for more info). List(context.Context, *ListRequest) (*ListResponse, error) + // List resources of a given owner. + // + // Results are eventually consistent (see ResourceService docs for more info). + ListByOwner(context.Context, *ListByOwnerRequest) (*ListByOwnerResponse, error) // Delete a resource by ID. // // Deleting a non-existent resource will return a successful response for @@ -277,6 +294,9 @@ func (UnimplementedResourceServiceServer) WriteStatus(context.Context, *WriteSta func (UnimplementedResourceServiceServer) List(context.Context, *ListRequest) (*ListResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method List not implemented") } +func (UnimplementedResourceServiceServer) ListByOwner(context.Context, *ListByOwnerRequest) (*ListByOwnerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListByOwner not implemented") +} func (UnimplementedResourceServiceServer) Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented") } @@ -367,6 +387,24 @@ func _ResourceService_List_Handler(srv interface{}, ctx context.Context, dec fun return interceptor(ctx, in, info, handler) } +func _ResourceService_ListByOwner_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListByOwnerRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ResourceServiceServer).ListByOwner(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/hashicorp.consul.resource.ResourceService/ListByOwner", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ResourceServiceServer).ListByOwner(ctx, req.(*ListByOwnerRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _ResourceService_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(DeleteRequest) if err := dec(in); err != nil { @@ -429,6 +467,10 @@ var ResourceService_ServiceDesc = grpc.ServiceDesc{ MethodName: "List", Handler: _ResourceService_List_Handler, }, + { + MethodName: "ListByOwner", + Handler: _ResourceService_ListByOwner_Handler, + }, { MethodName: "Delete", Handler: _ResourceService_Delete_Handler,