mirror of
https://github.com/hexolan/stocklet.git
synced 2026-12-01 03:09:10 +00:00
d05489c01b
Signed-off-by: Declan Teevan <dt@hexolan.com>
460 lines
16 KiB
Go
460 lines
16 KiB
Go
// Copyright (C) 2024 Declan Teevan
|
|
//
|
|
// This program is free software: you can redistribute it and/or modify
|
|
// it under the terms of the GNU Affero General Public License as published by
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
// (at your option) any later version.
|
|
//
|
|
// This program is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
// GNU Affero General Public License for more details.
|
|
//
|
|
// You should have received a copy of the GNU Affero General Public License
|
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
|
// versions:
|
|
// protoc-gen-go v1.36.12
|
|
// protoc (unknown)
|
|
// source: stocklet/events/v1/product.proto
|
|
|
|
package events_v1
|
|
|
|
import (
|
|
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
|
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
|
reflect "reflect"
|
|
sync "sync"
|
|
unsafe "unsafe"
|
|
)
|
|
|
|
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 ProductPriceQuoteEvent_Type int32
|
|
|
|
const (
|
|
ProductPriceQuoteEvent_TYPE_UNSPECIFIED ProductPriceQuoteEvent_Type = 0
|
|
ProductPriceQuoteEvent_TYPE_UNAVAILABLE ProductPriceQuoteEvent_Type = 1
|
|
ProductPriceQuoteEvent_TYPE_AVAILABLE ProductPriceQuoteEvent_Type = 2
|
|
)
|
|
|
|
// Enum value maps for ProductPriceQuoteEvent_Type.
|
|
var (
|
|
ProductPriceQuoteEvent_Type_name = map[int32]string{
|
|
0: "TYPE_UNSPECIFIED",
|
|
1: "TYPE_UNAVAILABLE",
|
|
2: "TYPE_AVAILABLE",
|
|
}
|
|
ProductPriceQuoteEvent_Type_value = map[string]int32{
|
|
"TYPE_UNSPECIFIED": 0,
|
|
"TYPE_UNAVAILABLE": 1,
|
|
"TYPE_AVAILABLE": 2,
|
|
}
|
|
)
|
|
|
|
func (x ProductPriceQuoteEvent_Type) Enum() *ProductPriceQuoteEvent_Type {
|
|
p := new(ProductPriceQuoteEvent_Type)
|
|
*p = x
|
|
return p
|
|
}
|
|
|
|
func (x ProductPriceQuoteEvent_Type) String() string {
|
|
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
|
}
|
|
|
|
func (ProductPriceQuoteEvent_Type) Descriptor() protoreflect.EnumDescriptor {
|
|
return file_stocklet_events_v1_product_proto_enumTypes[0].Descriptor()
|
|
}
|
|
|
|
func (ProductPriceQuoteEvent_Type) Type() protoreflect.EnumType {
|
|
return &file_stocklet_events_v1_product_proto_enumTypes[0]
|
|
}
|
|
|
|
func (x ProductPriceQuoteEvent_Type) Number() protoreflect.EnumNumber {
|
|
return protoreflect.EnumNumber(x)
|
|
}
|
|
|
|
// Deprecated: Use ProductPriceQuoteEvent_Type.Descriptor instead.
|
|
func (ProductPriceQuoteEvent_Type) EnumDescriptor() ([]byte, []int) {
|
|
return file_stocklet_events_v1_product_proto_rawDescGZIP(), []int{3, 0}
|
|
}
|
|
|
|
type ProductCreatedEvent struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"`
|
|
ProductId string `protobuf:"bytes,2,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"`
|
|
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
|
|
Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"`
|
|
Price float32 `protobuf:"fixed32,5,opt,name=price,proto3" json:"price,omitempty"`
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *ProductCreatedEvent) Reset() {
|
|
*x = ProductCreatedEvent{}
|
|
mi := &file_stocklet_events_v1_product_proto_msgTypes[0]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *ProductCreatedEvent) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*ProductCreatedEvent) ProtoMessage() {}
|
|
|
|
func (x *ProductCreatedEvent) ProtoReflect() protoreflect.Message {
|
|
mi := &file_stocklet_events_v1_product_proto_msgTypes[0]
|
|
if x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use ProductCreatedEvent.ProtoReflect.Descriptor instead.
|
|
func (*ProductCreatedEvent) Descriptor() ([]byte, []int) {
|
|
return file_stocklet_events_v1_product_proto_rawDescGZIP(), []int{0}
|
|
}
|
|
|
|
func (x *ProductCreatedEvent) GetRevision() int32 {
|
|
if x != nil {
|
|
return x.Revision
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (x *ProductCreatedEvent) GetProductId() string {
|
|
if x != nil {
|
|
return x.ProductId
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (x *ProductCreatedEvent) GetName() string {
|
|
if x != nil {
|
|
return x.Name
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (x *ProductCreatedEvent) GetDescription() string {
|
|
if x != nil {
|
|
return x.Description
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (x *ProductCreatedEvent) GetPrice() float32 {
|
|
if x != nil {
|
|
return x.Price
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type ProductPriceUpdatedEvent struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"`
|
|
ProductId string `protobuf:"bytes,2,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"`
|
|
Price float32 `protobuf:"fixed32,3,opt,name=price,proto3" json:"price,omitempty"`
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *ProductPriceUpdatedEvent) Reset() {
|
|
*x = ProductPriceUpdatedEvent{}
|
|
mi := &file_stocklet_events_v1_product_proto_msgTypes[1]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *ProductPriceUpdatedEvent) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*ProductPriceUpdatedEvent) ProtoMessage() {}
|
|
|
|
func (x *ProductPriceUpdatedEvent) ProtoReflect() protoreflect.Message {
|
|
mi := &file_stocklet_events_v1_product_proto_msgTypes[1]
|
|
if x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use ProductPriceUpdatedEvent.ProtoReflect.Descriptor instead.
|
|
func (*ProductPriceUpdatedEvent) Descriptor() ([]byte, []int) {
|
|
return file_stocklet_events_v1_product_proto_rawDescGZIP(), []int{1}
|
|
}
|
|
|
|
func (x *ProductPriceUpdatedEvent) GetRevision() int32 {
|
|
if x != nil {
|
|
return x.Revision
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (x *ProductPriceUpdatedEvent) GetProductId() string {
|
|
if x != nil {
|
|
return x.ProductId
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (x *ProductPriceUpdatedEvent) GetPrice() float32 {
|
|
if x != nil {
|
|
return x.Price
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type ProductDeletedEvent struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"`
|
|
ProductId string `protobuf:"bytes,2,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"`
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *ProductDeletedEvent) Reset() {
|
|
*x = ProductDeletedEvent{}
|
|
mi := &file_stocklet_events_v1_product_proto_msgTypes[2]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *ProductDeletedEvent) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*ProductDeletedEvent) ProtoMessage() {}
|
|
|
|
func (x *ProductDeletedEvent) ProtoReflect() protoreflect.Message {
|
|
mi := &file_stocklet_events_v1_product_proto_msgTypes[2]
|
|
if x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use ProductDeletedEvent.ProtoReflect.Descriptor instead.
|
|
func (*ProductDeletedEvent) Descriptor() ([]byte, []int) {
|
|
return file_stocklet_events_v1_product_proto_rawDescGZIP(), []int{2}
|
|
}
|
|
|
|
func (x *ProductDeletedEvent) GetRevision() int32 {
|
|
if x != nil {
|
|
return x.Revision
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (x *ProductDeletedEvent) GetProductId() string {
|
|
if x != nil {
|
|
return x.ProductId
|
|
}
|
|
return ""
|
|
}
|
|
|
|
type ProductPriceQuoteEvent struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"`
|
|
Type ProductPriceQuoteEvent_Type `protobuf:"varint,2,opt,name=type,proto3,enum=stocklet.events.v1.ProductPriceQuoteEvent_Type" json:"type,omitempty"`
|
|
OrderId string `protobuf:"bytes,3,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"`
|
|
// Product ID: Quantity
|
|
ProductQuantities map[string]int32 `protobuf:"bytes,4,rep,name=product_quantities,json=productQuantities,proto3" json:"product_quantities,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"`
|
|
// Product ID: Unit Price
|
|
ProductPrices map[string]float32 `protobuf:"bytes,5,rep,name=product_prices,json=productPrices,proto3" json:"product_prices,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"fixed32,2,opt,name=value"`
|
|
TotalPrice float32 `protobuf:"fixed32,6,opt,name=total_price,json=totalPrice,proto3" json:"total_price,omitempty"`
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *ProductPriceQuoteEvent) Reset() {
|
|
*x = ProductPriceQuoteEvent{}
|
|
mi := &file_stocklet_events_v1_product_proto_msgTypes[3]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *ProductPriceQuoteEvent) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*ProductPriceQuoteEvent) ProtoMessage() {}
|
|
|
|
func (x *ProductPriceQuoteEvent) ProtoReflect() protoreflect.Message {
|
|
mi := &file_stocklet_events_v1_product_proto_msgTypes[3]
|
|
if x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use ProductPriceQuoteEvent.ProtoReflect.Descriptor instead.
|
|
func (*ProductPriceQuoteEvent) Descriptor() ([]byte, []int) {
|
|
return file_stocklet_events_v1_product_proto_rawDescGZIP(), []int{3}
|
|
}
|
|
|
|
func (x *ProductPriceQuoteEvent) GetRevision() int32 {
|
|
if x != nil {
|
|
return x.Revision
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (x *ProductPriceQuoteEvent) GetType() ProductPriceQuoteEvent_Type {
|
|
if x != nil {
|
|
return x.Type
|
|
}
|
|
return ProductPriceQuoteEvent_TYPE_UNSPECIFIED
|
|
}
|
|
|
|
func (x *ProductPriceQuoteEvent) GetOrderId() string {
|
|
if x != nil {
|
|
return x.OrderId
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (x *ProductPriceQuoteEvent) GetProductQuantities() map[string]int32 {
|
|
if x != nil {
|
|
return x.ProductQuantities
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (x *ProductPriceQuoteEvent) GetProductPrices() map[string]float32 {
|
|
if x != nil {
|
|
return x.ProductPrices
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (x *ProductPriceQuoteEvent) GetTotalPrice() float32 {
|
|
if x != nil {
|
|
return x.TotalPrice
|
|
}
|
|
return 0
|
|
}
|
|
|
|
var File_stocklet_events_v1_product_proto protoreflect.FileDescriptor
|
|
|
|
const file_stocklet_events_v1_product_proto_rawDesc = "" +
|
|
"\n" +
|
|
" stocklet/events/v1/product.proto\x12\x12stocklet.events.v1\"\x9c\x01\n" +
|
|
"\x13ProductCreatedEvent\x12\x1a\n" +
|
|
"\brevision\x18\x01 \x01(\x05R\brevision\x12\x1d\n" +
|
|
"\n" +
|
|
"product_id\x18\x02 \x01(\tR\tproductId\x12\x12\n" +
|
|
"\x04name\x18\x03 \x01(\tR\x04name\x12 \n" +
|
|
"\vdescription\x18\x04 \x01(\tR\vdescription\x12\x14\n" +
|
|
"\x05price\x18\x05 \x01(\x02R\x05price\"k\n" +
|
|
"\x18ProductPriceUpdatedEvent\x12\x1a\n" +
|
|
"\brevision\x18\x01 \x01(\x05R\brevision\x12\x1d\n" +
|
|
"\n" +
|
|
"product_id\x18\x02 \x01(\tR\tproductId\x12\x14\n" +
|
|
"\x05price\x18\x03 \x01(\x02R\x05price\"P\n" +
|
|
"\x13ProductDeletedEvent\x12\x1a\n" +
|
|
"\brevision\x18\x01 \x01(\x05R\brevision\x12\x1d\n" +
|
|
"\n" +
|
|
"product_id\x18\x02 \x01(\tR\tproductId\"\xdd\x04\n" +
|
|
"\x16ProductPriceQuoteEvent\x12\x1a\n" +
|
|
"\brevision\x18\x01 \x01(\x05R\brevision\x12C\n" +
|
|
"\x04type\x18\x02 \x01(\x0e2/.stocklet.events.v1.ProductPriceQuoteEvent.TypeR\x04type\x12\x19\n" +
|
|
"\border_id\x18\x03 \x01(\tR\aorderId\x12p\n" +
|
|
"\x12product_quantities\x18\x04 \x03(\v2A.stocklet.events.v1.ProductPriceQuoteEvent.ProductQuantitiesEntryR\x11productQuantities\x12d\n" +
|
|
"\x0eproduct_prices\x18\x05 \x03(\v2=.stocklet.events.v1.ProductPriceQuoteEvent.ProductPricesEntryR\rproductPrices\x12\x1f\n" +
|
|
"\vtotal_price\x18\x06 \x01(\x02R\n" +
|
|
"totalPrice\x1aD\n" +
|
|
"\x16ProductQuantitiesEntry\x12\x10\n" +
|
|
"\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" +
|
|
"\x05value\x18\x02 \x01(\x05R\x05value:\x028\x01\x1a@\n" +
|
|
"\x12ProductPricesEntry\x12\x10\n" +
|
|
"\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" +
|
|
"\x05value\x18\x02 \x01(\x02R\x05value:\x028\x01\"F\n" +
|
|
"\x04Type\x12\x14\n" +
|
|
"\x10TYPE_UNSPECIFIED\x10\x00\x12\x14\n" +
|
|
"\x10TYPE_UNAVAILABLE\x10\x01\x12\x12\n" +
|
|
"\x0eTYPE_AVAILABLE\x10\x02BGZEgithub.com/hexolan/stocklet/internal/pkg/protogen/events/v1;events_v1b\x06proto3"
|
|
|
|
var (
|
|
file_stocklet_events_v1_product_proto_rawDescOnce sync.Once
|
|
file_stocklet_events_v1_product_proto_rawDescData []byte
|
|
)
|
|
|
|
func file_stocklet_events_v1_product_proto_rawDescGZIP() []byte {
|
|
file_stocklet_events_v1_product_proto_rawDescOnce.Do(func() {
|
|
file_stocklet_events_v1_product_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_stocklet_events_v1_product_proto_rawDesc), len(file_stocklet_events_v1_product_proto_rawDesc)))
|
|
})
|
|
return file_stocklet_events_v1_product_proto_rawDescData
|
|
}
|
|
|
|
var file_stocklet_events_v1_product_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
|
var file_stocklet_events_v1_product_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
|
|
var file_stocklet_events_v1_product_proto_goTypes = []any{
|
|
(ProductPriceQuoteEvent_Type)(0), // 0: stocklet.events.v1.ProductPriceQuoteEvent.Type
|
|
(*ProductCreatedEvent)(nil), // 1: stocklet.events.v1.ProductCreatedEvent
|
|
(*ProductPriceUpdatedEvent)(nil), // 2: stocklet.events.v1.ProductPriceUpdatedEvent
|
|
(*ProductDeletedEvent)(nil), // 3: stocklet.events.v1.ProductDeletedEvent
|
|
(*ProductPriceQuoteEvent)(nil), // 4: stocklet.events.v1.ProductPriceQuoteEvent
|
|
nil, // 5: stocklet.events.v1.ProductPriceQuoteEvent.ProductQuantitiesEntry
|
|
nil, // 6: stocklet.events.v1.ProductPriceQuoteEvent.ProductPricesEntry
|
|
}
|
|
var file_stocklet_events_v1_product_proto_depIdxs = []int32{
|
|
0, // 0: stocklet.events.v1.ProductPriceQuoteEvent.type:type_name -> stocklet.events.v1.ProductPriceQuoteEvent.Type
|
|
5, // 1: stocklet.events.v1.ProductPriceQuoteEvent.product_quantities:type_name -> stocklet.events.v1.ProductPriceQuoteEvent.ProductQuantitiesEntry
|
|
6, // 2: stocklet.events.v1.ProductPriceQuoteEvent.product_prices:type_name -> stocklet.events.v1.ProductPriceQuoteEvent.ProductPricesEntry
|
|
3, // [3:3] is the sub-list for method output_type
|
|
3, // [3:3] 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_stocklet_events_v1_product_proto_init() }
|
|
func file_stocklet_events_v1_product_proto_init() {
|
|
if File_stocklet_events_v1_product_proto != nil {
|
|
return
|
|
}
|
|
type x struct{}
|
|
out := protoimpl.TypeBuilder{
|
|
File: protoimpl.DescBuilder{
|
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
|
RawDescriptor: unsafe.Slice(unsafe.StringData(file_stocklet_events_v1_product_proto_rawDesc), len(file_stocklet_events_v1_product_proto_rawDesc)),
|
|
NumEnums: 1,
|
|
NumMessages: 6,
|
|
NumExtensions: 0,
|
|
NumServices: 0,
|
|
},
|
|
GoTypes: file_stocklet_events_v1_product_proto_goTypes,
|
|
DependencyIndexes: file_stocklet_events_v1_product_proto_depIdxs,
|
|
EnumInfos: file_stocklet_events_v1_product_proto_enumTypes,
|
|
MessageInfos: file_stocklet_events_v1_product_proto_msgTypes,
|
|
}.Build()
|
|
File_stocklet_events_v1_product_proto = out.File
|
|
file_stocklet_events_v1_product_proto_goTypes = nil
|
|
file_stocklet_events_v1_product_proto_depIdxs = nil
|
|
}
|