feat: update protobuf message structure for product tariffs; change Offers to Offer and adjust related conversions
This commit is contained in:
		@@ -25,7 +25,7 @@ type CalculateProductTariffsRequest struct {
 | 
			
		||||
	state         protoimpl.MessageState                     `protogen:"open.v1"`
 | 
			
		||||
	MarketplaceId int64                                      `protobuf:"varint,1,opt,name=marketplace_id,json=marketplaceId,proto3" json:"marketplace_id,omitempty"`
 | 
			
		||||
	Parameters    *CalculateProductTariffsRequest_Parameters `protobuf:"bytes,2,opt,name=parameters,proto3" json:"parameters,omitempty"`
 | 
			
		||||
	Offers        []*CalculateProductTariffsRequest_Offers   `protobuf:"bytes,3,rep,name=offers,proto3" json:"offers,omitempty"`
 | 
			
		||||
	Offers        []*CalculateProductTariffsRequest_Offer    `protobuf:"bytes,3,rep,name=offers,proto3" json:"offers,omitempty"`
 | 
			
		||||
	unknownFields protoimpl.UnknownFields
 | 
			
		||||
	sizeCache     protoimpl.SizeCache
 | 
			
		||||
}
 | 
			
		||||
@@ -74,7 +74,7 @@ func (x *CalculateProductTariffsRequest) GetParameters() *CalculateProductTariff
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (x *CalculateProductTariffsRequest) GetOffers() []*CalculateProductTariffsRequest_Offers {
 | 
			
		||||
func (x *CalculateProductTariffsRequest) GetOffers() []*CalculateProductTariffsRequest_Offer {
 | 
			
		||||
	if x != nil {
 | 
			
		||||
		return x.Offers
 | 
			
		||||
	}
 | 
			
		||||
@@ -221,33 +221,33 @@ func (x *GetProductsResponse) GetOffers() []*GetProductsResponse_Offer {
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
type CalculateProductTariffsRequest_Offers struct {
 | 
			
		||||
type CalculateProductTariffsRequest_Offer struct {
 | 
			
		||||
	state         protoimpl.MessageState `protogen:"open.v1"`
 | 
			
		||||
	CategoryId    int64                  `protobuf:"varint,1,opt,name=category_id,json=categoryId,proto3" json:"category_id,omitempty"`
 | 
			
		||||
	Price         int64                  `protobuf:"varint,2,opt,name=price,proto3" json:"price,omitempty"`
 | 
			
		||||
	Length        int64                  `protobuf:"varint,3,opt,name=length,proto3" json:"length,omitempty"`
 | 
			
		||||
	Width         int64                  `protobuf:"varint,4,opt,name=width,proto3" json:"width,omitempty"`
 | 
			
		||||
	Height        int64                  `protobuf:"varint,5,opt,name=height,proto3" json:"height,omitempty"`
 | 
			
		||||
	Weight        int64                  `protobuf:"varint,6,opt,name=weight,proto3" json:"weight,omitempty"`
 | 
			
		||||
	Price         float32                `protobuf:"fixed32,2,opt,name=price,proto3" json:"price,omitempty"`
 | 
			
		||||
	Length        float32                `protobuf:"fixed32,3,opt,name=length,proto3" json:"length,omitempty"`
 | 
			
		||||
	Width         float32                `protobuf:"fixed32,4,opt,name=width,proto3" json:"width,omitempty"`
 | 
			
		||||
	Height        float32                `protobuf:"fixed32,5,opt,name=height,proto3" json:"height,omitempty"`
 | 
			
		||||
	Weight        float32                `protobuf:"fixed32,6,opt,name=weight,proto3" json:"weight,omitempty"`
 | 
			
		||||
	Quantity      int64                  `protobuf:"varint,7,opt,name=quantity,proto3" json:"quantity,omitempty"`
 | 
			
		||||
	unknownFields protoimpl.UnknownFields
 | 
			
		||||
	sizeCache     protoimpl.SizeCache
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (x *CalculateProductTariffsRequest_Offers) Reset() {
 | 
			
		||||
	*x = CalculateProductTariffsRequest_Offers{}
 | 
			
		||||
func (x *CalculateProductTariffsRequest_Offer) Reset() {
 | 
			
		||||
	*x = CalculateProductTariffsRequest_Offer{}
 | 
			
		||||
	mi := &file_yandexmarket_products_proto_msgTypes[4]
 | 
			
		||||
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 | 
			
		||||
	ms.StoreMessageInfo(mi)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (x *CalculateProductTariffsRequest_Offers) String() string {
 | 
			
		||||
func (x *CalculateProductTariffsRequest_Offer) String() string {
 | 
			
		||||
	return protoimpl.X.MessageStringOf(x)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (*CalculateProductTariffsRequest_Offers) ProtoMessage() {}
 | 
			
		||||
func (*CalculateProductTariffsRequest_Offer) ProtoMessage() {}
 | 
			
		||||
 | 
			
		||||
func (x *CalculateProductTariffsRequest_Offers) ProtoReflect() protoreflect.Message {
 | 
			
		||||
func (x *CalculateProductTariffsRequest_Offer) ProtoReflect() protoreflect.Message {
 | 
			
		||||
	mi := &file_yandexmarket_products_proto_msgTypes[4]
 | 
			
		||||
	if x != nil {
 | 
			
		||||
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 | 
			
		||||
@@ -259,54 +259,54 @@ func (x *CalculateProductTariffsRequest_Offers) ProtoReflect() protoreflect.Mess
 | 
			
		||||
	return mi.MessageOf(x)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Deprecated: Use CalculateProductTariffsRequest_Offers.ProtoReflect.Descriptor instead.
 | 
			
		||||
func (*CalculateProductTariffsRequest_Offers) Descriptor() ([]byte, []int) {
 | 
			
		||||
// Deprecated: Use CalculateProductTariffsRequest_Offer.ProtoReflect.Descriptor instead.
 | 
			
		||||
func (*CalculateProductTariffsRequest_Offer) Descriptor() ([]byte, []int) {
 | 
			
		||||
	return file_yandexmarket_products_proto_rawDescGZIP(), []int{0, 0}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (x *CalculateProductTariffsRequest_Offers) GetCategoryId() int64 {
 | 
			
		||||
func (x *CalculateProductTariffsRequest_Offer) GetCategoryId() int64 {
 | 
			
		||||
	if x != nil {
 | 
			
		||||
		return x.CategoryId
 | 
			
		||||
	}
 | 
			
		||||
	return 0
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (x *CalculateProductTariffsRequest_Offers) GetPrice() int64 {
 | 
			
		||||
func (x *CalculateProductTariffsRequest_Offer) GetPrice() float32 {
 | 
			
		||||
	if x != nil {
 | 
			
		||||
		return x.Price
 | 
			
		||||
	}
 | 
			
		||||
	return 0
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (x *CalculateProductTariffsRequest_Offers) GetLength() int64 {
 | 
			
		||||
func (x *CalculateProductTariffsRequest_Offer) GetLength() float32 {
 | 
			
		||||
	if x != nil {
 | 
			
		||||
		return x.Length
 | 
			
		||||
	}
 | 
			
		||||
	return 0
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (x *CalculateProductTariffsRequest_Offers) GetWidth() int64 {
 | 
			
		||||
func (x *CalculateProductTariffsRequest_Offer) GetWidth() float32 {
 | 
			
		||||
	if x != nil {
 | 
			
		||||
		return x.Width
 | 
			
		||||
	}
 | 
			
		||||
	return 0
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (x *CalculateProductTariffsRequest_Offers) GetHeight() int64 {
 | 
			
		||||
func (x *CalculateProductTariffsRequest_Offer) GetHeight() float32 {
 | 
			
		||||
	if x != nil {
 | 
			
		||||
		return x.Height
 | 
			
		||||
	}
 | 
			
		||||
	return 0
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (x *CalculateProductTariffsRequest_Offers) GetWeight() int64 {
 | 
			
		||||
func (x *CalculateProductTariffsRequest_Offer) GetWeight() float32 {
 | 
			
		||||
	if x != nil {
 | 
			
		||||
		return x.Weight
 | 
			
		||||
	}
 | 
			
		||||
	return 0
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (x *CalculateProductTariffsRequest_Offers) GetQuantity() int64 {
 | 
			
		||||
func (x *CalculateProductTariffsRequest_Offer) GetQuantity() int64 {
 | 
			
		||||
	if x != nil {
 | 
			
		||||
		return x.Quantity
 | 
			
		||||
	}
 | 
			
		||||
@@ -384,11 +384,11 @@ func (x *CalculateProductTariffsRequest_Parameters) GetCurrency() string {
 | 
			
		||||
type CalculateProductTariffsResponse_Offer struct {
 | 
			
		||||
	state         protoimpl.MessageState `protogen:"open.v1"`
 | 
			
		||||
	CategoryId    int64                  `protobuf:"varint,1,opt,name=category_id,json=categoryId,proto3" json:"category_id,omitempty"`
 | 
			
		||||
	Price         int64                  `protobuf:"varint,2,opt,name=price,proto3" json:"price,omitempty"`
 | 
			
		||||
	Length        int64                  `protobuf:"varint,3,opt,name=length,proto3" json:"length,omitempty"`
 | 
			
		||||
	Width         int64                  `protobuf:"varint,4,opt,name=width,proto3" json:"width,omitempty"`
 | 
			
		||||
	Height        int64                  `protobuf:"varint,5,opt,name=height,proto3" json:"height,omitempty"`
 | 
			
		||||
	Weight        int64                  `protobuf:"varint,6,opt,name=weight,proto3" json:"weight,omitempty"`
 | 
			
		||||
	Price         float32                `protobuf:"fixed32,2,opt,name=price,proto3" json:"price,omitempty"`
 | 
			
		||||
	Length        float32                `protobuf:"fixed32,3,opt,name=length,proto3" json:"length,omitempty"`
 | 
			
		||||
	Width         float32                `protobuf:"fixed32,4,opt,name=width,proto3" json:"width,omitempty"`
 | 
			
		||||
	Height        float32                `protobuf:"fixed32,5,opt,name=height,proto3" json:"height,omitempty"`
 | 
			
		||||
	Weight        float32                `protobuf:"fixed32,6,opt,name=weight,proto3" json:"weight,omitempty"`
 | 
			
		||||
	Quantity      int64                  `protobuf:"varint,7,opt,name=quantity,proto3" json:"quantity,omitempty"`
 | 
			
		||||
	unknownFields protoimpl.UnknownFields
 | 
			
		||||
	sizeCache     protoimpl.SizeCache
 | 
			
		||||
@@ -431,35 +431,35 @@ func (x *CalculateProductTariffsResponse_Offer) GetCategoryId() int64 {
 | 
			
		||||
	return 0
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (x *CalculateProductTariffsResponse_Offer) GetPrice() int64 {
 | 
			
		||||
func (x *CalculateProductTariffsResponse_Offer) GetPrice() float32 {
 | 
			
		||||
	if x != nil {
 | 
			
		||||
		return x.Price
 | 
			
		||||
	}
 | 
			
		||||
	return 0
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (x *CalculateProductTariffsResponse_Offer) GetLength() int64 {
 | 
			
		||||
func (x *CalculateProductTariffsResponse_Offer) GetLength() float32 {
 | 
			
		||||
	if x != nil {
 | 
			
		||||
		return x.Length
 | 
			
		||||
	}
 | 
			
		||||
	return 0
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (x *CalculateProductTariffsResponse_Offer) GetWidth() int64 {
 | 
			
		||||
func (x *CalculateProductTariffsResponse_Offer) GetWidth() float32 {
 | 
			
		||||
	if x != nil {
 | 
			
		||||
		return x.Width
 | 
			
		||||
	}
 | 
			
		||||
	return 0
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (x *CalculateProductTariffsResponse_Offer) GetHeight() int64 {
 | 
			
		||||
func (x *CalculateProductTariffsResponse_Offer) GetHeight() float32 {
 | 
			
		||||
	if x != nil {
 | 
			
		||||
		return x.Height
 | 
			
		||||
	}
 | 
			
		||||
	return 0
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (x *CalculateProductTariffsResponse_Offer) GetWeight() int64 {
 | 
			
		||||
func (x *CalculateProductTariffsResponse_Offer) GetWeight() float32 {
 | 
			
		||||
	if x != nil {
 | 
			
		||||
		return x.Weight
 | 
			
		||||
	}
 | 
			
		||||
@@ -829,21 +829,21 @@ var File_yandexmarket_products_proto protoreflect.FileDescriptor
 | 
			
		||||
 | 
			
		||||
const file_yandexmarket_products_proto_rawDesc = "" +
 | 
			
		||||
	"\n" +
 | 
			
		||||
	"\x1byandexmarket/products.proto\x12\x15yandexmarket.products\"\xce\x04\n" +
 | 
			
		||||
	"\x1byandexmarket/products.proto\x12\x15yandexmarket.products\"\xcc\x04\n" +
 | 
			
		||||
	"\x1eCalculateProductTariffsRequest\x12%\n" +
 | 
			
		||||
	"\x0emarketplace_id\x18\x01 \x01(\x03R\rmarketplaceId\x12`\n" +
 | 
			
		||||
	"\n" +
 | 
			
		||||
	"parameters\x18\x02 \x01(\v2@.yandexmarket.products.CalculateProductTariffsRequest.ParametersR\n" +
 | 
			
		||||
	"parameters\x12T\n" +
 | 
			
		||||
	"\x06offers\x18\x03 \x03(\v2<.yandexmarket.products.CalculateProductTariffsRequest.OffersR\x06offers\x1a\xb9\x01\n" +
 | 
			
		||||
	"\x06Offers\x12\x1f\n" +
 | 
			
		||||
	"parameters\x12S\n" +
 | 
			
		||||
	"\x06offers\x18\x03 \x03(\v2;.yandexmarket.products.CalculateProductTariffsRequest.OfferR\x06offers\x1a\xb8\x01\n" +
 | 
			
		||||
	"\x05Offer\x12\x1f\n" +
 | 
			
		||||
	"\vcategory_id\x18\x01 \x01(\x03R\n" +
 | 
			
		||||
	"categoryId\x12\x14\n" +
 | 
			
		||||
	"\x05price\x18\x02 \x01(\x03R\x05price\x12\x16\n" +
 | 
			
		||||
	"\x06length\x18\x03 \x01(\x03R\x06length\x12\x14\n" +
 | 
			
		||||
	"\x05width\x18\x04 \x01(\x03R\x05width\x12\x16\n" +
 | 
			
		||||
	"\x06height\x18\x05 \x01(\x03R\x06height\x12\x16\n" +
 | 
			
		||||
	"\x06weight\x18\x06 \x01(\x03R\x06weight\x12\x1a\n" +
 | 
			
		||||
	"\x05price\x18\x02 \x01(\x02R\x05price\x12\x16\n" +
 | 
			
		||||
	"\x06length\x18\x03 \x01(\x02R\x06length\x12\x14\n" +
 | 
			
		||||
	"\x05width\x18\x04 \x01(\x02R\x05width\x12\x16\n" +
 | 
			
		||||
	"\x06height\x18\x05 \x01(\x02R\x06height\x12\x16\n" +
 | 
			
		||||
	"\x06weight\x18\x06 \x01(\x02R\x06weight\x12\x1a\n" +
 | 
			
		||||
	"\bquantity\x18\a \x01(\x03R\bquantity\x1a\x90\x01\n" +
 | 
			
		||||
	"\n" +
 | 
			
		||||
	"Parameters\x12\x1f\n" +
 | 
			
		||||
@@ -857,11 +857,11 @@ const file_yandexmarket_products_proto_rawDesc = "" +
 | 
			
		||||
	"\x05Offer\x12\x1f\n" +
 | 
			
		||||
	"\vcategory_id\x18\x01 \x01(\x03R\n" +
 | 
			
		||||
	"categoryId\x12\x14\n" +
 | 
			
		||||
	"\x05price\x18\x02 \x01(\x03R\x05price\x12\x16\n" +
 | 
			
		||||
	"\x06length\x18\x03 \x01(\x03R\x06length\x12\x14\n" +
 | 
			
		||||
	"\x05width\x18\x04 \x01(\x03R\x05width\x12\x16\n" +
 | 
			
		||||
	"\x06height\x18\x05 \x01(\x03R\x06height\x12\x16\n" +
 | 
			
		||||
	"\x06weight\x18\x06 \x01(\x03R\x06weight\x12\x1a\n" +
 | 
			
		||||
	"\x05price\x18\x02 \x01(\x02R\x05price\x12\x16\n" +
 | 
			
		||||
	"\x06length\x18\x03 \x01(\x02R\x06length\x12\x14\n" +
 | 
			
		||||
	"\x05width\x18\x04 \x01(\x02R\x05width\x12\x16\n" +
 | 
			
		||||
	"\x06height\x18\x05 \x01(\x02R\x06height\x12\x16\n" +
 | 
			
		||||
	"\x06weight\x18\x06 \x01(\x02R\x06weight\x12\x1a\n" +
 | 
			
		||||
	"\bquantity\x18\a \x01(\x03R\bquantity\x1a5\n" +
 | 
			
		||||
	"\tParameter\x12\x12\n" +
 | 
			
		||||
	"\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n" +
 | 
			
		||||
@@ -917,7 +917,7 @@ var file_yandexmarket_products_proto_goTypes = []any{
 | 
			
		||||
	(*CalculateProductTariffsResponse)(nil),            // 1: yandexmarket.products.CalculateProductTariffsResponse
 | 
			
		||||
	(*GetProductsRequest)(nil),                         // 2: yandexmarket.products.GetProductsRequest
 | 
			
		||||
	(*GetProductsResponse)(nil),                        // 3: yandexmarket.products.GetProductsResponse
 | 
			
		||||
	(*CalculateProductTariffsRequest_Offers)(nil),      // 4: yandexmarket.products.CalculateProductTariffsRequest.Offers
 | 
			
		||||
	(*CalculateProductTariffsRequest_Offer)(nil),       // 4: yandexmarket.products.CalculateProductTariffsRequest.Offer
 | 
			
		||||
	(*CalculateProductTariffsRequest_Parameters)(nil),  // 5: yandexmarket.products.CalculateProductTariffsRequest.Parameters
 | 
			
		||||
	(*CalculateProductTariffsResponse_Offer)(nil),      // 6: yandexmarket.products.CalculateProductTariffsResponse.Offer
 | 
			
		||||
	(*CalculateProductTariffsResponse_Parameter)(nil),  // 7: yandexmarket.products.CalculateProductTariffsResponse.Parameter
 | 
			
		||||
@@ -929,7 +929,7 @@ var file_yandexmarket_products_proto_goTypes = []any{
 | 
			
		||||
}
 | 
			
		||||
var file_yandexmarket_products_proto_depIdxs = []int32{
 | 
			
		||||
	5,  // 0: yandexmarket.products.CalculateProductTariffsRequest.parameters:type_name -> yandexmarket.products.CalculateProductTariffsRequest.Parameters
 | 
			
		||||
	4,  // 1: yandexmarket.products.CalculateProductTariffsRequest.offers:type_name -> yandexmarket.products.CalculateProductTariffsRequest.Offers
 | 
			
		||||
	4,  // 1: yandexmarket.products.CalculateProductTariffsRequest.offers:type_name -> yandexmarket.products.CalculateProductTariffsRequest.Offer
 | 
			
		||||
	9,  // 2: yandexmarket.products.CalculateProductTariffsResponse.offers:type_name -> yandexmarket.products.CalculateProductTariffsResponse.Offers
 | 
			
		||||
	10, // 3: yandexmarket.products.GetProductsResponse.offers:type_name -> yandexmarket.products.GetProductsResponse.Offer
 | 
			
		||||
	7,  // 4: yandexmarket.products.CalculateProductTariffsResponse.Tariff.parameters:type_name -> yandexmarket.products.CalculateProductTariffsResponse.Parameter
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user