From 6833085527b3c606e5ea21eddcbbfdb67120dcfd Mon Sep 17 00:00:00 2001 From: Yusuke Tsutsumi Date: Fri, 29 Nov 2024 21:17:25 -0800 Subject: [PATCH] chore: refactor out parsedservice aep-lib-go provides it's own representation of APIs. Using that the source of truth in the codebase, over the aepc-specific parsed service, will hopefully deduplicate code in the future by providing a single API representation among AEP codebases. --- cmd/root.go | 15 +- example/bookstore/v1/bookstore.pb.go | 1320 +++++++++---------- example/bookstore/v1/bookstore.pb.gw.go | 103 -- example/bookstore/v1/bookstore.proto | 102 +- example/bookstore/v1/bookstore.swagger.json | 69 +- example/bookstore/v1/bookstore_grpc.pb.go | 39 - example/bookstore/v1/bookstore_openapi.json | 160 ++- example/bookstore/v1/bookstore_openapi.yaml | 103 +- example/service/service.go | 4 - parser/api.go | 21 + parser/parser.go | 150 --- parser/utils.go | 19 +- schema/resourcedefinition.pb.go | 60 +- schema/resourcedefinition.proto | 10 +- writer/proto/proto.go | 43 +- writer/proto/resource.go | 392 +++--- 16 files changed, 1121 insertions(+), 1489 deletions(-) delete mode 100644 parser/parser.go diff --git a/cmd/root.go b/cmd/root.go index 0dc9fe9..c033a24 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -68,13 +68,13 @@ func ProcessInput(inputFile, outputFilePrefix string) error { if len(errors) > 0 { return fmt.Errorf("error validating service: %v", errors) } - ps, err := parser.NewParsedService(s) + api, err := parser.ToAPI(s) if err != nil { - return fmt.Errorf("error parsing service: %w", err) + return fmt.Errorf("error building api: %w", err) } - proto, err := proto.WriteServiceToProto(ps, outputDir) + proto, err := proto.WriteServiceToProto(api, outputDir) if err != nil { - return fmt.Errorf("error writing service proto %w", err) + return fmt.Errorf("error writing service proto: %w", err) } protoFile := fmt.Sprintf("%s.proto", outputFilePrefix) err = WriteFile(protoFile, proto) @@ -82,14 +82,9 @@ func ProcessInput(inputFile, outputFilePrefix string) error { return fmt.Errorf("error writing file: %w", err) } fmt.Printf("output proto file: %s\n", protoFile) - api, err := parser.ToAPI(s) - if err != nil { - return fmt.Errorf("error building api %s", err) - } - openapi, err := api.ConvertToOpenAPIBytes() if err != nil { - return fmt.Errorf("error building openapi %s", err) + return fmt.Errorf("error building openapi: %w", err) } openapiFile := fmt.Sprintf("%s_openapi.json", outputFilePrefix) err = WriteFile(openapiFile, openapi) diff --git a/example/bookstore/v1/bookstore.pb.go b/example/bookstore/v1/bookstore.pb.go index 87507ec..78b1450 100644 --- a/example/bookstore/v1/bookstore.pb.go +++ b/example/bookstore/v1/bookstore.pb.go @@ -40,9 +40,7 @@ type Book struct { // Field for edition. Edition int32 `protobuf:"varint,4,opt,name=edition,proto3" json:"edition,omitempty"` // Field for path. - Path string `protobuf:"bytes,10000,opt,name=path,proto3" json:"path,omitempty"` - // Field for id. - Id string `protobuf:"bytes,10001,opt,name=id,proto3" json:"id,omitempty"` + Path string `protobuf:"bytes,10018,opt,name=path,proto3" json:"path,omitempty"` } func (x *Book) Reset() { @@ -119,9 +117,167 @@ func (x *Book) GetPath() string { return "" } -func (x *Book) GetId() string { +// A BookEdition. +type BookEdition struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Field for displayname. + Displayname string `protobuf:"bytes,1,opt,name=displayname,proto3" json:"displayname,omitempty"` + // Field for path. + Path string `protobuf:"bytes,10018,opt,name=path,proto3" json:"path,omitempty"` +} + +func (x *BookEdition) Reset() { + *x = BookEdition{} + if protoimpl.UnsafeEnabled { + mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BookEdition) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BookEdition) ProtoMessage() {} + +func (x *BookEdition) ProtoReflect() protoreflect.Message { + mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[1] + 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 BookEdition.ProtoReflect.Descriptor instead. +func (*BookEdition) Descriptor() ([]byte, []int) { + return file_example_bookstore_v1_bookstore_proto_rawDescGZIP(), []int{1} +} + +func (x *BookEdition) GetDisplayname() string { + if x != nil { + return x.Displayname + } + return "" +} + +func (x *BookEdition) GetPath() string { if x != nil { - return x.Id + return x.Path + } + return "" +} + +// A Isbn. +type Isbn struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Field for path. + Path string `protobuf:"bytes,10018,opt,name=path,proto3" json:"path,omitempty"` +} + +func (x *Isbn) Reset() { + *x = Isbn{} + if protoimpl.UnsafeEnabled { + mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Isbn) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Isbn) ProtoMessage() {} + +func (x *Isbn) ProtoReflect() protoreflect.Message { + mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[2] + 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 Isbn.ProtoReflect.Descriptor instead. +func (*Isbn) Descriptor() ([]byte, []int) { + return file_example_bookstore_v1_bookstore_proto_rawDescGZIP(), []int{2} +} + +func (x *Isbn) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +// A Publisher. +type Publisher struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Field for description. + Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"` + // Field for path. + Path string `protobuf:"bytes,10018,opt,name=path,proto3" json:"path,omitempty"` +} + +func (x *Publisher) Reset() { + *x = Publisher{} + if protoimpl.UnsafeEnabled { + mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Publisher) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Publisher) ProtoMessage() {} + +func (x *Publisher) ProtoReflect() protoreflect.Message { + mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[3] + 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 Publisher.ProtoReflect.Descriptor instead. +func (*Publisher) Descriptor() ([]byte, []int) { + return file_example_bookstore_v1_bookstore_proto_rawDescGZIP(), []int{3} +} + +func (x *Publisher) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *Publisher) GetPath() string { + if x != nil { + return x.Path } return "" } @@ -143,7 +299,7 @@ type CreateBookRequest struct { func (x *CreateBookRequest) Reset() { *x = CreateBookRequest{} if protoimpl.UnsafeEnabled { - mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[1] + mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -156,7 +312,7 @@ func (x *CreateBookRequest) String() string { func (*CreateBookRequest) ProtoMessage() {} func (x *CreateBookRequest) ProtoReflect() protoreflect.Message { - mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[1] + mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -169,7 +325,7 @@ func (x *CreateBookRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateBookRequest.ProtoReflect.Descriptor instead. func (*CreateBookRequest) Descriptor() ([]byte, []int) { - return file_example_bookstore_v1_bookstore_proto_rawDescGZIP(), []int{1} + return file_example_bookstore_v1_bookstore_proto_rawDescGZIP(), []int{4} } func (x *CreateBookRequest) GetParent() string { @@ -206,7 +362,7 @@ type GetBookRequest struct { func (x *GetBookRequest) Reset() { *x = GetBookRequest{} if protoimpl.UnsafeEnabled { - mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[2] + mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -219,7 +375,7 @@ func (x *GetBookRequest) String() string { func (*GetBookRequest) ProtoMessage() {} func (x *GetBookRequest) ProtoReflect() protoreflect.Message { - mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[2] + mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -232,7 +388,7 @@ func (x *GetBookRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetBookRequest.ProtoReflect.Descriptor instead. func (*GetBookRequest) Descriptor() ([]byte, []int) { - return file_example_bookstore_v1_bookstore_proto_rawDescGZIP(), []int{2} + return file_example_bookstore_v1_bookstore_proto_rawDescGZIP(), []int{5} } func (x *GetBookRequest) GetPath() string { @@ -259,7 +415,7 @@ type UpdateBookRequest struct { func (x *UpdateBookRequest) Reset() { *x = UpdateBookRequest{} if protoimpl.UnsafeEnabled { - mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[3] + mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -272,7 +428,7 @@ func (x *UpdateBookRequest) String() string { func (*UpdateBookRequest) ProtoMessage() {} func (x *UpdateBookRequest) ProtoReflect() protoreflect.Message { - mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[3] + mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -285,7 +441,7 @@ func (x *UpdateBookRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateBookRequest.ProtoReflect.Descriptor instead. func (*UpdateBookRequest) Descriptor() ([]byte, []int) { - return file_example_bookstore_v1_bookstore_proto_rawDescGZIP(), []int{3} + return file_example_bookstore_v1_bookstore_proto_rawDescGZIP(), []int{6} } func (x *UpdateBookRequest) GetPath() string { @@ -322,7 +478,7 @@ type DeleteBookRequest struct { func (x *DeleteBookRequest) Reset() { *x = DeleteBookRequest{} if protoimpl.UnsafeEnabled { - mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[4] + mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -335,7 +491,7 @@ func (x *DeleteBookRequest) String() string { func (*DeleteBookRequest) ProtoMessage() {} func (x *DeleteBookRequest) ProtoReflect() protoreflect.Message { - mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[4] + mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -348,7 +504,7 @@ func (x *DeleteBookRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteBookRequest.ProtoReflect.Descriptor instead. func (*DeleteBookRequest) Descriptor() ([]byte, []int) { - return file_example_bookstore_v1_bookstore_proto_rawDescGZIP(), []int{4} + return file_example_bookstore_v1_bookstore_proto_rawDescGZIP(), []int{7} } func (x *DeleteBookRequest) GetPath() string { @@ -375,7 +531,7 @@ type ListBooksRequest struct { func (x *ListBooksRequest) Reset() { *x = ListBooksRequest{} if protoimpl.UnsafeEnabled { - mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[5] + mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -388,7 +544,7 @@ func (x *ListBooksRequest) String() string { func (*ListBooksRequest) ProtoMessage() {} func (x *ListBooksRequest) ProtoReflect() protoreflect.Message { - mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[5] + mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -401,7 +557,7 @@ func (x *ListBooksRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ListBooksRequest.ProtoReflect.Descriptor instead. func (*ListBooksRequest) Descriptor() ([]byte, []int) { - return file_example_bookstore_v1_bookstore_proto_rawDescGZIP(), []int{5} + return file_example_bookstore_v1_bookstore_proto_rawDescGZIP(), []int{8} } func (x *ListBooksRequest) GetParent() string { @@ -440,7 +596,7 @@ type ListBooksResponse struct { func (x *ListBooksResponse) Reset() { *x = ListBooksResponse{} if protoimpl.UnsafeEnabled { - mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[6] + mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -453,7 +609,7 @@ func (x *ListBooksResponse) String() string { func (*ListBooksResponse) ProtoMessage() {} func (x *ListBooksResponse) ProtoReflect() protoreflect.Message { - mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[6] + mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -466,7 +622,7 @@ func (x *ListBooksResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListBooksResponse.ProtoReflect.Descriptor instead. func (*ListBooksResponse) Descriptor() ([]byte, []int) { - return file_example_bookstore_v1_bookstore_proto_rawDescGZIP(), []int{6} + return file_example_bookstore_v1_bookstore_proto_rawDescGZIP(), []int{9} } func (x *ListBooksResponse) GetResults() []*Book { @@ -498,7 +654,7 @@ type ApplyBookRequest struct { func (x *ApplyBookRequest) Reset() { *x = ApplyBookRequest{} if protoimpl.UnsafeEnabled { - mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[7] + mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -511,7 +667,7 @@ func (x *ApplyBookRequest) String() string { func (*ApplyBookRequest) ProtoMessage() {} func (x *ApplyBookRequest) ProtoReflect() protoreflect.Message { - mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[7] + mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -524,7 +680,7 @@ func (x *ApplyBookRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ApplyBookRequest.ProtoReflect.Descriptor instead. func (*ApplyBookRequest) Descriptor() ([]byte, []int) { - return file_example_bookstore_v1_bookstore_proto_rawDescGZIP(), []int{7} + return file_example_bookstore_v1_bookstore_proto_rawDescGZIP(), []int{10} } func (x *ApplyBookRequest) GetPath() string { @@ -541,73 +697,6 @@ func (x *ApplyBookRequest) GetBook() *Book { return nil } -// A BookEdition. -type BookEdition struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Field for displayname. - Displayname string `protobuf:"bytes,1,opt,name=displayname,proto3" json:"displayname,omitempty"` - // Field for path. - Path string `protobuf:"bytes,10000,opt,name=path,proto3" json:"path,omitempty"` - // Field for id. - Id string `protobuf:"bytes,10001,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *BookEdition) Reset() { - *x = BookEdition{} - if protoimpl.UnsafeEnabled { - mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *BookEdition) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BookEdition) ProtoMessage() {} - -func (x *BookEdition) ProtoReflect() protoreflect.Message { - mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[8] - 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 BookEdition.ProtoReflect.Descriptor instead. -func (*BookEdition) Descriptor() ([]byte, []int) { - return file_example_bookstore_v1_bookstore_proto_rawDescGZIP(), []int{8} -} - -func (x *BookEdition) GetDisplayname() string { - if x != nil { - return x.Displayname - } - return "" -} - -func (x *BookEdition) GetPath() string { - if x != nil { - return x.Path - } - return "" -} - -func (x *BookEdition) GetId() string { - if x != nil { - return x.Id - } - return "" -} - // A Create request for a book-edition resource. type CreateBookEditionRequest struct { state protoimpl.MessageState @@ -625,7 +714,7 @@ type CreateBookEditionRequest struct { func (x *CreateBookEditionRequest) Reset() { *x = CreateBookEditionRequest{} if protoimpl.UnsafeEnabled { - mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[9] + mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -638,7 +727,7 @@ func (x *CreateBookEditionRequest) String() string { func (*CreateBookEditionRequest) ProtoMessage() {} func (x *CreateBookEditionRequest) ProtoReflect() protoreflect.Message { - mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[9] + mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -651,7 +740,7 @@ func (x *CreateBookEditionRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateBookEditionRequest.ProtoReflect.Descriptor instead. func (*CreateBookEditionRequest) Descriptor() ([]byte, []int) { - return file_example_bookstore_v1_bookstore_proto_rawDescGZIP(), []int{9} + return file_example_bookstore_v1_bookstore_proto_rawDescGZIP(), []int{11} } func (x *CreateBookEditionRequest) GetParent() string { @@ -688,7 +777,7 @@ type GetBookEditionRequest struct { func (x *GetBookEditionRequest) Reset() { *x = GetBookEditionRequest{} if protoimpl.UnsafeEnabled { - mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[10] + mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -701,7 +790,7 @@ func (x *GetBookEditionRequest) String() string { func (*GetBookEditionRequest) ProtoMessage() {} func (x *GetBookEditionRequest) ProtoReflect() protoreflect.Message { - mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[10] + mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -714,7 +803,7 @@ func (x *GetBookEditionRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetBookEditionRequest.ProtoReflect.Descriptor instead. func (*GetBookEditionRequest) Descriptor() ([]byte, []int) { - return file_example_bookstore_v1_bookstore_proto_rawDescGZIP(), []int{10} + return file_example_bookstore_v1_bookstore_proto_rawDescGZIP(), []int{12} } func (x *GetBookEditionRequest) GetPath() string { @@ -737,7 +826,7 @@ type DeleteBookEditionRequest struct { func (x *DeleteBookEditionRequest) Reset() { *x = DeleteBookEditionRequest{} if protoimpl.UnsafeEnabled { - mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[11] + mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -750,7 +839,7 @@ func (x *DeleteBookEditionRequest) String() string { func (*DeleteBookEditionRequest) ProtoMessage() {} func (x *DeleteBookEditionRequest) ProtoReflect() protoreflect.Message { - mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[11] + mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -763,230 +852,47 @@ func (x *DeleteBookEditionRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteBookEditionRequest.ProtoReflect.Descriptor instead. func (*DeleteBookEditionRequest) Descriptor() ([]byte, []int) { - return file_example_bookstore_v1_bookstore_proto_rawDescGZIP(), []int{11} -} - -func (x *DeleteBookEditionRequest) GetPath() string { - if x != nil { - return x.Path - } - return "" -} - -// Request message for the Listbook-edition method -type ListBookEditionsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // A field for the parent of book-edition - Parent string `protobuf:"bytes,10013,opt,name=parent,proto3" json:"parent,omitempty"` - // The page token indicating the starting point of the page - PageToken string `protobuf:"bytes,10010,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` - // The maximum number of resources to return in a single page. - MaxPageSize int32 `protobuf:"varint,10017,opt,name=max_page_size,json=maxPageSize,proto3" json:"max_page_size,omitempty"` -} - -func (x *ListBookEditionsRequest) Reset() { - *x = ListBookEditionsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListBookEditionsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListBookEditionsRequest) ProtoMessage() {} - -func (x *ListBookEditionsRequest) ProtoReflect() protoreflect.Message { - mi := &file_example_bookstore_v1_bookstore_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 ListBookEditionsRequest.ProtoReflect.Descriptor instead. -func (*ListBookEditionsRequest) Descriptor() ([]byte, []int) { - return file_example_bookstore_v1_bookstore_proto_rawDescGZIP(), []int{12} -} - -func (x *ListBookEditionsRequest) GetParent() string { - if x != nil { - return x.Parent - } - return "" -} - -func (x *ListBookEditionsRequest) GetPageToken() string { - if x != nil { - return x.PageToken - } - return "" -} - -func (x *ListBookEditionsRequest) GetMaxPageSize() int32 { - if x != nil { - return x.MaxPageSize - } - return 0 -} - -// Response message for the Listbook-edition method -type ListBookEditionsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // A list of book-editions - Results []*BookEdition `protobuf:"bytes,10016,rep,name=results,proto3" json:"results,omitempty"` - // The page token indicating the ending point of this response. - NextPageToken string `protobuf:"bytes,10011,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` -} - -func (x *ListBookEditionsResponse) Reset() { - *x = ListBookEditionsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListBookEditionsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListBookEditionsResponse) ProtoMessage() {} - -func (x *ListBookEditionsResponse) ProtoReflect() protoreflect.Message { - mi := &file_example_bookstore_v1_bookstore_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 ListBookEditionsResponse.ProtoReflect.Descriptor instead. -func (*ListBookEditionsResponse) Descriptor() ([]byte, []int) { - return file_example_bookstore_v1_bookstore_proto_rawDescGZIP(), []int{13} -} - -func (x *ListBookEditionsResponse) GetResults() []*BookEdition { - if x != nil { - return x.Results - } - return nil -} - -func (x *ListBookEditionsResponse) GetNextPageToken() string { - if x != nil { - return x.NextPageToken - } - return "" -} - -// A Isbn. -type Isbn struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Field for path. - Path string `protobuf:"bytes,10000,opt,name=path,proto3" json:"path,omitempty"` - // Field for id. - Id string `protobuf:"bytes,10001,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *Isbn) Reset() { - *x = Isbn{} - if protoimpl.UnsafeEnabled { - mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Isbn) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Isbn) ProtoMessage() {} - -func (x *Isbn) ProtoReflect() protoreflect.Message { - mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[14] - 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 Isbn.ProtoReflect.Descriptor instead. -func (*Isbn) Descriptor() ([]byte, []int) { - return file_example_bookstore_v1_bookstore_proto_rawDescGZIP(), []int{14} -} - -func (x *Isbn) GetPath() string { - if x != nil { - return x.Path - } - return "" + return file_example_bookstore_v1_bookstore_proto_rawDescGZIP(), []int{13} } -func (x *Isbn) GetId() string { +func (x *DeleteBookEditionRequest) GetPath() string { if x != nil { - return x.Id + return x.Path } return "" } -// A Create request for a isbn resource. -type CreateIsbnRequest struct { +// Request message for the Listbook-edition method +type ListBookEditionsRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // A field for the parent of isbn + // A field for the parent of book-edition Parent string `protobuf:"bytes,10013,opt,name=parent,proto3" json:"parent,omitempty"` - // An id that uniquely identifies the resource within the collection - Id string `protobuf:"bytes,10014,opt,name=id,proto3" json:"id,omitempty"` - // The resource to perform the operation on. - Isbn *Isbn `protobuf:"bytes,10015,opt,name=isbn,proto3" json:"isbn,omitempty"` + // The page token indicating the starting point of the page + PageToken string `protobuf:"bytes,10010,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` + // The maximum number of resources to return in a single page. + MaxPageSize int32 `protobuf:"varint,10017,opt,name=max_page_size,json=maxPageSize,proto3" json:"max_page_size,omitempty"` } -func (x *CreateIsbnRequest) Reset() { - *x = CreateIsbnRequest{} +func (x *ListBookEditionsRequest) Reset() { + *x = ListBookEditionsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[15] + mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *CreateIsbnRequest) String() string { +func (x *ListBookEditionsRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CreateIsbnRequest) ProtoMessage() {} +func (*ListBookEditionsRequest) ProtoMessage() {} -func (x *CreateIsbnRequest) ProtoReflect() protoreflect.Message { - mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[15] +func (x *ListBookEditionsRequest) ProtoReflect() protoreflect.Message { + mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -997,59 +903,61 @@ func (x *CreateIsbnRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CreateIsbnRequest.ProtoReflect.Descriptor instead. -func (*CreateIsbnRequest) Descriptor() ([]byte, []int) { - return file_example_bookstore_v1_bookstore_proto_rawDescGZIP(), []int{15} +// Deprecated: Use ListBookEditionsRequest.ProtoReflect.Descriptor instead. +func (*ListBookEditionsRequest) Descriptor() ([]byte, []int) { + return file_example_bookstore_v1_bookstore_proto_rawDescGZIP(), []int{14} } -func (x *CreateIsbnRequest) GetParent() string { +func (x *ListBookEditionsRequest) GetParent() string { if x != nil { return x.Parent } return "" } -func (x *CreateIsbnRequest) GetId() string { +func (x *ListBookEditionsRequest) GetPageToken() string { if x != nil { - return x.Id + return x.PageToken } return "" } -func (x *CreateIsbnRequest) GetIsbn() *Isbn { +func (x *ListBookEditionsRequest) GetMaxPageSize() int32 { if x != nil { - return x.Isbn + return x.MaxPageSize } - return nil + return 0 } -// Request message for the Getisbn method -type GetIsbnRequest struct { +// Response message for the Listbook-edition method +type ListBookEditionsResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // The globally unique identifier for the resource - Path string `protobuf:"bytes,10018,opt,name=path,proto3" json:"path,omitempty"` + // A list of book-editions + Results []*BookEdition `protobuf:"bytes,10016,rep,name=results,proto3" json:"results,omitempty"` + // The page token indicating the ending point of this response. + NextPageToken string `protobuf:"bytes,10011,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` } -func (x *GetIsbnRequest) Reset() { - *x = GetIsbnRequest{} +func (x *ListBookEditionsResponse) Reset() { + *x = ListBookEditionsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[16] + mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *GetIsbnRequest) String() string { +func (x *ListBookEditionsResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetIsbnRequest) ProtoMessage() {} +func (*ListBookEditionsResponse) ProtoMessage() {} -func (x *GetIsbnRequest) ProtoReflect() protoreflect.Message { - mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[16] +func (x *ListBookEditionsResponse) ProtoReflect() protoreflect.Message { + mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1060,49 +968,56 @@ func (x *GetIsbnRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetIsbnRequest.ProtoReflect.Descriptor instead. -func (*GetIsbnRequest) Descriptor() ([]byte, []int) { - return file_example_bookstore_v1_bookstore_proto_rawDescGZIP(), []int{16} +// Deprecated: Use ListBookEditionsResponse.ProtoReflect.Descriptor instead. +func (*ListBookEditionsResponse) Descriptor() ([]byte, []int) { + return file_example_bookstore_v1_bookstore_proto_rawDescGZIP(), []int{15} +} + +func (x *ListBookEditionsResponse) GetResults() []*BookEdition { + if x != nil { + return x.Results + } + return nil } -func (x *GetIsbnRequest) GetPath() string { +func (x *ListBookEditionsResponse) GetNextPageToken() string { if x != nil { - return x.Path + return x.NextPageToken } return "" } -// A Publisher. -type Publisher struct { +// A Create request for a isbn resource. +type CreateIsbnRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Field for description. - Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"` - // Field for path. - Path string `protobuf:"bytes,10000,opt,name=path,proto3" json:"path,omitempty"` - // Field for id. - Id string `protobuf:"bytes,10001,opt,name=id,proto3" json:"id,omitempty"` + // A field for the parent of isbn + Parent string `protobuf:"bytes,10013,opt,name=parent,proto3" json:"parent,omitempty"` + // An id that uniquely identifies the resource within the collection + Id string `protobuf:"bytes,10014,opt,name=id,proto3" json:"id,omitempty"` + // The resource to perform the operation on. + Isbn *Isbn `protobuf:"bytes,10015,opt,name=isbn,proto3" json:"isbn,omitempty"` } -func (x *Publisher) Reset() { - *x = Publisher{} +func (x *CreateIsbnRequest) Reset() { + *x = CreateIsbnRequest{} if protoimpl.UnsafeEnabled { - mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[17] + mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *Publisher) String() string { +func (x *CreateIsbnRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Publisher) ProtoMessage() {} +func (*CreateIsbnRequest) ProtoMessage() {} -func (x *Publisher) ProtoReflect() protoreflect.Message { - mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[17] +func (x *CreateIsbnRequest) ProtoReflect() protoreflect.Message { + mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1113,30 +1028,30 @@ func (x *Publisher) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Publisher.ProtoReflect.Descriptor instead. -func (*Publisher) Descriptor() ([]byte, []int) { - return file_example_bookstore_v1_bookstore_proto_rawDescGZIP(), []int{17} +// Deprecated: Use CreateIsbnRequest.ProtoReflect.Descriptor instead. +func (*CreateIsbnRequest) Descriptor() ([]byte, []int) { + return file_example_bookstore_v1_bookstore_proto_rawDescGZIP(), []int{16} } -func (x *Publisher) GetDescription() string { +func (x *CreateIsbnRequest) GetParent() string { if x != nil { - return x.Description + return x.Parent } return "" } -func (x *Publisher) GetPath() string { +func (x *CreateIsbnRequest) GetId() string { if x != nil { - return x.Path + return x.Id } return "" } -func (x *Publisher) GetId() string { +func (x *CreateIsbnRequest) GetIsbn() *Isbn { if x != nil { - return x.Id + return x.Isbn } - return "" + return nil } // A Create request for a publisher resource. @@ -1156,7 +1071,7 @@ type CreatePublisherRequest struct { func (x *CreatePublisherRequest) Reset() { *x = CreatePublisherRequest{} if protoimpl.UnsafeEnabled { - mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[18] + mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1169,7 +1084,7 @@ func (x *CreatePublisherRequest) String() string { func (*CreatePublisherRequest) ProtoMessage() {} func (x *CreatePublisherRequest) ProtoReflect() protoreflect.Message { - mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[18] + mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1182,7 +1097,7 @@ func (x *CreatePublisherRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CreatePublisherRequest.ProtoReflect.Descriptor instead. func (*CreatePublisherRequest) Descriptor() ([]byte, []int) { - return file_example_bookstore_v1_bookstore_proto_rawDescGZIP(), []int{18} + return file_example_bookstore_v1_bookstore_proto_rawDescGZIP(), []int{17} } func (x *CreatePublisherRequest) GetParent() string { @@ -1219,7 +1134,7 @@ type GetPublisherRequest struct { func (x *GetPublisherRequest) Reset() { *x = GetPublisherRequest{} if protoimpl.UnsafeEnabled { - mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[19] + mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1232,7 +1147,7 @@ func (x *GetPublisherRequest) String() string { func (*GetPublisherRequest) ProtoMessage() {} func (x *GetPublisherRequest) ProtoReflect() protoreflect.Message { - mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[19] + mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1245,7 +1160,7 @@ func (x *GetPublisherRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetPublisherRequest.ProtoReflect.Descriptor instead. func (*GetPublisherRequest) Descriptor() ([]byte, []int) { - return file_example_bookstore_v1_bookstore_proto_rawDescGZIP(), []int{19} + return file_example_bookstore_v1_bookstore_proto_rawDescGZIP(), []int{18} } func (x *GetPublisherRequest) GetPath() string { @@ -1272,7 +1187,7 @@ type UpdatePublisherRequest struct { func (x *UpdatePublisherRequest) Reset() { *x = UpdatePublisherRequest{} if protoimpl.UnsafeEnabled { - mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[20] + mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1285,7 +1200,7 @@ func (x *UpdatePublisherRequest) String() string { func (*UpdatePublisherRequest) ProtoMessage() {} func (x *UpdatePublisherRequest) ProtoReflect() protoreflect.Message { - mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[20] + mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1298,7 +1213,7 @@ func (x *UpdatePublisherRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdatePublisherRequest.ProtoReflect.Descriptor instead. func (*UpdatePublisherRequest) Descriptor() ([]byte, []int) { - return file_example_bookstore_v1_bookstore_proto_rawDescGZIP(), []int{20} + return file_example_bookstore_v1_bookstore_proto_rawDescGZIP(), []int{19} } func (x *UpdatePublisherRequest) GetPath() string { @@ -1335,7 +1250,7 @@ type DeletePublisherRequest struct { func (x *DeletePublisherRequest) Reset() { *x = DeletePublisherRequest{} if protoimpl.UnsafeEnabled { - mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[21] + mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1348,7 +1263,7 @@ func (x *DeletePublisherRequest) String() string { func (*DeletePublisherRequest) ProtoMessage() {} func (x *DeletePublisherRequest) ProtoReflect() protoreflect.Message { - mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[21] + mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1361,7 +1276,7 @@ func (x *DeletePublisherRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DeletePublisherRequest.ProtoReflect.Descriptor instead. func (*DeletePublisherRequest) Descriptor() ([]byte, []int) { - return file_example_bookstore_v1_bookstore_proto_rawDescGZIP(), []int{21} + return file_example_bookstore_v1_bookstore_proto_rawDescGZIP(), []int{20} } func (x *DeletePublisherRequest) GetPath() string { @@ -1388,7 +1303,7 @@ type ListPublishersRequest struct { func (x *ListPublishersRequest) Reset() { *x = ListPublishersRequest{} if protoimpl.UnsafeEnabled { - mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[22] + mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1401,7 +1316,7 @@ func (x *ListPublishersRequest) String() string { func (*ListPublishersRequest) ProtoMessage() {} func (x *ListPublishersRequest) ProtoReflect() protoreflect.Message { - mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[22] + mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1414,7 +1329,7 @@ func (x *ListPublishersRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ListPublishersRequest.ProtoReflect.Descriptor instead. func (*ListPublishersRequest) Descriptor() ([]byte, []int) { - return file_example_bookstore_v1_bookstore_proto_rawDescGZIP(), []int{22} + return file_example_bookstore_v1_bookstore_proto_rawDescGZIP(), []int{21} } func (x *ListPublishersRequest) GetParent() string { @@ -1453,7 +1368,7 @@ type ListPublishersResponse struct { func (x *ListPublishersResponse) Reset() { *x = ListPublishersResponse{} if protoimpl.UnsafeEnabled { - mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[23] + mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1466,7 +1381,7 @@ func (x *ListPublishersResponse) String() string { func (*ListPublishersResponse) ProtoMessage() {} func (x *ListPublishersResponse) ProtoReflect() protoreflect.Message { - mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[23] + mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1479,7 +1394,7 @@ func (x *ListPublishersResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListPublishersResponse.ProtoReflect.Descriptor instead. func (*ListPublishersResponse) Descriptor() ([]byte, []int) { - return file_example_bookstore_v1_bookstore_proto_rawDescGZIP(), []int{23} + return file_example_bookstore_v1_bookstore_proto_rawDescGZIP(), []int{22} } func (x *ListPublishersResponse) GetResults() []*Publisher { @@ -1511,7 +1426,7 @@ type ApplyPublisherRequest struct { func (x *ApplyPublisherRequest) Reset() { *x = ApplyPublisherRequest{} if protoimpl.UnsafeEnabled { - mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[24] + mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1524,7 +1439,7 @@ func (x *ApplyPublisherRequest) String() string { func (*ApplyPublisherRequest) ProtoMessage() {} func (x *ApplyPublisherRequest) ProtoReflect() protoreflect.Message { - mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[24] + mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1537,7 +1452,7 @@ func (x *ApplyPublisherRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ApplyPublisherRequest.ProtoReflect.Descriptor instead. func (*ApplyPublisherRequest) Descriptor() ([]byte, []int) { - return file_example_bookstore_v1_bookstore_proto_rawDescGZIP(), []int{24} + return file_example_bookstore_v1_bookstore_proto_rawDescGZIP(), []int{23} } func (x *ApplyPublisherRequest) GetPath() string { @@ -1569,7 +1484,7 @@ type Book_Author struct { func (x *Book_Author) Reset() { *x = Book_Author{} if protoimpl.UnsafeEnabled { - mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[25] + mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1582,7 +1497,7 @@ func (x *Book_Author) String() string { func (*Book_Author) ProtoMessage() {} func (x *Book_Author) ProtoReflect() protoreflect.Message { - mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[25] + mi := &file_example_bookstore_v1_bookstore_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1629,201 +1544,177 @@ var file_example_bookstore_v1_bookstore_proto_rawDesc = []byte{ 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66, 0x69, - 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9c, - 0x02, 0x0a, 0x04, 0x42, 0x6f, 0x6f, 0x6b, 0x12, 0x39, 0x0a, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, + 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xfc, + 0x01, 0x0a, 0x04, 0x42, 0x6f, 0x6f, 0x6b, 0x12, 0x39, 0x0a, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x62, 0x6f, 0x6f, 0x6b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6f, 0x6f, 0x6b, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x52, 0x06, 0x61, 0x75, 0x74, 0x68, - 0x6f, 0x72, 0x12, 0x17, 0x0a, 0x04, 0x69, 0x73, 0x62, 0x6e, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, - 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x04, 0x69, 0x73, 0x62, 0x6e, 0x12, 0x19, 0x0a, 0x05, 0x70, - 0x72, 0x69, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x02, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, - 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x12, 0x21, 0x0a, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, - 0x68, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x09, - 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x64, 0x69, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x65, 0x64, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x13, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x90, 0x4e, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x0f, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x91, - 0x4e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x1a, 0x42, 0x0a, 0x06, 0x41, 0x75, 0x74, + 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x73, 0x62, 0x6e, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x04, 0x69, 0x73, 0x62, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x02, 0x52, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x12, 0x1c, 0x0a, 0x09, + 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x64, + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x65, 0x64, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x13, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0xa2, 0x4e, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x1a, 0x42, 0x0a, 0x06, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x69, 0x72, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x66, 0x69, 0x72, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x61, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x61, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x7b, 0x0a, - 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x9d, 0x4e, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x06, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x00, 0x52, 0x06, 0x70, 0x61, 0x72, - 0x65, 0x6e, 0x74, 0x12, 0x0f, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x9e, 0x4e, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x02, 0x69, 0x64, 0x12, 0x34, 0x0a, 0x04, 0x62, 0x6f, 0x6f, 0x6b, 0x18, 0x9f, 0x4e, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x62, 0x6f, - 0x6f, 0x6b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6f, 0x6f, 0x6b, 0x42, - 0x03, 0xe0, 0x41, 0x02, 0x52, 0x04, 0x62, 0x6f, 0x6f, 0x6b, 0x22, 0x49, 0x0a, 0x0e, 0x47, 0x65, - 0x74, 0x42, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x37, 0x0a, 0x04, - 0x70, 0x61, 0x74, 0x68, 0x18, 0xa2, 0x4e, 0x20, 0x01, 0x28, 0x09, 0x42, 0x22, 0xe0, 0x41, 0x02, - 0xfa, 0x41, 0x1c, 0x0a, 0x1a, 0x62, 0x6f, 0x6f, 0x6b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x65, - 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x6f, 0x6f, 0x6b, 0x52, - 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0xc0, 0x01, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x42, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x37, 0x0a, 0x04, 0x70, - 0x61, 0x74, 0x68, 0x18, 0xa2, 0x4e, 0x20, 0x01, 0x28, 0x09, 0x42, 0x22, 0xe0, 0x41, 0x02, 0xfa, - 0x41, 0x1c, 0x0a, 0x1a, 0x62, 0x6f, 0x6f, 0x6b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x65, 0x78, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x6f, 0x6f, 0x6b, 0x52, 0x04, - 0x70, 0x61, 0x74, 0x68, 0x12, 0x34, 0x0a, 0x04, 0x62, 0x6f, 0x6f, 0x6b, 0x18, 0x9f, 0x4e, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x62, 0x6f, - 0x6f, 0x6b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6f, 0x6f, 0x6b, 0x42, - 0x03, 0xe0, 0x41, 0x02, 0x52, 0x04, 0x62, 0x6f, 0x6f, 0x6b, 0x12, 0x3c, 0x0a, 0x0b, 0x75, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x9c, 0x4e, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x4c, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x42, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x37, 0x0a, - 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0xa2, 0x4e, 0x20, 0x01, 0x28, 0x09, 0x42, 0x22, 0xe0, 0x41, - 0x02, 0xfa, 0x41, 0x1c, 0x0a, 0x1a, 0x62, 0x6f, 0x6f, 0x6b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, - 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x6f, 0x6f, 0x6b, - 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0x78, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x6f, - 0x6f, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x06, 0x70, 0x61, - 0x72, 0x65, 0x6e, 0x74, 0x18, 0x9d, 0x4e, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe0, 0x41, 0x02, - 0xfa, 0x41, 0x00, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x70, - 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x9a, 0x4e, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x6d, - 0x61, 0x78, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0xa1, 0x4e, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x0b, 0x6d, 0x61, 0x78, 0x50, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, - 0x22, 0x73, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x6f, 0x6f, 0x6b, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, - 0x18, 0xa0, 0x4e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, - 0x65, 0x2e, 0x62, 0x6f, 0x6f, 0x6b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, - 0x6f, 0x6f, 0x6b, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x27, 0x0a, 0x0f, - 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, - 0x9b, 0x4e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, - 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x81, 0x01, 0x0a, 0x10, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x42, - 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x37, 0x0a, 0x04, 0x70, 0x61, - 0x74, 0x68, 0x18, 0xa2, 0x4e, 0x20, 0x01, 0x28, 0x09, 0x42, 0x22, 0xe0, 0x41, 0x02, 0xfa, 0x41, - 0x1c, 0x0a, 0x1a, 0x62, 0x6f, 0x6f, 0x6b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x65, 0x78, 0x61, - 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x6f, 0x6f, 0x6b, 0x52, 0x04, 0x70, - 0x61, 0x74, 0x68, 0x12, 0x34, 0x0a, 0x04, 0x62, 0x6f, 0x6f, 0x6b, 0x18, 0x9f, 0x4e, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x62, 0x6f, 0x6f, - 0x6b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6f, 0x6f, 0x6b, 0x42, 0x03, - 0xe0, 0x41, 0x02, 0x52, 0x04, 0x62, 0x6f, 0x6f, 0x6b, 0x22, 0x5a, 0x0a, 0x0b, 0x42, 0x6f, 0x6f, - 0x6b, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x0a, 0x0b, 0x64, 0x69, 0x73, 0x70, - 0x6c, 0x61, 0x79, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, - 0x41, 0x02, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x13, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x90, 0x4e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x70, 0x61, 0x74, 0x68, 0x12, 0x0f, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x91, 0x4e, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x98, 0x01, 0x0a, 0x18, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x42, 0x6f, 0x6f, 0x6b, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x9d, 0x4e, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x06, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x00, 0x52, 0x06, 0x70, 0x61, 0x72, - 0x65, 0x6e, 0x74, 0x12, 0x0f, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x9e, 0x4e, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x02, 0x69, 0x64, 0x12, 0x4a, 0x0a, 0x0c, 0x62, 0x6f, 0x6f, 0x6b, 0x5f, 0x65, 0x64, 0x69, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x9f, 0x4e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x65, 0x78, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x62, 0x6f, 0x6f, 0x6b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, - 0x76, 0x31, 0x2e, 0x42, 0x6f, 0x6f, 0x6b, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x03, - 0xe0, 0x41, 0x02, 0x52, 0x0b, 0x62, 0x6f, 0x6f, 0x6b, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, - 0x22, 0x58, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x42, 0x6f, 0x6f, 0x6b, 0x45, 0x64, 0x69, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x04, 0x70, 0x61, 0x74, - 0x68, 0x18, 0xa2, 0x4e, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2a, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x24, - 0x0a, 0x22, 0x62, 0x6f, 0x6f, 0x6b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x65, 0x78, 0x61, 0x6d, - 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x6f, 0x6f, 0x6b, 0x2d, 0x65, 0x64, 0x69, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0x5b, 0x0a, 0x18, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x42, 0x6f, 0x6f, 0x6b, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0xa2, - 0x4e, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2a, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x24, 0x0a, 0x22, 0x62, - 0x6f, 0x6f, 0x6b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x6f, 0x6f, 0x6b, 0x2d, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0x7f, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x42, - 0x6f, 0x6f, 0x6b, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x9d, 0x4e, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x06, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x00, 0x52, 0x06, 0x70, 0x61, 0x72, - 0x65, 0x6e, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, - 0x6e, 0x18, 0x9a, 0x4e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, - 0x6b, 0x65, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x6d, 0x61, 0x78, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, - 0x73, 0x69, 0x7a, 0x65, 0x18, 0xa1, 0x4e, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x6d, 0x61, 0x78, - 0x50, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x81, 0x01, 0x0a, 0x18, 0x4c, 0x69, 0x73, - 0x74, 0x42, 0x6f, 0x6f, 0x6b, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, - 0x18, 0xa0, 0x4e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, - 0x65, 0x2e, 0x62, 0x6f, 0x6f, 0x6b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, - 0x6f, 0x6f, 0x6b, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, - 0x6c, 0x74, 0x73, 0x12, 0x27, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, - 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x9b, 0x4e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, - 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x2c, 0x0a, 0x04, - 0x49, 0x73, 0x62, 0x6e, 0x12, 0x13, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x90, 0x4e, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x0f, 0x0a, 0x02, 0x69, 0x64, 0x18, - 0x91, 0x4e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x7b, 0x0a, 0x11, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x49, 0x73, 0x62, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x61, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x44, 0x0a, + 0x0b, 0x42, 0x6f, 0x6f, 0x6b, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x20, 0x0a, 0x0b, + 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x13, + 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0xa2, 0x4e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, + 0x61, 0x74, 0x68, 0x22, 0x1b, 0x0a, 0x04, 0x49, 0x73, 0x62, 0x6e, 0x12, 0x13, 0x0a, 0x04, 0x70, + 0x61, 0x74, 0x68, 0x18, 0xa2, 0x4e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, + 0x22, 0x42, 0x0a, 0x09, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x12, 0x20, 0x0a, + 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x13, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0xa2, 0x4e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x70, 0x61, 0x74, 0x68, 0x22, 0x7b, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x6f, + 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x06, 0x70, 0x61, 0x72, + 0x65, 0x6e, 0x74, 0x18, 0x9d, 0x4e, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe0, 0x41, 0x02, 0xfa, + 0x41, 0x00, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x0f, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x9e, 0x4e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x34, 0x0a, 0x04, 0x62, + 0x6f, 0x6f, 0x6b, 0x18, 0x9f, 0x4e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x65, 0x78, 0x61, + 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x62, 0x6f, 0x6f, 0x6b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x42, 0x6f, 0x6f, 0x6b, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x04, 0x62, 0x6f, 0x6f, + 0x6b, 0x22, 0x33, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x42, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0xa2, 0x4e, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x0c, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x06, 0x0a, 0x04, 0x62, 0x6f, 0x6f, 0x6b, + 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0xaa, 0x01, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x42, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x04, + 0x70, 0x61, 0x74, 0x68, 0x18, 0xa2, 0x4e, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0c, 0xe0, 0x41, 0x02, + 0xfa, 0x41, 0x06, 0x0a, 0x04, 0x62, 0x6f, 0x6f, 0x6b, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, + 0x34, 0x0a, 0x04, 0x62, 0x6f, 0x6f, 0x6b, 0x18, 0x9f, 0x4e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x62, 0x6f, 0x6f, 0x6b, 0x73, 0x74, 0x6f, + 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6f, 0x6f, 0x6b, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, + 0x04, 0x62, 0x6f, 0x6f, 0x6b, 0x12, 0x3c, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, + 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x9c, 0x4e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, + 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, + 0x61, 0x73, 0x6b, 0x22, 0x36, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x6f, 0x6f, + 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, + 0x18, 0xa2, 0x4e, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0c, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x06, 0x0a, + 0x04, 0x62, 0x6f, 0x6f, 0x6b, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0x78, 0x0a, 0x10, 0x4c, + 0x69, 0x73, 0x74, 0x42, 0x6f, 0x6f, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x9d, 0x4e, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x00, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, - 0x12, 0x0f, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x9e, 0x4e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, - 0x64, 0x12, 0x34, 0x0a, 0x04, 0x69, 0x73, 0x62, 0x6e, 0x18, 0x9f, 0x4e, 0x20, 0x01, 0x28, 0x0b, + 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x9a, + 0x4e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x12, 0x23, 0x0a, 0x0d, 0x6d, 0x61, 0x78, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, + 0x65, 0x18, 0xa1, 0x4e, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x6d, 0x61, 0x78, 0x50, 0x61, 0x67, + 0x65, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x73, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x6f, 0x6f, + 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x07, 0x72, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0xa0, 0x4e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x65, + 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x62, 0x6f, 0x6f, 0x6b, 0x73, 0x74, 0x6f, 0x72, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6f, 0x6f, 0x6b, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x73, 0x12, 0x27, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x9b, 0x4e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, + 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x6b, 0x0a, 0x10, 0x41, 0x70, + 0x70, 0x6c, 0x79, 0x42, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, + 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0xa2, 0x4e, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0c, 0xe0, + 0x41, 0x02, 0xfa, 0x41, 0x06, 0x0a, 0x04, 0x62, 0x6f, 0x6f, 0x6b, 0x52, 0x04, 0x70, 0x61, 0x74, + 0x68, 0x12, 0x34, 0x0a, 0x04, 0x62, 0x6f, 0x6f, 0x6b, 0x18, 0x9f, 0x4e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x62, 0x6f, 0x6f, 0x6b, 0x73, - 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x73, 0x62, 0x6e, 0x42, 0x03, 0xe0, 0x41, - 0x02, 0x52, 0x04, 0x69, 0x73, 0x62, 0x6e, 0x22, 0x49, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x49, 0x73, - 0x62, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x37, 0x0a, 0x04, 0x70, 0x61, 0x74, - 0x68, 0x18, 0xa2, 0x4e, 0x20, 0x01, 0x28, 0x09, 0x42, 0x22, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x1c, - 0x0a, 0x1a, 0x62, 0x6f, 0x6f, 0x6b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x65, 0x78, 0x61, 0x6d, - 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x73, 0x62, 0x6e, 0x52, 0x04, 0x70, 0x61, - 0x74, 0x68, 0x22, 0x53, 0x0a, 0x09, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x12, - 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x13, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x90, 0x4e, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x0f, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x91, 0x4e, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x8f, 0x01, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x9d, 0x4e, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x06, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x00, 0x52, 0x06, 0x70, 0x61, 0x72, - 0x65, 0x6e, 0x74, 0x12, 0x0f, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x9e, 0x4e, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x02, 0x69, 0x64, 0x12, 0x43, 0x0a, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, - 0x72, 0x18, 0x9f, 0x4e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, + 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6f, 0x6f, 0x6b, 0x42, 0x03, 0xe0, 0x41, + 0x02, 0x52, 0x04, 0x62, 0x6f, 0x6f, 0x6b, 0x22, 0x98, 0x01, 0x0a, 0x18, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x42, 0x6f, 0x6f, 0x6b, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x9d, + 0x4e, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x00, 0x52, 0x06, 0x70, + 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x0f, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x9e, 0x4e, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x4a, 0x0a, 0x0c, 0x62, 0x6f, 0x6f, 0x6b, 0x5f, 0x65, + 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x9f, 0x4e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, + 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x62, 0x6f, 0x6f, 0x6b, 0x73, 0x74, 0x6f, 0x72, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6f, 0x6f, 0x6b, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0b, 0x62, 0x6f, 0x6f, 0x6b, 0x45, 0x64, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x22, 0x42, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x42, 0x6f, 0x6f, 0x6b, 0x45, 0x64, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x29, 0x0a, 0x04, 0x70, + 0x61, 0x74, 0x68, 0x18, 0xa2, 0x4e, 0x20, 0x01, 0x28, 0x09, 0x42, 0x14, 0xe0, 0x41, 0x02, 0xfa, + 0x41, 0x0e, 0x0a, 0x0c, 0x62, 0x6f, 0x6f, 0x6b, 0x2d, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0x45, 0x0a, 0x18, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x42, 0x6f, 0x6f, 0x6b, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x29, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0xa2, 0x4e, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x14, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x0e, 0x0a, 0x0c, 0x62, 0x6f, 0x6f, 0x6b, 0x2d, + 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0x7f, 0x0a, + 0x17, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x6f, 0x6f, 0x6b, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, + 0x6e, 0x74, 0x18, 0x9d, 0x4e, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe0, 0x41, 0x02, 0xfa, 0x41, + 0x00, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x61, 0x67, + 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x9a, 0x4e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x6d, 0x61, 0x78, + 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0xa1, 0x4e, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x0b, 0x6d, 0x61, 0x78, 0x50, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x81, + 0x01, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x6f, 0x6f, 0x6b, 0x45, 0x64, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x07, 0x72, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0xa0, 0x4e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, + 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x62, 0x6f, 0x6f, 0x6b, 0x73, 0x74, 0x6f, 0x72, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6f, 0x6f, 0x6b, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x27, 0x0a, 0x0f, 0x6e, 0x65, 0x78, + 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x9b, 0x4e, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x22, 0x7b, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x73, 0x62, 0x6e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, + 0x74, 0x18, 0x9d, 0x4e, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x00, + 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x0f, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x9e, + 0x4e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x34, 0x0a, 0x04, 0x69, 0x73, 0x62, + 0x6e, 0x18, 0x9f, 0x4e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x62, 0x6f, 0x6f, 0x6b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, - 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x09, - 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x22, 0x53, 0x0a, 0x13, 0x47, 0x65, 0x74, + 0x49, 0x73, 0x62, 0x6e, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x04, 0x69, 0x73, 0x62, 0x6e, 0x22, + 0x8f, 0x01, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, + 0x68, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x06, 0x70, 0x61, + 0x72, 0x65, 0x6e, 0x74, 0x18, 0x9d, 0x4e, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe0, 0x41, 0x02, + 0xfa, 0x41, 0x00, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x0f, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x9e, 0x4e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x43, 0x0a, 0x09, + 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x18, 0x9f, 0x4e, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x62, 0x6f, 0x6f, 0x6b, 0x73, + 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, + 0x72, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, + 0x72, 0x22, 0x3d, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, + 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, + 0x18, 0xa2, 0x4e, 0x20, 0x01, 0x28, 0x09, 0x42, 0x11, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x0b, 0x0a, + 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, + 0x22, 0xc3, 0x01, 0x0a, 0x16, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x75, 0x62, 0x6c, 0x69, + 0x73, 0x68, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x04, 0x70, + 0x61, 0x74, 0x68, 0x18, 0xa2, 0x4e, 0x20, 0x01, 0x28, 0x09, 0x42, 0x11, 0xe0, 0x41, 0x02, 0xfa, + 0x41, 0x0b, 0x0a, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x52, 0x04, 0x70, + 0x61, 0x74, 0x68, 0x12, 0x43, 0x0a, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, + 0x18, 0x9f, 0x4e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, + 0x65, 0x2e, 0x62, 0x6f, 0x6f, 0x6b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, + 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x09, 0x70, + 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x12, 0x3c, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x9c, 0x4e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x40, 0x0a, 0x16, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x3c, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0xa2, 0x4e, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x27, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x21, 0x0a, 0x1f, 0x62, 0x6f, 0x6f, 0x6b, 0x73, 0x74, 0x6f, - 0x72, 0x65, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, - 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0xd9, - 0x01, 0x0a, 0x16, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, - 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3c, 0x0a, 0x04, 0x70, 0x61, 0x74, - 0x68, 0x18, 0xa2, 0x4e, 0x20, 0x01, 0x28, 0x09, 0x42, 0x27, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x21, - 0x0a, 0x1f, 0x62, 0x6f, 0x6f, 0x6b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x65, 0x78, 0x61, 0x6d, - 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, - 0x72, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x43, 0x0a, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, - 0x73, 0x68, 0x65, 0x72, 0x18, 0x9f, 0x4e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x78, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x62, 0x6f, 0x6f, 0x6b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, - 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x42, 0x03, 0xe0, 0x41, - 0x02, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x12, 0x3c, 0x0a, 0x0b, - 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x9c, 0x4e, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, - 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x56, 0x0a, 0x16, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x3c, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0xa2, 0x4e, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x27, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x21, 0x0a, 0x1f, 0x62, 0x6f, 0x6f, - 0x6b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x52, 0x04, 0x70, 0x61, - 0x74, 0x68, 0x22, 0x7d, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, - 0x68, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x06, 0x70, - 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x9d, 0x4e, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe0, 0x41, - 0x02, 0xfa, 0x41, 0x00, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x1e, 0x0a, 0x0a, - 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x9a, 0x4e, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x23, 0x0a, 0x0d, - 0x6d, 0x61, 0x78, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0xa1, 0x4e, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x6d, 0x61, 0x78, 0x50, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, - 0x65, 0x22, 0x7d, 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, - 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x07, 0x72, - 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0xa0, 0x4e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, - 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x62, 0x6f, 0x6f, 0x6b, 0x73, 0x74, 0x6f, 0x72, - 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x52, 0x07, - 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x27, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, - 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x9b, 0x4e, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, - 0x22, 0x9a, 0x01, 0x0a, 0x15, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, - 0x68, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3c, 0x0a, 0x04, 0x70, 0x61, - 0x74, 0x68, 0x18, 0xa2, 0x4e, 0x20, 0x01, 0x28, 0x09, 0x42, 0x27, 0xe0, 0x41, 0x02, 0xfa, 0x41, - 0x21, 0x0a, 0x1f, 0x62, 0x6f, 0x6f, 0x6b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x65, 0x78, 0x61, - 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, + 0x12, 0x26, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0xa2, 0x4e, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x11, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x0b, 0x0a, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, + 0x65, 0x72, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0x7d, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, + 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x1f, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x9d, 0x4e, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x06, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x00, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, + 0x6e, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, + 0x18, 0x9a, 0x4e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x6d, 0x61, 0x78, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, + 0x69, 0x7a, 0x65, 0x18, 0xa1, 0x4e, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x6d, 0x61, 0x78, 0x50, + 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x7d, 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x50, + 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x3a, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0xa0, 0x4e, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x62, 0x6f, + 0x6f, 0x6b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, + 0x73, 0x68, 0x65, 0x72, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x27, 0x0a, + 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, + 0x18, 0x9b, 0x4e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, + 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x84, 0x01, 0x0a, 0x15, 0x41, 0x70, 0x70, 0x6c, 0x79, + 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x26, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0xa2, 0x4e, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x11, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x0b, 0x0a, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x43, 0x0a, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x18, 0x9f, 0x4e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x62, 0x6f, 0x6f, 0x6b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x42, 0x03, 0xe0, - 0x41, 0x02, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x32, 0x98, 0x14, + 0x41, 0x02, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x32, 0xab, 0x13, 0x0a, 0x09, 0x42, 0x6f, 0x6f, 0x6b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x8b, 0x01, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x6f, 0x6f, 0x6b, 0x12, 0x27, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x62, 0x6f, 0x6f, 0x6b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, @@ -1924,69 +1815,63 @@ var file_example_bookstore_v1_bookstore_proto_rawDesc = []byte{ 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x73, 0x62, 0x6e, 0x22, 0x2b, 0xda, 0x41, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x2c, 0x69, 0x73, 0x62, 0x6e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x3a, 0x04, 0x69, 0x73, 0x62, 0x6e, 0x22, 0x0f, 0x2f, 0x7b, 0x70, 0x61, 0x72, - 0x65, 0x6e, 0x74, 0x3d, 0x69, 0x73, 0x62, 0x6e, 0x73, 0x7d, 0x12, 0x6b, 0x0a, 0x07, 0x47, 0x65, - 0x74, 0x49, 0x73, 0x62, 0x6e, 0x12, 0x24, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, - 0x62, 0x6f, 0x6f, 0x6b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, - 0x49, 0x73, 0x62, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x65, 0x78, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x62, 0x6f, 0x6f, 0x6b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, - 0x76, 0x31, 0x2e, 0x49, 0x73, 0x62, 0x6e, 0x22, 0x1e, 0xda, 0x41, 0x04, 0x70, 0x61, 0x74, 0x68, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x11, 0x12, 0x0f, 0x2f, 0x7b, 0x70, 0x61, 0x74, 0x68, 0x3d, 0x69, - 0x73, 0x62, 0x6e, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x9c, 0x01, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x12, 0x2c, 0x2e, 0x65, 0x78, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x62, 0x6f, 0x6f, 0x6b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, - 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, - 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x65, 0x78, 0x61, 0x6d, - 0x70, 0x6c, 0x65, 0x2e, 0x62, 0x6f, 0x6f, 0x6b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, - 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x22, 0x3a, 0xda, 0x41, 0x10, 0x70, - 0x61, 0x72, 0x65, 0x6e, 0x74, 0x2c, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x3a, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, - 0x22, 0x14, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x75, 0x62, 0x6c, 0x69, - 0x73, 0x68, 0x65, 0x72, 0x73, 0x7d, 0x12, 0x7f, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x50, 0x75, 0x62, - 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x12, 0x29, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, - 0x2e, 0x62, 0x6f, 0x6f, 0x6b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, - 0x74, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x1f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x62, 0x6f, 0x6f, 0x6b, - 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, - 0x65, 0x72, 0x22, 0x23, 0xda, 0x41, 0x04, 0x70, 0x61, 0x74, 0x68, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x16, 0x12, 0x14, 0x2f, 0x7b, 0x70, 0x61, 0x74, 0x68, 0x3d, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, - 0x68, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0xa1, 0x01, 0x0a, 0x0f, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x12, 0x2c, 0x2e, 0x65, 0x78, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x62, 0x6f, 0x6f, 0x6b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, - 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, - 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x65, 0x78, 0x61, 0x6d, - 0x70, 0x6c, 0x65, 0x2e, 0x62, 0x6f, 0x6f, 0x6b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, - 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x22, 0x3f, 0xda, 0x41, 0x15, 0x70, - 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, - 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x3a, 0x09, 0x70, 0x75, 0x62, 0x6c, - 0x69, 0x73, 0x68, 0x65, 0x72, 0x32, 0x14, 0x2f, 0x7b, 0x70, 0x61, 0x74, 0x68, 0x3d, 0x70, 0x75, - 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x7c, 0x0a, 0x0f, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x12, 0x2c, + 0x65, 0x6e, 0x74, 0x3d, 0x69, 0x73, 0x62, 0x6e, 0x73, 0x7d, 0x12, 0x9c, 0x01, 0x0a, 0x0f, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x12, 0x2c, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x62, 0x6f, 0x6f, 0x6b, 0x73, 0x74, 0x6f, - 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x75, 0x62, 0x6c, - 0x69, 0x73, 0x68, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, - 0x6d, 0x70, 0x74, 0x79, 0x22, 0x23, 0xda, 0x41, 0x04, 0x70, 0x61, 0x74, 0x68, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x16, 0x2a, 0x14, 0x2f, 0x7b, 0x70, 0x61, 0x74, 0x68, 0x3d, 0x70, 0x75, 0x62, 0x6c, - 0x69, 0x73, 0x68, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x92, 0x01, 0x0a, 0x0e, 0x4c, 0x69, - 0x73, 0x74, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x73, 0x12, 0x2b, 0x2e, 0x65, + 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x75, 0x62, 0x6c, + 0x69, 0x73, 0x68, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x62, 0x6f, 0x6f, 0x6b, 0x73, 0x74, 0x6f, 0x72, 0x65, - 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, - 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x65, 0x78, 0x61, 0x6d, + 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x22, 0x3a, 0xda, + 0x41, 0x10, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x2c, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, + 0x65, 0x72, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x3a, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, + 0x68, 0x65, 0x72, 0x22, 0x14, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x73, 0x7d, 0x12, 0x7f, 0x0a, 0x0c, 0x47, 0x65, 0x74, + 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x12, 0x29, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x62, 0x6f, 0x6f, 0x6b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, 0xda, 0x41, 0x06, 0x70, 0x61, 0x72, 0x65, - 0x6e, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x12, 0x14, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, - 0x6e, 0x74, 0x3d, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x73, 0x7d, 0x12, 0x87, - 0x01, 0x0a, 0x0e, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, - 0x72, 0x12, 0x2b, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x62, 0x6f, 0x6f, 0x6b, - 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x50, 0x75, - 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, + 0x2e, 0x47, 0x65, 0x74, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x62, + 0x6f, 0x6f, 0x6b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x6c, + 0x69, 0x73, 0x68, 0x65, 0x72, 0x22, 0x23, 0xda, 0x41, 0x04, 0x70, 0x61, 0x74, 0x68, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x16, 0x12, 0x14, 0x2f, 0x7b, 0x70, 0x61, 0x74, 0x68, 0x3d, 0x70, 0x75, 0x62, + 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0xa1, 0x01, 0x0a, 0x0f, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x12, 0x2c, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x62, 0x6f, 0x6f, 0x6b, 0x73, 0x74, 0x6f, - 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x22, - 0x27, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x3a, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, - 0x65, 0x72, 0x1a, 0x14, 0x2f, 0x7b, 0x70, 0x61, 0x74, 0x68, 0x3d, 0x70, 0x75, 0x62, 0x6c, 0x69, - 0x73, 0x68, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x42, 0x0c, 0x5a, 0x0a, 0x2f, 0x62, 0x6f, 0x6f, - 0x6b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x75, 0x62, 0x6c, + 0x69, 0x73, 0x68, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x65, + 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x62, 0x6f, 0x6f, 0x6b, 0x73, 0x74, 0x6f, 0x72, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x22, 0x3f, 0xda, + 0x41, 0x15, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x2c, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x3a, 0x09, 0x70, + 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x32, 0x14, 0x2f, 0x7b, 0x70, 0x61, 0x74, 0x68, + 0x3d, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x7c, + 0x0a, 0x0f, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, + 0x72, 0x12, 0x2c, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x62, 0x6f, 0x6f, 0x6b, + 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, + 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x23, 0xda, 0x41, 0x04, 0x70, 0x61, 0x74, 0x68, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x2a, 0x14, 0x2f, 0x7b, 0x70, 0x61, 0x74, 0x68, 0x3d, 0x70, + 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x92, 0x01, 0x0a, + 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x73, 0x12, + 0x2b, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x62, 0x6f, 0x6f, 0x6b, 0x73, 0x74, + 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x75, 0x62, 0x6c, 0x69, + 0x73, 0x68, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x65, + 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x62, 0x6f, 0x6f, 0x6b, 0x73, 0x74, 0x6f, 0x72, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, + 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, 0xda, 0x41, 0x06, 0x70, + 0x61, 0x72, 0x65, 0x6e, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x12, 0x14, 0x2f, 0x7b, 0x70, + 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x73, + 0x7d, 0x12, 0x87, 0x01, 0x0a, 0x0e, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x50, 0x75, 0x62, 0x6c, 0x69, + 0x73, 0x68, 0x65, 0x72, 0x12, 0x2b, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x62, + 0x6f, 0x6f, 0x6b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x70, 0x70, 0x6c, + 0x79, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x62, 0x6f, 0x6f, 0x6b, + 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, + 0x65, 0x72, 0x22, 0x27, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x3a, 0x09, 0x70, 0x75, 0x62, 0x6c, + 0x69, 0x73, 0x68, 0x65, 0x72, 0x1a, 0x14, 0x2f, 0x7b, 0x70, 0x61, 0x74, 0x68, 0x3d, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x42, 0x0c, 0x5a, 0x0a, 0x2f, + 0x62, 0x6f, 0x6f, 0x6b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( @@ -2001,90 +1886,87 @@ func file_example_bookstore_v1_bookstore_proto_rawDescGZIP() []byte { return file_example_bookstore_v1_bookstore_proto_rawDescData } -var file_example_bookstore_v1_bookstore_proto_msgTypes = make([]protoimpl.MessageInfo, 26) +var file_example_bookstore_v1_bookstore_proto_msgTypes = make([]protoimpl.MessageInfo, 25) var file_example_bookstore_v1_bookstore_proto_goTypes = []interface{}{ (*Book)(nil), // 0: example.bookstore.v1.Book - (*CreateBookRequest)(nil), // 1: example.bookstore.v1.CreateBookRequest - (*GetBookRequest)(nil), // 2: example.bookstore.v1.GetBookRequest - (*UpdateBookRequest)(nil), // 3: example.bookstore.v1.UpdateBookRequest - (*DeleteBookRequest)(nil), // 4: example.bookstore.v1.DeleteBookRequest - (*ListBooksRequest)(nil), // 5: example.bookstore.v1.ListBooksRequest - (*ListBooksResponse)(nil), // 6: example.bookstore.v1.ListBooksResponse - (*ApplyBookRequest)(nil), // 7: example.bookstore.v1.ApplyBookRequest - (*BookEdition)(nil), // 8: example.bookstore.v1.BookEdition - (*CreateBookEditionRequest)(nil), // 9: example.bookstore.v1.CreateBookEditionRequest - (*GetBookEditionRequest)(nil), // 10: example.bookstore.v1.GetBookEditionRequest - (*DeleteBookEditionRequest)(nil), // 11: example.bookstore.v1.DeleteBookEditionRequest - (*ListBookEditionsRequest)(nil), // 12: example.bookstore.v1.ListBookEditionsRequest - (*ListBookEditionsResponse)(nil), // 13: example.bookstore.v1.ListBookEditionsResponse - (*Isbn)(nil), // 14: example.bookstore.v1.Isbn - (*CreateIsbnRequest)(nil), // 15: example.bookstore.v1.CreateIsbnRequest - (*GetIsbnRequest)(nil), // 16: example.bookstore.v1.GetIsbnRequest - (*Publisher)(nil), // 17: example.bookstore.v1.Publisher - (*CreatePublisherRequest)(nil), // 18: example.bookstore.v1.CreatePublisherRequest - (*GetPublisherRequest)(nil), // 19: example.bookstore.v1.GetPublisherRequest - (*UpdatePublisherRequest)(nil), // 20: example.bookstore.v1.UpdatePublisherRequest - (*DeletePublisherRequest)(nil), // 21: example.bookstore.v1.DeletePublisherRequest - (*ListPublishersRequest)(nil), // 22: example.bookstore.v1.ListPublishersRequest - (*ListPublishersResponse)(nil), // 23: example.bookstore.v1.ListPublishersResponse - (*ApplyPublisherRequest)(nil), // 24: example.bookstore.v1.ApplyPublisherRequest - (*Book_Author)(nil), // 25: example.bookstore.v1.Book.Author - (*fieldmaskpb.FieldMask)(nil), // 26: google.protobuf.FieldMask - (*emptypb.Empty)(nil), // 27: google.protobuf.Empty + (*BookEdition)(nil), // 1: example.bookstore.v1.BookEdition + (*Isbn)(nil), // 2: example.bookstore.v1.Isbn + (*Publisher)(nil), // 3: example.bookstore.v1.Publisher + (*CreateBookRequest)(nil), // 4: example.bookstore.v1.CreateBookRequest + (*GetBookRequest)(nil), // 5: example.bookstore.v1.GetBookRequest + (*UpdateBookRequest)(nil), // 6: example.bookstore.v1.UpdateBookRequest + (*DeleteBookRequest)(nil), // 7: example.bookstore.v1.DeleteBookRequest + (*ListBooksRequest)(nil), // 8: example.bookstore.v1.ListBooksRequest + (*ListBooksResponse)(nil), // 9: example.bookstore.v1.ListBooksResponse + (*ApplyBookRequest)(nil), // 10: example.bookstore.v1.ApplyBookRequest + (*CreateBookEditionRequest)(nil), // 11: example.bookstore.v1.CreateBookEditionRequest + (*GetBookEditionRequest)(nil), // 12: example.bookstore.v1.GetBookEditionRequest + (*DeleteBookEditionRequest)(nil), // 13: example.bookstore.v1.DeleteBookEditionRequest + (*ListBookEditionsRequest)(nil), // 14: example.bookstore.v1.ListBookEditionsRequest + (*ListBookEditionsResponse)(nil), // 15: example.bookstore.v1.ListBookEditionsResponse + (*CreateIsbnRequest)(nil), // 16: example.bookstore.v1.CreateIsbnRequest + (*CreatePublisherRequest)(nil), // 17: example.bookstore.v1.CreatePublisherRequest + (*GetPublisherRequest)(nil), // 18: example.bookstore.v1.GetPublisherRequest + (*UpdatePublisherRequest)(nil), // 19: example.bookstore.v1.UpdatePublisherRequest + (*DeletePublisherRequest)(nil), // 20: example.bookstore.v1.DeletePublisherRequest + (*ListPublishersRequest)(nil), // 21: example.bookstore.v1.ListPublishersRequest + (*ListPublishersResponse)(nil), // 22: example.bookstore.v1.ListPublishersResponse + (*ApplyPublisherRequest)(nil), // 23: example.bookstore.v1.ApplyPublisherRequest + (*Book_Author)(nil), // 24: example.bookstore.v1.Book.Author + (*fieldmaskpb.FieldMask)(nil), // 25: google.protobuf.FieldMask + (*emptypb.Empty)(nil), // 26: google.protobuf.Empty } var file_example_bookstore_v1_bookstore_proto_depIdxs = []int32{ - 25, // 0: example.bookstore.v1.Book.author:type_name -> example.bookstore.v1.Book.Author + 24, // 0: example.bookstore.v1.Book.author:type_name -> example.bookstore.v1.Book.Author 0, // 1: example.bookstore.v1.CreateBookRequest.book:type_name -> example.bookstore.v1.Book 0, // 2: example.bookstore.v1.UpdateBookRequest.book:type_name -> example.bookstore.v1.Book - 26, // 3: example.bookstore.v1.UpdateBookRequest.update_mask:type_name -> google.protobuf.FieldMask + 25, // 3: example.bookstore.v1.UpdateBookRequest.update_mask:type_name -> google.protobuf.FieldMask 0, // 4: example.bookstore.v1.ListBooksResponse.results:type_name -> example.bookstore.v1.Book 0, // 5: example.bookstore.v1.ApplyBookRequest.book:type_name -> example.bookstore.v1.Book - 8, // 6: example.bookstore.v1.CreateBookEditionRequest.book_edition:type_name -> example.bookstore.v1.BookEdition - 8, // 7: example.bookstore.v1.ListBookEditionsResponse.results:type_name -> example.bookstore.v1.BookEdition - 14, // 8: example.bookstore.v1.CreateIsbnRequest.isbn:type_name -> example.bookstore.v1.Isbn - 17, // 9: example.bookstore.v1.CreatePublisherRequest.publisher:type_name -> example.bookstore.v1.Publisher - 17, // 10: example.bookstore.v1.UpdatePublisherRequest.publisher:type_name -> example.bookstore.v1.Publisher - 26, // 11: example.bookstore.v1.UpdatePublisherRequest.update_mask:type_name -> google.protobuf.FieldMask - 17, // 12: example.bookstore.v1.ListPublishersResponse.results:type_name -> example.bookstore.v1.Publisher - 17, // 13: example.bookstore.v1.ApplyPublisherRequest.publisher:type_name -> example.bookstore.v1.Publisher - 1, // 14: example.bookstore.v1.Bookstore.CreateBook:input_type -> example.bookstore.v1.CreateBookRequest - 2, // 15: example.bookstore.v1.Bookstore.GetBook:input_type -> example.bookstore.v1.GetBookRequest - 3, // 16: example.bookstore.v1.Bookstore.UpdateBook:input_type -> example.bookstore.v1.UpdateBookRequest - 4, // 17: example.bookstore.v1.Bookstore.DeleteBook:input_type -> example.bookstore.v1.DeleteBookRequest - 5, // 18: example.bookstore.v1.Bookstore.ListBooks:input_type -> example.bookstore.v1.ListBooksRequest - 7, // 19: example.bookstore.v1.Bookstore.ApplyBook:input_type -> example.bookstore.v1.ApplyBookRequest - 9, // 20: example.bookstore.v1.Bookstore.CreateBookEdition:input_type -> example.bookstore.v1.CreateBookEditionRequest - 10, // 21: example.bookstore.v1.Bookstore.GetBookEdition:input_type -> example.bookstore.v1.GetBookEditionRequest - 11, // 22: example.bookstore.v1.Bookstore.DeleteBookEdition:input_type -> example.bookstore.v1.DeleteBookEditionRequest - 12, // 23: example.bookstore.v1.Bookstore.ListBookEditions:input_type -> example.bookstore.v1.ListBookEditionsRequest - 15, // 24: example.bookstore.v1.Bookstore.CreateIsbn:input_type -> example.bookstore.v1.CreateIsbnRequest - 16, // 25: example.bookstore.v1.Bookstore.GetIsbn:input_type -> example.bookstore.v1.GetIsbnRequest - 18, // 26: example.bookstore.v1.Bookstore.CreatePublisher:input_type -> example.bookstore.v1.CreatePublisherRequest - 19, // 27: example.bookstore.v1.Bookstore.GetPublisher:input_type -> example.bookstore.v1.GetPublisherRequest - 20, // 28: example.bookstore.v1.Bookstore.UpdatePublisher:input_type -> example.bookstore.v1.UpdatePublisherRequest - 21, // 29: example.bookstore.v1.Bookstore.DeletePublisher:input_type -> example.bookstore.v1.DeletePublisherRequest - 22, // 30: example.bookstore.v1.Bookstore.ListPublishers:input_type -> example.bookstore.v1.ListPublishersRequest - 24, // 31: example.bookstore.v1.Bookstore.ApplyPublisher:input_type -> example.bookstore.v1.ApplyPublisherRequest - 0, // 32: example.bookstore.v1.Bookstore.CreateBook:output_type -> example.bookstore.v1.Book - 0, // 33: example.bookstore.v1.Bookstore.GetBook:output_type -> example.bookstore.v1.Book - 0, // 34: example.bookstore.v1.Bookstore.UpdateBook:output_type -> example.bookstore.v1.Book - 27, // 35: example.bookstore.v1.Bookstore.DeleteBook:output_type -> google.protobuf.Empty - 6, // 36: example.bookstore.v1.Bookstore.ListBooks:output_type -> example.bookstore.v1.ListBooksResponse - 0, // 37: example.bookstore.v1.Bookstore.ApplyBook:output_type -> example.bookstore.v1.Book - 8, // 38: example.bookstore.v1.Bookstore.CreateBookEdition:output_type -> example.bookstore.v1.BookEdition - 8, // 39: example.bookstore.v1.Bookstore.GetBookEdition:output_type -> example.bookstore.v1.BookEdition - 27, // 40: example.bookstore.v1.Bookstore.DeleteBookEdition:output_type -> google.protobuf.Empty - 13, // 41: example.bookstore.v1.Bookstore.ListBookEditions:output_type -> example.bookstore.v1.ListBookEditionsResponse - 14, // 42: example.bookstore.v1.Bookstore.CreateIsbn:output_type -> example.bookstore.v1.Isbn - 14, // 43: example.bookstore.v1.Bookstore.GetIsbn:output_type -> example.bookstore.v1.Isbn - 17, // 44: example.bookstore.v1.Bookstore.CreatePublisher:output_type -> example.bookstore.v1.Publisher - 17, // 45: example.bookstore.v1.Bookstore.GetPublisher:output_type -> example.bookstore.v1.Publisher - 17, // 46: example.bookstore.v1.Bookstore.UpdatePublisher:output_type -> example.bookstore.v1.Publisher - 27, // 47: example.bookstore.v1.Bookstore.DeletePublisher:output_type -> google.protobuf.Empty - 23, // 48: example.bookstore.v1.Bookstore.ListPublishers:output_type -> example.bookstore.v1.ListPublishersResponse - 17, // 49: example.bookstore.v1.Bookstore.ApplyPublisher:output_type -> example.bookstore.v1.Publisher - 32, // [32:50] is the sub-list for method output_type - 14, // [14:32] is the sub-list for method input_type + 1, // 6: example.bookstore.v1.CreateBookEditionRequest.book_edition:type_name -> example.bookstore.v1.BookEdition + 1, // 7: example.bookstore.v1.ListBookEditionsResponse.results:type_name -> example.bookstore.v1.BookEdition + 2, // 8: example.bookstore.v1.CreateIsbnRequest.isbn:type_name -> example.bookstore.v1.Isbn + 3, // 9: example.bookstore.v1.CreatePublisherRequest.publisher:type_name -> example.bookstore.v1.Publisher + 3, // 10: example.bookstore.v1.UpdatePublisherRequest.publisher:type_name -> example.bookstore.v1.Publisher + 25, // 11: example.bookstore.v1.UpdatePublisherRequest.update_mask:type_name -> google.protobuf.FieldMask + 3, // 12: example.bookstore.v1.ListPublishersResponse.results:type_name -> example.bookstore.v1.Publisher + 3, // 13: example.bookstore.v1.ApplyPublisherRequest.publisher:type_name -> example.bookstore.v1.Publisher + 4, // 14: example.bookstore.v1.Bookstore.CreateBook:input_type -> example.bookstore.v1.CreateBookRequest + 5, // 15: example.bookstore.v1.Bookstore.GetBook:input_type -> example.bookstore.v1.GetBookRequest + 6, // 16: example.bookstore.v1.Bookstore.UpdateBook:input_type -> example.bookstore.v1.UpdateBookRequest + 7, // 17: example.bookstore.v1.Bookstore.DeleteBook:input_type -> example.bookstore.v1.DeleteBookRequest + 8, // 18: example.bookstore.v1.Bookstore.ListBooks:input_type -> example.bookstore.v1.ListBooksRequest + 10, // 19: example.bookstore.v1.Bookstore.ApplyBook:input_type -> example.bookstore.v1.ApplyBookRequest + 11, // 20: example.bookstore.v1.Bookstore.CreateBookEdition:input_type -> example.bookstore.v1.CreateBookEditionRequest + 12, // 21: example.bookstore.v1.Bookstore.GetBookEdition:input_type -> example.bookstore.v1.GetBookEditionRequest + 13, // 22: example.bookstore.v1.Bookstore.DeleteBookEdition:input_type -> example.bookstore.v1.DeleteBookEditionRequest + 14, // 23: example.bookstore.v1.Bookstore.ListBookEditions:input_type -> example.bookstore.v1.ListBookEditionsRequest + 16, // 24: example.bookstore.v1.Bookstore.CreateIsbn:input_type -> example.bookstore.v1.CreateIsbnRequest + 17, // 25: example.bookstore.v1.Bookstore.CreatePublisher:input_type -> example.bookstore.v1.CreatePublisherRequest + 18, // 26: example.bookstore.v1.Bookstore.GetPublisher:input_type -> example.bookstore.v1.GetPublisherRequest + 19, // 27: example.bookstore.v1.Bookstore.UpdatePublisher:input_type -> example.bookstore.v1.UpdatePublisherRequest + 20, // 28: example.bookstore.v1.Bookstore.DeletePublisher:input_type -> example.bookstore.v1.DeletePublisherRequest + 21, // 29: example.bookstore.v1.Bookstore.ListPublishers:input_type -> example.bookstore.v1.ListPublishersRequest + 23, // 30: example.bookstore.v1.Bookstore.ApplyPublisher:input_type -> example.bookstore.v1.ApplyPublisherRequest + 0, // 31: example.bookstore.v1.Bookstore.CreateBook:output_type -> example.bookstore.v1.Book + 0, // 32: example.bookstore.v1.Bookstore.GetBook:output_type -> example.bookstore.v1.Book + 0, // 33: example.bookstore.v1.Bookstore.UpdateBook:output_type -> example.bookstore.v1.Book + 26, // 34: example.bookstore.v1.Bookstore.DeleteBook:output_type -> google.protobuf.Empty + 9, // 35: example.bookstore.v1.Bookstore.ListBooks:output_type -> example.bookstore.v1.ListBooksResponse + 0, // 36: example.bookstore.v1.Bookstore.ApplyBook:output_type -> example.bookstore.v1.Book + 1, // 37: example.bookstore.v1.Bookstore.CreateBookEdition:output_type -> example.bookstore.v1.BookEdition + 1, // 38: example.bookstore.v1.Bookstore.GetBookEdition:output_type -> example.bookstore.v1.BookEdition + 26, // 39: example.bookstore.v1.Bookstore.DeleteBookEdition:output_type -> google.protobuf.Empty + 15, // 40: example.bookstore.v1.Bookstore.ListBookEditions:output_type -> example.bookstore.v1.ListBookEditionsResponse + 2, // 41: example.bookstore.v1.Bookstore.CreateIsbn:output_type -> example.bookstore.v1.Isbn + 3, // 42: example.bookstore.v1.Bookstore.CreatePublisher:output_type -> example.bookstore.v1.Publisher + 3, // 43: example.bookstore.v1.Bookstore.GetPublisher:output_type -> example.bookstore.v1.Publisher + 3, // 44: example.bookstore.v1.Bookstore.UpdatePublisher:output_type -> example.bookstore.v1.Publisher + 26, // 45: example.bookstore.v1.Bookstore.DeletePublisher:output_type -> google.protobuf.Empty + 22, // 46: example.bookstore.v1.Bookstore.ListPublishers:output_type -> example.bookstore.v1.ListPublishersResponse + 3, // 47: example.bookstore.v1.Bookstore.ApplyPublisher:output_type -> example.bookstore.v1.Publisher + 31, // [31:48] is the sub-list for method output_type + 14, // [14:31] is the sub-list for method input_type 14, // [14:14] is the sub-list for extension type_name 14, // [14:14] is the sub-list for extension extendee 0, // [0:14] is the sub-list for field type_name @@ -2109,7 +1991,7 @@ func file_example_bookstore_v1_bookstore_proto_init() { } } file_example_bookstore_v1_bookstore_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateBookRequest); i { + switch v := v.(*BookEdition); i { case 0: return &v.state case 1: @@ -2121,7 +2003,7 @@ func file_example_bookstore_v1_bookstore_proto_init() { } } file_example_bookstore_v1_bookstore_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetBookRequest); i { + switch v := v.(*Isbn); i { case 0: return &v.state case 1: @@ -2133,7 +2015,7 @@ func file_example_bookstore_v1_bookstore_proto_init() { } } file_example_bookstore_v1_bookstore_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateBookRequest); i { + switch v := v.(*Publisher); i { case 0: return &v.state case 1: @@ -2145,7 +2027,7 @@ func file_example_bookstore_v1_bookstore_proto_init() { } } file_example_bookstore_v1_bookstore_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteBookRequest); i { + switch v := v.(*CreateBookRequest); i { case 0: return &v.state case 1: @@ -2157,7 +2039,7 @@ func file_example_bookstore_v1_bookstore_proto_init() { } } file_example_bookstore_v1_bookstore_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListBooksRequest); i { + switch v := v.(*GetBookRequest); i { case 0: return &v.state case 1: @@ -2169,7 +2051,7 @@ func file_example_bookstore_v1_bookstore_proto_init() { } } file_example_bookstore_v1_bookstore_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListBooksResponse); i { + switch v := v.(*UpdateBookRequest); i { case 0: return &v.state case 1: @@ -2181,7 +2063,7 @@ func file_example_bookstore_v1_bookstore_proto_init() { } } file_example_bookstore_v1_bookstore_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ApplyBookRequest); i { + switch v := v.(*DeleteBookRequest); i { case 0: return &v.state case 1: @@ -2193,7 +2075,7 @@ func file_example_bookstore_v1_bookstore_proto_init() { } } file_example_bookstore_v1_bookstore_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BookEdition); i { + switch v := v.(*ListBooksRequest); i { case 0: return &v.state case 1: @@ -2205,7 +2087,7 @@ func file_example_bookstore_v1_bookstore_proto_init() { } } file_example_bookstore_v1_bookstore_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateBookEditionRequest); i { + switch v := v.(*ListBooksResponse); i { case 0: return &v.state case 1: @@ -2217,7 +2099,7 @@ func file_example_bookstore_v1_bookstore_proto_init() { } } file_example_bookstore_v1_bookstore_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetBookEditionRequest); i { + switch v := v.(*ApplyBookRequest); i { case 0: return &v.state case 1: @@ -2229,7 +2111,7 @@ func file_example_bookstore_v1_bookstore_proto_init() { } } file_example_bookstore_v1_bookstore_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteBookEditionRequest); i { + switch v := v.(*CreateBookEditionRequest); i { case 0: return &v.state case 1: @@ -2241,7 +2123,7 @@ func file_example_bookstore_v1_bookstore_proto_init() { } } file_example_bookstore_v1_bookstore_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListBookEditionsRequest); i { + switch v := v.(*GetBookEditionRequest); i { case 0: return &v.state case 1: @@ -2253,7 +2135,7 @@ func file_example_bookstore_v1_bookstore_proto_init() { } } file_example_bookstore_v1_bookstore_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListBookEditionsResponse); i { + switch v := v.(*DeleteBookEditionRequest); i { case 0: return &v.state case 1: @@ -2265,7 +2147,7 @@ func file_example_bookstore_v1_bookstore_proto_init() { } } file_example_bookstore_v1_bookstore_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Isbn); i { + switch v := v.(*ListBookEditionsRequest); i { case 0: return &v.state case 1: @@ -2277,7 +2159,7 @@ func file_example_bookstore_v1_bookstore_proto_init() { } } file_example_bookstore_v1_bookstore_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateIsbnRequest); i { + switch v := v.(*ListBookEditionsResponse); i { case 0: return &v.state case 1: @@ -2289,7 +2171,7 @@ func file_example_bookstore_v1_bookstore_proto_init() { } } file_example_bookstore_v1_bookstore_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetIsbnRequest); i { + switch v := v.(*CreateIsbnRequest); i { case 0: return &v.state case 1: @@ -2301,18 +2183,6 @@ func file_example_bookstore_v1_bookstore_proto_init() { } } file_example_bookstore_v1_bookstore_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Publisher); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_example_bookstore_v1_bookstore_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreatePublisherRequest); i { case 0: return &v.state @@ -2324,7 +2194,7 @@ func file_example_bookstore_v1_bookstore_proto_init() { return nil } } - file_example_bookstore_v1_bookstore_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + file_example_bookstore_v1_bookstore_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetPublisherRequest); i { case 0: return &v.state @@ -2336,7 +2206,7 @@ func file_example_bookstore_v1_bookstore_proto_init() { return nil } } - file_example_bookstore_v1_bookstore_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + file_example_bookstore_v1_bookstore_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdatePublisherRequest); i { case 0: return &v.state @@ -2348,7 +2218,7 @@ func file_example_bookstore_v1_bookstore_proto_init() { return nil } } - file_example_bookstore_v1_bookstore_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + file_example_bookstore_v1_bookstore_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeletePublisherRequest); i { case 0: return &v.state @@ -2360,7 +2230,7 @@ func file_example_bookstore_v1_bookstore_proto_init() { return nil } } - file_example_bookstore_v1_bookstore_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + file_example_bookstore_v1_bookstore_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListPublishersRequest); i { case 0: return &v.state @@ -2372,7 +2242,7 @@ func file_example_bookstore_v1_bookstore_proto_init() { return nil } } - file_example_bookstore_v1_bookstore_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + file_example_bookstore_v1_bookstore_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListPublishersResponse); i { case 0: return &v.state @@ -2384,7 +2254,7 @@ func file_example_bookstore_v1_bookstore_proto_init() { return nil } } - file_example_bookstore_v1_bookstore_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + file_example_bookstore_v1_bookstore_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ApplyPublisherRequest); i { case 0: return &v.state @@ -2396,7 +2266,7 @@ func file_example_bookstore_v1_bookstore_proto_init() { return nil } } - file_example_bookstore_v1_bookstore_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + file_example_bookstore_v1_bookstore_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Book_Author); i { case 0: return &v.state @@ -2415,7 +2285,7 @@ func file_example_bookstore_v1_bookstore_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_example_bookstore_v1_bookstore_proto_rawDesc, NumEnums: 0, - NumMessages: 26, + NumMessages: 25, NumExtensions: 0, NumServices: 1, }, diff --git a/example/bookstore/v1/bookstore.pb.gw.go b/example/bookstore/v1/bookstore.pb.gw.go index 43850cf..d23965f 100644 --- a/example/bookstore/v1/bookstore.pb.gw.go +++ b/example/bookstore/v1/bookstore.pb.gw.go @@ -805,58 +805,6 @@ func local_request_Bookstore_CreateIsbn_0(ctx context.Context, marshaler runtime } -func request_Bookstore_GetIsbn_0(ctx context.Context, marshaler runtime.Marshaler, client BookstoreClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetIsbnRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["path"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "path") - } - - protoReq.Path, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "path", err) - } - - msg, err := client.GetIsbn(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Bookstore_GetIsbn_0(ctx context.Context, marshaler runtime.Marshaler, server BookstoreServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetIsbnRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["path"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "path") - } - - protoReq.Path, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "path", err) - } - - msg, err := server.GetIsbn(ctx, &protoReq) - return msg, metadata, err - -} - var ( filter_Bookstore_CreatePublisher_0 = &utilities.DoubleArray{Encoding: map[string]int{"publisher": 0, "parent": 1}, Base: []int{1, 2, 4, 0, 0, 0, 0}, Check: []int{0, 1, 1, 2, 2, 3, 3}} ) @@ -1566,31 +1514,6 @@ func RegisterBookstoreHandlerServer(ctx context.Context, mux *runtime.ServeMux, }) - mux.Handle("GET", pattern_Bookstore_GetIsbn_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/example.bookstore.v1.Bookstore/GetIsbn", runtime.WithHTTPPathPattern("/{path=isbns/*}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Bookstore_GetIsbn_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Bookstore_GetIsbn_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - mux.Handle("POST", pattern_Bookstore_CreatePublisher_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -2024,28 +1947,6 @@ func RegisterBookstoreHandlerClient(ctx context.Context, mux *runtime.ServeMux, }) - mux.Handle("GET", pattern_Bookstore_GetIsbn_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/example.bookstore.v1.Bookstore/GetIsbn", runtime.WithHTTPPathPattern("/{path=isbns/*}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Bookstore_GetIsbn_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Bookstore_GetIsbn_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - mux.Handle("POST", pattern_Bookstore_CreatePublisher_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -2204,8 +2105,6 @@ var ( pattern_Bookstore_CreateIsbn_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 4, 1, 5, 1}, []string{"isbns", "parent"}, "")) - pattern_Bookstore_GetIsbn_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 2, 5, 1}, []string{"isbns", "path"}, "")) - pattern_Bookstore_CreatePublisher_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 4, 1, 5, 1}, []string{"publishers", "parent"}, "")) pattern_Bookstore_GetPublisher_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 2, 5, 1}, []string{"publishers", "path"}, "")) @@ -2242,8 +2141,6 @@ var ( forward_Bookstore_CreateIsbn_0 = runtime.ForwardResponseMessage - forward_Bookstore_GetIsbn_0 = runtime.ForwardResponseMessage - forward_Bookstore_CreatePublisher_0 = runtime.ForwardResponseMessage forward_Bookstore_GetPublisher_0 = runtime.ForwardResponseMessage diff --git a/example/bookstore/v1/bookstore.proto b/example/bookstore/v1/bookstore.proto index 5b5a920..6931282 100644 --- a/example/bookstore/v1/bookstore.proto +++ b/example/bookstore/v1/bookstore.proto @@ -107,13 +107,6 @@ service Bookstore { option (google.api.method_signature) = "parent,isbn"; } - // An aep-compliant Get method for isbn. - rpc GetIsbn ( GetIsbnRequest ) returns ( Isbn ) { - option (google.api.http) = { get: "/{path=isbns/*}" }; - - option (google.api.method_signature) = "path"; - } - // An aep-compliant Create method for publisher. rpc CreatePublisher ( CreatePublisherRequest ) returns ( Publisher ) { option (google.api.http) = { @@ -176,22 +169,43 @@ message Book { repeated Author author = 5; // Field for isbn. - repeated string isbn = 1 [(google.api.field_behavior) = REQUIRED]; + repeated string isbn = 1; // Field for price. - float price = 2 [(google.api.field_behavior) = REQUIRED]; + float price = 2; // Field for published. - bool published = 3 [(google.api.field_behavior) = REQUIRED]; + bool published = 3; // Field for edition. int32 edition = 4; // Field for path. - string path = 10000; + string path = 10018; +} + +// A BookEdition. +message BookEdition { + // Field for displayname. + string displayname = 1; + + // Field for path. + string path = 10018; +} + +// A Isbn. +message Isbn { + // Field for path. + string path = 10018; +} - // Field for id. - string id = 10001; +// A Publisher. +message Publisher { + // Field for description. + string description = 1; + + // Field for path. + string path = 10018; } // A Create request for a book resource. @@ -214,7 +228,7 @@ message GetBookRequest { // The globally unique identifier for the resource string path = 10018 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "bookstore.example.com/book" } + (google.api.resource_reference) = { type: "book" } ]; } @@ -223,7 +237,7 @@ message UpdateBookRequest { // The globally unique identifier for the resource string path = 10018 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "bookstore.example.com/book" } + (google.api.resource_reference) = { type: "book" } ]; // The resource to perform the operation on. @@ -238,7 +252,7 @@ message DeleteBookRequest { // The globally unique identifier for the resource string path = 10018 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "bookstore.example.com/book" } + (google.api.resource_reference) = { type: "book" } ]; } @@ -271,25 +285,13 @@ message ApplyBookRequest { // The globally unique identifier for the resource string path = 10018 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "bookstore.example.com/book" } + (google.api.resource_reference) = { type: "book" } ]; // The resource to perform the operation on. Book book = 10015 [(google.api.field_behavior) = REQUIRED]; } -// A BookEdition. -message BookEdition { - // Field for displayname. - string displayname = 1 [(google.api.field_behavior) = REQUIRED]; - - // Field for path. - string path = 10000; - - // Field for id. - string id = 10001; -} - // A Create request for a book-edition resource. message CreateBookEditionRequest { // A field for the parent of book-edition @@ -310,7 +312,7 @@ message GetBookEditionRequest { // The globally unique identifier for the resource string path = 10018 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "bookstore.example.com/book-edition" } + (google.api.resource_reference) = { type: "book-edition" } ]; } @@ -319,7 +321,7 @@ message DeleteBookEditionRequest { // The globally unique identifier for the resource string path = 10018 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "bookstore.example.com/book-edition" } + (google.api.resource_reference) = { type: "book-edition" } ]; } @@ -347,15 +349,6 @@ message ListBookEditionsResponse { string next_page_token = 10011; } -// A Isbn. -message Isbn { - // Field for path. - string path = 10000; - - // Field for id. - string id = 10001; -} - // A Create request for a isbn resource. message CreateIsbnRequest { // A field for the parent of isbn @@ -371,27 +364,6 @@ message CreateIsbnRequest { Isbn isbn = 10015 [(google.api.field_behavior) = REQUIRED]; } -// Request message for the Getisbn method -message GetIsbnRequest { - // The globally unique identifier for the resource - string path = 10018 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "bookstore.example.com/isbn" } - ]; -} - -// A Publisher. -message Publisher { - // Field for description. - string description = 1; - - // Field for path. - string path = 10000; - - // Field for id. - string id = 10001; -} - // A Create request for a publisher resource. message CreatePublisherRequest { // A field for the parent of publisher @@ -412,7 +384,7 @@ message GetPublisherRequest { // The globally unique identifier for the resource string path = 10018 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "bookstore.example.com/publisher" } + (google.api.resource_reference) = { type: "publisher" } ]; } @@ -421,7 +393,7 @@ message UpdatePublisherRequest { // The globally unique identifier for the resource string path = 10018 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "bookstore.example.com/publisher" } + (google.api.resource_reference) = { type: "publisher" } ]; // The resource to perform the operation on. @@ -436,7 +408,7 @@ message DeletePublisherRequest { // The globally unique identifier for the resource string path = 10018 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "bookstore.example.com/publisher" } + (google.api.resource_reference) = { type: "publisher" } ]; } @@ -469,7 +441,7 @@ message ApplyPublisherRequest { // The globally unique identifier for the resource string path = 10018 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "bookstore.example.com/publisher" } + (google.api.resource_reference) = { type: "publisher" } ]; // The resource to perform the operation on. diff --git a/example/bookstore/v1/bookstore.swagger.json b/example/bookstore/v1/bookstore.swagger.json index 859aee3..20b3a2b 100644 --- a/example/bookstore/v1/bookstore.swagger.json +++ b/example/bookstore/v1/bookstore.swagger.json @@ -515,13 +515,13 @@ }, "/{path_2}": { "get": { - "summary": "An aep-compliant Get method for isbn.", - "operationId": "Bookstore_GetIsbn", + "summary": "An aep-compliant Get method for publisher.", + "operationId": "Bookstore_GetPublisher", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1Isbn" + "$ref": "#/definitions/v1Publisher" } }, "default": { @@ -538,7 +538,7 @@ "in": "path", "required": true, "type": "string", - "pattern": "isbns/[^/]+" + "pattern": "publishers/[^/]+" } ], "tags": [ @@ -578,39 +578,6 @@ ] } }, - "/{path_3}": { - "get": { - "summary": "An aep-compliant Get method for publisher.", - "operationId": "Bookstore_GetPublisher", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1Publisher" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "path_3", - "description": "The globally unique identifier for the resource", - "in": "path", - "required": true, - "type": "string", - "pattern": "publishers/[^/]+" - } - ], - "tags": [ - "Bookstore" - ] - } - }, "/{path}": { "get": { "summary": "An aep-compliant Get method for book.", @@ -841,18 +808,9 @@ "path": { "type": "string", "description": "Field for path." - }, - "id": { - "type": "string", - "description": "Field for id." } }, - "description": "A Book.", - "required": [ - "isbn", - "price", - "published" - ] + "description": "A Book." }, "v1BookEdition": { "type": "object", @@ -864,16 +822,9 @@ "path": { "type": "string", "description": "Field for path." - }, - "id": { - "type": "string", - "description": "Field for id." } }, - "description": "A BookEdition.", - "required": [ - "displayname" - ] + "description": "A BookEdition." }, "v1Isbn": { "type": "object", @@ -881,10 +832,6 @@ "path": { "type": "string", "description": "Field for path." - }, - "id": { - "type": "string", - "description": "Field for id." } }, "description": "A Isbn." @@ -953,10 +900,6 @@ "path": { "type": "string", "description": "Field for path." - }, - "id": { - "type": "string", - "description": "Field for id." } }, "description": "A Publisher." diff --git a/example/bookstore/v1/bookstore_grpc.pb.go b/example/bookstore/v1/bookstore_grpc.pb.go index b3409d1..e19b7e3 100644 --- a/example/bookstore/v1/bookstore_grpc.pb.go +++ b/example/bookstore/v1/bookstore_grpc.pb.go @@ -31,7 +31,6 @@ const ( Bookstore_DeleteBookEdition_FullMethodName = "/example.bookstore.v1.Bookstore/DeleteBookEdition" Bookstore_ListBookEditions_FullMethodName = "/example.bookstore.v1.Bookstore/ListBookEditions" Bookstore_CreateIsbn_FullMethodName = "/example.bookstore.v1.Bookstore/CreateIsbn" - Bookstore_GetIsbn_FullMethodName = "/example.bookstore.v1.Bookstore/GetIsbn" Bookstore_CreatePublisher_FullMethodName = "/example.bookstore.v1.Bookstore/CreatePublisher" Bookstore_GetPublisher_FullMethodName = "/example.bookstore.v1.Bookstore/GetPublisher" Bookstore_UpdatePublisher_FullMethodName = "/example.bookstore.v1.Bookstore/UpdatePublisher" @@ -66,8 +65,6 @@ type BookstoreClient interface { ListBookEditions(ctx context.Context, in *ListBookEditionsRequest, opts ...grpc.CallOption) (*ListBookEditionsResponse, error) // An aep-compliant Create method for isbn. CreateIsbn(ctx context.Context, in *CreateIsbnRequest, opts ...grpc.CallOption) (*Isbn, error) - // An aep-compliant Get method for isbn. - GetIsbn(ctx context.Context, in *GetIsbnRequest, opts ...grpc.CallOption) (*Isbn, error) // An aep-compliant Create method for publisher. CreatePublisher(ctx context.Context, in *CreatePublisherRequest, opts ...grpc.CallOption) (*Publisher, error) // An aep-compliant Get method for publisher. @@ -189,15 +186,6 @@ func (c *bookstoreClient) CreateIsbn(ctx context.Context, in *CreateIsbnRequest, return out, nil } -func (c *bookstoreClient) GetIsbn(ctx context.Context, in *GetIsbnRequest, opts ...grpc.CallOption) (*Isbn, error) { - out := new(Isbn) - err := c.cc.Invoke(ctx, Bookstore_GetIsbn_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *bookstoreClient) CreatePublisher(ctx context.Context, in *CreatePublisherRequest, opts ...grpc.CallOption) (*Publisher, error) { out := new(Publisher) err := c.cc.Invoke(ctx, Bookstore_CreatePublisher_FullMethodName, in, out, opts...) @@ -278,8 +266,6 @@ type BookstoreServer interface { ListBookEditions(context.Context, *ListBookEditionsRequest) (*ListBookEditionsResponse, error) // An aep-compliant Create method for isbn. CreateIsbn(context.Context, *CreateIsbnRequest) (*Isbn, error) - // An aep-compliant Get method for isbn. - GetIsbn(context.Context, *GetIsbnRequest) (*Isbn, error) // An aep-compliant Create method for publisher. CreatePublisher(context.Context, *CreatePublisherRequest) (*Publisher, error) // An aep-compliant Get method for publisher. @@ -332,9 +318,6 @@ func (UnimplementedBookstoreServer) ListBookEditions(context.Context, *ListBookE func (UnimplementedBookstoreServer) CreateIsbn(context.Context, *CreateIsbnRequest) (*Isbn, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateIsbn not implemented") } -func (UnimplementedBookstoreServer) GetIsbn(context.Context, *GetIsbnRequest) (*Isbn, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetIsbn not implemented") -} func (UnimplementedBookstoreServer) CreatePublisher(context.Context, *CreatePublisherRequest) (*Publisher, error) { return nil, status.Errorf(codes.Unimplemented, "method CreatePublisher not implemented") } @@ -564,24 +547,6 @@ func _Bookstore_CreateIsbn_Handler(srv interface{}, ctx context.Context, dec fun return interceptor(ctx, in, info, handler) } -func _Bookstore_GetIsbn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetIsbnRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BookstoreServer).GetIsbn(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Bookstore_GetIsbn_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BookstoreServer).GetIsbn(ctx, req.(*GetIsbnRequest)) - } - return interceptor(ctx, in, info, handler) -} - func _Bookstore_CreatePublisher_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CreatePublisherRequest) if err := dec(in); err != nil { @@ -741,10 +706,6 @@ var Bookstore_ServiceDesc = grpc.ServiceDesc{ MethodName: "CreateIsbn", Handler: _Bookstore_CreateIsbn_Handler, }, - { - MethodName: "GetIsbn", - Handler: _Bookstore_GetIsbn_Handler, - }, { MethodName: "CreatePublisher", Handler: _Bookstore_CreatePublisher_Handler, diff --git a/example/bookstore/v1/bookstore_openapi.json b/example/bookstore/v1/bookstore_openapi.json index 5d36c75..bc2ed0e 100644 --- a/example/bookstore/v1/bookstore_openapi.json +++ b/example/bookstore/v1/bookstore_openapi.json @@ -42,34 +42,6 @@ } } }, - "/isbns/{isbn}": { - "get": { - "summary": "", - "description": "", - "operationId": "", - "parameters": [ - { - "name": "isbn", - "in": "path", - "description": "", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "Successful response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/isbn" - } - } - } - } - } - } - }, "/publishers": { "get": { "summary": "", @@ -206,6 +178,43 @@ "required": true } }, + "put": { + "summary": "", + "description": "", + "operationId": "", + "parameters": [ + { + "name": "publisher", + "in": "path", + "description": "", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/publisher" + } + } + } + } + }, + "requestBody": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/publisher" + } + } + }, + "required": true + } + }, "delete": { "summary": "", "description": "", @@ -399,6 +408,50 @@ "required": true } }, + "put": { + "summary": "", + "description": "", + "operationId": "", + "parameters": [ + { + "name": "publisher", + "in": "path", + "description": "", + "required": true, + "type": "string" + }, + { + "name": "book", + "in": "path", + "description": "", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/book" + } + } + } + } + }, + "requestBody": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/book" + } + } + }, + "required": true + } + }, "delete": { "summary": "", "description": "", @@ -628,6 +681,10 @@ "lastName": { "type": "string" } + }, + "x-aep-field-numbers": { + "1": "firstName", + "2": "lastName" } } }, @@ -635,9 +692,6 @@ "type": "integer", "format": "int32" }, - "id": { - "type": "string" - }, "isbn": { "type": "array", "items": { @@ -645,7 +699,8 @@ } }, "path": { - "type": "string" + "type": "string", + "readOnly": true }, "price": { "type": "number", @@ -665,10 +720,18 @@ "publisher" ] }, + "x-aep-field-numbers": { + "0": "author", + "1": "isbn", + "10018": "path", + "2": "price", + "3": "published", + "4": "edition" + }, "required": [ - "published", "isbn", - "price" + "price", + "published" ] }, "book-edition": { @@ -677,11 +740,9 @@ "displayname": { "type": "string" }, - "id": { - "type": "string" - }, "path": { - "type": "string" + "type": "string", + "readOnly": true } }, "x-aep-resource": { @@ -694,6 +755,10 @@ "book" ] }, + "x-aep-field-numbers": { + "1": "displayname", + "10018": "path" + }, "required": [ "displayname" ] @@ -701,11 +766,9 @@ "isbn": { "type": "object", "properties": { - "id": { - "type": "string" - }, "path": { - "type": "string" + "type": "string", + "readOnly": true } }, "x-aep-resource": { @@ -714,6 +777,9 @@ "patterns": [ "isbns/{isbn}" ] + }, + "x-aep-field-numbers": { + "10018": "path" } }, "publisher": { @@ -722,11 +788,9 @@ "description": { "type": "string" }, - "id": { - "type": "string" - }, "path": { - "type": "string" + "type": "string", + "readOnly": true } }, "x-aep-resource": { @@ -735,6 +799,10 @@ "patterns": [ "publishers/{publisher}" ] + }, + "x-aep-field-numbers": { + "1": "description", + "10018": "path" } } } diff --git a/example/bookstore/v1/bookstore_openapi.yaml b/example/bookstore/v1/bookstore_openapi.yaml index 7f80ad2..7971644 100644 --- a/example/bookstore/v1/bookstore_openapi.yaml +++ b/example/bookstore/v1/bookstore_openapi.yaml @@ -10,17 +10,19 @@ components: lastName: type: string type: object + x-aep-field-numbers: + "1": firstName + "2": lastName type: array edition: format: int32 type: integer - id: - type: string isbn: items: type: string type: array path: + readOnly: true type: string price: format: float @@ -28,10 +30,17 @@ components: published: type: boolean required: - - published - isbn - price + - published type: object + x-aep-field-numbers: + "0": author + "1": isbn + "2": price + "3": published + "4": edition + "10018": path x-aep-resource: parents: - publisher @@ -43,13 +52,15 @@ components: properties: displayname: type: string - id: - type: string path: + readOnly: true type: string required: - displayname type: object + x-aep-field-numbers: + "1": displayname + "10018": path x-aep-resource: parents: - book @@ -59,11 +70,12 @@ components: singular: book-edition isbn: properties: - id: - type: string path: + readOnly: true type: string type: object + x-aep-field-numbers: + "10018": path x-aep-resource: patterns: - isbns/{isbn} @@ -73,11 +85,13 @@ components: properties: description: type: string - id: - type: string path: + readOnly: true type: string type: object + x-aep-field-numbers: + "1": description + "10018": path x-aep-resource: patterns: - publishers/{publisher} @@ -109,24 +123,6 @@ paths: $ref: '#/components/schemas/isbn' description: Successful response summary: "" - /isbns/{isbn}: - get: - description: "" - operationId: "" - parameters: - - description: "" - in: path - name: isbn - required: true - type: string - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/isbn' - description: Successful response - summary: "" /publishers: get: description: "" @@ -235,6 +231,30 @@ paths: $ref: '#/components/schemas/publisher' description: Successful response summary: "" + put: + description: "" + operationId: "" + parameters: + - description: "" + in: path + name: publisher + required: true + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/publisher' + description: "" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/publisher' + description: Successful response + summary: "" /publishers/{publisher}/books: get: description: "" @@ -368,6 +388,35 @@ paths: $ref: '#/components/schemas/book' description: Successful response summary: "" + put: + description: "" + operationId: "" + parameters: + - description: "" + in: path + name: publisher + required: true + type: string + - description: "" + in: path + name: book + required: true + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/book' + description: "" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/book' + description: Successful response + summary: "" /publishers/{publisher}/books/{book}/editions: get: description: "" diff --git a/example/service/service.go b/example/service/service.go index 13b2909..6d602d0 100644 --- a/example/service/service.go +++ b/example/service/service.go @@ -33,7 +33,6 @@ func (BookstoreServer) CreateBook(_ context.Context, r *bpb.CreateBookRequest) ( r.Id = fmt.Sprintf("%v/books/%v", r.Parent, len(bookDatabase)+1) } path := fmt.Sprintf("%v/books/%v", r.Parent, r.Id) - book.Id = r.Id book.Path = path bookDatabase[path] = book log.Printf("created book %q", path) @@ -44,7 +43,6 @@ func (BookstoreServer) ApplyBook(_ context.Context, r *bpb.ApplyBookRequest) (*b log.Printf("applying book request: %v", r) originalResource := bookDatabase[r.Path] book := proto.Clone(r.Book).(*bpb.Book) - book.Id = originalResource.Id book.Path = originalResource.Path bookDatabase[r.Path] = book log.Printf("applied book %q", book.Path) @@ -89,7 +87,6 @@ func (BookstoreServer) CreatePublisher(_ context.Context, r *bpb.CreatePublisher r.Id = fmt.Sprintf("%v", len(bookDatabase)+1) } path := fmt.Sprintf("publishers/%v", r.Id) - publisher.Id = r.Id publisher.Path = path publisherDatabase[path] = publisher log.Printf("created publisher %q", path) @@ -100,7 +97,6 @@ func (BookstoreServer) ApplyPublisher(_ context.Context, r *bpb.ApplyPublisherRe log.Printf("applying publisher request: %v", r) originalResource := bookDatabase[r.Path] publisher := proto.Clone(r.Publisher).(*bpb.Publisher) - publisher.Id = originalResource.Id publisher.Path = originalResource.Path publisherDatabase[r.Path] = publisher log.Printf("applied publisher %q", publisher.Path) diff --git a/parser/api.go b/parser/api.go index ebe5964..5b7e94d 100644 --- a/parser/api.go +++ b/parser/api.go @@ -5,6 +5,7 @@ import ( "github.com/aep-dev/aep-lib-go/pkg/api" "github.com/aep-dev/aep-lib-go/pkg/openapi" + "github.com/aep-dev/aepc/constants" "github.com/aep-dev/aepc/schema" ) @@ -14,6 +15,13 @@ func ToAPI(s *schema.Service) (*api.API, error) { for _, r := range s.Resources { resourceByName[r.Kind] = r } + for _, s := range s.Schemas { + oasSchema, err := toOpenAPISchemaFromPropMap(s.Properties) + if err != nil { + return nil, err + } + schemas[s.Name] = oasSchema + } resources := map[string]*api.Resource{} for _, r := range s.Resources { _, err := getOrCreateResource(resources, resourceByName, r.Kind) @@ -41,6 +49,7 @@ func getOrCreateResource(apiResourceByName map[string]*api.Resource, resourceByN if err != nil { return nil, err } + addCommonFieldsToResourceSchema(schema) parents := []*api.Resource{} apiR := &api.Resource{ Singular: schemaR.Kind, @@ -66,6 +75,9 @@ func getOrCreateResource(apiResourceByName map[string]*api.Resource, resourceByN if methods.List != nil { apiR.ListMethod = &api.ListMethod{} } + if methods.Apply != nil { + apiR.ApplyMethod = &api.ApplyMethod{} + } for _, p := range schemaR.Parents { apiP, err := getOrCreateResource(apiResourceByName, resourceByName, p) if err != nil { @@ -77,3 +89,12 @@ func getOrCreateResource(apiResourceByName map[string]*api.Resource, resourceByN apiResourceByName[name] = apiR return apiR, nil } + +// add an id field to the resource. +func addCommonFieldsToResourceSchema(s *openapi.Schema) { + s.Properties[constants.FIELD_PATH_NAME] = openapi.Schema{ + Type: "string", + ReadOnly: true, + } + s.XAEPFieldNumbers[constants.FIELD_PATH_NUMBER] = constants.FIELD_PATH_NAME +} diff --git a/parser/parser.go b/parser/parser.go deleted file mode 100644 index 51de352..0000000 --- a/parser/parser.go +++ /dev/null @@ -1,150 +0,0 @@ -// package parser converts the schema -// into a full-fledged struct that provides -// more functionality for discovering resource references, etc. -package parser - -import ( - "fmt" - "sort" - "strings" - - "github.com/aep-dev/aepc/constants" - "github.com/aep-dev/aepc/schema" -) - -// ParsedService wraps schema.Service, but includes -// helper functions for things like retrieving the resource -// definitions within a service. -type ParsedService struct { - *schema.Service - ResourceByType map[string]*ParsedResource -} - -func (ps *ParsedService) GetShortName() string { - before, _, _ := strings.Cut(ps.Name, ".") - return before -} - -type ParsedResource struct { - *schema.Resource - Type string - ParsedParents []*ParsedResource - - IsResource bool -} - -type ParsedProperty struct { - *schema.Property - Name string -} - -func NewParsedService(s *schema.Service) (*ParsedService, error) { - resourceByType, err := loadResourceByType(s) - if err != nil { - return nil, fmt.Errorf("unable to build service %q: %w", s, err) - } - err = loadObjectsByType(s.Objects, s, &resourceByType) - if err != nil { - return nil, fmt.Errorf("unable to build service objects %q: %w", s, err) - } - ps := ParsedService{ - Service: s, - ResourceByType: resourceByType, - } - return &ps, nil -} - -func ParsedResourceForObject(r *schema.Object, s *schema.Service) *ParsedResource { - t := fmt.Sprintf("%s/%s", s.Name, r.Kind) - return &ParsedResource{ - Type: t, - Resource: &schema.Resource{ - Kind: r.Kind, - Properties: r.Properties, - }, - IsResource: false, - } -} - -func loadObjectsByType(o []*schema.Object, s *schema.Service, m *map[string]*ParsedResource) error { - for _, r := range o { - t := fmt.Sprintf("%s/%s", s.Name, r.Kind) - (*m)[t] = ParsedResourceForObject(r, s) - } - return nil -} - -func loadResourceByType(s *schema.Service) (map[string]*ParsedResource, error) { - resourceByType := map[string]*ParsedResource{} - for _, r := range s.Resources { - t := fmt.Sprintf("%s/%s", s.Name, r.Kind) - resourceByType[t] = &ParsedResource{ - Resource: r, - Type: t, - ParsedParents: []*ParsedResource{}, - IsResource: true, - } - } - // populate resource parents - for _, r := range resourceByType { - for _, p := range r.Resource.Parents { - // if the string is a shorthand resource type (sans service), - // build it before checking it's existence. - if !strings.Contains(p, "/") { - p = strings.Join([]string{s.Name, p}, "/") - } - parentResource, exists := resourceByType[p] - if !exists { - return nil, fmt.Errorf("parent %q for resource %q not found", p, r.Kind) - } - r.ParsedParents = append(r.ParsedParents, parentResource) - } - addGetToResource(r) - addCommonFieldsToResource(r) - } - return resourceByType, nil -} - -func (pr *ParsedResource) GetPropertiesSortedByNumber() []*ParsedProperty { - return PropertiesSortedByNumber(pr.Properties) -} - -func PropertiesSortedByNumber(properties map[string]*schema.Property) []*ParsedProperty { - // to ensure idempotency of generators, fields are ordered by - // field number - parsedProperties := []*ParsedProperty{} - for name, p := range properties { - parsedProperties = append(parsedProperties, &ParsedProperty{ - Property: p, - Name: name, - }) - } - sort.Slice(parsedProperties, func(i, j int) bool { - return parsedProperties[i].Number < parsedProperties[j].Number - }) - return parsedProperties -} - -// addGetToResource adds a Get method to a resource, -// since all resources must have a Get method. -func addGetToResource(pr *ParsedResource) { - if pr.Methods.Read == nil { - pr.Methods.Read = &schema.Methods_ReadMethod{} - } -} - -// add an id field to the resource. -// TODO(yft): this has to be reconciled with the -// existence of path. -func addCommonFieldsToResource(pr *ParsedResource) { - pr.Properties[constants.FIELD_PATH_NAME] = &schema.Property{ - Types: &schema.Property_Type{Type: schema.Type_STRING}, - Number: 10000, - ReadOnly: true, - } - pr.Properties[constants.FIELD_ID_NAME] = &schema.Property{ - Types: &schema.Property_Type{Type: schema.Type_STRING}, - Number: 10001, - ReadOnly: true, - } -} diff --git a/parser/utils.go b/parser/utils.go index 61ed317..69fb41c 100644 --- a/parser/utils.go +++ b/parser/utils.go @@ -7,14 +7,6 @@ import ( "github.com/aep-dev/aepc/schema" ) -type TypeInfo struct { - openapi_type string - openapi_format string - openapi_ref string - - array_type *TypeInfo -} - func toOpenAPISchema(p *schema.Property) (*openapi.Schema, error) { switch p.GetTypes().(type) { case *schema.Property_ArrayType: @@ -64,6 +56,7 @@ func openAPITypeObject(o *schema.ObjectType) (*openapi.Schema, error) { func toOpenAPISchemaFromPropMap(propMap map[string]*schema.Property) (*openapi.Schema, error) { required := []string{} properties := openapi.Properties{} + field_numbers := map[int]string{} for name, p := range propMap { prop, err := toOpenAPISchema(p) if err != nil { @@ -73,11 +66,13 @@ func toOpenAPISchemaFromPropMap(propMap map[string]*schema.Property) (*openapi.S if p.GetRequired() { required = append(required, name) } + field_numbers[int(p.GetNumber())] = name } return &openapi.Schema{ - Type: "object", - Properties: properties, - Required: required, + Type: "object", + Properties: properties, + Required: required, + XAEPFieldNumbers: field_numbers, }, nil } @@ -103,7 +98,7 @@ func openAPITypePrimitive(p schema.Type) (*openapi.Schema, error) { case schema.Type_BOOLEAN: t = "boolean" default: - return nil, fmt.Errorf("%s does not have openapi type support", p.Type) + return nil, fmt.Errorf("%s does not have openapi type support", p) } return &openapi.Schema{ diff --git a/schema/resourcedefinition.pb.go b/schema/resourcedefinition.pb.go index fc2e5a5..b148fb1 100644 --- a/schema/resourcedefinition.pb.go +++ b/schema/resourcedefinition.pb.go @@ -108,7 +108,7 @@ type Service struct { // The resources that the API service exposes. Resources []*Resource `protobuf:"bytes,3,rep,name=resources,proto3" json:"resources,omitempty"` // These are additional objects (list of properties) that may be referenced from another property. - Objects []*Object `protobuf:"bytes,4,rep,name=objects,proto3" json:"objects,omitempty"` + Schemas []*Schema `protobuf:"bytes,4,rep,name=schemas,proto3" json:"schemas,omitempty"` } func (x *Service) Reset() { @@ -164,9 +164,9 @@ func (x *Service) GetResources() []*Resource { return nil } -func (x *Service) GetObjects() []*Object { +func (x *Service) GetSchemas() []*Schema { if x != nil { - return x.Objects + return x.Schemas } return nil } @@ -259,19 +259,19 @@ func (x *Resource) GetMethods() *Methods { // An object is a collection of properties, that does not have methods of it's // on in the API. It is currently only used as a property of a resource. -type Object struct { +type Schema struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // The name of the object. - Kind string `protobuf:"bytes,1,opt,name=kind,proto3" json:"kind,omitempty"` - // The properties of the object. + // The name of the schema. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // The properties of the schema. Properties map[string]*Property `protobuf:"bytes,2,rep,name=properties,proto3" json:"properties,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } -func (x *Object) Reset() { - *x = Object{} +func (x *Schema) Reset() { + *x = Schema{} if protoimpl.UnsafeEnabled { mi := &file_schema_resourcedefinition_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -279,13 +279,13 @@ func (x *Object) Reset() { } } -func (x *Object) String() string { +func (x *Schema) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Object) ProtoMessage() {} +func (*Schema) ProtoMessage() {} -func (x *Object) ProtoReflect() protoreflect.Message { +func (x *Schema) ProtoReflect() protoreflect.Message { mi := &file_schema_resourcedefinition_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -297,19 +297,19 @@ func (x *Object) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Object.ProtoReflect.Descriptor instead. -func (*Object) Descriptor() ([]byte, []int) { +// Deprecated: Use Schema.ProtoReflect.Descriptor instead. +func (*Schema) Descriptor() ([]byte, []int) { return file_schema_resourcedefinition_proto_rawDescGZIP(), []int{2} } -func (x *Object) GetKind() string { +func (x *Schema) GetName() string { if x != nil { - return x.Kind + return x.Name } return "" } -func (x *Object) GetProperties() map[string]*Property { +func (x *Schema) GetProperties() map[string]*Property { if x != nil { return x.Properties } @@ -972,9 +972,9 @@ var file_schema_resourcedefinition_proto_rawDesc = []byte{ 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x27, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x21, 0x0a, 0x07, 0x6f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x4f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x07, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x22, 0xf9, + 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x21, 0x0a, 0x07, 0x73, + 0x63, 0x68, 0x65, 0x6d, 0x61, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x53, + 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x07, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x73, 0x22, 0xf9, 0x01, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x6c, 0x75, 0x72, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, @@ -990,11 +990,11 @@ var file_schema_resourcedefinition_proto_rawDesc = []byte{ 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1f, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x9f, 0x01, 0x0a, 0x06, 0x4f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x37, 0x0a, 0x0a, 0x70, 0x72, 0x6f, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x9f, 0x01, 0x0a, 0x06, 0x53, + 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x37, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, - 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, + 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x1a, 0x48, 0x0a, 0x0f, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, @@ -1092,13 +1092,13 @@ var file_schema_resourcedefinition_proto_goTypes = []interface{}{ (Type)(0), // 0: Type (*Service)(nil), // 1: Service (*Resource)(nil), // 2: Resource - (*Object)(nil), // 3: Object + (*Schema)(nil), // 3: Schema (*Methods)(nil), // 4: Methods (*Property)(nil), // 5: Property (*ObjectType)(nil), // 6: ObjectType (*ArrayType)(nil), // 7: ArrayType nil, // 8: Resource.PropertiesEntry - nil, // 9: Object.PropertiesEntry + nil, // 9: Schema.PropertiesEntry (*Methods_CreateMethod)(nil), // 10: Methods.CreateMethod (*Methods_ReadMethod)(nil), // 11: Methods.ReadMethod (*Methods_UpdateMethod)(nil), // 12: Methods.UpdateMethod @@ -1110,10 +1110,10 @@ var file_schema_resourcedefinition_proto_goTypes = []interface{}{ } var file_schema_resourcedefinition_proto_depIdxs = []int32{ 2, // 0: Service.resources:type_name -> Resource - 3, // 1: Service.objects:type_name -> Object + 3, // 1: Service.schemas:type_name -> Schema 8, // 2: Resource.properties:type_name -> Resource.PropertiesEntry 4, // 3: Resource.methods:type_name -> Methods - 9, // 4: Object.properties:type_name -> Object.PropertiesEntry + 9, // 4: Schema.properties:type_name -> Schema.PropertiesEntry 10, // 5: Methods.create:type_name -> Methods.CreateMethod 11, // 6: Methods.read:type_name -> Methods.ReadMethod 12, // 7: Methods.update:type_name -> Methods.UpdateMethod @@ -1128,7 +1128,7 @@ var file_schema_resourcedefinition_proto_depIdxs = []int32{ 0, // 16: ArrayType.type:type_name -> Type 6, // 17: ArrayType.object_type:type_name -> ObjectType 5, // 18: Resource.PropertiesEntry.value:type_name -> Property - 5, // 19: Object.PropertiesEntry.value:type_name -> Property + 5, // 19: Schema.PropertiesEntry.value:type_name -> Property 5, // 20: ObjectType.PropertiesEntry.value:type_name -> Property 21, // [21:21] is the sub-list for method output_type 21, // [21:21] is the sub-list for method input_type @@ -1168,7 +1168,7 @@ func file_schema_resourcedefinition_proto_init() { } } file_schema_resourcedefinition_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object); i { + switch v := v.(*Schema); i { case 0: return &v.state case 1: diff --git a/schema/resourcedefinition.proto b/schema/resourcedefinition.proto index d3a4721..31e716d 100644 --- a/schema/resourcedefinition.proto +++ b/schema/resourcedefinition.proto @@ -18,7 +18,7 @@ message Service { repeated Resource resources = 3; // These are additional objects (list of properties) that may be referenced from another property. - repeated Object objects = 4; + repeated Schema schemas = 4; } // A resource. @@ -38,10 +38,10 @@ message Resource { // An object is a collection of properties, that does not have methods of it's // on in the API. It is currently only used as a property of a resource. -message Object { - // The name of the object. - string kind = 1; - // The properties of the object. +message Schema { + // The name of the schema. + string name = 1; + // The properties of the schema. map properties = 2; } diff --git a/writer/proto/proto.go b/writer/proto/proto.go index c5f9283..e46ad0d 100644 --- a/writer/proto/proto.go +++ b/writer/proto/proto.go @@ -21,8 +21,9 @@ import ( "sort" "strings" + "github.com/aep-dev/aep-lib-go/pkg/api" + "github.com/aep-dev/aep-lib-go/pkg/openapi" "github.com/aep-dev/aepc/internal/utils" - "github.com/aep-dev/aepc/parser" "github.com/jhump/protoreflect/desc/builder" "github.com/jhump/protoreflect/desc/protoprint" "golang.org/x/text/cases" @@ -40,7 +41,7 @@ type MessageStorage struct { Messages map[string]*builder.MessageBuilder } -func WriteServiceToProto(ps *parser.ParsedService, outputDir string) ([]byte, error) { +func WriteServiceToProto(a *api.API, outputDir string) ([]byte, error) { m := &MessageStorage{Messages: map[string]*builder.MessageBuilder{}} dir, file := filepath.Split(outputDir) packageParts := []string{file} @@ -60,7 +61,7 @@ func WriteServiceToProto(ps *parser.ParsedService, outputDir string) ([]byte, er fb.SetComments(builder.Comments{ LeadingComment: "this file is autogenerated by aepc", }) - pServiceName := toProtoServiceName(ps.Name) + pServiceName := toProtoServiceName(a.Name) serviceNameAsLower := fmt.Sprintf("/%s", strings.ToLower(pServiceName)) fo := &descriptorpb.FileOptions{ GoPackage: &serviceNameAsLower, @@ -72,15 +73,15 @@ func WriteServiceToProto(ps *parser.ParsedService, outputDir string) ([]byte, er }) // Add resources to MessageStorage. - err := GenerateResourceMessages(ps.ResourceByType, ps, m) + err := GenerateSchemaMessages(a, m, fb) if err != nil { return nil, err } - for _, r := range getSortedResources(ps.ResourceByType) { - err := AddResource(r, ps, fb, sb, m) + for _, r := range getSortedResources(a) { + err := AddResource(r, a, fb, sb, m) if err != nil { - return []byte{}, fmt.Errorf("adding resource %v failed: %w", r.Kind, err) + return []byte{}, fmt.Errorf("adding resource %v failed: %w", r.Singular, err) } } fb.AddService(sb) @@ -109,13 +110,27 @@ func WriteServiceToProto(ps *parser.ParsedService, outputDir string) ([]byte, er return output.Bytes(), nil } -func GenerateResourceMessages(r map[string]*parser.ParsedResource, s *parser.ParsedService, m *MessageStorage) error { +func GenerateSchemaMessages(a *api.API, m *MessageStorage, fb *builder.FileBuilder) error { // Generate Resource messages on combined map - for _, r := range getSortedResources(r) { - _, err := GeneratedResourceMessage(r, s, m) + schemaByName := make(map[string]*openapi.Schema) + for name, s := range a.Schemas { + schemaByName[name] = s + } + for name, r := range a.Resources { + schemaByName[name] = r.Schema + } + schemaNames := []string{} + for name := range schemaByName { + schemaNames = append(schemaNames, name) + } + sort.Strings(schemaNames) + for _, name := range schemaNames { + s := schemaByName[name] + mb, err := GenerateSchemaMessage(name, s, a, m) if err != nil { return err } + fb.AddMessage(mb) } return nil } @@ -129,15 +144,15 @@ func toMessageName(resource string) string { return utils.KebabToCamelCase(resource) } -func getSortedResources(prsByString map[string]*parser.ParsedResource) []*parser.ParsedResource { +func getSortedResources(a *api.API) []*api.Resource { keys := []string{} - for k := range prsByString { + for k := range a.Resources { keys = append(keys, k) } sort.Strings(keys) - resources := make([]*parser.ParsedResource, 0, len(keys)) + resources := make([]*api.Resource, 0, len(keys)) for _, k := range keys { - resources = append(resources, prsByString[k]) + resources = append(resources, a.Resources[k]) } return resources } diff --git a/writer/proto/resource.go b/writer/proto/resource.go index 6c9996a..1d78630 100644 --- a/writer/proto/resource.go +++ b/writer/proto/resource.go @@ -16,13 +16,13 @@ package proto import ( "fmt" "reflect" + "sort" "strings" + "github.com/aep-dev/aep-lib-go/pkg/api" + "github.com/aep-dev/aep-lib-go/pkg/openapi" "github.com/aep-dev/aepc/constants" "github.com/aep-dev/aepc/internal/utils" - "github.com/aep-dev/aepc/parser" - "github.com/aep-dev/aepc/schema" - "github.com/aep-dev/aepc/writer/writer_utils" "github.com/jhump/protoreflect/desc" "github.com/jhump/protoreflect/desc/builder" "google.golang.org/genproto/googleapis/api/annotations" @@ -32,210 +32,197 @@ import ( ) // AddResource adds a resource's protos and RPCs to a file and service. -func AddResource(r *parser.ParsedResource, ps *parser.ParsedService, fb *builder.FileBuilder, sb *builder.ServiceBuilder, m *MessageStorage) error { +func AddResource(r *api.Resource, a *api.API, fb *builder.FileBuilder, sb *builder.ServiceBuilder, m *MessageStorage) error { // Do not recreate resources if they've already been created. - resourceMb, ok := m.Messages[fmt.Sprintf("%s/%s", ps.Name, r.Kind)] + resourceMb, ok := m.Messages[fmt.Sprintf("%s/%s", a.Name, r.Singular)] if !ok { - return fmt.Errorf("%s not found in message storage", r.Kind) + return fmt.Errorf("%s not found in message storage", r.Singular) } - fb.AddMessage(resourceMb) - - if !r.IsResource { - return nil - } - - if r.Methods != nil { - if r.Methods.Create != nil { - err := AddCreate(r, resourceMb, fb, sb) - if err != nil { - return err - } - } - if r.Methods.Read != nil { - err := AddGet(r, resourceMb, fb, sb) - if err != nil { - return err - } + if r.CreateMethod != nil { + err := AddCreate(a, r, resourceMb, fb, sb) + if err != nil { + return err } - if r.Methods.Update != nil { - err := AddUpdate(r, resourceMb, fb, sb) - if err != nil { - return err - } + } + if r.GetMethod != nil { + err := AddGet(a, r, resourceMb, fb, sb) + if err != nil { + return err } - if r.Methods.Delete != nil { - err := AddDelete(r, resourceMb, fb, sb) - if err != nil { - return err - } + } + if r.UpdateMethod != nil { + err := AddUpdate(a, r, resourceMb, fb, sb) + if err != nil { + return err } - if r.Methods.List != nil { - err := AddList(r, resourceMb, fb, sb) - if err != nil { - return err - } + } + if r.DeleteMethod != nil { + err := AddDelete(a, r, resourceMb, fb, sb) + if err != nil { + return err } - if r.Methods.GlobalList != nil { - err := AddGlobalList(r, resourceMb, fb, sb) - if err != nil { - return err - } + } + if r.ListMethod != nil { + err := AddList(r, resourceMb, fb, sb) + if err != nil { + return err } + } + // TODO: add global list + /// if r.GlobalList != nil { + /// err := AddGlobalList(r, resourceMb, fb, sb) + /// if err != nil { + /// return err + /// } + /// } - if r.Methods.Apply != nil { - err := AddApply(r, resourceMb, fb, sb) - if err != nil { - return err - } + if r.ApplyMethod != nil { + err := AddApply(a, r, resourceMb, fb, sb) + if err != nil { + return err } } return nil } -func protoType(p *parser.ParsedProperty, s *parser.ParsedService, m *MessageStorage, parent *builder.MessageBuilder) (*builder.FieldType, error) { - switch p.GetTypes().(type) { - case *schema.Property_Type: - return protoTypePrimitive(p.GetType()) - case *schema.Property_ObjectType: - return protoTypeObject(p.GetObjectType(), p, s, m, parent) - case *schema.Property_ArrayType: - return protoTypeArray(p.GetArrayType(), p, s, m, parent) - default: - return nil, fmt.Errorf("reached outside of prototype switch statement.") - } -} - -func protoTypeObject(o *schema.ObjectType, p *parser.ParsedProperty, s *parser.ParsedService, m *MessageStorage, parent *builder.MessageBuilder) (*builder.FieldType, error) { - if o.GetMessageName() != "" { - wantedType := fmt.Sprintf("%s/%s", s.Name, o.GetMessageName()) - _, ok := m.Messages[wantedType] - if !ok { - // Resource has not been generated yet. - n, ok := s.ResourceByType[wantedType] - if !ok { - return nil, fmt.Errorf("could not find %s in full object list", wantedType) - } - _, err := GeneratedResourceMessage(n, s, m) - if err != nil { - return nil, err - } - } - resourceMb, ok := m.Messages[wantedType] - if !ok { - return nil, fmt.Errorf("could not find message %s after recursive create", wantedType) +// this function should only be called with openapi Schemas that +// map to primitive types. +func protoFieldType(name string, number int, s openapi.Schema, a *api.API, m *MessageStorage, parent *builder.MessageBuilder) (*builder.FieldType, error) { + switch s.Type { + case "object": + typ, err := protoFieldTypeObject(name, &s, a, m, parent) + if err != nil { + return nil, fmt.Errorf("error creating proto type object for %s: %w", name, err) } - return builder.FieldTypeMessage(resourceMb), nil - } else { - msg, err := GenerateMessage(parser.PropertiesSortedByNumber(o.GetProperties()), toMessageName(p.Name), s, m) + return typ, nil + // Ideally we would set the repeated parameter here as well. + // But "repeated" is a property of the field, not the type. + case "array": + typ, err := protoFieldType(name, number, *s.Items, a, m, parent) if err != nil { - return nil, err + return nil, fmt.Errorf("error creating proto type for array item for %s: %w", name, err) + } + return typ, nil + case "string": + return builder.FieldTypeString(), nil + case "boolean": + return builder.FieldTypeBool(), nil + case "integer": + if s.Format == "int32" { + return builder.FieldTypeInt32(), nil + } else if s.Format == "int64" { + return builder.FieldTypeInt64(), nil + } + case "number": + if s.Format == "float" { + return builder.FieldTypeFloat(), nil + } else if s.Format == "double" { + return builder.FieldTypeDouble(), nil } - parent.AddNestedMessage(msg) - return builder.FieldTypeMessage(msg), nil } + return nil, fmt.Errorf("proto type for %q, format %q not found", s.Type, s.Format) } -func protoTypeArray(a *schema.ArrayType, p *parser.ParsedProperty, s *parser.ParsedService, m *MessageStorage, parent *builder.MessageBuilder) (*builder.FieldType, error) { - switch a.GetArrayDetails().(type) { - case *schema.ArrayType_Type: - // Repeated will be set later on. - return protoTypePrimitive(a.GetType()) - case *schema.ArrayType_ObjectType: - return protoTypeObject(a.GetObjectType(), p, s, m, parent) - default: - return nil, fmt.Errorf("Proto type for %q not found ", a) +func GenerateMessage(name string, s *openapi.Schema, a *api.API, m *MessageStorage) (*builder.MessageBuilder, error) { + mb := builder.NewMessage(name) + mb.SetComments(builder.Comments{ + LeadingComment: fmt.Sprintf("A %v.", name), + }) + sorted_field_numbers := []int{} + for n := range s.XAEPFieldNumbers { + sorted_field_numbers = append(sorted_field_numbers, n) } -} + sort.Ints(sorted_field_numbers) -func protoTypePrimitive(t schema.Type) (*builder.FieldType, error) { - switch t { - case schema.Type_STRING: - return builder.FieldTypeString(), nil - case schema.Type_INT32: - return builder.FieldTypeInt32(), nil - case schema.Type_INT64: - return builder.FieldTypeInt64(), nil - case schema.Type_BOOLEAN: - return builder.FieldTypeBool(), nil - case schema.Type_DOUBLE: - return builder.FieldTypeDouble(), nil - case schema.Type_FLOAT: - return builder.FieldTypeFloat(), nil - default: - return nil, fmt.Errorf("Proto type for %q not found", t) + required := map[string]bool{} + for _, n := range s.Required { + required[n] = true } + + for _, num := range sorted_field_numbers { + name := s.XAEPFieldNumbers[num] + f, err := protoField(name, num, s.Properties[name], a, m, mb) + if err != nil { + return nil, err + } + if required[name] { + proto.SetExtension(&descriptorpb.FieldOptions{}, annotations.E_FieldBehavior, []annotations.FieldBehavior{annotations.FieldBehavior_REQUIRED}) + } + mb.AddField(f) + } + return mb, nil } -func protoField(p *parser.ParsedProperty, s *parser.ParsedService, m *MessageStorage, parent *builder.MessageBuilder) (*builder.FieldBuilder, error) { - typ, err := protoType(p, s, m, parent) +func protoField(name string, number int, s openapi.Schema, a *api.API, m *MessageStorage, parent *builder.MessageBuilder) (*builder.FieldBuilder, error) { + typ, err := protoFieldType(name, number, s, a, m, parent) if err != nil { - return nil, err + return nil, fmt.Errorf("error creating proto field for %s: %w", name, err) } - f := builder.NewField(p.Name, typ).SetNumber(p.Number).SetComments( + f := builder.NewField(name, typ).SetNumber(int32(number)).SetComments( builder.Comments{ - LeadingComment: fmt.Sprintf("Field for %v.", p.Name), + LeadingComment: fmt.Sprintf("Field for %v.", name), }, ) - switch p.GetTypes().(type) { - case *schema.Property_ArrayType: + if s.Type == "array" { f.SetRepeated() } - o := &descriptorpb.FieldOptions{} - if p.Required { - proto.SetExtension(o, annotations.E_FieldBehavior, []annotations.FieldBehavior{annotations.FieldBehavior_REQUIRED}) - } - f.SetOptions(o) return f, nil } -func GenerateMessage(properties []*parser.ParsedProperty, name string, s *parser.ParsedService, m *MessageStorage) (*builder.MessageBuilder, error) { - mb := builder.NewMessage(name) - mb.SetComments(builder.Comments{ - LeadingComment: fmt.Sprintf("A %v.", name), - }) - for _, p := range properties { - f, err := protoField(p, s, m, mb) +func protoFieldTypeObject(name string, s *openapi.Schema, a *api.API, m *MessageStorage, parent *builder.MessageBuilder) (*builder.FieldType, error) { + if s.Ref != "" { + wantedType := s.Ref + // extract the name from the ref + wantedType = strings.TrimPrefix(wantedType, "#/components/schemas/") + wantedType = fmt.Sprintf("%s/%s", a.Name, wantedType) + _, ok := m.Messages[wantedType] + if !ok { + return nil, fmt.Errorf("could not find message %s, referenced by %s", wantedType, name) + } + return builder.FieldTypeMessage(m.Messages[wantedType]), nil + } else { + msg, err := GenerateMessage(toMessageName(name), s, a, m) if err != nil { return nil, err } - mb.AddField(f) + parent.AddNestedMessage(msg) + return builder.FieldTypeMessage(msg), nil } - return mb, nil } // GenerateResourceMesssage adds the resource message. -func GeneratedResourceMessage(r *parser.ParsedResource, s *parser.ParsedService, m *MessageStorage) (*builder.MessageBuilder, error) { - mb, err := GenerateMessage(r.GetPropertiesSortedByNumber(), toMessageName(r.Kind), s, m) +func GenerateSchemaMessage(name string, s *openapi.Schema, a *api.API, m *MessageStorage) (*builder.MessageBuilder, error) { + mb, err := GenerateMessage(toMessageName(name), s, a, m) if err != nil { return nil, err } - m.Messages[fmt.Sprintf("%s/%s", s.Name, r.Kind)] = mb + m.Messages[fmt.Sprintf("%s/%s", a.Name, name)] = mb return mb, nil } -func AddCreate(r *parser.ParsedResource, resourceMb *builder.MessageBuilder, fb *builder.FileBuilder, sb *builder.ServiceBuilder) error { +func AddCreate(a *api.API, r *api.Resource, resourceMb *builder.MessageBuilder, fb *builder.FileBuilder, sb *builder.ServiceBuilder) error { // add the resource message // create request messages - mb := builder.NewMessage("Create" + toMessageName(r.Kind) + "Request") + mb := builder.NewMessage("Create" + toMessageName(r.Singular) + "Request") mb.SetComments(builder.Comments{ - LeadingComment: fmt.Sprintf("A Create request for a %v resource.", r.Kind), + LeadingComment: fmt.Sprintf("A Create request for a %v resource.", r.Singular), }) addParentField(r, mb) - if !r.Methods.Create.NonClientSettableId { + if r.CreateMethod.SupportsUserSettableCreate { addIdField(r, mb) } addResourceField(r, resourceMb, mb) fb.AddMessage(mb) - method := builder.NewMethod("Create"+toMessageName(r.Kind), + method := builder.NewMethod("Create"+toMessageName(r.Singular), builder.RpcTypeMessage(mb, false), builder.RpcTypeMessage(resourceMb, false), ) method.SetComments(builder.Comments{ - LeadingComment: fmt.Sprintf("An aep-compliant Create method for %v.", r.Kind), + LeadingComment: fmt.Sprintf("An aep-compliant Create method for %v.", r.Singular), }) options := &descriptorpb.MethodOptions{} - bodyField := utils.KebabToSnakeCase(r.Kind) + bodyField := utils.KebabToSnakeCase(r.Singular) proto.SetExtension(options, annotations.E_Http, &annotations.HttpRule{ Pattern: &annotations.HttpRule_Post{ Post: generateParentHTTPPath(r), @@ -252,19 +239,19 @@ func AddCreate(r *parser.ParsedResource, resourceMb *builder.MessageBuilder, fb // AddGet adds a read method for the resource, along with // any required messages. -func AddGet(r *parser.ParsedResource, resourceMb *builder.MessageBuilder, fb *builder.FileBuilder, sb *builder.ServiceBuilder) error { - mb := builder.NewMessage("Get" + toMessageName(r.Kind) + "Request") +func AddGet(a *api.API, r *api.Resource, resourceMb *builder.MessageBuilder, fb *builder.FileBuilder, sb *builder.ServiceBuilder) error { + mb := builder.NewMessage("Get" + toMessageName(r.Singular) + "Request") mb.SetComments(builder.Comments{ - LeadingComment: fmt.Sprintf("Request message for the Get%v method", r.Kind), + LeadingComment: fmt.Sprintf("Request message for the Get%v method", r.Singular), }) addPathField(r, mb) fb.AddMessage(mb) - method := builder.NewMethod("Get"+toMessageName(r.Kind), + method := builder.NewMethod("Get"+toMessageName(r.Singular), builder.RpcTypeMessage(mb, false), builder.RpcTypeMessage(resourceMb, false), ) method.SetComments(builder.Comments{ - LeadingComment: fmt.Sprintf("An aep-compliant Get method for %v.", r.Kind), + LeadingComment: fmt.Sprintf("An aep-compliant Get method for %v.", r.Singular), }) options := &descriptorpb.MethodOptions{} proto.SetExtension(options, annotations.E_Http, &annotations.HttpRule{ @@ -282,10 +269,10 @@ func AddGet(r *parser.ParsedResource, resourceMb *builder.MessageBuilder, fb *bu // AddRead adds a read method for the resource, along with // any required messages. -func AddUpdate(r *parser.ParsedResource, resourceMb *builder.MessageBuilder, fb *builder.FileBuilder, sb *builder.ServiceBuilder) error { - mb := builder.NewMessage("Update" + toMessageName(r.Kind) + "Request") +func AddUpdate(a *api.API, r *api.Resource, resourceMb *builder.MessageBuilder, fb *builder.FileBuilder, sb *builder.ServiceBuilder) error { + mb := builder.NewMessage("Update" + toMessageName(r.Singular) + "Request") mb.SetComments(builder.Comments{ - LeadingComment: fmt.Sprintf("Request message for the Update%v method", toMessageName(r.Kind)), + LeadingComment: fmt.Sprintf("Request message for the Update%v method", toMessageName(r.Singular)), }) addPathField(r, mb) addResourceField(r, resourceMb, mb) @@ -299,15 +286,15 @@ func AddUpdate(r *parser.ParsedResource, resourceMb *builder.MessageBuilder, fb })) fb.AddMessage(mb) - method := builder.NewMethod("Update"+toMessageName(r.Kind), + method := builder.NewMethod("Update"+toMessageName(r.Singular), builder.RpcTypeMessage(mb, false), builder.RpcTypeMessage(resourceMb, false), ) method.SetComments(builder.Comments{ - LeadingComment: fmt.Sprintf("An aep-compliant Update method for %v.", r.Kind), + LeadingComment: fmt.Sprintf("An aep-compliant Update method for %v.", r.Singular), }) options := &descriptorpb.MethodOptions{} - body_field := utils.KebabToSnakeCase(r.Kind) + body_field := utils.KebabToSnakeCase(r.Singular) proto.SetExtension(options, annotations.E_Http, &annotations.HttpRule{ Pattern: &annotations.HttpRule_Patch{ Patch: fmt.Sprintf("/{path=%v}", generateHTTPPath(r)), @@ -322,12 +309,12 @@ func AddUpdate(r *parser.ParsedResource, resourceMb *builder.MessageBuilder, fb return nil } -func AddDelete(r *parser.ParsedResource, resourceMb *builder.MessageBuilder, fb *builder.FileBuilder, sb *builder.ServiceBuilder) error { +func AddDelete(a *api.API, r *api.Resource, resourceMb *builder.MessageBuilder, fb *builder.FileBuilder, sb *builder.ServiceBuilder) error { // add the resource message // create request messages - mb := builder.NewMessage("Delete" + toMessageName(r.Kind) + "Request") + mb := builder.NewMessage("Delete" + toMessageName(r.Singular) + "Request") mb.SetComments(builder.Comments{ - LeadingComment: fmt.Sprintf("Request message for the Delete%v method", toMessageName(r.Kind)), + LeadingComment: fmt.Sprintf("Request message for the Delete%v method", toMessageName(r.Singular)), }) addPathField(r, mb) fb.AddMessage(mb) @@ -335,12 +322,12 @@ func AddDelete(r *parser.ParsedResource, resourceMb *builder.MessageBuilder, fb if err != nil { return err } - method := builder.NewMethod("Delete"+toMessageName(r.Kind), + method := builder.NewMethod("Delete"+toMessageName(r.Singular), builder.RpcTypeMessage(mb, false), builder.RpcTypeImportedMessage(emptyMd, false), ) method.SetComments(builder.Comments{ - LeadingComment: fmt.Sprintf("An aep-compliant Delete method for %v.", r.Kind), + LeadingComment: fmt.Sprintf("An aep-compliant Delete method for %v.", r.Singular), }) options := &descriptorpb.MethodOptions{} proto.SetExtension(options, annotations.E_Http, &annotations.HttpRule{ @@ -356,12 +343,12 @@ func AddDelete(r *parser.ParsedResource, resourceMb *builder.MessageBuilder, fb return nil } -func AddList(r *parser.ParsedResource, resourceMb *builder.MessageBuilder, fb *builder.FileBuilder, sb *builder.ServiceBuilder) error { +func AddList(r *api.Resource, resourceMb *builder.MessageBuilder, fb *builder.FileBuilder, sb *builder.ServiceBuilder) error { // add the resource message // create request messages reqMb := builder.NewMessage("List" + toMessageName(r.Plural) + "Request") reqMb.SetComments(builder.Comments{ - LeadingComment: fmt.Sprintf("Request message for the List%v method", r.Kind), + LeadingComment: fmt.Sprintf("Request message for the List%v method", r.Singular), }) addParentField(r, reqMb) addPageToken(r, reqMb) @@ -373,7 +360,7 @@ func AddList(r *parser.ParsedResource, resourceMb *builder.MessageBuilder, fb *b fb.AddMessage(reqMb) respMb := builder.NewMessage("List" + toMessageName(r.Plural) + "Response") respMb.SetComments(builder.Comments{ - LeadingComment: fmt.Sprintf("Response message for the List%v method", r.Kind), + LeadingComment: fmt.Sprintf("Response message for the List%v method", r.Singular), }) addResourcesField(r, resourceMb, respMb) addNextPageToken(r, respMb) @@ -399,31 +386,31 @@ func AddList(r *parser.ParsedResource, resourceMb *builder.MessageBuilder, fb *b return nil } -func AddGlobalList(r *parser.ParsedResource, resourceMb *builder.MessageBuilder, fb *builder.FileBuilder, sb *builder.ServiceBuilder) error { +func AddGlobalList(r *api.Resource, resourceMb *builder.MessageBuilder, fb *builder.FileBuilder, sb *builder.ServiceBuilder) error { // add the resource message // create request messages - reqMb := builder.NewMessage("GlobalList" + r.Kind + "Request") + reqMb := builder.NewMessage("GlobalList" + r.Singular + "Request") reqMb.SetComments(builder.Comments{ - LeadingComment: fmt.Sprintf("Request message for the GlobalList%v method", r.Kind), + LeadingComment: fmt.Sprintf("Request message for the GlobalList%v method", r.Singular), }) addPathField(r, reqMb) addPageToken(r, reqMb) fb.AddMessage(reqMb) - respMb := builder.NewMessage("GlobalList" + r.Kind + "Response") + respMb := builder.NewMessage("GlobalList" + r.Singular + "Response") respMb.SetComments(builder.Comments{ - LeadingComment: fmt.Sprintf("Response message for the GlobalList%v method", r.Kind), + LeadingComment: fmt.Sprintf("Response message for the GlobalList%v method", r.Singular), }) addResourcesField(r, resourceMb, respMb) addNextPageToken(r, respMb) fb.AddMessage(respMb) - method := builder.NewMethod("GlobalList"+r.Kind, + method := builder.NewMethod("GlobalList"+r.Singular, builder.RpcTypeMessage(reqMb, false), builder.RpcTypeMessage(respMb, false), ) options := &descriptorpb.MethodOptions{} proto.SetExtension(options, annotations.E_Http, &annotations.HttpRule{ Pattern: &annotations.HttpRule_Get{ - Get: fmt.Sprintf("/{path=--/%v}", strings.ToLower(r.Kind)), + Get: fmt.Sprintf("/{path=--/%v}", strings.ToLower(r.Singular)), }, }) method.SetOptions(options) @@ -433,15 +420,15 @@ func AddGlobalList(r *parser.ParsedResource, resourceMb *builder.MessageBuilder, // AddApply adds a read method for the resource, along with // any required messages. -func AddApply(r *parser.ParsedResource, resourceMb *builder.MessageBuilder, fb *builder.FileBuilder, sb *builder.ServiceBuilder) error { - mb := builder.NewMessage("Apply" + toMessageName(r.Kind) + "Request") +func AddApply(a *api.API, r *api.Resource, resourceMb *builder.MessageBuilder, fb *builder.FileBuilder, sb *builder.ServiceBuilder) error { + mb := builder.NewMessage("Apply" + toMessageName(r.Singular) + "Request") mb.SetComments(builder.Comments{ - LeadingComment: fmt.Sprintf("Request message for the Apply%v method", r.Kind), + LeadingComment: fmt.Sprintf("Request message for the Apply%v method", r.Singular), }) addPathField(r, mb) addResourceField(r, resourceMb, mb) fb.AddMessage(mb) - method := builder.NewMethod("Apply"+toMessageName(r.Kind), + method := builder.NewMethod("Apply"+toMessageName(r.Singular), builder.RpcTypeMessage(mb, false), builder.RpcTypeMessage(resourceMb, false), ) @@ -454,41 +441,41 @@ func AddApply(r *parser.ParsedResource, resourceMb *builder.MessageBuilder, fb * Put: fmt.Sprintf("/{path=%v}", generateHTTPPath(r)), }, // TODO: do a conversion to underscores instead. - Body: strings.ToLower(r.Kind), + Body: strings.ToLower(r.Singular), }) method.SetOptions(options) sb.AddMethod(method) return nil } -func generateHTTPPath(r *parser.ParsedResource) string { - elements := []string{writer_utils.CollectionName(r)} - if len(r.ParsedParents) > 0 { +func generateHTTPPath(r *api.Resource) string { + elements := []string{api.CollectionName(r)} + if len(r.Parents) > 0 { // TODO: handle multiple parents - p := r.ParsedParents[0] + p := r.Parents[0] for p != nil { - elements = append([]string{strings.ToLower(p.Plural)}, elements...) - if len(p.ParsedParents) == 0 { + elements = append([]string{api.CollectionName(p)}, elements...) + if len(p.Parents) == 0 { break } - p = p.ParsedParents[0] + p = p.Parents[0] } } return fmt.Sprintf("%v/*", strings.Join(elements, "/*/")) } -func generateParentHTTPPath(r *parser.ParsedResource) string { +func generateParentHTTPPath(r *api.Resource) string { parentPath := "" - if len(r.ParsedParents) == 0 { + if len(r.Parents) == 0 { return fmt.Sprintf("/{parent=%v}", strings.ToLower(r.Plural)) } - if len(r.ParsedParents) > 0 { - parentPath = fmt.Sprintf("%v", generateHTTPPath(r.ParsedParents[0])) + if len(r.Parents) > 0 { + parentPath = fmt.Sprintf("%v", generateHTTPPath(r.Parents[0])) } - return fmt.Sprintf("/{parent=%v}/%v", parentPath, writer_utils.CollectionName(r)) + return fmt.Sprintf("/{parent=%v}/%v", parentPath, api.CollectionName(r)) } -func addParentField(r *parser.ParsedResource, mb *builder.MessageBuilder) { +func addParentField(r *api.Resource, mb *builder.MessageBuilder) { o := &descriptorpb.FieldOptions{} proto.SetExtension(o, annotations.E_FieldBehavior, []annotations.FieldBehavior{annotations.FieldBehavior_REQUIRED}) proto.SetExtension(o, annotations.E_ResourceReference, &annotations.ResourceReference{}) @@ -496,24 +483,24 @@ func addParentField(r *parser.ParsedResource, mb *builder.MessageBuilder) { NewField(constants.FIELD_PARENT_NAME, builder.FieldTypeString()). SetNumber(constants.FIELD_PARENT_NUMBER). SetComments(builder.Comments{ - LeadingComment: fmt.Sprintf("A field for the parent of %v", r.Kind), + LeadingComment: fmt.Sprintf("A field for the parent of %v", r.Singular), }). SetOptions(o) mb.AddField(f) } -func addIdField(r *parser.ParsedResource, mb *builder.MessageBuilder) { +func addIdField(r *api.Resource, mb *builder.MessageBuilder) { f := builder.NewField(constants.FIELD_ID_NAME, builder.FieldTypeString()).SetNumber(constants.FIELD_ID_NUMBER).SetComments(builder.Comments{ LeadingComment: "An id that uniquely identifies the resource within the collection", }) mb.AddField(f) } -func addPathField(r *parser.ParsedResource, mb *builder.MessageBuilder) { +func addPathField(r *api.Resource, mb *builder.MessageBuilder) { o := &descriptorpb.FieldOptions{} proto.SetExtension(o, annotations.E_FieldBehavior, []annotations.FieldBehavior{annotations.FieldBehavior_REQUIRED}) proto.SetExtension(o, annotations.E_ResourceReference, &annotations.ResourceReference{ - Type: r.Type, + Type: r.Singular, }) f := builder.NewField(constants.FIELD_PATH_NAME, builder.FieldTypeString()). SetNumber(constants.FIELD_PATH_NUMBER). @@ -524,10 +511,10 @@ func addPathField(r *parser.ParsedResource, mb *builder.MessageBuilder) { mb.AddField(f) } -func addResourceField(r *parser.ParsedResource, resourceMb, mb *builder.MessageBuilder) { +func addResourceField(r *api.Resource, resourceMb, mb *builder.MessageBuilder) { o := &descriptorpb.FieldOptions{} proto.SetExtension(o, annotations.E_FieldBehavior, []annotations.FieldBehavior{annotations.FieldBehavior_REQUIRED}) - f := builder.NewField(utils.KebabToSnakeCase(r.Kind), builder.FieldTypeMessage(resourceMb)). + f := builder.NewField(utils.KebabToSnakeCase(r.Singular), builder.FieldTypeMessage(resourceMb)). SetNumber(constants.FIELD_RESOURCE_NUMBER). SetComments(builder.Comments{ LeadingComment: fmt.Sprintf("The resource to perform the operation on."), @@ -536,23 +523,36 @@ func addResourceField(r *parser.ParsedResource, resourceMb, mb *builder.MessageB mb.AddField(f) } -func addResourcesField(r *parser.ParsedResource, resourceMb, mb *builder.MessageBuilder) { +func addResourcesField(r *api.Resource, resourceMb, mb *builder.MessageBuilder) { f := builder.NewField("results", builder.FieldTypeMessage(resourceMb)).SetNumber(constants.FIELD_RESOURCES_NUMBER).SetComments(builder.Comments{ LeadingComment: fmt.Sprintf("A list of %v", r.Plural), }).SetRepeated() mb.AddField(f) } -func addPageToken(r *parser.ParsedResource, mb *builder.MessageBuilder) { +func addPageToken(r *api.Resource, mb *builder.MessageBuilder) { f := builder.NewField(constants.FIELD_PAGE_TOKEN_NAME, builder.FieldTypeString()).SetNumber(constants.FIELD_PAGE_TOKEN_NUMBER).SetComments(builder.Comments{ LeadingComment: fmt.Sprintf("The page token indicating the starting point of the page"), }) mb.AddField(f) } -func addNextPageToken(r *parser.ParsedResource, mb *builder.MessageBuilder) { +func addNextPageToken(r *api.Resource, mb *builder.MessageBuilder) { f := builder.NewField(constants.FIELD_NEXT_PAGE_TOKEN_NAME, builder.FieldTypeString()).SetNumber(constants.FIELD_NEXT_PAGE_TOKEN_NUMBER).SetComments(builder.Comments{ LeadingComment: fmt.Sprintf("The page token indicating the ending point of this response."), }) mb.AddField(f) } + +func getSortedProperties(s *openapi.Schema) []openapi.Schema { + sorted_field_names := []string{} + for _, f := range s.XAEPFieldNumbers { + sorted_field_names = append(sorted_field_names, f) + } + sort.Strings(sorted_field_names) + sorted_fields := []openapi.Schema{} + for _, f := range sorted_field_names { + sorted_fields = append(sorted_fields, s.Properties[f]) + } + return sorted_fields +}