From 75af642e5c60a707f9bd7ccc3693bb91d68e01f2 Mon Sep 17 00:00:00 2001 From: Edward McFarlane Date: Mon, 27 May 2024 17:15:47 -0400 Subject: [PATCH] Remove uneeded config and generate pets example Signed-off-by: Edward McFarlane --- buf.gen.yaml | 2 - buf.yaml | 35 +- .../gen/io/swagger/petstore/v2/pets.pb.go | 1079 +++++++++++++++++ .../io/swagger/petstore/v2/pets_grpc.pb.go | 396 ++++++ .../v2/petstorev2connect/pets.connect.go | 352 ++++++ 5 files changed, 1840 insertions(+), 24 deletions(-) create mode 100644 internal/gen/io/swagger/petstore/v2/pets.pb.go create mode 100644 internal/gen/io/swagger/petstore/v2/pets_grpc.pb.go create mode 100644 internal/gen/io/swagger/petstore/v2/petstorev2connect/pets.connect.go diff --git a/buf.gen.yaml b/buf.gen.yaml index 8f9abd5..b8c5fe5 100644 --- a/buf.gen.yaml +++ b/buf.gen.yaml @@ -17,5 +17,3 @@ plugins: - remote: buf.build/grpc/go:v1.3.0 out: internal/gen opt: paths=source_relative -inputs: - - directory: internal/proto diff --git a/buf.yaml b/buf.yaml index 26a37e9..c78138c 100644 --- a/buf.yaml +++ b/buf.yaml @@ -1,5 +1,6 @@ version: v2 modules: + - path: internal/proto - path: internal/examples/pets/internal/proto lint: use: @@ -15,27 +16,17 @@ modules: - RPC_RESPONSE_STANDARD_NAME rpc_allow_google_protobuf_empty_responses: true disallow_comment_ignores: true - breaking: - use: - - WIRE_JSON - except: - - FIELD_SAME_DEFAULT - - path: internal/proto - lint: - use: - - DEFAULT - except: - - FIELD_NOT_REQUIRED - - PACKAGE_NO_IMPORT_CYCLE - - RPC_REQUEST_RESPONSE_UNIQUE - - RPC_REQUEST_STANDARD_NAME - - RPC_RESPONSE_STANDARD_NAME - rpc_allow_google_protobuf_empty_responses: true - disallow_comment_ignores: true - breaking: - use: - - WIRE_JSON - except: - - FIELD_SAME_DEFAULT deps: - buf.build/googleapis/googleapis +lint: + use: + - DEFAULT + except: + - FIELD_NOT_REQUIRED + - PACKAGE_NO_IMPORT_CYCLE + - RPC_REQUEST_RESPONSE_UNIQUE + - RPC_REQUEST_STANDARD_NAME + - RPC_RESPONSE_STANDARD_NAME +breaking: + use: + - WIRE_JSON diff --git a/internal/gen/io/swagger/petstore/v2/pets.pb.go b/internal/gen/io/swagger/petstore/v2/pets.pb.go new file mode 100644 index 0000000..fa02d6c --- /dev/null +++ b/internal/gen/io/swagger/petstore/v2/pets.pb.go @@ -0,0 +1,1079 @@ +// Copyright 2023-2024 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc (unknown) +// source: io/swagger/petstore/v2/pets.proto + +// The service defined herein comes from v2 of the Petstore service, which +// is used as an example for Swagger/OpenAPI. The Swagger spec can be found +// here: https://petstore.swagger.io/v2/swagger.json +// A human-friendly HTML view of this API is also available at +// https://petstore.swagger.io. +// +// This file defines only the "pet" service. The spec for this site also +// includes "store" and "user" services which are not supported via these +// RPC definitions. + +package petstorev2 + +import ( + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + emptypb "google.golang.org/protobuf/types/known/emptypb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Status int32 + +const ( + Status_unknown Status = 0 + Status_available Status = 1 + Status_pending Status = 2 + Status_sold Status = 3 +) + +// Enum value maps for Status. +var ( + Status_name = map[int32]string{ + 0: "unknown", + 1: "available", + 2: "pending", + 3: "sold", + } + Status_value = map[string]int32{ + "unknown": 0, + "available": 1, + "pending": 2, + "sold": 3, + } +) + +func (x Status) Enum() *Status { + p := new(Status) + *p = x + return p +} + +func (x Status) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Status) Descriptor() protoreflect.EnumDescriptor { + return file_io_swagger_petstore_v2_pets_proto_enumTypes[0].Descriptor() +} + +func (Status) Type() protoreflect.EnumType { + return &file_io_swagger_petstore_v2_pets_proto_enumTypes[0] +} + +func (x Status) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Status.Descriptor instead. +func (Status) EnumDescriptor() ([]byte, []int) { + return file_io_swagger_petstore_v2_pets_proto_rawDescGZIP(), []int{0} +} + +type Category struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *Category) Reset() { + *x = Category{} + if protoimpl.UnsafeEnabled { + mi := &file_io_swagger_petstore_v2_pets_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Category) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Category) ProtoMessage() {} + +func (x *Category) ProtoReflect() protoreflect.Message { + mi := &file_io_swagger_petstore_v2_pets_proto_msgTypes[0] + 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 Category.ProtoReflect.Descriptor instead. +func (*Category) Descriptor() ([]byte, []int) { + return file_io_swagger_petstore_v2_pets_proto_rawDescGZIP(), []int{0} +} + +func (x *Category) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *Category) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type Tag struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *Tag) Reset() { + *x = Tag{} + if protoimpl.UnsafeEnabled { + mi := &file_io_swagger_petstore_v2_pets_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Tag) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Tag) ProtoMessage() {} + +func (x *Tag) ProtoReflect() protoreflect.Message { + mi := &file_io_swagger_petstore_v2_pets_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 Tag.ProtoReflect.Descriptor instead. +func (*Tag) Descriptor() ([]byte, []int) { + return file_io_swagger_petstore_v2_pets_proto_rawDescGZIP(), []int{1} +} + +func (x *Tag) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *Tag) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type PetID struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PetId int64 `protobuf:"varint,1,opt,name=pet_id,json=petId,proto3" json:"pet_id,omitempty"` +} + +func (x *PetID) Reset() { + *x = PetID{} + if protoimpl.UnsafeEnabled { + mi := &file_io_swagger_petstore_v2_pets_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PetID) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PetID) ProtoMessage() {} + +func (x *PetID) ProtoReflect() protoreflect.Message { + mi := &file_io_swagger_petstore_v2_pets_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 PetID.ProtoReflect.Descriptor instead. +func (*PetID) Descriptor() ([]byte, []int) { + return file_io_swagger_petstore_v2_pets_proto_rawDescGZIP(), []int{2} +} + +func (x *PetID) GetPetId() int64 { + if x != nil { + return x.PetId + } + return 0 +} + +type Pet struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Category *Category `protobuf:"bytes,2,opt,name=category,proto3" json:"category,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + PhotoUrls []string `protobuf:"bytes,4,rep,name=photo_urls,json=photoUrls,proto3" json:"photo_urls,omitempty"` + Tags []*Tag `protobuf:"bytes,5,rep,name=tags,proto3" json:"tags,omitempty"` + Status string `protobuf:"bytes,6,opt,name=status,proto3" json:"status,omitempty"` +} + +func (x *Pet) Reset() { + *x = Pet{} + if protoimpl.UnsafeEnabled { + mi := &file_io_swagger_petstore_v2_pets_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Pet) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Pet) ProtoMessage() {} + +func (x *Pet) ProtoReflect() protoreflect.Message { + mi := &file_io_swagger_petstore_v2_pets_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 Pet.ProtoReflect.Descriptor instead. +func (*Pet) Descriptor() ([]byte, []int) { + return file_io_swagger_petstore_v2_pets_proto_rawDescGZIP(), []int{3} +} + +func (x *Pet) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *Pet) GetCategory() *Category { + if x != nil { + return x.Category + } + return nil +} + +func (x *Pet) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Pet) GetPhotoUrls() []string { + if x != nil { + return x.PhotoUrls + } + return nil +} + +func (x *Pet) GetTags() []*Tag { + if x != nil { + return x.Tags + } + return nil +} + +func (x *Pet) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} + +type UpdatePetWithFormReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PetId int64 `protobuf:"varint,1,opt,name=pet_id,json=petId,proto3" json:"pet_id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Status string `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"` +} + +func (x *UpdatePetWithFormReq) Reset() { + *x = UpdatePetWithFormReq{} + if protoimpl.UnsafeEnabled { + mi := &file_io_swagger_petstore_v2_pets_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdatePetWithFormReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdatePetWithFormReq) ProtoMessage() {} + +func (x *UpdatePetWithFormReq) ProtoReflect() protoreflect.Message { + mi := &file_io_swagger_petstore_v2_pets_proto_msgTypes[4] + 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 UpdatePetWithFormReq.ProtoReflect.Descriptor instead. +func (*UpdatePetWithFormReq) Descriptor() ([]byte, []int) { + return file_io_swagger_petstore_v2_pets_proto_rawDescGZIP(), []int{4} +} + +func (x *UpdatePetWithFormReq) GetPetId() int64 { + if x != nil { + return x.PetId + } + return 0 +} + +func (x *UpdatePetWithFormReq) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *UpdatePetWithFormReq) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} + +type UploadFileReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PetId int64 `protobuf:"varint,1,opt,name=pet_id,json=petId,proto3" json:"pet_id,omitempty"` + AdditionalMetadata string `protobuf:"bytes,2,opt,name=additional_metadata,json=additionalMetadata,proto3" json:"additional_metadata,omitempty"` + File string `protobuf:"bytes,3,opt,name=file,proto3" json:"file,omitempty"` +} + +func (x *UploadFileReq) Reset() { + *x = UploadFileReq{} + if protoimpl.UnsafeEnabled { + mi := &file_io_swagger_petstore_v2_pets_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UploadFileReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UploadFileReq) ProtoMessage() {} + +func (x *UploadFileReq) ProtoReflect() protoreflect.Message { + mi := &file_io_swagger_petstore_v2_pets_proto_msgTypes[5] + 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 UploadFileReq.ProtoReflect.Descriptor instead. +func (*UploadFileReq) Descriptor() ([]byte, []int) { + return file_io_swagger_petstore_v2_pets_proto_rawDescGZIP(), []int{5} +} + +func (x *UploadFileReq) GetPetId() int64 { + if x != nil { + return x.PetId + } + return 0 +} + +func (x *UploadFileReq) GetAdditionalMetadata() string { + if x != nil { + return x.AdditionalMetadata + } + return "" +} + +func (x *UploadFileReq) GetFile() string { + if x != nil { + return x.File + } + return "" +} + +type PetBody struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PetId int64 `protobuf:"varint,1,opt,name=pet_id,json=petId,proto3" json:"pet_id,omitempty"` + Body string `protobuf:"bytes,2,opt,name=body,proto3" json:"body,omitempty"` +} + +func (x *PetBody) Reset() { + *x = PetBody{} + if protoimpl.UnsafeEnabled { + mi := &file_io_swagger_petstore_v2_pets_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PetBody) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PetBody) ProtoMessage() {} + +func (x *PetBody) ProtoReflect() protoreflect.Message { + mi := &file_io_swagger_petstore_v2_pets_proto_msgTypes[6] + 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 PetBody.ProtoReflect.Descriptor instead. +func (*PetBody) Descriptor() ([]byte, []int) { + return file_io_swagger_petstore_v2_pets_proto_rawDescGZIP(), []int{6} +} + +func (x *PetBody) GetPetId() int64 { + if x != nil { + return x.PetId + } + return 0 +} + +func (x *PetBody) GetBody() string { + if x != nil { + return x.Body + } + return "" +} + +type StatusReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status []string `protobuf:"bytes,1,rep,name=status,proto3" json:"status,omitempty"` +} + +func (x *StatusReq) Reset() { + *x = StatusReq{} + if protoimpl.UnsafeEnabled { + mi := &file_io_swagger_petstore_v2_pets_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StatusReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StatusReq) ProtoMessage() {} + +func (x *StatusReq) ProtoReflect() protoreflect.Message { + mi := &file_io_swagger_petstore_v2_pets_proto_msgTypes[7] + 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 StatusReq.ProtoReflect.Descriptor instead. +func (*StatusReq) Descriptor() ([]byte, []int) { + return file_io_swagger_petstore_v2_pets_proto_rawDescGZIP(), []int{7} +} + +func (x *StatusReq) GetStatus() []string { + if x != nil { + return x.Status + } + return nil +} + +type TagReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Tag []string `protobuf:"bytes,1,rep,name=tag,proto3" json:"tag,omitempty"` +} + +func (x *TagReq) Reset() { + *x = TagReq{} + if protoimpl.UnsafeEnabled { + mi := &file_io_swagger_petstore_v2_pets_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TagReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TagReq) ProtoMessage() {} + +func (x *TagReq) ProtoReflect() protoreflect.Message { + mi := &file_io_swagger_petstore_v2_pets_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 TagReq.ProtoReflect.Descriptor instead. +func (*TagReq) Descriptor() ([]byte, []int) { + return file_io_swagger_petstore_v2_pets_proto_rawDescGZIP(), []int{8} +} + +func (x *TagReq) GetTag() []string { + if x != nil { + return x.Tag + } + return nil +} + +type Pets struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Pets []*Pet `protobuf:"bytes,1,rep,name=pets,proto3" json:"pets,omitempty"` +} + +func (x *Pets) Reset() { + *x = Pets{} + if protoimpl.UnsafeEnabled { + mi := &file_io_swagger_petstore_v2_pets_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Pets) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Pets) ProtoMessage() {} + +func (x *Pets) ProtoReflect() protoreflect.Message { + mi := &file_io_swagger_petstore_v2_pets_proto_msgTypes[9] + 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 Pets.ProtoReflect.Descriptor instead. +func (*Pets) Descriptor() ([]byte, []int) { + return file_io_swagger_petstore_v2_pets_proto_rawDescGZIP(), []int{9} +} + +func (x *Pets) GetPets() []*Pet { + if x != nil { + return x.Pets + } + return nil +} + +type ApiResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` + Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` +} + +func (x *ApiResponse) Reset() { + *x = ApiResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_io_swagger_petstore_v2_pets_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ApiResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ApiResponse) ProtoMessage() {} + +func (x *ApiResponse) ProtoReflect() protoreflect.Message { + mi := &file_io_swagger_petstore_v2_pets_proto_msgTypes[10] + 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 ApiResponse.ProtoReflect.Descriptor instead. +func (*ApiResponse) Descriptor() ([]byte, []int) { + return file_io_swagger_petstore_v2_pets_proto_rawDescGZIP(), []int{10} +} + +func (x *ApiResponse) GetCode() int32 { + if x != nil { + return x.Code + } + return 0 +} + +func (x *ApiResponse) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *ApiResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +var File_io_swagger_petstore_v2_pets_proto protoreflect.FileDescriptor + +var file_io_swagger_petstore_v2_pets_proto_rawDesc = []byte{ + 0x0a, 0x21, 0x69, 0x6f, 0x2f, 0x73, 0x77, 0x61, 0x67, 0x67, 0x65, 0x72, 0x2f, 0x70, 0x65, 0x74, + 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x32, 0x2f, 0x70, 0x65, 0x74, 0x73, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x16, 0x69, 0x6f, 0x2e, 0x73, 0x77, 0x61, 0x67, 0x67, 0x65, 0x72, 0x2e, + 0x70, 0x65, 0x74, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x32, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 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, 0x22, 0x2e, 0x0a, 0x08, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, + 0x72, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x29, 0x0a, 0x03, 0x54, 0x61, 0x67, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x22, 0x1e, 0x0a, 0x05, 0x50, 0x65, 0x74, 0x49, 0x44, 0x12, 0x15, 0x0a, 0x06, 0x70, 0x65, + 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x70, 0x65, 0x74, 0x49, + 0x64, 0x22, 0xcf, 0x01, 0x0a, 0x03, 0x50, 0x65, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x3c, 0x0a, 0x08, 0x63, 0x61, 0x74, + 0x65, 0x67, 0x6f, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x69, 0x6f, + 0x2e, 0x73, 0x77, 0x61, 0x67, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x65, 0x74, 0x73, 0x74, 0x6f, 0x72, + 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x08, 0x63, + 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, + 0x68, 0x6f, 0x74, 0x6f, 0x5f, 0x75, 0x72, 0x6c, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x09, 0x70, 0x68, 0x6f, 0x74, 0x6f, 0x55, 0x72, 0x6c, 0x73, 0x12, 0x2f, 0x0a, 0x04, 0x74, 0x61, + 0x67, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x69, 0x6f, 0x2e, 0x73, 0x77, + 0x61, 0x67, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x65, 0x74, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, + 0x32, 0x2e, 0x54, 0x61, 0x67, 0x52, 0x04, 0x74, 0x61, 0x67, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x22, 0x59, 0x0a, 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x65, 0x74, + 0x57, 0x69, 0x74, 0x68, 0x46, 0x6f, 0x72, 0x6d, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x70, + 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x70, 0x65, 0x74, + 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x6b, + 0x0a, 0x0d, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x12, + 0x15, 0x0a, 0x06, 0x70, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x05, 0x70, 0x65, 0x74, 0x49, 0x64, 0x12, 0x2f, 0x0a, 0x13, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x12, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x22, 0x34, 0x0a, 0x07, 0x50, + 0x65, 0x74, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x15, 0x0a, 0x06, 0x70, 0x65, 0x74, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x70, 0x65, 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, + 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x62, 0x6f, 0x64, + 0x79, 0x22, 0x23, 0x0a, 0x09, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x12, 0x16, + 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x1a, 0x0a, 0x06, 0x54, 0x61, 0x67, 0x52, 0x65, 0x71, + 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x03, 0x74, + 0x61, 0x67, 0x22, 0x37, 0x0a, 0x04, 0x50, 0x65, 0x74, 0x73, 0x12, 0x2f, 0x0a, 0x04, 0x70, 0x65, + 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x69, 0x6f, 0x2e, 0x73, 0x77, + 0x61, 0x67, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x65, 0x74, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, + 0x32, 0x2e, 0x50, 0x65, 0x74, 0x52, 0x04, 0x70, 0x65, 0x74, 0x73, 0x22, 0x4f, 0x0a, 0x0b, 0x41, + 0x70, 0x69, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, + 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x12, + 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2a, 0x3b, 0x0a, 0x06, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x75, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, + 0x6e, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, + 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x10, 0x02, 0x12, + 0x08, 0x0a, 0x04, 0x73, 0x6f, 0x6c, 0x64, 0x10, 0x03, 0x32, 0xda, 0x06, 0x0a, 0x0a, 0x50, 0x65, + 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x62, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x50, + 0x65, 0x74, 0x42, 0x79, 0x49, 0x44, 0x12, 0x1d, 0x2e, 0x69, 0x6f, 0x2e, 0x73, 0x77, 0x61, 0x67, + 0x67, 0x65, 0x72, 0x2e, 0x70, 0x65, 0x74, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x32, 0x2e, + 0x50, 0x65, 0x74, 0x49, 0x44, 0x1a, 0x1b, 0x2e, 0x69, 0x6f, 0x2e, 0x73, 0x77, 0x61, 0x67, 0x67, + 0x65, 0x72, 0x2e, 0x70, 0x65, 0x74, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x50, + 0x65, 0x74, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0f, 0x12, 0x0d, 0x2f, 0x70, 0x65, 0x74, + 0x2f, 0x7b, 0x70, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x7d, 0x90, 0x02, 0x01, 0x12, 0x73, 0x0a, 0x11, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x65, 0x74, 0x57, 0x69, 0x74, 0x68, 0x46, 0x6f, 0x72, + 0x6d, 0x12, 0x2c, 0x2e, 0x69, 0x6f, 0x2e, 0x73, 0x77, 0x61, 0x67, 0x67, 0x65, 0x72, 0x2e, 0x70, + 0x65, 0x74, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x50, 0x65, 0x74, 0x57, 0x69, 0x74, 0x68, 0x46, 0x6f, 0x72, 0x6d, 0x52, 0x65, 0x71, 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, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x3a, + 0x01, 0x2a, 0x22, 0x0d, 0x2f, 0x70, 0x65, 0x74, 0x2f, 0x7b, 0x70, 0x65, 0x74, 0x5f, 0x69, 0x64, + 0x7d, 0x12, 0x59, 0x0a, 0x09, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x65, 0x74, 0x12, 0x1d, + 0x2e, 0x69, 0x6f, 0x2e, 0x73, 0x77, 0x61, 0x67, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x65, 0x74, 0x73, + 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x65, 0x74, 0x49, 0x44, 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, 0x15, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0f, 0x2a, 0x0d, 0x2f, + 0x70, 0x65, 0x74, 0x2f, 0x7b, 0x70, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x7e, 0x0a, 0x0a, + 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x25, 0x2e, 0x69, 0x6f, 0x2e, + 0x73, 0x77, 0x61, 0x67, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x65, 0x74, 0x73, 0x74, 0x6f, 0x72, 0x65, + 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, + 0x71, 0x1a, 0x23, 0x2e, 0x69, 0x6f, 0x2e, 0x73, 0x77, 0x61, 0x67, 0x67, 0x65, 0x72, 0x2e, 0x70, + 0x65, 0x74, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x70, 0x69, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x24, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x3a, 0x01, + 0x2a, 0x22, 0x19, 0x2f, 0x70, 0x65, 0x74, 0x2f, 0x7b, 0x70, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x7d, + 0x2f, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x53, 0x0a, 0x06, + 0x41, 0x64, 0x64, 0x50, 0x65, 0x74, 0x12, 0x1b, 0x2e, 0x69, 0x6f, 0x2e, 0x73, 0x77, 0x61, 0x67, + 0x67, 0x65, 0x72, 0x2e, 0x70, 0x65, 0x74, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x32, 0x2e, + 0x50, 0x65, 0x74, 0x1a, 0x1b, 0x2e, 0x69, 0x6f, 0x2e, 0x73, 0x77, 0x61, 0x67, 0x67, 0x65, 0x72, + 0x2e, 0x70, 0x65, 0x74, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x65, 0x74, + 0x22, 0x0f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x09, 0x3a, 0x01, 0x2a, 0x22, 0x04, 0x2f, 0x70, 0x65, + 0x74, 0x12, 0x56, 0x0a, 0x09, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x65, 0x74, 0x12, 0x1b, + 0x2e, 0x69, 0x6f, 0x2e, 0x73, 0x77, 0x61, 0x67, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x65, 0x74, 0x73, + 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x65, 0x74, 0x1a, 0x1b, 0x2e, 0x69, 0x6f, + 0x2e, 0x73, 0x77, 0x61, 0x67, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x65, 0x74, 0x73, 0x74, 0x6f, 0x72, + 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x65, 0x74, 0x22, 0x0f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x09, + 0x3a, 0x01, 0x2a, 0x1a, 0x04, 0x2f, 0x70, 0x65, 0x74, 0x12, 0x72, 0x0a, 0x0d, 0x46, 0x69, 0x6e, + 0x64, 0x50, 0x65, 0x74, 0x73, 0x42, 0x79, 0x54, 0x61, 0x67, 0x12, 0x1e, 0x2e, 0x69, 0x6f, 0x2e, + 0x73, 0x77, 0x61, 0x67, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x65, 0x74, 0x73, 0x74, 0x6f, 0x72, 0x65, + 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x61, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x1c, 0x2e, 0x69, 0x6f, 0x2e, + 0x73, 0x77, 0x61, 0x67, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x65, 0x74, 0x73, 0x74, 0x6f, 0x72, 0x65, + 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x65, 0x74, 0x73, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x17, + 0x62, 0x04, 0x70, 0x65, 0x74, 0x73, 0x12, 0x0f, 0x2f, 0x70, 0x65, 0x74, 0x2f, 0x66, 0x69, 0x6e, + 0x64, 0x42, 0x79, 0x54, 0x61, 0x67, 0x73, 0x88, 0x02, 0x01, 0x90, 0x02, 0x01, 0x12, 0x77, 0x0a, + 0x10, 0x46, 0x69, 0x6e, 0x64, 0x50, 0x65, 0x74, 0x73, 0x42, 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x12, 0x21, 0x2e, 0x69, 0x6f, 0x2e, 0x73, 0x77, 0x61, 0x67, 0x67, 0x65, 0x72, 0x2e, 0x70, + 0x65, 0x74, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x52, 0x65, 0x71, 0x1a, 0x1c, 0x2e, 0x69, 0x6f, 0x2e, 0x73, 0x77, 0x61, 0x67, 0x67, 0x65, + 0x72, 0x2e, 0x70, 0x65, 0x74, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x65, + 0x74, 0x73, 0x22, 0x22, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x62, 0x04, 0x70, 0x65, 0x74, 0x73, + 0x12, 0x11, 0x2f, 0x70, 0x65, 0x74, 0x2f, 0x66, 0x69, 0x6e, 0x64, 0x42, 0x79, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x90, 0x02, 0x01, 0x42, 0xea, 0x01, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x69, + 0x6f, 0x2e, 0x73, 0x77, 0x61, 0x67, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x65, 0x74, 0x73, 0x74, 0x6f, + 0x72, 0x65, 0x2e, 0x76, 0x32, 0x42, 0x09, 0x50, 0x65, 0x74, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x01, 0x5a, 0x46, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x76, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x72, 0x64, 0x2f, 0x69, 0x6e, 0x74, 0x65, + 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x69, 0x6f, 0x2f, 0x73, 0x77, 0x61, 0x67, + 0x67, 0x65, 0x72, 0x2f, 0x70, 0x65, 0x74, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x32, 0x3b, + 0x70, 0x65, 0x74, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x76, 0x32, 0xa2, 0x02, 0x03, 0x49, 0x53, 0x50, + 0xaa, 0x02, 0x16, 0x49, 0x6f, 0x2e, 0x53, 0x77, 0x61, 0x67, 0x67, 0x65, 0x72, 0x2e, 0x50, 0x65, + 0x74, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x16, 0x49, 0x6f, 0x5c, 0x53, + 0x77, 0x61, 0x67, 0x67, 0x65, 0x72, 0x5c, 0x50, 0x65, 0x74, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5c, + 0x56, 0x32, 0xe2, 0x02, 0x22, 0x49, 0x6f, 0x5c, 0x53, 0x77, 0x61, 0x67, 0x67, 0x65, 0x72, 0x5c, + 0x50, 0x65, 0x74, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5c, 0x56, 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x19, 0x49, 0x6f, 0x3a, 0x3a, 0x53, 0x77, + 0x61, 0x67, 0x67, 0x65, 0x72, 0x3a, 0x3a, 0x50, 0x65, 0x74, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x3a, + 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_io_swagger_petstore_v2_pets_proto_rawDescOnce sync.Once + file_io_swagger_petstore_v2_pets_proto_rawDescData = file_io_swagger_petstore_v2_pets_proto_rawDesc +) + +func file_io_swagger_petstore_v2_pets_proto_rawDescGZIP() []byte { + file_io_swagger_petstore_v2_pets_proto_rawDescOnce.Do(func() { + file_io_swagger_petstore_v2_pets_proto_rawDescData = protoimpl.X.CompressGZIP(file_io_swagger_petstore_v2_pets_proto_rawDescData) + }) + return file_io_swagger_petstore_v2_pets_proto_rawDescData +} + +var file_io_swagger_petstore_v2_pets_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_io_swagger_petstore_v2_pets_proto_msgTypes = make([]protoimpl.MessageInfo, 11) +var file_io_swagger_petstore_v2_pets_proto_goTypes = []interface{}{ + (Status)(0), // 0: io.swagger.petstore.v2.Status + (*Category)(nil), // 1: io.swagger.petstore.v2.Category + (*Tag)(nil), // 2: io.swagger.petstore.v2.Tag + (*PetID)(nil), // 3: io.swagger.petstore.v2.PetID + (*Pet)(nil), // 4: io.swagger.petstore.v2.Pet + (*UpdatePetWithFormReq)(nil), // 5: io.swagger.petstore.v2.UpdatePetWithFormReq + (*UploadFileReq)(nil), // 6: io.swagger.petstore.v2.UploadFileReq + (*PetBody)(nil), // 7: io.swagger.petstore.v2.PetBody + (*StatusReq)(nil), // 8: io.swagger.petstore.v2.StatusReq + (*TagReq)(nil), // 9: io.swagger.petstore.v2.TagReq + (*Pets)(nil), // 10: io.swagger.petstore.v2.Pets + (*ApiResponse)(nil), // 11: io.swagger.petstore.v2.ApiResponse + (*emptypb.Empty)(nil), // 12: google.protobuf.Empty +} +var file_io_swagger_petstore_v2_pets_proto_depIdxs = []int32{ + 1, // 0: io.swagger.petstore.v2.Pet.category:type_name -> io.swagger.petstore.v2.Category + 2, // 1: io.swagger.petstore.v2.Pet.tags:type_name -> io.swagger.petstore.v2.Tag + 4, // 2: io.swagger.petstore.v2.Pets.pets:type_name -> io.swagger.petstore.v2.Pet + 3, // 3: io.swagger.petstore.v2.PetService.GetPetByID:input_type -> io.swagger.petstore.v2.PetID + 5, // 4: io.swagger.petstore.v2.PetService.UpdatePetWithForm:input_type -> io.swagger.petstore.v2.UpdatePetWithFormReq + 3, // 5: io.swagger.petstore.v2.PetService.DeletePet:input_type -> io.swagger.petstore.v2.PetID + 6, // 6: io.swagger.petstore.v2.PetService.UploadFile:input_type -> io.swagger.petstore.v2.UploadFileReq + 4, // 7: io.swagger.petstore.v2.PetService.AddPet:input_type -> io.swagger.petstore.v2.Pet + 4, // 8: io.swagger.petstore.v2.PetService.UpdatePet:input_type -> io.swagger.petstore.v2.Pet + 9, // 9: io.swagger.petstore.v2.PetService.FindPetsByTag:input_type -> io.swagger.petstore.v2.TagReq + 8, // 10: io.swagger.petstore.v2.PetService.FindPetsByStatus:input_type -> io.swagger.petstore.v2.StatusReq + 4, // 11: io.swagger.petstore.v2.PetService.GetPetByID:output_type -> io.swagger.petstore.v2.Pet + 12, // 12: io.swagger.petstore.v2.PetService.UpdatePetWithForm:output_type -> google.protobuf.Empty + 12, // 13: io.swagger.petstore.v2.PetService.DeletePet:output_type -> google.protobuf.Empty + 11, // 14: io.swagger.petstore.v2.PetService.UploadFile:output_type -> io.swagger.petstore.v2.ApiResponse + 4, // 15: io.swagger.petstore.v2.PetService.AddPet:output_type -> io.swagger.petstore.v2.Pet + 4, // 16: io.swagger.petstore.v2.PetService.UpdatePet:output_type -> io.swagger.petstore.v2.Pet + 10, // 17: io.swagger.petstore.v2.PetService.FindPetsByTag:output_type -> io.swagger.petstore.v2.Pets + 10, // 18: io.swagger.petstore.v2.PetService.FindPetsByStatus:output_type -> io.swagger.petstore.v2.Pets + 11, // [11:19] is the sub-list for method output_type + 3, // [3:11] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_io_swagger_petstore_v2_pets_proto_init() } +func file_io_swagger_petstore_v2_pets_proto_init() { + if File_io_swagger_petstore_v2_pets_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_io_swagger_petstore_v2_pets_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Category); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_io_swagger_petstore_v2_pets_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Tag); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_io_swagger_petstore_v2_pets_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PetID); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_io_swagger_petstore_v2_pets_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Pet); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_io_swagger_petstore_v2_pets_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdatePetWithFormReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_io_swagger_petstore_v2_pets_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UploadFileReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_io_swagger_petstore_v2_pets_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PetBody); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_io_swagger_petstore_v2_pets_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StatusReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_io_swagger_petstore_v2_pets_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TagReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_io_swagger_petstore_v2_pets_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Pets); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_io_swagger_petstore_v2_pets_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ApiResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_io_swagger_petstore_v2_pets_proto_rawDesc, + NumEnums: 1, + NumMessages: 11, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_io_swagger_petstore_v2_pets_proto_goTypes, + DependencyIndexes: file_io_swagger_petstore_v2_pets_proto_depIdxs, + EnumInfos: file_io_swagger_petstore_v2_pets_proto_enumTypes, + MessageInfos: file_io_swagger_petstore_v2_pets_proto_msgTypes, + }.Build() + File_io_swagger_petstore_v2_pets_proto = out.File + file_io_swagger_petstore_v2_pets_proto_rawDesc = nil + file_io_swagger_petstore_v2_pets_proto_goTypes = nil + file_io_swagger_petstore_v2_pets_proto_depIdxs = nil +} diff --git a/internal/gen/io/swagger/petstore/v2/pets_grpc.pb.go b/internal/gen/io/swagger/petstore/v2/pets_grpc.pb.go new file mode 100644 index 0000000..59c3a61 --- /dev/null +++ b/internal/gen/io/swagger/petstore/v2/pets_grpc.pb.go @@ -0,0 +1,396 @@ +// Copyright 2023-2024 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: io/swagger/petstore/v2/pets.proto + +// The service defined herein comes from v2 of the Petstore service, which +// is used as an example for Swagger/OpenAPI. The Swagger spec can be found +// here: https://petstore.swagger.io/v2/swagger.json +// A human-friendly HTML view of this API is also available at +// https://petstore.swagger.io. +// +// This file defines only the "pet" service. The spec for this site also +// includes "store" and "user" services which are not supported via these +// RPC definitions. + +package petstorev2 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + PetService_GetPetByID_FullMethodName = "/io.swagger.petstore.v2.PetService/GetPetByID" + PetService_UpdatePetWithForm_FullMethodName = "/io.swagger.petstore.v2.PetService/UpdatePetWithForm" + PetService_DeletePet_FullMethodName = "/io.swagger.petstore.v2.PetService/DeletePet" + PetService_UploadFile_FullMethodName = "/io.swagger.petstore.v2.PetService/UploadFile" + PetService_AddPet_FullMethodName = "/io.swagger.petstore.v2.PetService/AddPet" + PetService_UpdatePet_FullMethodName = "/io.swagger.petstore.v2.PetService/UpdatePet" + PetService_FindPetsByTag_FullMethodName = "/io.swagger.petstore.v2.PetService/FindPetsByTag" + PetService_FindPetsByStatus_FullMethodName = "/io.swagger.petstore.v2.PetService/FindPetsByStatus" +) + +// PetServiceClient is the client API for PetService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type PetServiceClient interface { + GetPetByID(ctx context.Context, in *PetID, opts ...grpc.CallOption) (*Pet, error) + UpdatePetWithForm(ctx context.Context, in *UpdatePetWithFormReq, opts ...grpc.CallOption) (*emptypb.Empty, error) + DeletePet(ctx context.Context, in *PetID, opts ...grpc.CallOption) (*emptypb.Empty, error) + UploadFile(ctx context.Context, in *UploadFileReq, opts ...grpc.CallOption) (*ApiResponse, error) + AddPet(ctx context.Context, in *Pet, opts ...grpc.CallOption) (*Pet, error) + UpdatePet(ctx context.Context, in *Pet, opts ...grpc.CallOption) (*Pet, error) + // Deprecated: Do not use. + FindPetsByTag(ctx context.Context, in *TagReq, opts ...grpc.CallOption) (*Pets, error) + FindPetsByStatus(ctx context.Context, in *StatusReq, opts ...grpc.CallOption) (*Pets, error) +} + +type petServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewPetServiceClient(cc grpc.ClientConnInterface) PetServiceClient { + return &petServiceClient{cc} +} + +func (c *petServiceClient) GetPetByID(ctx context.Context, in *PetID, opts ...grpc.CallOption) (*Pet, error) { + out := new(Pet) + err := c.cc.Invoke(ctx, PetService_GetPetByID_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *petServiceClient) UpdatePetWithForm(ctx context.Context, in *UpdatePetWithFormReq, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, PetService_UpdatePetWithForm_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *petServiceClient) DeletePet(ctx context.Context, in *PetID, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, PetService_DeletePet_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *petServiceClient) UploadFile(ctx context.Context, in *UploadFileReq, opts ...grpc.CallOption) (*ApiResponse, error) { + out := new(ApiResponse) + err := c.cc.Invoke(ctx, PetService_UploadFile_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *petServiceClient) AddPet(ctx context.Context, in *Pet, opts ...grpc.CallOption) (*Pet, error) { + out := new(Pet) + err := c.cc.Invoke(ctx, PetService_AddPet_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *petServiceClient) UpdatePet(ctx context.Context, in *Pet, opts ...grpc.CallOption) (*Pet, error) { + out := new(Pet) + err := c.cc.Invoke(ctx, PetService_UpdatePet_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Deprecated: Do not use. +func (c *petServiceClient) FindPetsByTag(ctx context.Context, in *TagReq, opts ...grpc.CallOption) (*Pets, error) { + out := new(Pets) + err := c.cc.Invoke(ctx, PetService_FindPetsByTag_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *petServiceClient) FindPetsByStatus(ctx context.Context, in *StatusReq, opts ...grpc.CallOption) (*Pets, error) { + out := new(Pets) + err := c.cc.Invoke(ctx, PetService_FindPetsByStatus_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// PetServiceServer is the server API for PetService service. +// All implementations must embed UnimplementedPetServiceServer +// for forward compatibility +type PetServiceServer interface { + GetPetByID(context.Context, *PetID) (*Pet, error) + UpdatePetWithForm(context.Context, *UpdatePetWithFormReq) (*emptypb.Empty, error) + DeletePet(context.Context, *PetID) (*emptypb.Empty, error) + UploadFile(context.Context, *UploadFileReq) (*ApiResponse, error) + AddPet(context.Context, *Pet) (*Pet, error) + UpdatePet(context.Context, *Pet) (*Pet, error) + // Deprecated: Do not use. + FindPetsByTag(context.Context, *TagReq) (*Pets, error) + FindPetsByStatus(context.Context, *StatusReq) (*Pets, error) + mustEmbedUnimplementedPetServiceServer() +} + +// UnimplementedPetServiceServer must be embedded to have forward compatible implementations. +type UnimplementedPetServiceServer struct { +} + +func (UnimplementedPetServiceServer) GetPetByID(context.Context, *PetID) (*Pet, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetPetByID not implemented") +} +func (UnimplementedPetServiceServer) UpdatePetWithForm(context.Context, *UpdatePetWithFormReq) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdatePetWithForm not implemented") +} +func (UnimplementedPetServiceServer) DeletePet(context.Context, *PetID) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeletePet not implemented") +} +func (UnimplementedPetServiceServer) UploadFile(context.Context, *UploadFileReq) (*ApiResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UploadFile not implemented") +} +func (UnimplementedPetServiceServer) AddPet(context.Context, *Pet) (*Pet, error) { + return nil, status.Errorf(codes.Unimplemented, "method AddPet not implemented") +} +func (UnimplementedPetServiceServer) UpdatePet(context.Context, *Pet) (*Pet, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdatePet not implemented") +} +func (UnimplementedPetServiceServer) FindPetsByTag(context.Context, *TagReq) (*Pets, error) { + return nil, status.Errorf(codes.Unimplemented, "method FindPetsByTag not implemented") +} +func (UnimplementedPetServiceServer) FindPetsByStatus(context.Context, *StatusReq) (*Pets, error) { + return nil, status.Errorf(codes.Unimplemented, "method FindPetsByStatus not implemented") +} +func (UnimplementedPetServiceServer) mustEmbedUnimplementedPetServiceServer() {} + +// UnsafePetServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to PetServiceServer will +// result in compilation errors. +type UnsafePetServiceServer interface { + mustEmbedUnimplementedPetServiceServer() +} + +func RegisterPetServiceServer(s grpc.ServiceRegistrar, srv PetServiceServer) { + s.RegisterService(&PetService_ServiceDesc, srv) +} + +func _PetService_GetPetByID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PetID) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PetServiceServer).GetPetByID(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PetService_GetPetByID_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PetServiceServer).GetPetByID(ctx, req.(*PetID)) + } + return interceptor(ctx, in, info, handler) +} + +func _PetService_UpdatePetWithForm_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdatePetWithFormReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PetServiceServer).UpdatePetWithForm(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PetService_UpdatePetWithForm_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PetServiceServer).UpdatePetWithForm(ctx, req.(*UpdatePetWithFormReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PetService_DeletePet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PetID) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PetServiceServer).DeletePet(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PetService_DeletePet_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PetServiceServer).DeletePet(ctx, req.(*PetID)) + } + return interceptor(ctx, in, info, handler) +} + +func _PetService_UploadFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UploadFileReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PetServiceServer).UploadFile(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PetService_UploadFile_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PetServiceServer).UploadFile(ctx, req.(*UploadFileReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PetService_AddPet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Pet) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PetServiceServer).AddPet(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PetService_AddPet_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PetServiceServer).AddPet(ctx, req.(*Pet)) + } + return interceptor(ctx, in, info, handler) +} + +func _PetService_UpdatePet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Pet) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PetServiceServer).UpdatePet(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PetService_UpdatePet_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PetServiceServer).UpdatePet(ctx, req.(*Pet)) + } + return interceptor(ctx, in, info, handler) +} + +func _PetService_FindPetsByTag_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TagReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PetServiceServer).FindPetsByTag(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PetService_FindPetsByTag_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PetServiceServer).FindPetsByTag(ctx, req.(*TagReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PetService_FindPetsByStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StatusReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PetServiceServer).FindPetsByStatus(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PetService_FindPetsByStatus_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PetServiceServer).FindPetsByStatus(ctx, req.(*StatusReq)) + } + return interceptor(ctx, in, info, handler) +} + +// PetService_ServiceDesc is the grpc.ServiceDesc for PetService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var PetService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "io.swagger.petstore.v2.PetService", + HandlerType: (*PetServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetPetByID", + Handler: _PetService_GetPetByID_Handler, + }, + { + MethodName: "UpdatePetWithForm", + Handler: _PetService_UpdatePetWithForm_Handler, + }, + { + MethodName: "DeletePet", + Handler: _PetService_DeletePet_Handler, + }, + { + MethodName: "UploadFile", + Handler: _PetService_UploadFile_Handler, + }, + { + MethodName: "AddPet", + Handler: _PetService_AddPet_Handler, + }, + { + MethodName: "UpdatePet", + Handler: _PetService_UpdatePet_Handler, + }, + { + MethodName: "FindPetsByTag", + Handler: _PetService_FindPetsByTag_Handler, + }, + { + MethodName: "FindPetsByStatus", + Handler: _PetService_FindPetsByStatus_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "io/swagger/petstore/v2/pets.proto", +} diff --git a/internal/gen/io/swagger/petstore/v2/petstorev2connect/pets.connect.go b/internal/gen/io/swagger/petstore/v2/petstorev2connect/pets.connect.go new file mode 100644 index 0000000..996e893 --- /dev/null +++ b/internal/gen/io/swagger/petstore/v2/petstorev2connect/pets.connect.go @@ -0,0 +1,352 @@ +// Copyright 2023-2024 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-connect-go. DO NOT EDIT. +// +// Source: io/swagger/petstore/v2/pets.proto + +// The service defined herein comes from v2 of the Petstore service, which +// is used as an example for Swagger/OpenAPI. The Swagger spec can be found +// here: https://petstore.swagger.io/v2/swagger.json +// A human-friendly HTML view of this API is also available at +// https://petstore.swagger.io. +// +// This file defines only the "pet" service. The spec for this site also +// includes "store" and "user" services which are not supported via these +// RPC definitions. +package petstorev2connect + +import ( + connect "connectrpc.com/connect" + v2 "connectrpc.com/vanguard/internal/gen/io/swagger/petstore/v2" + context "context" + errors "errors" + emptypb "google.golang.org/protobuf/types/known/emptypb" + http "net/http" + strings "strings" +) + +// This is a compile-time assertion to ensure that this generated file and the connect package are +// compatible. If you get a compiler error that this constant is not defined, this code was +// generated with a version of connect newer than the one compiled into your binary. You can fix the +// problem by either regenerating this code with an older version of connect or updating the connect +// version compiled into your binary. +const _ = connect.IsAtLeastVersion1_13_0 + +const ( + // PetServiceName is the fully-qualified name of the PetService service. + PetServiceName = "io.swagger.petstore.v2.PetService" +) + +// These constants are the fully-qualified names of the RPCs defined in this package. They're +// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route. +// +// Note that these are different from the fully-qualified method names used by +// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to +// reflection-formatted method names, remove the leading slash and convert the remaining slash to a +// period. +const ( + // PetServiceGetPetByIDProcedure is the fully-qualified name of the PetService's GetPetByID RPC. + PetServiceGetPetByIDProcedure = "/io.swagger.petstore.v2.PetService/GetPetByID" + // PetServiceUpdatePetWithFormProcedure is the fully-qualified name of the PetService's + // UpdatePetWithForm RPC. + PetServiceUpdatePetWithFormProcedure = "/io.swagger.petstore.v2.PetService/UpdatePetWithForm" + // PetServiceDeletePetProcedure is the fully-qualified name of the PetService's DeletePet RPC. + PetServiceDeletePetProcedure = "/io.swagger.petstore.v2.PetService/DeletePet" + // PetServiceUploadFileProcedure is the fully-qualified name of the PetService's UploadFile RPC. + PetServiceUploadFileProcedure = "/io.swagger.petstore.v2.PetService/UploadFile" + // PetServiceAddPetProcedure is the fully-qualified name of the PetService's AddPet RPC. + PetServiceAddPetProcedure = "/io.swagger.petstore.v2.PetService/AddPet" + // PetServiceUpdatePetProcedure is the fully-qualified name of the PetService's UpdatePet RPC. + PetServiceUpdatePetProcedure = "/io.swagger.petstore.v2.PetService/UpdatePet" + // PetServiceFindPetsByTagProcedure is the fully-qualified name of the PetService's FindPetsByTag + // RPC. + PetServiceFindPetsByTagProcedure = "/io.swagger.petstore.v2.PetService/FindPetsByTag" + // PetServiceFindPetsByStatusProcedure is the fully-qualified name of the PetService's + // FindPetsByStatus RPC. + PetServiceFindPetsByStatusProcedure = "/io.swagger.petstore.v2.PetService/FindPetsByStatus" +) + +// These variables are the protoreflect.Descriptor objects for the RPCs defined in this package. +var ( + petServiceServiceDescriptor = v2.File_io_swagger_petstore_v2_pets_proto.Services().ByName("PetService") + petServiceGetPetByIDMethodDescriptor = petServiceServiceDescriptor.Methods().ByName("GetPetByID") + petServiceUpdatePetWithFormMethodDescriptor = petServiceServiceDescriptor.Methods().ByName("UpdatePetWithForm") + petServiceDeletePetMethodDescriptor = petServiceServiceDescriptor.Methods().ByName("DeletePet") + petServiceUploadFileMethodDescriptor = petServiceServiceDescriptor.Methods().ByName("UploadFile") + petServiceAddPetMethodDescriptor = petServiceServiceDescriptor.Methods().ByName("AddPet") + petServiceUpdatePetMethodDescriptor = petServiceServiceDescriptor.Methods().ByName("UpdatePet") + petServiceFindPetsByTagMethodDescriptor = petServiceServiceDescriptor.Methods().ByName("FindPetsByTag") + petServiceFindPetsByStatusMethodDescriptor = petServiceServiceDescriptor.Methods().ByName("FindPetsByStatus") +) + +// PetServiceClient is a client for the io.swagger.petstore.v2.PetService service. +type PetServiceClient interface { + GetPetByID(context.Context, *connect.Request[v2.PetID]) (*connect.Response[v2.Pet], error) + UpdatePetWithForm(context.Context, *connect.Request[v2.UpdatePetWithFormReq]) (*connect.Response[emptypb.Empty], error) + DeletePet(context.Context, *connect.Request[v2.PetID]) (*connect.Response[emptypb.Empty], error) + UploadFile(context.Context, *connect.Request[v2.UploadFileReq]) (*connect.Response[v2.ApiResponse], error) + AddPet(context.Context, *connect.Request[v2.Pet]) (*connect.Response[v2.Pet], error) + UpdatePet(context.Context, *connect.Request[v2.Pet]) (*connect.Response[v2.Pet], error) + // Deprecated: do not use. + FindPetsByTag(context.Context, *connect.Request[v2.TagReq]) (*connect.Response[v2.Pets], error) + FindPetsByStatus(context.Context, *connect.Request[v2.StatusReq]) (*connect.Response[v2.Pets], error) +} + +// NewPetServiceClient constructs a client for the io.swagger.petstore.v2.PetService service. By +// default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, +// and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the +// connect.WithGRPC() or connect.WithGRPCWeb() options. +// +// The URL supplied here should be the base URL for the Connect or gRPC server (for example, +// http://api.acme.com or https://acme.com/grpc). +func NewPetServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) PetServiceClient { + baseURL = strings.TrimRight(baseURL, "/") + return &petServiceClient{ + getPetByID: connect.NewClient[v2.PetID, v2.Pet]( + httpClient, + baseURL+PetServiceGetPetByIDProcedure, + connect.WithSchema(petServiceGetPetByIDMethodDescriptor), + connect.WithIdempotency(connect.IdempotencyNoSideEffects), + connect.WithClientOptions(opts...), + ), + updatePetWithForm: connect.NewClient[v2.UpdatePetWithFormReq, emptypb.Empty]( + httpClient, + baseURL+PetServiceUpdatePetWithFormProcedure, + connect.WithSchema(petServiceUpdatePetWithFormMethodDescriptor), + connect.WithClientOptions(opts...), + ), + deletePet: connect.NewClient[v2.PetID, emptypb.Empty]( + httpClient, + baseURL+PetServiceDeletePetProcedure, + connect.WithSchema(petServiceDeletePetMethodDescriptor), + connect.WithClientOptions(opts...), + ), + uploadFile: connect.NewClient[v2.UploadFileReq, v2.ApiResponse]( + httpClient, + baseURL+PetServiceUploadFileProcedure, + connect.WithSchema(petServiceUploadFileMethodDescriptor), + connect.WithClientOptions(opts...), + ), + addPet: connect.NewClient[v2.Pet, v2.Pet]( + httpClient, + baseURL+PetServiceAddPetProcedure, + connect.WithSchema(petServiceAddPetMethodDescriptor), + connect.WithClientOptions(opts...), + ), + updatePet: connect.NewClient[v2.Pet, v2.Pet]( + httpClient, + baseURL+PetServiceUpdatePetProcedure, + connect.WithSchema(petServiceUpdatePetMethodDescriptor), + connect.WithClientOptions(opts...), + ), + findPetsByTag: connect.NewClient[v2.TagReq, v2.Pets]( + httpClient, + baseURL+PetServiceFindPetsByTagProcedure, + connect.WithSchema(petServiceFindPetsByTagMethodDescriptor), + connect.WithIdempotency(connect.IdempotencyNoSideEffects), + connect.WithClientOptions(opts...), + ), + findPetsByStatus: connect.NewClient[v2.StatusReq, v2.Pets]( + httpClient, + baseURL+PetServiceFindPetsByStatusProcedure, + connect.WithSchema(petServiceFindPetsByStatusMethodDescriptor), + connect.WithIdempotency(connect.IdempotencyNoSideEffects), + connect.WithClientOptions(opts...), + ), + } +} + +// petServiceClient implements PetServiceClient. +type petServiceClient struct { + getPetByID *connect.Client[v2.PetID, v2.Pet] + updatePetWithForm *connect.Client[v2.UpdatePetWithFormReq, emptypb.Empty] + deletePet *connect.Client[v2.PetID, emptypb.Empty] + uploadFile *connect.Client[v2.UploadFileReq, v2.ApiResponse] + addPet *connect.Client[v2.Pet, v2.Pet] + updatePet *connect.Client[v2.Pet, v2.Pet] + findPetsByTag *connect.Client[v2.TagReq, v2.Pets] + findPetsByStatus *connect.Client[v2.StatusReq, v2.Pets] +} + +// GetPetByID calls io.swagger.petstore.v2.PetService.GetPetByID. +func (c *petServiceClient) GetPetByID(ctx context.Context, req *connect.Request[v2.PetID]) (*connect.Response[v2.Pet], error) { + return c.getPetByID.CallUnary(ctx, req) +} + +// UpdatePetWithForm calls io.swagger.petstore.v2.PetService.UpdatePetWithForm. +func (c *petServiceClient) UpdatePetWithForm(ctx context.Context, req *connect.Request[v2.UpdatePetWithFormReq]) (*connect.Response[emptypb.Empty], error) { + return c.updatePetWithForm.CallUnary(ctx, req) +} + +// DeletePet calls io.swagger.petstore.v2.PetService.DeletePet. +func (c *petServiceClient) DeletePet(ctx context.Context, req *connect.Request[v2.PetID]) (*connect.Response[emptypb.Empty], error) { + return c.deletePet.CallUnary(ctx, req) +} + +// UploadFile calls io.swagger.petstore.v2.PetService.UploadFile. +func (c *petServiceClient) UploadFile(ctx context.Context, req *connect.Request[v2.UploadFileReq]) (*connect.Response[v2.ApiResponse], error) { + return c.uploadFile.CallUnary(ctx, req) +} + +// AddPet calls io.swagger.petstore.v2.PetService.AddPet. +func (c *petServiceClient) AddPet(ctx context.Context, req *connect.Request[v2.Pet]) (*connect.Response[v2.Pet], error) { + return c.addPet.CallUnary(ctx, req) +} + +// UpdatePet calls io.swagger.petstore.v2.PetService.UpdatePet. +func (c *petServiceClient) UpdatePet(ctx context.Context, req *connect.Request[v2.Pet]) (*connect.Response[v2.Pet], error) { + return c.updatePet.CallUnary(ctx, req) +} + +// FindPetsByTag calls io.swagger.petstore.v2.PetService.FindPetsByTag. +// +// Deprecated: do not use. +func (c *petServiceClient) FindPetsByTag(ctx context.Context, req *connect.Request[v2.TagReq]) (*connect.Response[v2.Pets], error) { + return c.findPetsByTag.CallUnary(ctx, req) +} + +// FindPetsByStatus calls io.swagger.petstore.v2.PetService.FindPetsByStatus. +func (c *petServiceClient) FindPetsByStatus(ctx context.Context, req *connect.Request[v2.StatusReq]) (*connect.Response[v2.Pets], error) { + return c.findPetsByStatus.CallUnary(ctx, req) +} + +// PetServiceHandler is an implementation of the io.swagger.petstore.v2.PetService service. +type PetServiceHandler interface { + GetPetByID(context.Context, *connect.Request[v2.PetID]) (*connect.Response[v2.Pet], error) + UpdatePetWithForm(context.Context, *connect.Request[v2.UpdatePetWithFormReq]) (*connect.Response[emptypb.Empty], error) + DeletePet(context.Context, *connect.Request[v2.PetID]) (*connect.Response[emptypb.Empty], error) + UploadFile(context.Context, *connect.Request[v2.UploadFileReq]) (*connect.Response[v2.ApiResponse], error) + AddPet(context.Context, *connect.Request[v2.Pet]) (*connect.Response[v2.Pet], error) + UpdatePet(context.Context, *connect.Request[v2.Pet]) (*connect.Response[v2.Pet], error) + // Deprecated: do not use. + FindPetsByTag(context.Context, *connect.Request[v2.TagReq]) (*connect.Response[v2.Pets], error) + FindPetsByStatus(context.Context, *connect.Request[v2.StatusReq]) (*connect.Response[v2.Pets], error) +} + +// NewPetServiceHandler builds an HTTP handler from the service implementation. It returns the path +// on which to mount the handler and the handler itself. +// +// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf +// and JSON codecs. They also support gzip compression. +func NewPetServiceHandler(svc PetServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { + petServiceGetPetByIDHandler := connect.NewUnaryHandler( + PetServiceGetPetByIDProcedure, + svc.GetPetByID, + connect.WithSchema(petServiceGetPetByIDMethodDescriptor), + connect.WithIdempotency(connect.IdempotencyNoSideEffects), + connect.WithHandlerOptions(opts...), + ) + petServiceUpdatePetWithFormHandler := connect.NewUnaryHandler( + PetServiceUpdatePetWithFormProcedure, + svc.UpdatePetWithForm, + connect.WithSchema(petServiceUpdatePetWithFormMethodDescriptor), + connect.WithHandlerOptions(opts...), + ) + petServiceDeletePetHandler := connect.NewUnaryHandler( + PetServiceDeletePetProcedure, + svc.DeletePet, + connect.WithSchema(petServiceDeletePetMethodDescriptor), + connect.WithHandlerOptions(opts...), + ) + petServiceUploadFileHandler := connect.NewUnaryHandler( + PetServiceUploadFileProcedure, + svc.UploadFile, + connect.WithSchema(petServiceUploadFileMethodDescriptor), + connect.WithHandlerOptions(opts...), + ) + petServiceAddPetHandler := connect.NewUnaryHandler( + PetServiceAddPetProcedure, + svc.AddPet, + connect.WithSchema(petServiceAddPetMethodDescriptor), + connect.WithHandlerOptions(opts...), + ) + petServiceUpdatePetHandler := connect.NewUnaryHandler( + PetServiceUpdatePetProcedure, + svc.UpdatePet, + connect.WithSchema(petServiceUpdatePetMethodDescriptor), + connect.WithHandlerOptions(opts...), + ) + petServiceFindPetsByTagHandler := connect.NewUnaryHandler( + PetServiceFindPetsByTagProcedure, + svc.FindPetsByTag, + connect.WithSchema(petServiceFindPetsByTagMethodDescriptor), + connect.WithIdempotency(connect.IdempotencyNoSideEffects), + connect.WithHandlerOptions(opts...), + ) + petServiceFindPetsByStatusHandler := connect.NewUnaryHandler( + PetServiceFindPetsByStatusProcedure, + svc.FindPetsByStatus, + connect.WithSchema(petServiceFindPetsByStatusMethodDescriptor), + connect.WithIdempotency(connect.IdempotencyNoSideEffects), + connect.WithHandlerOptions(opts...), + ) + return "/io.swagger.petstore.v2.PetService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + switch r.URL.Path { + case PetServiceGetPetByIDProcedure: + petServiceGetPetByIDHandler.ServeHTTP(w, r) + case PetServiceUpdatePetWithFormProcedure: + petServiceUpdatePetWithFormHandler.ServeHTTP(w, r) + case PetServiceDeletePetProcedure: + petServiceDeletePetHandler.ServeHTTP(w, r) + case PetServiceUploadFileProcedure: + petServiceUploadFileHandler.ServeHTTP(w, r) + case PetServiceAddPetProcedure: + petServiceAddPetHandler.ServeHTTP(w, r) + case PetServiceUpdatePetProcedure: + petServiceUpdatePetHandler.ServeHTTP(w, r) + case PetServiceFindPetsByTagProcedure: + petServiceFindPetsByTagHandler.ServeHTTP(w, r) + case PetServiceFindPetsByStatusProcedure: + petServiceFindPetsByStatusHandler.ServeHTTP(w, r) + default: + http.NotFound(w, r) + } + }) +} + +// UnimplementedPetServiceHandler returns CodeUnimplemented from all methods. +type UnimplementedPetServiceHandler struct{} + +func (UnimplementedPetServiceHandler) GetPetByID(context.Context, *connect.Request[v2.PetID]) (*connect.Response[v2.Pet], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("io.swagger.petstore.v2.PetService.GetPetByID is not implemented")) +} + +func (UnimplementedPetServiceHandler) UpdatePetWithForm(context.Context, *connect.Request[v2.UpdatePetWithFormReq]) (*connect.Response[emptypb.Empty], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("io.swagger.petstore.v2.PetService.UpdatePetWithForm is not implemented")) +} + +func (UnimplementedPetServiceHandler) DeletePet(context.Context, *connect.Request[v2.PetID]) (*connect.Response[emptypb.Empty], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("io.swagger.petstore.v2.PetService.DeletePet is not implemented")) +} + +func (UnimplementedPetServiceHandler) UploadFile(context.Context, *connect.Request[v2.UploadFileReq]) (*connect.Response[v2.ApiResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("io.swagger.petstore.v2.PetService.UploadFile is not implemented")) +} + +func (UnimplementedPetServiceHandler) AddPet(context.Context, *connect.Request[v2.Pet]) (*connect.Response[v2.Pet], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("io.swagger.petstore.v2.PetService.AddPet is not implemented")) +} + +func (UnimplementedPetServiceHandler) UpdatePet(context.Context, *connect.Request[v2.Pet]) (*connect.Response[v2.Pet], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("io.swagger.petstore.v2.PetService.UpdatePet is not implemented")) +} + +func (UnimplementedPetServiceHandler) FindPetsByTag(context.Context, *connect.Request[v2.TagReq]) (*connect.Response[v2.Pets], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("io.swagger.petstore.v2.PetService.FindPetsByTag is not implemented")) +} + +func (UnimplementedPetServiceHandler) FindPetsByStatus(context.Context, *connect.Request[v2.StatusReq]) (*connect.Response[v2.Pets], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("io.swagger.petstore.v2.PetService.FindPetsByStatus is not implemented")) +}