diff --git a/api/generated/v1/ozon/products/products.pb.go b/api/generated/v1/ozon/products/products.pb.go index 8ce9288..980ff39 100644 --- a/api/generated/v1/ozon/products/products.pb.go +++ b/api/generated/v1/ozon/products/products.pb.go @@ -198,6 +198,302 @@ func (x *GetProductPriceResponse) GetProductPrices() []*ProductPrice { return nil } +type GetProductAttributesRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + MarketplaceId int64 `protobuf:"varint,1,opt,name=marketplace_id,json=marketplaceId,proto3" json:"marketplace_id,omitempty"` + ProductId []int64 `protobuf:"varint,2,rep,packed,name=product_id,json=productId,proto3" json:"product_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetProductAttributesRequest) Reset() { + *x = GetProductAttributesRequest{} + mi := &file_ozon_products_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetProductAttributesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetProductAttributesRequest) ProtoMessage() {} + +func (x *GetProductAttributesRequest) ProtoReflect() protoreflect.Message { + mi := &file_ozon_products_proto_msgTypes[4] + 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 GetProductAttributesRequest.ProtoReflect.Descriptor instead. +func (*GetProductAttributesRequest) Descriptor() ([]byte, []int) { + return file_ozon_products_proto_rawDescGZIP(), []int{4} +} + +func (x *GetProductAttributesRequest) GetMarketplaceId() int64 { + if x != nil { + return x.MarketplaceId + } + return 0 +} + +func (x *GetProductAttributesRequest) GetProductId() []int64 { + if x != nil { + return x.ProductId + } + return nil +} + +type GetProductAttributesResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Items []*ProductAttributes `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetProductAttributesResponse) Reset() { + *x = GetProductAttributesResponse{} + mi := &file_ozon_products_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetProductAttributesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetProductAttributesResponse) ProtoMessage() {} + +func (x *GetProductAttributesResponse) ProtoReflect() protoreflect.Message { + mi := &file_ozon_products_proto_msgTypes[5] + 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 GetProductAttributesResponse.ProtoReflect.Descriptor instead. +func (*GetProductAttributesResponse) Descriptor() ([]byte, []int) { + return file_ozon_products_proto_rawDescGZIP(), []int{5} +} + +func (x *GetProductAttributesResponse) GetItems() []*ProductAttributes { + if x != nil { + return x.Items + } + return nil +} + +type DeleteProductsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + MarketplaceId int64 `protobuf:"varint,1,opt,name=marketplace_id,json=marketplaceId,proto3" json:"marketplace_id,omitempty"` + Items []*DeleteProductsRequest_Item `protobuf:"bytes,2,rep,name=items,proto3" json:"items,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteProductsRequest) Reset() { + *x = DeleteProductsRequest{} + mi := &file_ozon_products_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteProductsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteProductsRequest) ProtoMessage() {} + +func (x *DeleteProductsRequest) ProtoReflect() protoreflect.Message { + mi := &file_ozon_products_proto_msgTypes[6] + 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 DeleteProductsRequest.ProtoReflect.Descriptor instead. +func (*DeleteProductsRequest) Descriptor() ([]byte, []int) { + return file_ozon_products_proto_rawDescGZIP(), []int{6} +} + +func (x *DeleteProductsRequest) GetMarketplaceId() int64 { + if x != nil { + return x.MarketplaceId + } + return 0 +} + +func (x *DeleteProductsRequest) GetItems() []*DeleteProductsRequest_Item { + if x != nil { + return x.Items + } + return nil +} + +type DeleteProductsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + MarketplaceId int64 `protobuf:"varint,1,opt,name=marketplace_id,json=marketplaceId,proto3" json:"marketplace_id,omitempty"` + Items []*DeleteProductsResponse_Item `protobuf:"bytes,2,rep,name=items,proto3" json:"items,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteProductsResponse) Reset() { + *x = DeleteProductsResponse{} + mi := &file_ozon_products_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteProductsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteProductsResponse) ProtoMessage() {} + +func (x *DeleteProductsResponse) ProtoReflect() protoreflect.Message { + mi := &file_ozon_products_proto_msgTypes[7] + 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 DeleteProductsResponse.ProtoReflect.Descriptor instead. +func (*DeleteProductsResponse) Descriptor() ([]byte, []int) { + return file_ozon_products_proto_rawDescGZIP(), []int{7} +} + +func (x *DeleteProductsResponse) GetMarketplaceId() int64 { + if x != nil { + return x.MarketplaceId + } + return 0 +} + +func (x *DeleteProductsResponse) GetItems() []*DeleteProductsResponse_Item { + if x != nil { + return x.Items + } + return nil +} + +type CreateOrUpdateProductsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + MarketplaceId int64 `protobuf:"varint,1,opt,name=marketplace_id,json=marketplaceId,proto3" json:"marketplace_id,omitempty"` + Items []*CreateOrUpdateProductsRequest_Item `protobuf:"bytes,2,rep,name=items,proto3" json:"items,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateOrUpdateProductsRequest) Reset() { + *x = CreateOrUpdateProductsRequest{} + mi := &file_ozon_products_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateOrUpdateProductsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateOrUpdateProductsRequest) ProtoMessage() {} + +func (x *CreateOrUpdateProductsRequest) ProtoReflect() protoreflect.Message { + mi := &file_ozon_products_proto_msgTypes[8] + 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 CreateOrUpdateProductsRequest.ProtoReflect.Descriptor instead. +func (*CreateOrUpdateProductsRequest) Descriptor() ([]byte, []int) { + return file_ozon_products_proto_rawDescGZIP(), []int{8} +} + +func (x *CreateOrUpdateProductsRequest) GetMarketplaceId() int64 { + if x != nil { + return x.MarketplaceId + } + return 0 +} + +func (x *CreateOrUpdateProductsRequest) GetItems() []*CreateOrUpdateProductsRequest_Item { + if x != nil { + return x.Items + } + return nil +} + +type CreateOrUpdateProductsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + TaskId []int64 `protobuf:"varint,1,rep,packed,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateOrUpdateProductsResponse) Reset() { + *x = CreateOrUpdateProductsResponse{} + mi := &file_ozon_products_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateOrUpdateProductsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateOrUpdateProductsResponse) ProtoMessage() {} + +func (x *CreateOrUpdateProductsResponse) ProtoReflect() protoreflect.Message { + mi := &file_ozon_products_proto_msgTypes[9] + 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 CreateOrUpdateProductsResponse.ProtoReflect.Descriptor instead. +func (*CreateOrUpdateProductsResponse) Descriptor() ([]byte, []int) { + return file_ozon_products_proto_rawDescGZIP(), []int{9} +} + +func (x *CreateOrUpdateProductsResponse) GetTaskId() []int64 { + if x != nil { + return x.TaskId + } + return nil +} + type Product struct { state protoimpl.MessageState `protogen:"open.v1"` Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` @@ -205,13 +501,14 @@ type Product struct { Stocks *Product_Stocks `protobuf:"bytes,3,opt,name=stocks,proto3" json:"stocks,omitempty"` Barcodes []string `protobuf:"bytes,4,rep,name=barcodes,proto3" json:"barcodes,omitempty"` Statuses *Product_Status `protobuf:"bytes,5,opt,name=statuses,proto3" json:"statuses,omitempty"` + Errors []*Product_Error `protobuf:"bytes,6,rep,name=errors,proto3" json:"errors,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *Product) Reset() { *x = Product{} - mi := &file_ozon_products_proto_msgTypes[4] + mi := &file_ozon_products_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -223,7 +520,7 @@ func (x *Product) String() string { func (*Product) ProtoMessage() {} func (x *Product) ProtoReflect() protoreflect.Message { - mi := &file_ozon_products_proto_msgTypes[4] + mi := &file_ozon_products_proto_msgTypes[10] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -236,7 +533,7 @@ func (x *Product) ProtoReflect() protoreflect.Message { // Deprecated: Use Product.ProtoReflect.Descriptor instead. func (*Product) Descriptor() ([]byte, []int) { - return file_ozon_products_proto_rawDescGZIP(), []int{4} + return file_ozon_products_proto_rawDescGZIP(), []int{10} } func (x *Product) GetId() int64 { @@ -274,19 +571,26 @@ func (x *Product) GetStatuses() *Product_Status { return nil } +func (x *Product) GetErrors() []*Product_Error { + if x != nil { + return x.Errors + } + return nil +} + type ProductPrice struct { state protoimpl.MessageState `protogen:"open.v1"` - Acquiring uint32 `protobuf:"varint,1,opt,name=acquiring,proto3" json:"acquiring,omitempty"` + Acquiring int64 `protobuf:"varint,1,opt,name=acquiring,proto3" json:"acquiring,omitempty"` Commissions *ProductPrice_Commissions `protobuf:"bytes,2,opt,name=commissions,proto3" json:"commissions,omitempty"` OfferId string `protobuf:"bytes,4,opt,name=offer_id,json=offerId,proto3" json:"offer_id,omitempty"` - ProductId uint32 `protobuf:"varint,7,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` + ProductId int64 `protobuf:"varint,7,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *ProductPrice) Reset() { *x = ProductPrice{} - mi := &file_ozon_products_proto_msgTypes[5] + mi := &file_ozon_products_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -298,7 +602,7 @@ func (x *ProductPrice) String() string { func (*ProductPrice) ProtoMessage() {} func (x *ProductPrice) ProtoReflect() protoreflect.Message { - mi := &file_ozon_products_proto_msgTypes[5] + mi := &file_ozon_products_proto_msgTypes[11] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -311,10 +615,10 @@ func (x *ProductPrice) ProtoReflect() protoreflect.Message { // Deprecated: Use ProductPrice.ProtoReflect.Descriptor instead. func (*ProductPrice) Descriptor() ([]byte, []int) { - return file_ozon_products_proto_rawDescGZIP(), []int{5} + return file_ozon_products_proto_rawDescGZIP(), []int{11} } -func (x *ProductPrice) GetAcquiring() uint32 { +func (x *ProductPrice) GetAcquiring() int64 { if x != nil { return x.Acquiring } @@ -335,13 +639,749 @@ func (x *ProductPrice) GetOfferId() string { return "" } -func (x *ProductPrice) GetProductId() uint32 { +func (x *ProductPrice) GetProductId() int64 { if x != nil { return x.ProductId } return 0 } +type ProductAttributes struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Barcode string `protobuf:"bytes,2,opt,name=barcode,proto3" json:"barcode,omitempty"` + Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` + OfferId string `protobuf:"bytes,5,opt,name=offer_id,json=offerId,proto3" json:"offer_id,omitempty"` + TypeId int64 `protobuf:"varint,6,opt,name=type_id,json=typeId,proto3" json:"type_id,omitempty"` + Height int64 `protobuf:"varint,7,opt,name=height,proto3" json:"height,omitempty"` + Depth int64 `protobuf:"varint,8,opt,name=depth,proto3" json:"depth,omitempty"` + Width int64 `protobuf:"varint,9,opt,name=width,proto3" json:"width,omitempty"` + DimensionUnit string `protobuf:"bytes,10,opt,name=dimension_unit,json=dimensionUnit,proto3" json:"dimension_unit,omitempty"` + Weight int64 `protobuf:"varint,11,opt,name=weight,proto3" json:"weight,omitempty"` + WeightUnit string `protobuf:"bytes,12,opt,name=weight_unit,json=weightUnit,proto3" json:"weight_unit,omitempty"` + PrimaryImage string `protobuf:"bytes,13,opt,name=primary_image,json=primaryImage,proto3" json:"primary_image,omitempty"` + ModelInfo *ProductAttributes_ModelInfo `protobuf:"bytes,15,opt,name=model_info,json=modelInfo,proto3" json:"model_info,omitempty"` + Images []string `protobuf:"bytes,16,rep,name=images,proto3" json:"images,omitempty"` + Attributes []*ProductAttributes_Attributes `protobuf:"bytes,18,rep,name=attributes,proto3" json:"attributes,omitempty"` + ColorImage string `protobuf:"bytes,21,opt,name=color_image,json=colorImage,proto3" json:"color_image,omitempty"` + DescriptionCategoryId int64 `protobuf:"varint,22,opt,name=description_category_id,json=descriptionCategoryId,proto3" json:"description_category_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ProductAttributes) Reset() { + *x = ProductAttributes{} + mi := &file_ozon_products_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ProductAttributes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProductAttributes) ProtoMessage() {} + +func (x *ProductAttributes) ProtoReflect() protoreflect.Message { + mi := &file_ozon_products_proto_msgTypes[12] + 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 ProductAttributes.ProtoReflect.Descriptor instead. +func (*ProductAttributes) Descriptor() ([]byte, []int) { + return file_ozon_products_proto_rawDescGZIP(), []int{12} +} + +func (x *ProductAttributes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ProductAttributes) GetBarcode() string { + if x != nil { + return x.Barcode + } + return "" +} + +func (x *ProductAttributes) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ProductAttributes) GetOfferId() string { + if x != nil { + return x.OfferId + } + return "" +} + +func (x *ProductAttributes) GetTypeId() int64 { + if x != nil { + return x.TypeId + } + return 0 +} + +func (x *ProductAttributes) GetHeight() int64 { + if x != nil { + return x.Height + } + return 0 +} + +func (x *ProductAttributes) GetDepth() int64 { + if x != nil { + return x.Depth + } + return 0 +} + +func (x *ProductAttributes) GetWidth() int64 { + if x != nil { + return x.Width + } + return 0 +} + +func (x *ProductAttributes) GetDimensionUnit() string { + if x != nil { + return x.DimensionUnit + } + return "" +} + +func (x *ProductAttributes) GetWeight() int64 { + if x != nil { + return x.Weight + } + return 0 +} + +func (x *ProductAttributes) GetWeightUnit() string { + if x != nil { + return x.WeightUnit + } + return "" +} + +func (x *ProductAttributes) GetPrimaryImage() string { + if x != nil { + return x.PrimaryImage + } + return "" +} + +func (x *ProductAttributes) GetModelInfo() *ProductAttributes_ModelInfo { + if x != nil { + return x.ModelInfo + } + return nil +} + +func (x *ProductAttributes) GetImages() []string { + if x != nil { + return x.Images + } + return nil +} + +func (x *ProductAttributes) GetAttributes() []*ProductAttributes_Attributes { + if x != nil { + return x.Attributes + } + return nil +} + +func (x *ProductAttributes) GetColorImage() string { + if x != nil { + return x.ColorImage + } + return "" +} + +func (x *ProductAttributes) GetDescriptionCategoryId() int64 { + if x != nil { + return x.DescriptionCategoryId + } + return 0 +} + +type DeleteProductsRequest_Item struct { + state protoimpl.MessageState `protogen:"open.v1"` + ProductId int64 `protobuf:"varint,1,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` + OfferId string `protobuf:"bytes,2,opt,name=offer_id,json=offerId,proto3" json:"offer_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteProductsRequest_Item) Reset() { + *x = DeleteProductsRequest_Item{} + mi := &file_ozon_products_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteProductsRequest_Item) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteProductsRequest_Item) ProtoMessage() {} + +func (x *DeleteProductsRequest_Item) ProtoReflect() protoreflect.Message { + mi := &file_ozon_products_proto_msgTypes[13] + 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 DeleteProductsRequest_Item.ProtoReflect.Descriptor instead. +func (*DeleteProductsRequest_Item) Descriptor() ([]byte, []int) { + return file_ozon_products_proto_rawDescGZIP(), []int{6, 0} +} + +func (x *DeleteProductsRequest_Item) GetProductId() int64 { + if x != nil { + return x.ProductId + } + return 0 +} + +func (x *DeleteProductsRequest_Item) GetOfferId() string { + if x != nil { + return x.OfferId + } + return "" +} + +type DeleteProductsResponse_Item struct { + state protoimpl.MessageState `protogen:"open.v1"` + ProductId int64 `protobuf:"varint,1,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` + OfferId string `protobuf:"bytes,2,opt,name=offer_id,json=offerId,proto3" json:"offer_id,omitempty"` + IsDeleted bool `protobuf:"varint,3,opt,name=is_deleted,json=isDeleted,proto3" json:"is_deleted,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteProductsResponse_Item) Reset() { + *x = DeleteProductsResponse_Item{} + mi := &file_ozon_products_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteProductsResponse_Item) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteProductsResponse_Item) ProtoMessage() {} + +func (x *DeleteProductsResponse_Item) ProtoReflect() protoreflect.Message { + mi := &file_ozon_products_proto_msgTypes[14] + 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 DeleteProductsResponse_Item.ProtoReflect.Descriptor instead. +func (*DeleteProductsResponse_Item) Descriptor() ([]byte, []int) { + return file_ozon_products_proto_rawDescGZIP(), []int{7, 0} +} + +func (x *DeleteProductsResponse_Item) GetProductId() int64 { + if x != nil { + return x.ProductId + } + return 0 +} + +func (x *DeleteProductsResponse_Item) GetOfferId() string { + if x != nil { + return x.OfferId + } + return "" +} + +func (x *DeleteProductsResponse_Item) GetIsDeleted() bool { + if x != nil { + return x.IsDeleted + } + return false +} + +type CreateOrUpdateProductsRequest_Item struct { + state protoimpl.MessageState `protogen:"open.v1"` + Attributes []*CreateOrUpdateProductsRequest_Item_Attributes `protobuf:"bytes,1,rep,name=attributes,proto3" json:"attributes,omitempty"` + Barcode string `protobuf:"bytes,2,opt,name=barcode,proto3" json:"barcode,omitempty"` + DescriptionCategoryId int64 `protobuf:"varint,3,opt,name=description_category_id,json=descriptionCategoryId,proto3" json:"description_category_id,omitempty"` + NewDescriptionCategoryId int64 `protobuf:"varint,4,opt,name=new_description_category_id,json=newDescriptionCategoryId,proto3" json:"new_description_category_id,omitempty"` + ColorImage string `protobuf:"bytes,5,opt,name=color_image,json=colorImage,proto3" json:"color_image,omitempty"` + CurrencyCode string `protobuf:"bytes,7,opt,name=currency_code,json=currencyCode,proto3" json:"currency_code,omitempty"` + Depth int64 `protobuf:"varint,8,opt,name=depth,proto3" json:"depth,omitempty"` + DimensionUnit string `protobuf:"bytes,9,opt,name=dimension_unit,json=dimensionUnit,proto3" json:"dimension_unit,omitempty"` + Height int64 `protobuf:"varint,10,opt,name=height,proto3" json:"height,omitempty"` + Images []string `protobuf:"bytes,11,rep,name=images,proto3" json:"images,omitempty"` + Images360 []string `protobuf:"bytes,12,rep,name=images360,proto3" json:"images360,omitempty"` + Name string `protobuf:"bytes,13,opt,name=name,proto3" json:"name,omitempty"` + OfferId string `protobuf:"bytes,14,opt,name=offer_id,json=offerId,proto3" json:"offer_id,omitempty"` + OldPrice string `protobuf:"bytes,15,opt,name=old_price,json=oldPrice,proto3" json:"old_price,omitempty"` + PdfList []*CreateOrUpdateProductsRequest_Item_PdfListItem `protobuf:"bytes,16,rep,name=pdf_list,json=pdfList,proto3" json:"pdf_list,omitempty"` + Price string `protobuf:"bytes,17,opt,name=price,proto3" json:"price,omitempty"` + PrimaryImage string `protobuf:"bytes,18,opt,name=primary_image,json=primaryImage,proto3" json:"primary_image,omitempty"` + Promotions []*CreateOrUpdateProductsRequest_Item_Promotions `protobuf:"bytes,19,rep,name=promotions,proto3" json:"promotions,omitempty"` + TypeId int64 `protobuf:"varint,20,opt,name=type_id,json=typeId,proto3" json:"type_id,omitempty"` + Vat string `protobuf:"bytes,21,opt,name=vat,proto3" json:"vat,omitempty"` + Weight int64 `protobuf:"varint,22,opt,name=weight,proto3" json:"weight,omitempty"` + WeightUnit string `protobuf:"bytes,23,opt,name=weight_unit,json=weightUnit,proto3" json:"weight_unit,omitempty"` + Width int64 `protobuf:"varint,24,opt,name=width,proto3" json:"width,omitempty"` + ServiceType string `protobuf:"bytes,25,opt,name=service_type,json=serviceType,proto3" json:"service_type,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateOrUpdateProductsRequest_Item) Reset() { + *x = CreateOrUpdateProductsRequest_Item{} + mi := &file_ozon_products_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateOrUpdateProductsRequest_Item) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateOrUpdateProductsRequest_Item) ProtoMessage() {} + +func (x *CreateOrUpdateProductsRequest_Item) ProtoReflect() protoreflect.Message { + mi := &file_ozon_products_proto_msgTypes[15] + 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 CreateOrUpdateProductsRequest_Item.ProtoReflect.Descriptor instead. +func (*CreateOrUpdateProductsRequest_Item) Descriptor() ([]byte, []int) { + return file_ozon_products_proto_rawDescGZIP(), []int{8, 0} +} + +func (x *CreateOrUpdateProductsRequest_Item) GetAttributes() []*CreateOrUpdateProductsRequest_Item_Attributes { + if x != nil { + return x.Attributes + } + return nil +} + +func (x *CreateOrUpdateProductsRequest_Item) GetBarcode() string { + if x != nil { + return x.Barcode + } + return "" +} + +func (x *CreateOrUpdateProductsRequest_Item) GetDescriptionCategoryId() int64 { + if x != nil { + return x.DescriptionCategoryId + } + return 0 +} + +func (x *CreateOrUpdateProductsRequest_Item) GetNewDescriptionCategoryId() int64 { + if x != nil { + return x.NewDescriptionCategoryId + } + return 0 +} + +func (x *CreateOrUpdateProductsRequest_Item) GetColorImage() string { + if x != nil { + return x.ColorImage + } + return "" +} + +func (x *CreateOrUpdateProductsRequest_Item) GetCurrencyCode() string { + if x != nil { + return x.CurrencyCode + } + return "" +} + +func (x *CreateOrUpdateProductsRequest_Item) GetDepth() int64 { + if x != nil { + return x.Depth + } + return 0 +} + +func (x *CreateOrUpdateProductsRequest_Item) GetDimensionUnit() string { + if x != nil { + return x.DimensionUnit + } + return "" +} + +func (x *CreateOrUpdateProductsRequest_Item) GetHeight() int64 { + if x != nil { + return x.Height + } + return 0 +} + +func (x *CreateOrUpdateProductsRequest_Item) GetImages() []string { + if x != nil { + return x.Images + } + return nil +} + +func (x *CreateOrUpdateProductsRequest_Item) GetImages360() []string { + if x != nil { + return x.Images360 + } + return nil +} + +func (x *CreateOrUpdateProductsRequest_Item) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CreateOrUpdateProductsRequest_Item) GetOfferId() string { + if x != nil { + return x.OfferId + } + return "" +} + +func (x *CreateOrUpdateProductsRequest_Item) GetOldPrice() string { + if x != nil { + return x.OldPrice + } + return "" +} + +func (x *CreateOrUpdateProductsRequest_Item) GetPdfList() []*CreateOrUpdateProductsRequest_Item_PdfListItem { + if x != nil { + return x.PdfList + } + return nil +} + +func (x *CreateOrUpdateProductsRequest_Item) GetPrice() string { + if x != nil { + return x.Price + } + return "" +} + +func (x *CreateOrUpdateProductsRequest_Item) GetPrimaryImage() string { + if x != nil { + return x.PrimaryImage + } + return "" +} + +func (x *CreateOrUpdateProductsRequest_Item) GetPromotions() []*CreateOrUpdateProductsRequest_Item_Promotions { + if x != nil { + return x.Promotions + } + return nil +} + +func (x *CreateOrUpdateProductsRequest_Item) GetTypeId() int64 { + if x != nil { + return x.TypeId + } + return 0 +} + +func (x *CreateOrUpdateProductsRequest_Item) GetVat() string { + if x != nil { + return x.Vat + } + return "" +} + +func (x *CreateOrUpdateProductsRequest_Item) GetWeight() int64 { + if x != nil { + return x.Weight + } + return 0 +} + +func (x *CreateOrUpdateProductsRequest_Item) GetWeightUnit() string { + if x != nil { + return x.WeightUnit + } + return "" +} + +func (x *CreateOrUpdateProductsRequest_Item) GetWidth() int64 { + if x != nil { + return x.Width + } + return 0 +} + +func (x *CreateOrUpdateProductsRequest_Item) GetServiceType() string { + if x != nil { + return x.ServiceType + } + return "" +} + +type CreateOrUpdateProductsRequest_Item_Values struct { + state protoimpl.MessageState `protogen:"open.v1"` + DictionaryValueId int64 `protobuf:"varint,1,opt,name=dictionary_value_id,json=dictionaryValueId,proto3" json:"dictionary_value_id,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateOrUpdateProductsRequest_Item_Values) Reset() { + *x = CreateOrUpdateProductsRequest_Item_Values{} + mi := &file_ozon_products_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateOrUpdateProductsRequest_Item_Values) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateOrUpdateProductsRequest_Item_Values) ProtoMessage() {} + +func (x *CreateOrUpdateProductsRequest_Item_Values) ProtoReflect() protoreflect.Message { + mi := &file_ozon_products_proto_msgTypes[16] + 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 CreateOrUpdateProductsRequest_Item_Values.ProtoReflect.Descriptor instead. +func (*CreateOrUpdateProductsRequest_Item_Values) Descriptor() ([]byte, []int) { + return file_ozon_products_proto_rawDescGZIP(), []int{8, 0, 0} +} + +func (x *CreateOrUpdateProductsRequest_Item_Values) GetDictionaryValueId() int64 { + if x != nil { + return x.DictionaryValueId + } + return 0 +} + +func (x *CreateOrUpdateProductsRequest_Item_Values) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +type CreateOrUpdateProductsRequest_Item_Attributes struct { + state protoimpl.MessageState `protogen:"open.v1"` + ComplexId int64 `protobuf:"varint,1,opt,name=complex_id,json=complexId,proto3" json:"complex_id,omitempty"` + Id int64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` + Values []*CreateOrUpdateProductsRequest_Item_Values `protobuf:"bytes,3,rep,name=values,proto3" json:"values,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateOrUpdateProductsRequest_Item_Attributes) Reset() { + *x = CreateOrUpdateProductsRequest_Item_Attributes{} + mi := &file_ozon_products_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateOrUpdateProductsRequest_Item_Attributes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateOrUpdateProductsRequest_Item_Attributes) ProtoMessage() {} + +func (x *CreateOrUpdateProductsRequest_Item_Attributes) ProtoReflect() protoreflect.Message { + mi := &file_ozon_products_proto_msgTypes[17] + 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 CreateOrUpdateProductsRequest_Item_Attributes.ProtoReflect.Descriptor instead. +func (*CreateOrUpdateProductsRequest_Item_Attributes) Descriptor() ([]byte, []int) { + return file_ozon_products_proto_rawDescGZIP(), []int{8, 0, 1} +} + +func (x *CreateOrUpdateProductsRequest_Item_Attributes) GetComplexId() int64 { + if x != nil { + return x.ComplexId + } + return 0 +} + +func (x *CreateOrUpdateProductsRequest_Item_Attributes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *CreateOrUpdateProductsRequest_Item_Attributes) GetValues() []*CreateOrUpdateProductsRequest_Item_Values { + if x != nil { + return x.Values + } + return nil +} + +type CreateOrUpdateProductsRequest_Item_Promotions struct { + state protoimpl.MessageState `protogen:"open.v1"` + Operation string `protobuf:"bytes,1,opt,name=operation,proto3" json:"operation,omitempty"` + Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateOrUpdateProductsRequest_Item_Promotions) Reset() { + *x = CreateOrUpdateProductsRequest_Item_Promotions{} + mi := &file_ozon_products_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateOrUpdateProductsRequest_Item_Promotions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateOrUpdateProductsRequest_Item_Promotions) ProtoMessage() {} + +func (x *CreateOrUpdateProductsRequest_Item_Promotions) ProtoReflect() protoreflect.Message { + mi := &file_ozon_products_proto_msgTypes[18] + 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 CreateOrUpdateProductsRequest_Item_Promotions.ProtoReflect.Descriptor instead. +func (*CreateOrUpdateProductsRequest_Item_Promotions) Descriptor() ([]byte, []int) { + return file_ozon_products_proto_rawDescGZIP(), []int{8, 0, 2} +} + +func (x *CreateOrUpdateProductsRequest_Item_Promotions) GetOperation() string { + if x != nil { + return x.Operation + } + return "" +} + +func (x *CreateOrUpdateProductsRequest_Item_Promotions) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +type CreateOrUpdateProductsRequest_Item_PdfListItem struct { + state protoimpl.MessageState `protogen:"open.v1"` + Index int64 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + SrcUrl string `protobuf:"bytes,3,opt,name=src_url,json=srcUrl,proto3" json:"src_url,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateOrUpdateProductsRequest_Item_PdfListItem) Reset() { + *x = CreateOrUpdateProductsRequest_Item_PdfListItem{} + mi := &file_ozon_products_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateOrUpdateProductsRequest_Item_PdfListItem) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateOrUpdateProductsRequest_Item_PdfListItem) ProtoMessage() {} + +func (x *CreateOrUpdateProductsRequest_Item_PdfListItem) ProtoReflect() protoreflect.Message { + mi := &file_ozon_products_proto_msgTypes[19] + 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 CreateOrUpdateProductsRequest_Item_PdfListItem.ProtoReflect.Descriptor instead. +func (*CreateOrUpdateProductsRequest_Item_PdfListItem) Descriptor() ([]byte, []int) { + return file_ozon_products_proto_rawDescGZIP(), []int{8, 0, 3} +} + +func (x *CreateOrUpdateProductsRequest_Item_PdfListItem) GetIndex() int64 { + if x != nil { + return x.Index + } + return 0 +} + +func (x *CreateOrUpdateProductsRequest_Item_PdfListItem) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CreateOrUpdateProductsRequest_Item_PdfListItem) GetSrcUrl() string { + if x != nil { + return x.SrcUrl + } + return "" +} + type Product_Status struct { state protoimpl.MessageState `protogen:"open.v1"` StatusName string `protobuf:"bytes,1,opt,name=status_name,json=statusName,proto3" json:"status_name,omitempty"` @@ -351,7 +1391,7 @@ type Product_Status struct { func (x *Product_Status) Reset() { *x = Product_Status{} - mi := &file_ozon_products_proto_msgTypes[6] + mi := &file_ozon_products_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -363,7 +1403,7 @@ func (x *Product_Status) String() string { func (*Product_Status) ProtoMessage() {} func (x *Product_Status) ProtoReflect() protoreflect.Message { - mi := &file_ozon_products_proto_msgTypes[6] + mi := &file_ozon_products_proto_msgTypes[20] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -376,7 +1416,7 @@ func (x *Product_Status) ProtoReflect() protoreflect.Message { // Deprecated: Use Product_Status.ProtoReflect.Descriptor instead. func (*Product_Status) Descriptor() ([]byte, []int) { - return file_ozon_products_proto_rawDescGZIP(), []int{4, 0} + return file_ozon_products_proto_rawDescGZIP(), []int{10, 0} } func (x *Product_Status) GetStatusName() string { @@ -396,7 +1436,7 @@ type Product_Stocks struct { func (x *Product_Stocks) Reset() { *x = Product_Stocks{} - mi := &file_ozon_products_proto_msgTypes[7] + mi := &file_ozon_products_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -408,7 +1448,7 @@ func (x *Product_Stocks) String() string { func (*Product_Stocks) ProtoMessage() {} func (x *Product_Stocks) ProtoReflect() protoreflect.Message { - mi := &file_ozon_products_proto_msgTypes[7] + mi := &file_ozon_products_proto_msgTypes[21] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -421,7 +1461,7 @@ func (x *Product_Stocks) ProtoReflect() protoreflect.Message { // Deprecated: Use Product_Stocks.ProtoReflect.Descriptor instead. func (*Product_Stocks) Descriptor() ([]byte, []int) { - return file_ozon_products_proto_rawDescGZIP(), []int{4, 1} + return file_ozon_products_proto_rawDescGZIP(), []int{10, 1} } func (x *Product_Stocks) GetStocks() []*Product_Stock { @@ -450,7 +1490,7 @@ type Product_Stock struct { func (x *Product_Stock) Reset() { *x = Product_Stock{} - mi := &file_ozon_products_proto_msgTypes[8] + mi := &file_ozon_products_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -462,7 +1502,7 @@ func (x *Product_Stock) String() string { func (*Product_Stock) ProtoMessage() {} func (x *Product_Stock) ProtoReflect() protoreflect.Message { - mi := &file_ozon_products_proto_msgTypes[8] + mi := &file_ozon_products_proto_msgTypes[22] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -475,7 +1515,7 @@ func (x *Product_Stock) ProtoReflect() protoreflect.Message { // Deprecated: Use Product_Stock.ProtoReflect.Descriptor instead. func (*Product_Stock) Descriptor() ([]byte, []int) { - return file_ozon_products_proto_rawDescGZIP(), []int{4, 2} + return file_ozon_products_proto_rawDescGZIP(), []int{10, 2} } func (x *Product_Stock) GetPresent() int64 { @@ -506,6 +1546,50 @@ func (x *Product_Stock) GetSource() string { return "" } +type Product_Error struct { + state protoimpl.MessageState `protogen:"open.v1"` + Code string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Product_Error) Reset() { + *x = Product_Error{} + mi := &file_ozon_products_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Product_Error) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Product_Error) ProtoMessage() {} + +func (x *Product_Error) ProtoReflect() protoreflect.Message { + mi := &file_ozon_products_proto_msgTypes[23] + 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 Product_Error.ProtoReflect.Descriptor instead. +func (*Product_Error) Descriptor() ([]byte, []int) { + return file_ozon_products_proto_rawDescGZIP(), []int{10, 3} +} + +func (x *Product_Error) GetCode() string { + if x != nil { + return x.Code + } + return "" +} + type ProductPrice_Commissions struct { state protoimpl.MessageState `protogen:"open.v1"` FboDelivToCustomerAmount float64 `protobuf:"fixed64,1,opt,name=fbo_deliv_to_customer_amount,json=fboDelivToCustomerAmount,proto3" json:"fbo_deliv_to_customer_amount,omitempty"` @@ -526,7 +1610,7 @@ type ProductPrice_Commissions struct { func (x *ProductPrice_Commissions) Reset() { *x = ProductPrice_Commissions{} - mi := &file_ozon_products_proto_msgTypes[9] + mi := &file_ozon_products_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -538,7 +1622,7 @@ func (x *ProductPrice_Commissions) String() string { func (*ProductPrice_Commissions) ProtoMessage() {} func (x *ProductPrice_Commissions) ProtoReflect() protoreflect.Message { - mi := &file_ozon_products_proto_msgTypes[9] + mi := &file_ozon_products_proto_msgTypes[24] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -551,7 +1635,7 @@ func (x *ProductPrice_Commissions) ProtoReflect() protoreflect.Message { // Deprecated: Use ProductPrice_Commissions.ProtoReflect.Descriptor instead. func (*ProductPrice_Commissions) Descriptor() ([]byte, []int) { - return file_ozon_products_proto_rawDescGZIP(), []int{5, 0} + return file_ozon_products_proto_rawDescGZIP(), []int{11, 0} } func (x *ProductPrice_Commissions) GetFboDelivToCustomerAmount() float64 { @@ -638,6 +1722,170 @@ func (x *ProductPrice_Commissions) GetSalesPercentFbs() float64 { return 0 } +type ProductAttributes_ModelInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + ModelId int64 `protobuf:"varint,1,opt,name=model_id,json=modelId,proto3" json:"model_id,omitempty"` + Count int64 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ProductAttributes_ModelInfo) Reset() { + *x = ProductAttributes_ModelInfo{} + mi := &file_ozon_products_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ProductAttributes_ModelInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProductAttributes_ModelInfo) ProtoMessage() {} + +func (x *ProductAttributes_ModelInfo) ProtoReflect() protoreflect.Message { + mi := &file_ozon_products_proto_msgTypes[25] + 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 ProductAttributes_ModelInfo.ProtoReflect.Descriptor instead. +func (*ProductAttributes_ModelInfo) Descriptor() ([]byte, []int) { + return file_ozon_products_proto_rawDescGZIP(), []int{12, 0} +} + +func (x *ProductAttributes_ModelInfo) GetModelId() int64 { + if x != nil { + return x.ModelId + } + return 0 +} + +func (x *ProductAttributes_ModelInfo) GetCount() int64 { + if x != nil { + return x.Count + } + return 0 +} + +type ProductAttributes_Values struct { + state protoimpl.MessageState `protogen:"open.v1"` + DictionaryValueId int64 `protobuf:"varint,1,opt,name=dictionary_value_id,json=dictionaryValueId,proto3" json:"dictionary_value_id,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ProductAttributes_Values) Reset() { + *x = ProductAttributes_Values{} + mi := &file_ozon_products_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ProductAttributes_Values) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProductAttributes_Values) ProtoMessage() {} + +func (x *ProductAttributes_Values) ProtoReflect() protoreflect.Message { + mi := &file_ozon_products_proto_msgTypes[26] + 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 ProductAttributes_Values.ProtoReflect.Descriptor instead. +func (*ProductAttributes_Values) Descriptor() ([]byte, []int) { + return file_ozon_products_proto_rawDescGZIP(), []int{12, 1} +} + +func (x *ProductAttributes_Values) GetDictionaryValueId() int64 { + if x != nil { + return x.DictionaryValueId + } + return 0 +} + +func (x *ProductAttributes_Values) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +type ProductAttributes_Attributes struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + ComplexId int64 `protobuf:"varint,2,opt,name=complex_id,json=complexId,proto3" json:"complex_id,omitempty"` + Values []*ProductAttributes_Values `protobuf:"bytes,3,rep,name=values,proto3" json:"values,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ProductAttributes_Attributes) Reset() { + *x = ProductAttributes_Attributes{} + mi := &file_ozon_products_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ProductAttributes_Attributes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProductAttributes_Attributes) ProtoMessage() {} + +func (x *ProductAttributes_Attributes) ProtoReflect() protoreflect.Message { + mi := &file_ozon_products_proto_msgTypes[27] + 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 ProductAttributes_Attributes.ProtoReflect.Descriptor instead. +func (*ProductAttributes_Attributes) Descriptor() ([]byte, []int) { + return file_ozon_products_proto_rawDescGZIP(), []int{12, 2} +} + +func (x *ProductAttributes_Attributes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ProductAttributes_Attributes) GetComplexId() int64 { + if x != nil { + return x.ComplexId + } + return 0 +} + +func (x *ProductAttributes_Attributes) GetValues() []*ProductAttributes_Values { + if x != nil { + return x.Values + } + return nil +} + var File_ozon_products_proto protoreflect.FileDescriptor const file_ozon_products_proto_rawDesc = "" + @@ -650,13 +1898,91 @@ const file_ozon_products_proto_rawDesc = "" + "\x16GetProductPriceRequest\x12%\n" + "\x0emarketplace_id\x18\x01 \x01(\x03R\rmarketplaceId\"]\n" + "\x17GetProductPriceResponse\x12B\n" + - "\x0eproduct_prices\x18\x01 \x03(\v2\x1b.ozon.products.ProductPriceR\rproductPrices\"\xb3\x03\n" + + "\x0eproduct_prices\x18\x01 \x03(\v2\x1b.ozon.products.ProductPriceR\rproductPrices\"c\n" + + "\x1bGetProductAttributesRequest\x12%\n" + + "\x0emarketplace_id\x18\x01 \x01(\x03R\rmarketplaceId\x12\x1d\n" + + "\n" + + "product_id\x18\x02 \x03(\x03R\tproductId\"V\n" + + "\x1cGetProductAttributesResponse\x126\n" + + "\x05items\x18\x01 \x03(\v2 .ozon.products.ProductAttributesR\x05items\"\xc1\x01\n" + + "\x15DeleteProductsRequest\x12%\n" + + "\x0emarketplace_id\x18\x01 \x01(\x03R\rmarketplaceId\x12?\n" + + "\x05items\x18\x02 \x03(\v2).ozon.products.DeleteProductsRequest.ItemR\x05items\x1a@\n" + + "\x04Item\x12\x1d\n" + + "\n" + + "product_id\x18\x01 \x01(\x03R\tproductId\x12\x19\n" + + "\boffer_id\x18\x02 \x01(\tR\aofferId\"\xe2\x01\n" + + "\x16DeleteProductsResponse\x12%\n" + + "\x0emarketplace_id\x18\x01 \x01(\x03R\rmarketplaceId\x12@\n" + + "\x05items\x18\x02 \x03(\v2*.ozon.products.DeleteProductsResponse.ItemR\x05items\x1a_\n" + + "\x04Item\x12\x1d\n" + + "\n" + + "product_id\x18\x01 \x01(\x03R\tproductId\x12\x19\n" + + "\boffer_id\x18\x02 \x01(\tR\aofferId\x12\x1d\n" + + "\n" + + "is_deleted\x18\x03 \x01(\bR\tisDeleted\"\xa6\v\n" + + "\x1dCreateOrUpdateProductsRequest\x12%\n" + + "\x0emarketplace_id\x18\x01 \x01(\x03R\rmarketplaceId\x12G\n" + + "\x05items\x18\x02 \x03(\v21.ozon.products.CreateOrUpdateProductsRequest.ItemR\x05items\x1a\x94\n" + + "\n" + + "\x04Item\x12\\\n" + + "\n" + + "attributes\x18\x01 \x03(\v2<.ozon.products.CreateOrUpdateProductsRequest.Item.AttributesR\n" + + "attributes\x12\x18\n" + + "\abarcode\x18\x02 \x01(\tR\abarcode\x126\n" + + "\x17description_category_id\x18\x03 \x01(\x03R\x15descriptionCategoryId\x12=\n" + + "\x1bnew_description_category_id\x18\x04 \x01(\x03R\x18newDescriptionCategoryId\x12\x1f\n" + + "\vcolor_image\x18\x05 \x01(\tR\n" + + "colorImage\x12#\n" + + "\rcurrency_code\x18\a \x01(\tR\fcurrencyCode\x12\x14\n" + + "\x05depth\x18\b \x01(\x03R\x05depth\x12%\n" + + "\x0edimension_unit\x18\t \x01(\tR\rdimensionUnit\x12\x16\n" + + "\x06height\x18\n" + + " \x01(\x03R\x06height\x12\x16\n" + + "\x06images\x18\v \x03(\tR\x06images\x12\x1c\n" + + "\timages360\x18\f \x03(\tR\timages360\x12\x12\n" + + "\x04name\x18\r \x01(\tR\x04name\x12\x19\n" + + "\boffer_id\x18\x0e \x01(\tR\aofferId\x12\x1b\n" + + "\told_price\x18\x0f \x01(\tR\boldPrice\x12X\n" + + "\bpdf_list\x18\x10 \x03(\v2=.ozon.products.CreateOrUpdateProductsRequest.Item.PdfListItemR\apdfList\x12\x14\n" + + "\x05price\x18\x11 \x01(\tR\x05price\x12#\n" + + "\rprimary_image\x18\x12 \x01(\tR\fprimaryImage\x12\\\n" + + "\n" + + "promotions\x18\x13 \x03(\v2<.ozon.products.CreateOrUpdateProductsRequest.Item.PromotionsR\n" + + "promotions\x12\x17\n" + + "\atype_id\x18\x14 \x01(\x03R\x06typeId\x12\x10\n" + + "\x03vat\x18\x15 \x01(\tR\x03vat\x12\x16\n" + + "\x06weight\x18\x16 \x01(\x03R\x06weight\x12\x1f\n" + + "\vweight_unit\x18\x17 \x01(\tR\n" + + "weightUnit\x12\x14\n" + + "\x05width\x18\x18 \x01(\x03R\x05width\x12!\n" + + "\fservice_type\x18\x19 \x01(\tR\vserviceType\x1aN\n" + + "\x06Values\x12.\n" + + "\x13dictionary_value_id\x18\x01 \x01(\x03R\x11dictionaryValueId\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value\x1a\x8d\x01\n" + + "\n" + + "Attributes\x12\x1d\n" + + "\n" + + "complex_id\x18\x01 \x01(\x03R\tcomplexId\x12\x0e\n" + + "\x02id\x18\x02 \x01(\x03R\x02id\x12P\n" + + "\x06values\x18\x03 \x03(\v28.ozon.products.CreateOrUpdateProductsRequest.Item.ValuesR\x06values\x1a>\n" + + "\n" + + "Promotions\x12\x1c\n" + + "\toperation\x18\x01 \x01(\tR\toperation\x12\x12\n" + + "\x04type\x18\x02 \x01(\tR\x04type\x1aP\n" + + "\vPdfListItem\x12\x14\n" + + "\x05index\x18\x01 \x01(\x03R\x05index\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x17\n" + + "\asrc_url\x18\x03 \x01(\tR\x06srcUrl\"9\n" + + "\x1eCreateOrUpdateProductsResponse\x12\x17\n" + + "\atask_id\x18\x01 \x03(\x03R\x06taskId\"\x86\x04\n" + "\aProduct\x12\x0e\n" + "\x02id\x18\x01 \x01(\x03R\x02id\x12\x19\n" + "\boffer_id\x18\x02 \x01(\tR\aofferId\x125\n" + "\x06stocks\x18\x03 \x01(\v2\x1d.ozon.products.Product.StocksR\x06stocks\x12\x1a\n" + "\bbarcodes\x18\x04 \x03(\tR\bbarcodes\x129\n" + - "\bstatuses\x18\x05 \x01(\v2\x1d.ozon.products.Product.StatusR\bstatuses\x1a)\n" + + "\bstatuses\x18\x05 \x01(\v2\x1d.ozon.products.Product.StatusR\bstatuses\x124\n" + + "\x06errors\x18\x06 \x03(\v2\x1c.ozon.products.Product.ErrorR\x06errors\x1a)\n" + "\x06Status\x12\x1f\n" + "\vstatus_name\x18\x01 \x01(\tR\n" + "statusName\x1a[\n" + @@ -667,13 +1993,15 @@ const file_ozon_products_proto_rawDesc = "" + "\apresent\x18\x01 \x01(\x03R\apresent\x12\x1a\n" + "\breserved\x18\x02 \x01(\x03R\breserved\x12\x10\n" + "\x03SKU\x18\x03 \x01(\x03R\x03SKU\x12\x16\n" + - "\x06source\x18\x04 \x01(\tR\x06source\"\x93\a\n" + + "\x06source\x18\x04 \x01(\tR\x06source\x1a\x1b\n" + + "\x05Error\x12\x12\n" + + "\x04code\x18\x01 \x01(\tR\x04code\"\x93\a\n" + "\fProductPrice\x12\x1c\n" + - "\tacquiring\x18\x01 \x01(\rR\tacquiring\x12I\n" + + "\tacquiring\x18\x01 \x01(\x03R\tacquiring\x12I\n" + "\vcommissions\x18\x02 \x01(\v2'.ozon.products.ProductPrice.CommissionsR\vcommissions\x12\x19\n" + "\boffer_id\x18\x04 \x01(\tR\aofferId\x12\x1d\n" + "\n" + - "product_id\x18\a \x01(\rR\tproductId\x1a\xdf\x05\n" + + "product_id\x18\a \x01(\x03R\tproductId\x1a\xdf\x05\n" + "\vCommissions\x12>\n" + "\x1cfbo_deliv_to_customer_amount\x18\x01 \x01(\x01R\x18fboDelivToCustomerAmount\x12E\n" + " fbo_direct_flow_trans_max_amount\x18\x02 \x01(\x01R\x1bfboDirectFlowTransMaxAmount\x12E\n" + @@ -687,10 +2015,50 @@ const file_ozon_products_proto_rawDesc = "" + "\x16fbs_return_flow_amount\x18\n" + " \x01(\x01R\x13fbsReturnFlowAmount\x12*\n" + "\x11sales_percent_fbo\x18\v \x01(\x01R\x0fsalesPercentFbo\x12*\n" + - "\x11sales_percent_fbs\x18\f \x01(\x01R\x0fsalesPercentFbs2\xdf\x01\n" + + "\x11sales_percent_fbs\x18\f \x01(\x01R\x0fsalesPercentFbs\"\xe5\x06\n" + + "\x11ProductAttributes\x12\x0e\n" + + "\x02id\x18\x01 \x01(\x03R\x02id\x12\x18\n" + + "\abarcode\x18\x02 \x01(\tR\abarcode\x12\x12\n" + + "\x04name\x18\x04 \x01(\tR\x04name\x12\x19\n" + + "\boffer_id\x18\x05 \x01(\tR\aofferId\x12\x17\n" + + "\atype_id\x18\x06 \x01(\x03R\x06typeId\x12\x16\n" + + "\x06height\x18\a \x01(\x03R\x06height\x12\x14\n" + + "\x05depth\x18\b \x01(\x03R\x05depth\x12\x14\n" + + "\x05width\x18\t \x01(\x03R\x05width\x12%\n" + + "\x0edimension_unit\x18\n" + + " \x01(\tR\rdimensionUnit\x12\x16\n" + + "\x06weight\x18\v \x01(\x03R\x06weight\x12\x1f\n" + + "\vweight_unit\x18\f \x01(\tR\n" + + "weightUnit\x12#\n" + + "\rprimary_image\x18\r \x01(\tR\fprimaryImage\x12J\n" + + "\n" + + "model_info\x18\x0f \x01(\v2+.ozon.products.ProductAttributes.Model_infoR\tmodelInfo\x12\x16\n" + + "\x06images\x18\x10 \x03(\tR\x06images\x12K\n" + + "\n" + + "attributes\x18\x12 \x03(\v2+.ozon.products.ProductAttributes.AttributesR\n" + + "attributes\x12\x1f\n" + + "\vcolor_image\x18\x15 \x01(\tR\n" + + "colorImage\x126\n" + + "\x17description_category_id\x18\x16 \x01(\x03R\x15descriptionCategoryId\x1a=\n" + + "\n" + + "Model_info\x12\x19\n" + + "\bmodel_id\x18\x01 \x01(\x03R\amodelId\x12\x14\n" + + "\x05count\x18\x02 \x01(\x03R\x05count\x1aN\n" + + "\x06Values\x12.\n" + + "\x13dictionary_value_id\x18\x01 \x01(\x03R\x11dictionaryValueId\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value\x1a|\n" + + "\n" + + "Attributes\x12\x0e\n" + + "\x02id\x18\x01 \x01(\x03R\x02id\x12\x1d\n" + + "\n" + + "complex_id\x18\x02 \x01(\x03R\tcomplexId\x12?\n" + + "\x06values\x18\x03 \x03(\v2'.ozon.products.ProductAttributes.ValuesR\x06values2\xa8\x04\n" + "\x0fProductsService\x12h\n" + "\x11GetListOfProducts\x12'.ozon.products.GetListOfProductsRequest\x1a(.ozon.products.GetListOfProductsResponse0\x01\x12b\n" + - "\x0fGetProductPrice\x12%.ozon.products.GetProductPriceRequest\x1a&.ozon.products.GetProductPriceResponse0\x01B\x11Z\x0f./ozon/productsb\x06proto3" + "\x0fGetProductPrice\x12%.ozon.products.GetProductPriceRequest\x1a&.ozon.products.GetProductPriceResponse0\x01\x12q\n" + + "\x14GetProductAttributes\x12*.ozon.products.GetProductAttributesRequest\x1a+.ozon.products.GetProductAttributesResponse0\x01\x12]\n" + + "\x0eDeleteProducts\x12$.ozon.products.DeleteProductsRequest\x1a%.ozon.products.DeleteProductsResponse\x12u\n" + + "\x16CreateOrUpdateProducts\x12,.ozon.products.CreateOrUpdateProductsRequest\x1a-.ozon.products.CreateOrUpdateProductsResponseB\x11Z\x0f./ozon/productsb\x06proto3" var ( file_ozon_products_proto_rawDescOnce sync.Once @@ -704,35 +2072,71 @@ func file_ozon_products_proto_rawDescGZIP() []byte { return file_ozon_products_proto_rawDescData } -var file_ozon_products_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_ozon_products_proto_msgTypes = make([]protoimpl.MessageInfo, 28) var file_ozon_products_proto_goTypes = []any{ - (*GetListOfProductsRequest)(nil), // 0: ozon.products.GetListOfProductsRequest - (*GetListOfProductsResponse)(nil), // 1: ozon.products.GetListOfProductsResponse - (*GetProductPriceRequest)(nil), // 2: ozon.products.GetProductPriceRequest - (*GetProductPriceResponse)(nil), // 3: ozon.products.GetProductPriceResponse - (*Product)(nil), // 4: ozon.products.Product - (*ProductPrice)(nil), // 5: ozon.products.ProductPrice - (*Product_Status)(nil), // 6: ozon.products.Product.Status - (*Product_Stocks)(nil), // 7: ozon.products.Product.Stocks - (*Product_Stock)(nil), // 8: ozon.products.Product.Stock - (*ProductPrice_Commissions)(nil), // 9: ozon.products.ProductPrice.Commissions + (*GetListOfProductsRequest)(nil), // 0: ozon.products.GetListOfProductsRequest + (*GetListOfProductsResponse)(nil), // 1: ozon.products.GetListOfProductsResponse + (*GetProductPriceRequest)(nil), // 2: ozon.products.GetProductPriceRequest + (*GetProductPriceResponse)(nil), // 3: ozon.products.GetProductPriceResponse + (*GetProductAttributesRequest)(nil), // 4: ozon.products.GetProductAttributesRequest + (*GetProductAttributesResponse)(nil), // 5: ozon.products.GetProductAttributesResponse + (*DeleteProductsRequest)(nil), // 6: ozon.products.DeleteProductsRequest + (*DeleteProductsResponse)(nil), // 7: ozon.products.DeleteProductsResponse + (*CreateOrUpdateProductsRequest)(nil), // 8: ozon.products.CreateOrUpdateProductsRequest + (*CreateOrUpdateProductsResponse)(nil), // 9: ozon.products.CreateOrUpdateProductsResponse + (*Product)(nil), // 10: ozon.products.Product + (*ProductPrice)(nil), // 11: ozon.products.ProductPrice + (*ProductAttributes)(nil), // 12: ozon.products.ProductAttributes + (*DeleteProductsRequest_Item)(nil), // 13: ozon.products.DeleteProductsRequest.Item + (*DeleteProductsResponse_Item)(nil), // 14: ozon.products.DeleteProductsResponse.Item + (*CreateOrUpdateProductsRequest_Item)(nil), // 15: ozon.products.CreateOrUpdateProductsRequest.Item + (*CreateOrUpdateProductsRequest_Item_Values)(nil), // 16: ozon.products.CreateOrUpdateProductsRequest.Item.Values + (*CreateOrUpdateProductsRequest_Item_Attributes)(nil), // 17: ozon.products.CreateOrUpdateProductsRequest.Item.Attributes + (*CreateOrUpdateProductsRequest_Item_Promotions)(nil), // 18: ozon.products.CreateOrUpdateProductsRequest.Item.Promotions + (*CreateOrUpdateProductsRequest_Item_PdfListItem)(nil), // 19: ozon.products.CreateOrUpdateProductsRequest.Item.PdfListItem + (*Product_Status)(nil), // 20: ozon.products.Product.Status + (*Product_Stocks)(nil), // 21: ozon.products.Product.Stocks + (*Product_Stock)(nil), // 22: ozon.products.Product.Stock + (*Product_Error)(nil), // 23: ozon.products.Product.Error + (*ProductPrice_Commissions)(nil), // 24: ozon.products.ProductPrice.Commissions + (*ProductAttributes_ModelInfo)(nil), // 25: ozon.products.ProductAttributes.Model_info + (*ProductAttributes_Values)(nil), // 26: ozon.products.ProductAttributes.Values + (*ProductAttributes_Attributes)(nil), // 27: ozon.products.ProductAttributes.Attributes } var file_ozon_products_proto_depIdxs = []int32{ - 4, // 0: ozon.products.GetListOfProductsResponse.products:type_name -> ozon.products.Product - 5, // 1: ozon.products.GetProductPriceResponse.product_prices:type_name -> ozon.products.ProductPrice - 7, // 2: ozon.products.Product.stocks:type_name -> ozon.products.Product.Stocks - 6, // 3: ozon.products.Product.statuses:type_name -> ozon.products.Product.Status - 9, // 4: ozon.products.ProductPrice.commissions:type_name -> ozon.products.ProductPrice.Commissions - 8, // 5: ozon.products.Product.Stocks.stocks:type_name -> ozon.products.Product.Stock - 0, // 6: ozon.products.ProductsService.GetListOfProducts:input_type -> ozon.products.GetListOfProductsRequest - 2, // 7: ozon.products.ProductsService.GetProductPrice:input_type -> ozon.products.GetProductPriceRequest - 1, // 8: ozon.products.ProductsService.GetListOfProducts:output_type -> ozon.products.GetListOfProductsResponse - 3, // 9: ozon.products.ProductsService.GetProductPrice:output_type -> ozon.products.GetProductPriceResponse - 8, // [8:10] is the sub-list for method output_type - 6, // [6:8] is the sub-list for method input_type - 6, // [6:6] is the sub-list for extension type_name - 6, // [6:6] is the sub-list for extension extendee - 0, // [0:6] is the sub-list for field type_name + 10, // 0: ozon.products.GetListOfProductsResponse.products:type_name -> ozon.products.Product + 11, // 1: ozon.products.GetProductPriceResponse.product_prices:type_name -> ozon.products.ProductPrice + 12, // 2: ozon.products.GetProductAttributesResponse.items:type_name -> ozon.products.ProductAttributes + 13, // 3: ozon.products.DeleteProductsRequest.items:type_name -> ozon.products.DeleteProductsRequest.Item + 14, // 4: ozon.products.DeleteProductsResponse.items:type_name -> ozon.products.DeleteProductsResponse.Item + 15, // 5: ozon.products.CreateOrUpdateProductsRequest.items:type_name -> ozon.products.CreateOrUpdateProductsRequest.Item + 21, // 6: ozon.products.Product.stocks:type_name -> ozon.products.Product.Stocks + 20, // 7: ozon.products.Product.statuses:type_name -> ozon.products.Product.Status + 23, // 8: ozon.products.Product.errors:type_name -> ozon.products.Product.Error + 24, // 9: ozon.products.ProductPrice.commissions:type_name -> ozon.products.ProductPrice.Commissions + 25, // 10: ozon.products.ProductAttributes.model_info:type_name -> ozon.products.ProductAttributes.Model_info + 27, // 11: ozon.products.ProductAttributes.attributes:type_name -> ozon.products.ProductAttributes.Attributes + 17, // 12: ozon.products.CreateOrUpdateProductsRequest.Item.attributes:type_name -> ozon.products.CreateOrUpdateProductsRequest.Item.Attributes + 19, // 13: ozon.products.CreateOrUpdateProductsRequest.Item.pdf_list:type_name -> ozon.products.CreateOrUpdateProductsRequest.Item.PdfListItem + 18, // 14: ozon.products.CreateOrUpdateProductsRequest.Item.promotions:type_name -> ozon.products.CreateOrUpdateProductsRequest.Item.Promotions + 16, // 15: ozon.products.CreateOrUpdateProductsRequest.Item.Attributes.values:type_name -> ozon.products.CreateOrUpdateProductsRequest.Item.Values + 22, // 16: ozon.products.Product.Stocks.stocks:type_name -> ozon.products.Product.Stock + 26, // 17: ozon.products.ProductAttributes.Attributes.values:type_name -> ozon.products.ProductAttributes.Values + 0, // 18: ozon.products.ProductsService.GetListOfProducts:input_type -> ozon.products.GetListOfProductsRequest + 2, // 19: ozon.products.ProductsService.GetProductPrice:input_type -> ozon.products.GetProductPriceRequest + 4, // 20: ozon.products.ProductsService.GetProductAttributes:input_type -> ozon.products.GetProductAttributesRequest + 6, // 21: ozon.products.ProductsService.DeleteProducts:input_type -> ozon.products.DeleteProductsRequest + 8, // 22: ozon.products.ProductsService.CreateOrUpdateProducts:input_type -> ozon.products.CreateOrUpdateProductsRequest + 1, // 23: ozon.products.ProductsService.GetListOfProducts:output_type -> ozon.products.GetListOfProductsResponse + 3, // 24: ozon.products.ProductsService.GetProductPrice:output_type -> ozon.products.GetProductPriceResponse + 5, // 25: ozon.products.ProductsService.GetProductAttributes:output_type -> ozon.products.GetProductAttributesResponse + 7, // 26: ozon.products.ProductsService.DeleteProducts:output_type -> ozon.products.DeleteProductsResponse + 9, // 27: ozon.products.ProductsService.CreateOrUpdateProducts:output_type -> ozon.products.CreateOrUpdateProductsResponse + 23, // [23:28] is the sub-list for method output_type + 18, // [18:23] is the sub-list for method input_type + 18, // [18:18] is the sub-list for extension type_name + 18, // [18:18] is the sub-list for extension extendee + 0, // [0:18] is the sub-list for field type_name } func init() { file_ozon_products_proto_init() } @@ -746,7 +2150,7 @@ func file_ozon_products_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_ozon_products_proto_rawDesc), len(file_ozon_products_proto_rawDesc)), NumEnums: 0, - NumMessages: 10, + NumMessages: 28, NumExtensions: 0, NumServices: 1, }, diff --git a/api/generated/v1/ozon/products/products_grpc.pb.go b/api/generated/v1/ozon/products/products_grpc.pb.go index b64db43..586f50e 100644 --- a/api/generated/v1/ozon/products/products_grpc.pb.go +++ b/api/generated/v1/ozon/products/products_grpc.pb.go @@ -19,8 +19,11 @@ import ( const _ = grpc.SupportPackageIsVersion9 const ( - ProductsService_GetListOfProducts_FullMethodName = "/ozon.products.ProductsService/GetListOfProducts" - ProductsService_GetProductPrice_FullMethodName = "/ozon.products.ProductsService/GetProductPrice" + ProductsService_GetListOfProducts_FullMethodName = "/ozon.products.ProductsService/GetListOfProducts" + ProductsService_GetProductPrice_FullMethodName = "/ozon.products.ProductsService/GetProductPrice" + ProductsService_GetProductAttributes_FullMethodName = "/ozon.products.ProductsService/GetProductAttributes" + ProductsService_DeleteProducts_FullMethodName = "/ozon.products.ProductsService/DeleteProducts" + ProductsService_CreateOrUpdateProducts_FullMethodName = "/ozon.products.ProductsService/CreateOrUpdateProducts" ) // ProductsServiceClient is the client API for ProductsService service. @@ -30,6 +33,9 @@ type ProductsServiceClient interface { // Retrieves a list of products based on the provided request. GetListOfProducts(ctx context.Context, in *GetListOfProductsRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[GetListOfProductsResponse], error) GetProductPrice(ctx context.Context, in *GetProductPriceRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[GetProductPriceResponse], error) + GetProductAttributes(ctx context.Context, in *GetProductAttributesRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[GetProductAttributesResponse], error) + DeleteProducts(ctx context.Context, in *DeleteProductsRequest, opts ...grpc.CallOption) (*DeleteProductsResponse, error) + CreateOrUpdateProducts(ctx context.Context, in *CreateOrUpdateProductsRequest, opts ...grpc.CallOption) (*CreateOrUpdateProductsResponse, error) } type productsServiceClient struct { @@ -78,6 +84,45 @@ func (c *productsServiceClient) GetProductPrice(ctx context.Context, in *GetProd // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. type ProductsService_GetProductPriceClient = grpc.ServerStreamingClient[GetProductPriceResponse] +func (c *productsServiceClient) GetProductAttributes(ctx context.Context, in *GetProductAttributesRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[GetProductAttributesResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &ProductsService_ServiceDesc.Streams[2], ProductsService_GetProductAttributes_FullMethodName, cOpts...) + if err != nil { + return nil, err + } + x := &grpc.GenericClientStream[GetProductAttributesRequest, GetProductAttributesResponse]{ClientStream: stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type ProductsService_GetProductAttributesClient = grpc.ServerStreamingClient[GetProductAttributesResponse] + +func (c *productsServiceClient) DeleteProducts(ctx context.Context, in *DeleteProductsRequest, opts ...grpc.CallOption) (*DeleteProductsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(DeleteProductsResponse) + err := c.cc.Invoke(ctx, ProductsService_DeleteProducts_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *productsServiceClient) CreateOrUpdateProducts(ctx context.Context, in *CreateOrUpdateProductsRequest, opts ...grpc.CallOption) (*CreateOrUpdateProductsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CreateOrUpdateProductsResponse) + err := c.cc.Invoke(ctx, ProductsService_CreateOrUpdateProducts_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + // ProductsServiceServer is the server API for ProductsService service. // All implementations must embed UnimplementedProductsServiceServer // for forward compatibility. @@ -85,6 +130,9 @@ type ProductsServiceServer interface { // Retrieves a list of products based on the provided request. GetListOfProducts(*GetListOfProductsRequest, grpc.ServerStreamingServer[GetListOfProductsResponse]) error GetProductPrice(*GetProductPriceRequest, grpc.ServerStreamingServer[GetProductPriceResponse]) error + GetProductAttributes(*GetProductAttributesRequest, grpc.ServerStreamingServer[GetProductAttributesResponse]) error + DeleteProducts(context.Context, *DeleteProductsRequest) (*DeleteProductsResponse, error) + CreateOrUpdateProducts(context.Context, *CreateOrUpdateProductsRequest) (*CreateOrUpdateProductsResponse, error) mustEmbedUnimplementedProductsServiceServer() } @@ -101,6 +149,15 @@ func (UnimplementedProductsServiceServer) GetListOfProducts(*GetListOfProductsRe func (UnimplementedProductsServiceServer) GetProductPrice(*GetProductPriceRequest, grpc.ServerStreamingServer[GetProductPriceResponse]) error { return status.Errorf(codes.Unimplemented, "method GetProductPrice not implemented") } +func (UnimplementedProductsServiceServer) GetProductAttributes(*GetProductAttributesRequest, grpc.ServerStreamingServer[GetProductAttributesResponse]) error { + return status.Errorf(codes.Unimplemented, "method GetProductAttributes not implemented") +} +func (UnimplementedProductsServiceServer) DeleteProducts(context.Context, *DeleteProductsRequest) (*DeleteProductsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteProducts not implemented") +} +func (UnimplementedProductsServiceServer) CreateOrUpdateProducts(context.Context, *CreateOrUpdateProductsRequest) (*CreateOrUpdateProductsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateOrUpdateProducts not implemented") +} func (UnimplementedProductsServiceServer) mustEmbedUnimplementedProductsServiceServer() {} func (UnimplementedProductsServiceServer) testEmbeddedByValue() {} @@ -144,13 +201,69 @@ func _ProductsService_GetProductPrice_Handler(srv interface{}, stream grpc.Serve // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. type ProductsService_GetProductPriceServer = grpc.ServerStreamingServer[GetProductPriceResponse] +func _ProductsService_GetProductAttributes_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(GetProductAttributesRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(ProductsServiceServer).GetProductAttributes(m, &grpc.GenericServerStream[GetProductAttributesRequest, GetProductAttributesResponse]{ServerStream: stream}) +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type ProductsService_GetProductAttributesServer = grpc.ServerStreamingServer[GetProductAttributesResponse] + +func _ProductsService_DeleteProducts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteProductsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ProductsServiceServer).DeleteProducts(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ProductsService_DeleteProducts_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ProductsServiceServer).DeleteProducts(ctx, req.(*DeleteProductsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ProductsService_CreateOrUpdateProducts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateOrUpdateProductsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ProductsServiceServer).CreateOrUpdateProducts(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ProductsService_CreateOrUpdateProducts_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ProductsServiceServer).CreateOrUpdateProducts(ctx, req.(*CreateOrUpdateProductsRequest)) + } + return interceptor(ctx, in, info, handler) +} + // ProductsService_ServiceDesc is the grpc.ServiceDesc for ProductsService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var ProductsService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "ozon.products.ProductsService", HandlerType: (*ProductsServiceServer)(nil), - Methods: []grpc.MethodDesc{}, + Methods: []grpc.MethodDesc{ + { + MethodName: "DeleteProducts", + Handler: _ProductsService_DeleteProducts_Handler, + }, + { + MethodName: "CreateOrUpdateProducts", + Handler: _ProductsService_CreateOrUpdateProducts_Handler, + }, + }, Streams: []grpc.StreamDesc{ { StreamName: "GetListOfProducts", @@ -162,6 +275,11 @@ var ProductsService_ServiceDesc = grpc.ServiceDesc{ Handler: _ProductsService_GetProductPrice_Handler, ServerStreams: true, }, + { + StreamName: "GetProductAttributes", + Handler: _ProductsService_GetProductAttributes_Handler, + ServerStreams: true, + }, }, Metadata: "ozon/products.proto", } diff --git a/api/proto/v1 b/api/proto/v1 index 84924dc..7fe9788 160000 --- a/api/proto/v1 +++ b/api/proto/v1 @@ -1 +1 @@ -Subproject commit 84924dc33f2aae71c77b0081eb25d723cfb55a9f +Subproject commit 7fe978865bfb896bfd0f5cb2b0f12187e05a4efa diff --git a/go.mod b/go.mod index c3ff4a8..75de53f 100755 --- a/go.mod +++ b/go.mod @@ -3,24 +3,24 @@ module sipro-mps go 1.24 require ( - git.denco.store/fakz9/ozon-api-client v1.18.1-0.20250526003754-c6c303092505 + git.denco.store/fakz9/ozon-api-client v1.18.1-0.20250723023800-89aeba12d443 github.com/go-faster/errors v0.7.1 github.com/go-faster/jx v1.1.0 - github.com/golang-jwt/jwt/v5 v5.2.2 + github.com/golang-jwt/jwt/v5 v5.2.3 github.com/google/uuid v1.6.0 github.com/hibiken/asynq v0.25.1 github.com/jackc/pgx/v5 v5.7.5 github.com/joho/godotenv v1.5.1 github.com/lib/pq v1.10.9 github.com/ogen-go/ogen v1.14.0 - github.com/redis/rueidis v1.0.60 - github.com/samber/lo v1.50.0 + github.com/redis/rueidis v1.0.63 + github.com/samber/lo v1.51.0 github.com/tidwall/gjson v1.18.0 - go.opentelemetry.io/otel v1.36.0 - go.opentelemetry.io/otel/metric v1.36.0 - go.opentelemetry.io/otel/trace v1.36.0 - google.golang.org/grpc v1.72.2 - google.golang.org/protobuf v1.36.5 + go.opentelemetry.io/otel v1.37.0 + go.opentelemetry.io/otel/metric v1.37.0 + go.opentelemetry.io/otel/trace v1.37.0 + google.golang.org/grpc v1.74.2 + google.golang.org/protobuf v1.36.6 ) require ( @@ -31,32 +31,32 @@ require ( github.com/fatih/color v1.18.0 // indirect github.com/ghodss/yaml v1.0.0 // indirect github.com/go-faster/yaml v0.4.6 // indirect - github.com/go-logr/logr v1.4.2 // indirect + github.com/go-logr/logr v1.4.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/jackc/pgpassfile v1.0.0 // indirect github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect github.com/jackc/puddle/v2 v2.2.2 // indirect github.com/jmattheis/goverter v1.9.0 // indirect - github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-colorable v0.1.14 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/redis/go-redis/v9 v9.7.0 // indirect + github.com/redis/go-redis/v9 v9.11.0 // indirect github.com/robfig/cron/v3 v3.0.1 // indirect github.com/segmentio/asm v1.2.0 // indirect - github.com/spf13/cast v1.7.0 // indirect + github.com/spf13/cast v1.9.2 // indirect github.com/tidwall/match v1.1.1 // indirect github.com/tidwall/pretty v1.2.1 // indirect go.opentelemetry.io/auto/sdk v1.1.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/crypto v0.38.0 // indirect - golang.org/x/exp v0.0.0-20230725093048-515e97ebf090 // indirect - golang.org/x/mod v0.24.0 // indirect - golang.org/x/net v0.40.0 // indirect - golang.org/x/sync v0.14.0 // indirect - golang.org/x/sys v0.33.0 // indirect - golang.org/x/text v0.25.0 // indirect - golang.org/x/time v0.8.0 // indirect - golang.org/x/tools v0.33.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20250218202821-56aae31c358a // indirect + golang.org/x/crypto v0.40.0 // indirect + golang.org/x/exp v0.0.0-20250718183923-645b1fa84792 // indirect + golang.org/x/mod v0.26.0 // indirect + golang.org/x/net v0.42.0 // indirect + golang.org/x/sync v0.16.0 // indirect + golang.org/x/sys v0.34.0 // indirect + golang.org/x/text v0.27.0 // indirect + golang.org/x/time v0.12.0 // indirect + golang.org/x/tools v0.35.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250721164621-a45f3dfb1074 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect ) diff --git a/go.sum b/go.sum index 27b2aeb..324a484 100755 --- a/go.sum +++ b/go.sum @@ -1,5 +1,11 @@ git.denco.store/fakz9/ozon-api-client v1.18.1-0.20250526003754-c6c303092505 h1:5mviYMLXLIvsFEXLR0IlGuqMNzkB8X/yrmxZHYk0n84= git.denco.store/fakz9/ozon-api-client v1.18.1-0.20250526003754-c6c303092505/go.mod h1:1uPm278HN7mDkP507KHsLpnW+R9vWGEzp9BSMycjVbQ= +git.denco.store/fakz9/ozon-api-client v1.18.1-0.20250723012308-3e6c8fbc0564 h1:HcuTzIudt97E6OnydVqqp7pOCMACOhWrtFmIVhtM7xU= +git.denco.store/fakz9/ozon-api-client v1.18.1-0.20250723012308-3e6c8fbc0564/go.mod h1:1uPm278HN7mDkP507KHsLpnW+R9vWGEzp9BSMycjVbQ= +git.denco.store/fakz9/ozon-api-client v1.18.1-0.20250723013247-1e2c591a70e9 h1:iYj23C0/ju0awoWA+MqunFa+YIYQkOSK9jUF8Eqpbks= +git.denco.store/fakz9/ozon-api-client v1.18.1-0.20250723013247-1e2c591a70e9/go.mod h1:1uPm278HN7mDkP507KHsLpnW+R9vWGEzp9BSMycjVbQ= +git.denco.store/fakz9/ozon-api-client v1.18.1-0.20250723023800-89aeba12d443 h1:EOwa2tU1GloC079TdXZq/+fRrXRvkdPnH8vWxgcxxYg= +git.denco.store/fakz9/ozon-api-client v1.18.1-0.20250723023800-89aeba12d443/go.mod h1:1uPm278HN7mDkP507KHsLpnW+R9vWGEzp9BSMycjVbQ= github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs= github.com/bsm/ginkgo/v2 v2.12.0/go.mod h1:SwYbGRRDovPVboqFv0tPTcG1sN61LM1Z4ARdbAV9g4c= github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA= @@ -30,10 +36,14 @@ github.com/go-faster/yaml v0.4.6/go.mod h1:390dRIvV4zbnO7qC9FGo6YYutc+wyyUSHBgbX github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= +github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/golang-jwt/jwt/v5 v5.2.2 h1:Rl4B7itRWVtYIHFrSNd7vhTiz9UpLdi6gZhZ3wEeDy8= github.com/golang-jwt/jwt/v5 v5.2.2/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= +github.com/golang-jwt/jwt/v5 v5.2.3 h1:kkGXqQOBSDDWRhWNXTFpqGSCMyh/PLnqUvMGJPDJDs0= +github.com/golang-jwt/jwt/v5 v5.2.3/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= @@ -62,6 +72,8 @@ github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE= +github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= @@ -73,18 +85,26 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/redis/go-redis/v9 v9.7.0 h1:HhLSs+B6O021gwzl+locl0zEDnyNkxMtf/Z3NNBMa9E= github.com/redis/go-redis/v9 v9.7.0/go.mod h1:f6zhXITC7JUJIlPEiBOTXxJgPLdZcA93GewI7inzyWw= +github.com/redis/go-redis/v9 v9.11.0 h1:E3S08Gl/nJNn5vkxd2i78wZxWAPNZgUNTp8WIJUAiIs= +github.com/redis/go-redis/v9 v9.11.0/go.mod h1:huWgSWd8mW6+m0VPhJjSSQ+d6Nh1VICQ6Q5lHuCH/Iw= github.com/redis/rueidis v1.0.60 h1:MGZX8uNdw7iyWz22JhjA/9iXzddfCUE/EMK4VxKoKpA= github.com/redis/rueidis v1.0.60/go.mod h1:Lkhr2QTgcoYBhxARU7kJRO8SyVlgUuEkcJO1Y8MCluA= +github.com/redis/rueidis v1.0.63 h1:zSt5focn0YgrgBAE5NcnAibyKf3ZKyv+eCQHk62jEFk= +github.com/redis/rueidis v1.0.63/go.mod h1:Lkhr2QTgcoYBhxARU7kJRO8SyVlgUuEkcJO1Y8MCluA= github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/samber/lo v1.50.0 h1:XrG0xOeHs+4FQ8gJR97zDz5uOFMW7OwFWiFVzqopKgY= github.com/samber/lo v1.50.0/go.mod h1:RjZyNk6WSnUFRKK6EyOhsRJMqft3G+pg7dCWHQCWvsc= +github.com/samber/lo v1.51.0 h1:kysRYLbHy/MB7kQZf5DSN50JHmMsNEdeY24VzJFu7wI= +github.com/samber/lo v1.51.0/go.mod h1:4+MXEGsJzbKGaUEQFKBq2xtfuznW9oz/WrgyzMzRoM0= github.com/segmentio/asm v1.2.0 h1:9BQrFxC+YOHJlTlHGkTrFWf59nbL3XnCoFLTwDCI7ys= github.com/segmentio/asm v1.2.0/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs= github.com/spf13/cast v1.7.0 h1:ntdiHjuueXFgm5nzDRdOS4yfT43P5Fnud6DH50rz/7w= github.com/spf13/cast v1.7.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= +github.com/spf13/cast v1.9.2 h1:SsGfm7M8QOFtEzumm7UZrZdLLquNdzFYfIbEXntcFbE= +github.com/spf13/cast v1.9.2/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= @@ -101,14 +121,20 @@ go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJyS go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= go.opentelemetry.io/otel v1.36.0 h1:UumtzIklRBY6cI/lllNZlALOF5nNIzJVb16APdvgTXg= go.opentelemetry.io/otel v1.36.0/go.mod h1:/TcFMXYjyRNh8khOAO9ybYkqaDBb/70aVwkNML4pP8E= +go.opentelemetry.io/otel v1.37.0 h1:9zhNfelUvx0KBfu/gb+ZgeAfAgtWrfHJZcAqFC228wQ= +go.opentelemetry.io/otel v1.37.0/go.mod h1:ehE/umFRLnuLa/vSccNq9oS1ErUlkkK71gMcN34UG8I= go.opentelemetry.io/otel/metric v1.36.0 h1:MoWPKVhQvJ+eeXWHFBOPoBOi20jh6Iq2CcCREuTYufE= go.opentelemetry.io/otel/metric v1.36.0/go.mod h1:zC7Ks+yeyJt4xig9DEw9kuUFe5C3zLbVjV2PzT6qzbs= +go.opentelemetry.io/otel/metric v1.37.0 h1:mvwbQS5m0tbmqML4NqK+e3aDiO02vsf/WgbsdpcPoZE= +go.opentelemetry.io/otel/metric v1.37.0/go.mod h1:04wGrZurHYKOc+RKeye86GwKiTb9FKm1WHtO+4EVr2E= go.opentelemetry.io/otel/sdk v1.36.0 h1:b6SYIuLRs88ztox4EyrvRti80uXIFy+Sqzoh9kFULbs= go.opentelemetry.io/otel/sdk v1.36.0/go.mod h1:+lC+mTgD+MUWfjJubi2vvXWcVxyr9rmlshZni72pXeY= go.opentelemetry.io/otel/sdk/metric v1.36.0 h1:r0ntwwGosWGaa0CrSt8cuNuTcccMXERFwHX4dThiPis= go.opentelemetry.io/otel/sdk/metric v1.36.0/go.mod h1:qTNOhFDfKRwX0yXOqJYegL5WRaW376QbB7P4Pb0qva4= go.opentelemetry.io/otel/trace v1.36.0 h1:ahxWNuqZjpdiFAyrIoQ4GIiAIhxAunQR6MUoKrsNd4w= go.opentelemetry.io/otel/trace v1.36.0/go.mod h1:gQ+OnDZzrybY4k4seLzPAWNwVBBVlF2szhehOBB/tGA= +go.opentelemetry.io/otel/trace v1.37.0 h1:HLdcFNbRQBE2imdSEgm/kwqmQj1Or1l/7bW6mxVK7z4= +go.opentelemetry.io/otel/trace v1.37.0/go.mod h1:TlgrlQ+PtQO5XFerSPUYG0JSgGyryXewPGyayAWSBS0= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= @@ -117,30 +143,50 @@ go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/crypto v0.38.0 h1:jt+WWG8IZlBnVbomuhg2Mdq0+BBQaHbtqHEFEigjUV8= golang.org/x/crypto v0.38.0/go.mod h1:MvrbAqul58NNYPKnOra203SB9vpuZW0e+RRZV+Ggqjw= +golang.org/x/crypto v0.40.0 h1:r4x+VvoG5Fm+eJcxMaY8CQM7Lb0l1lsmjGBQ6s8BfKM= +golang.org/x/crypto v0.40.0/go.mod h1:Qr1vMER5WyS2dfPHAlsOj01wgLbsyWtFn/aY+5+ZdxY= golang.org/x/exp v0.0.0-20230725093048-515e97ebf090 h1:Di6/M8l0O2lCLc6VVRWhgCiApHV8MnQurBnFSHsQtNY= golang.org/x/exp v0.0.0-20230725093048-515e97ebf090/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= -golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU= -golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= +golang.org/x/exp v0.0.0-20250718183923-645b1fa84792 h1:R9PFI6EUdfVKgwKjZef7QIwGcBKu86OEFpJ9nUEP2l4= +golang.org/x/exp v0.0.0-20250718183923-645b1fa84792/go.mod h1:A+z0yzpGtvnG90cToK5n2tu8UJVP2XUATh+r+sfOOOc= +golang.org/x/mod v0.26.0 h1:EGMPT//Ezu+ylkCijjPc+f4Aih7sZvaAr+O3EHBxvZg= +golang.org/x/mod v0.26.0/go.mod h1:/j6NAhSk8iQ723BGAUyoAcn7SlD7s15Dp9Nd/SfeaFQ= golang.org/x/net v0.40.0 h1:79Xs7wF06Gbdcg4kdCCIQArK11Z1hr5POQ6+fIYHNuY= golang.org/x/net v0.40.0/go.mod h1:y0hY0exeL2Pku80/zKK7tpntoX23cqL3Oa6njdgRtds= +golang.org/x/net v0.42.0 h1:jzkYrhi3YQWD6MLBJcsklgQsoAcw89EcZbJw8Z614hs= +golang.org/x/net v0.42.0/go.mod h1:FF1RA5d3u7nAYA4z2TkclSCKh68eSXtiFwcWQpPXdt8= golang.org/x/sync v0.14.0 h1:woo0S4Yywslg6hp4eUFjTVOyKt0RookbpAHG4c1HmhQ= golang.org/x/sync v0.14.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= +golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw= +golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw= golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/sys v0.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA= +golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/text v0.25.0 h1:qVyWApTSYLk/drJRO5mDlNYskwQznZmkpV2c8q9zls4= golang.org/x/text v0.25.0/go.mod h1:WEdwpYrmk1qmdHvhkSTNPm3app7v4rsT8F2UD6+VHIA= +golang.org/x/text v0.27.0 h1:4fGWRpyh641NLlecmyl4LOe6yDdfaYNrGb2zdfo4JV4= +golang.org/x/text v0.27.0/go.mod h1:1D28KMCvyooCX9hBiosv5Tz/+YLxj0j7XhWjpSUF7CU= golang.org/x/time v0.8.0 h1:9i3RxcPv3PZnitoVGMPDKZSq1xW1gK1Xy3ArNOGZfEg= golang.org/x/time v0.8.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= -golang.org/x/tools v0.33.0 h1:4qz2S3zmRxbGIhDIAgjxvFutSvH5EfnsYrRBj0UI0bc= -golang.org/x/tools v0.33.0/go.mod h1:CIJMaWEY88juyUfo7UbgPqbC8rU2OqfAV1h2Qp0oMYI= +golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE= +golang.org/x/time v0.12.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg= +golang.org/x/tools v0.35.0 h1:mBffYraMEf7aa0sB+NuKnuCy8qI/9Bughn8dC2Gu5r0= +golang.org/x/tools v0.35.0/go.mod h1:NKdj5HkL/73byiZSJjqJgKn3ep7KjFkBOkR/Hps3VPw= google.golang.org/genproto/googleapis/rpc v0.0.0-20250218202821-56aae31c358a h1:51aaUVRocpvUOSQKM6Q7VuoaktNIaMCLuhZB6DKksq4= google.golang.org/genproto/googleapis/rpc v0.0.0-20250218202821-56aae31c358a/go.mod h1:uRxBH1mhmO8PGhU89cMcHaXKZqO+OfakD8QQO0oYwlQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250721164621-a45f3dfb1074 h1:qJW29YvkiJmXOYMu5Tf8lyrTp3dOS+K4z6IixtLaCf8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250721164621-a45f3dfb1074/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A= google.golang.org/grpc v1.72.2 h1:TdbGzwb82ty4OusHWepvFWGLgIbNo1/SUynEN0ssqv8= google.golang.org/grpc v1.72.2/go.mod h1:wH5Aktxcg25y1I3w7H69nHfXdOG3UiadoBtjh3izSDM= +google.golang.org/grpc v1.74.2 h1:WoosgB65DlWVC9FqI82dGsZhWFNBSLjQ84bjROOpMu4= +google.golang.org/grpc v1.74.2/go.mod h1:CtQ+BGjaAIXHs/5YS3i473GqwBBa1zGQNevxdeBEXrM= google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM= google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= +google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY= +google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= diff --git a/internal/ozon/products/adapter_grpc.go b/internal/ozon/products/adapter_grpc.go index 9845887..b93861b 100644 --- a/internal/ozon/products/adapter_grpc.go +++ b/internal/ozon/products/adapter_grpc.go @@ -1,6 +1,7 @@ package products import ( + "context" "fmt" "github.com/samber/lo" "google.golang.org/grpc" @@ -59,3 +60,53 @@ func (g *AdapterGRPC) GetListOfProducts(req *pb.GetListOfProductsRequest, stream } } } + +func (g *AdapterGRPC) GetProductAttributes(req *pb.GetProductAttributesRequest, stream pb.ProductsService_GetProductAttributesServer) error { + ctx := stream.Context() + + resultChan := make(chan []pb.ProductAttributes, 10) + errChan := make(chan error) + productIds := lo.Map(req.ProductId, func(item int64, index int) int { + return int(item) + }) + go g.repo.StreamProductAttributesCache(ctx, int(req.MarketplaceId), productIds, resultChan, errChan) + + for { + select { + case <-ctx.Done(): + return ctx.Err() + case attrs, ok := <-resultChan: + if !ok { + return nil + } + items := lo.Map(attrs, func(item pb.ProductAttributes, index int) *pb.ProductAttributes { + return &item + }) + resp := pb.GetProductAttributesResponse{Items: items} + if err := stream.Send(&resp); err != nil { + return err + } + case err, ok := <-errChan: + if !ok { + return nil + } + return err + } + } +} + +func (g *AdapterGRPC) DeleteProducts(ctx context.Context, req *pb.DeleteProductsRequest) (*pb.DeleteProductsResponse, error) { + responseItems, err := g.repo.DeleteProducts(ctx, int(req.MarketplaceId), req.Items) + if err != nil { + return nil, err + } + return &pb.DeleteProductsResponse{ + MarketplaceId: req.MarketplaceId, + Items: responseItems, + }, + nil +} + +func (g *AdapterGRPC) CreateOrUpdateProducts(ctx context.Context, req *pb.CreateOrUpdateProductsRequest) (*pb.CreateOrUpdateProductsResponse, error) { + return g.repo.CreateOrUpdateProducts(ctx, int(req.MarketplaceId), req.Items) +} diff --git a/internal/ozon/products/entities.go b/internal/ozon/products/entities.go index 5568640..62e0958 100644 --- a/internal/ozon/products/entities.go +++ b/internal/ozon/products/entities.go @@ -7,3 +7,8 @@ import ( type OzonProduct = ozon.ProductDetails type PbProduct = pb.Product +type PbProductAttributes = pb.ProductAttributes +type PbDeleteProductRequestItem = pb.DeleteProductsRequest_Item +type PbDeleteProductResponseItem = pb.DeleteProductsResponse_Item +type PbCreateOrUpdateItem = pb.CreateOrUpdateProductsRequest_Item +type PbCreateOrUpdateProductsResponse = pb.CreateOrUpdateProductsResponse diff --git a/internal/ozon/products/mapping/converter.go b/internal/ozon/products/mapping/converter.go index 32e5a5d..8567560 100644 --- a/internal/ozon/products/mapping/converter.go +++ b/internal/ozon/products/mapping/converter.go @@ -8,13 +8,21 @@ import ( //go:generate go run github.com/jmattheis/goverter/cmd/goverter gen -global "ignoreUnexported yes" . // goverter:converter -// goverter:extend Int632ToInt64 +// goverter:extend Int32ToInt64 Int64ToInt32 +// goverter:matchIgnoreCase yes +// goverter:useZeroValueOnPointerInconsistency yes type Converter interface { // goverter:ignore state sizeCache unknownFields ToProto(details *internal.ProductDetails) *proto.Product + AttributesToProto(attrs *internal.GetDescriptionOfProductsResult) *proto.ProductAttributes + // goverter:ignore ComplexAttributes GeoNames + ProtoToUpdateItem(update *proto.CreateOrUpdateProductsRequest_Item) *internal.CreateOrUpdateProductItem } -func Int632ToInt64(i int32) int64 { +func Int32ToInt64(i int32) int64 { return int64(i) } +func Int64ToInt32(i int64) int32 { + return int32(i) +} diff --git a/internal/ozon/products/mapping/generated/generated.go b/internal/ozon/products/mapping/generated/generated.go index 53e4681..cdc53fe 100644 --- a/internal/ozon/products/mapping/generated/generated.go +++ b/internal/ozon/products/mapping/generated/generated.go @@ -11,6 +11,92 @@ import ( type ConverterImpl struct{} +func (c *ConverterImpl) AttributesToProto(source *ozon.GetDescriptionOfProductsResult) *products.ProductAttributes { + var pProductsProductAttributes *products.ProductAttributes + if source != nil { + var productsProductAttributes products.ProductAttributes + productsProductAttributes.Id = (*source).Id + productsProductAttributes.Barcode = (*source).Barcode + productsProductAttributes.Name = (*source).Name + productsProductAttributes.OfferId = (*source).OfferId + productsProductAttributes.TypeId = (*source).TypeId + productsProductAttributes.Height = mapping.Int32ToInt64((*source).Height) + productsProductAttributes.Depth = mapping.Int32ToInt64((*source).Depth) + productsProductAttributes.Width = mapping.Int32ToInt64((*source).Width) + productsProductAttributes.DimensionUnit = (*source).DimensionUnit + productsProductAttributes.Weight = mapping.Int32ToInt64((*source).Weight) + productsProductAttributes.WeightUnit = (*source).WeightUnit + productsProductAttributes.PrimaryImage = (*source).PrimaryImage + productsProductAttributes.ModelInfo = c.pOzonModelInfoToPProductsProductAttributes_ModelInfo((*source).ModelInfo) + if (*source).Images != nil { + productsProductAttributes.Images = make([]string, len((*source).Images)) + for i := 0; i < len((*source).Images); i++ { + productsProductAttributes.Images[i] = (*source).Images[i] + } + } + if (*source).Attributes != nil { + productsProductAttributes.Attributes = make([]*products.ProductAttributes_Attributes, len((*source).Attributes)) + for j := 0; j < len((*source).Attributes); j++ { + productsProductAttributes.Attributes[j] = c.ozonGetDescriptionOfProductsAttributeToPProductsProductAttributes_Attributes((*source).Attributes[j]) + } + } + productsProductAttributes.ColorImage = (*source).ColorImage + productsProductAttributes.DescriptionCategoryId = (*source).DescriptionCategoryId + pProductsProductAttributes = &productsProductAttributes + } + return pProductsProductAttributes +} +func (c *ConverterImpl) ProtoToUpdateItem(source *products.CreateOrUpdateProductsRequest_Item) *ozon.CreateOrUpdateProductItem { + var pOzonCreateOrUpdateProductItem *ozon.CreateOrUpdateProductItem + if source != nil { + var ozonCreateOrUpdateProductItem ozon.CreateOrUpdateProductItem + if (*source).Attributes != nil { + ozonCreateOrUpdateProductItem.Attributes = make([]ozon.CreateOrUpdateAttribute, len((*source).Attributes)) + for i := 0; i < len((*source).Attributes); i++ { + ozonCreateOrUpdateProductItem.Attributes[i] = c.pProductsCreateOrUpdateProductsRequest_Item_AttributesToOzonCreateOrUpdateAttribute((*source).Attributes[i]) + } + } + ozonCreateOrUpdateProductItem.Barcode = (*source).Barcode + ozonCreateOrUpdateProductItem.DescriptionCategoryId = (*source).DescriptionCategoryId + ozonCreateOrUpdateProductItem.NewDescriptionCategoryId = (*source).NewDescriptionCategoryId + ozonCreateOrUpdateProductItem.ColorImage = (*source).ColorImage + ozonCreateOrUpdateProductItem.Depth = mapping.Int64ToInt32((*source).Depth) + ozonCreateOrUpdateProductItem.DimensionUnit = (*source).DimensionUnit + ozonCreateOrUpdateProductItem.Height = mapping.Int64ToInt32((*source).Height) + if (*source).Images != nil { + ozonCreateOrUpdateProductItem.Images = make([]string, len((*source).Images)) + for j := 0; j < len((*source).Images); j++ { + ozonCreateOrUpdateProductItem.Images[j] = (*source).Images[j] + } + } + ozonCreateOrUpdateProductItem.PrimaryImage = (*source).PrimaryImage + if (*source).Images360 != nil { + ozonCreateOrUpdateProductItem.Images360 = make([]string, len((*source).Images360)) + for k := 0; k < len((*source).Images360); k++ { + ozonCreateOrUpdateProductItem.Images360[k] = (*source).Images360[k] + } + } + ozonCreateOrUpdateProductItem.Name = (*source).Name + ozonCreateOrUpdateProductItem.OfferId = (*source).OfferId + ozonCreateOrUpdateProductItem.CurrencyCode = (*source).CurrencyCode + ozonCreateOrUpdateProductItem.OldPrice = (*source).OldPrice + if (*source).PdfList != nil { + ozonCreateOrUpdateProductItem.PDFList = make([]ozon.CreateOrUpdateProductPDF, len((*source).PdfList)) + for l := 0; l < len((*source).PdfList); l++ { + ozonCreateOrUpdateProductItem.PDFList[l] = c.pProductsCreateOrUpdateProductsRequest_Item_PdfListItemToOzonCreateOrUpdateProductPDF((*source).PdfList[l]) + } + } + ozonCreateOrUpdateProductItem.Price = (*source).Price + ozonCreateOrUpdateProductItem.ServiceType = (*source).ServiceType + ozonCreateOrUpdateProductItem.TypeId = (*source).TypeId + ozonCreateOrUpdateProductItem.VAT = ozon.VAT((*source).Vat) + ozonCreateOrUpdateProductItem.Weight = mapping.Int64ToInt32((*source).Weight) + ozonCreateOrUpdateProductItem.WeightUnit = (*source).WeightUnit + ozonCreateOrUpdateProductItem.Width = mapping.Int64ToInt32((*source).Width) + pOzonCreateOrUpdateProductItem = &ozonCreateOrUpdateProductItem + } + return pOzonCreateOrUpdateProductItem +} func (c *ConverterImpl) ToProto(source *ozon.ProductDetails) *products.Product { var pProductsProduct *products.Product if source != nil { @@ -25,14 +111,38 @@ func (c *ConverterImpl) ToProto(source *ozon.ProductDetails) *products.Product { } } productsProduct.Statuses = c.ozonProductDetailsStatusToPProductsProduct_Status((*source).Statuses) + if (*source).Errors != nil { + productsProduct.Errors = make([]*products.Product_Error, len((*source).Errors)) + for j := 0; j < len((*source).Errors); j++ { + productsProduct.Errors[j] = c.ozonProductDetailsErrorToPProductsProduct_Error((*source).Errors[j]) + } + } pProductsProduct = &productsProduct } return pProductsProduct } +func (c *ConverterImpl) ozonGetDescriptionOfProductsAttributeToPProductsProductAttributes_Attributes(source ozon.GetDescriptionOfProductsAttribute) *products.ProductAttributes_Attributes { + var productsProductAttributes_Attributes products.ProductAttributes_Attributes + productsProductAttributes_Attributes.Id = source.Id + productsProductAttributes_Attributes.ComplexId = source.ComplexId + if source.Values != nil { + productsProductAttributes_Attributes.Values = make([]*products.ProductAttributes_Values, len(source.Values)) + for i := 0; i < len(source.Values); i++ { + productsProductAttributes_Attributes.Values[i] = c.ozonGetDescriptionOfProductsAttributeValueToPProductsProductAttributes_Values(source.Values[i]) + } + } + return &productsProductAttributes_Attributes +} +func (c *ConverterImpl) ozonGetDescriptionOfProductsAttributeValueToPProductsProductAttributes_Values(source ozon.GetDescriptionOfProductsAttributeValue) *products.ProductAttributes_Values { + var productsProductAttributes_Values products.ProductAttributes_Values + productsProductAttributes_Values.DictionaryValueId = source.DictionaryValueId + productsProductAttributes_Values.Value = source.Value + return &productsProductAttributes_Values +} func (c *ConverterImpl) ozonProductDetailStockStockToPProductsProduct_Stock(source ozon.ProductDetailStockStock) *products.Product_Stock { var productsProduct_Stock products.Product_Stock - productsProduct_Stock.Present = mapping.Int632ToInt64(source.Present) - productsProduct_Stock.Reserved = mapping.Int632ToInt64(source.Reserved) + productsProduct_Stock.Present = mapping.Int32ToInt64(source.Present) + productsProduct_Stock.Reserved = mapping.Int32ToInt64(source.Reserved) productsProduct_Stock.SKU = source.SKU productsProduct_Stock.Source = source.Source return &productsProduct_Stock @@ -48,8 +158,60 @@ func (c *ConverterImpl) ozonProductDetailStockToPProductsProduct_Stocks(source o productsProduct_Stocks.HasStock = source.HasStock return &productsProduct_Stocks } +func (c *ConverterImpl) ozonProductDetailsErrorToPProductsProduct_Error(source ozon.ProductDetailsError) *products.Product_Error { + var productsProduct_Error products.Product_Error + productsProduct_Error.Code = source.Code + return &productsProduct_Error +} func (c *ConverterImpl) ozonProductDetailsStatusToPProductsProduct_Status(source ozon.ProductDetailsStatus) *products.Product_Status { var productsProduct_Status products.Product_Status productsProduct_Status.StatusName = source.StatusName return &productsProduct_Status } +func (c *ConverterImpl) pOzonModelInfoToPProductsProductAttributes_ModelInfo(source *ozon.ModelInfo) *products.ProductAttributes_ModelInfo { + var pProductsProductAttributes_ModelInfo *products.ProductAttributes_ModelInfo + if source != nil { + var productsProductAttributes_ModelInfo products.ProductAttributes_ModelInfo + productsProductAttributes_ModelInfo.ModelId = (*source).ModelId + productsProductAttributes_ModelInfo.Count = (*source).Count + pProductsProductAttributes_ModelInfo = &productsProductAttributes_ModelInfo + } + return pProductsProductAttributes_ModelInfo +} +func (c *ConverterImpl) pProductsCreateOrUpdateProductsRequest_Item_AttributesToOzonCreateOrUpdateAttribute(source *products.CreateOrUpdateProductsRequest_Item_Attributes) ozon.CreateOrUpdateAttribute { + var ozonCreateOrUpdateAttribute ozon.CreateOrUpdateAttribute + if source != nil { + var ozonCreateOrUpdateAttribute2 ozon.CreateOrUpdateAttribute + ozonCreateOrUpdateAttribute2.ComplexId = (*source).ComplexId + ozonCreateOrUpdateAttribute2.Id = (*source).Id + if (*source).Values != nil { + ozonCreateOrUpdateAttribute2.Values = make([]ozon.CreateOrUpdateAttributeValue, len((*source).Values)) + for i := 0; i < len((*source).Values); i++ { + ozonCreateOrUpdateAttribute2.Values[i] = c.pProductsCreateOrUpdateProductsRequest_Item_ValuesToOzonCreateOrUpdateAttributeValue((*source).Values[i]) + } + } + ozonCreateOrUpdateAttribute = ozonCreateOrUpdateAttribute2 + } + return ozonCreateOrUpdateAttribute +} +func (c *ConverterImpl) pProductsCreateOrUpdateProductsRequest_Item_PdfListItemToOzonCreateOrUpdateProductPDF(source *products.CreateOrUpdateProductsRequest_Item_PdfListItem) ozon.CreateOrUpdateProductPDF { + var ozonCreateOrUpdateProductPDF ozon.CreateOrUpdateProductPDF + if source != nil { + var ozonCreateOrUpdateProductPDF2 ozon.CreateOrUpdateProductPDF + ozonCreateOrUpdateProductPDF2.Index = (*source).Index + ozonCreateOrUpdateProductPDF2.Name = (*source).Name + ozonCreateOrUpdateProductPDF2.SrcUrl = (*source).SrcUrl + ozonCreateOrUpdateProductPDF = ozonCreateOrUpdateProductPDF2 + } + return ozonCreateOrUpdateProductPDF +} +func (c *ConverterImpl) pProductsCreateOrUpdateProductsRequest_Item_ValuesToOzonCreateOrUpdateAttributeValue(source *products.CreateOrUpdateProductsRequest_Item_Values) ozon.CreateOrUpdateAttributeValue { + var ozonCreateOrUpdateAttributeValue ozon.CreateOrUpdateAttributeValue + if source != nil { + var ozonCreateOrUpdateAttributeValue2 ozon.CreateOrUpdateAttributeValue + ozonCreateOrUpdateAttributeValue2.DictionaryValueId = (*source).DictionaryValueId + ozonCreateOrUpdateAttributeValue2.Value = (*source).Value + ozonCreateOrUpdateAttributeValue = ozonCreateOrUpdateAttributeValue2 + } + return ozonCreateOrUpdateAttributeValue +} diff --git a/internal/ozon/products/repository.go b/internal/ozon/products/repository.go index c1f5467..c045ef9 100644 --- a/internal/ozon/products/repository.go +++ b/internal/ozon/products/repository.go @@ -6,4 +6,7 @@ type Repository interface { GetAllProducts(ctx context.Context, marketplaceId int) ([]OzonProduct, error) StreamAllProducts(ctx context.Context, marketplaceId int, resultChan chan<- []OzonProduct, errChan chan<- error) StreamAllProductsCache(ctx context.Context, marketplaceId int, resultChan chan<- []PbProduct, errChan chan<- error) + StreamProductAttributesCache(ctx context.Context, marketplaceId int, productIds []int, resultChan chan<- []PbProductAttributes, errChan chan<- error) + DeleteProducts(ctx context.Context, marketplaceId int, items []*PbDeleteProductRequestItem) ([]*PbDeleteProductResponseItem, error) + CreateOrUpdateProducts(ctx context.Context, marketplaceId int, items []*PbCreateOrUpdateItem) (*PbCreateOrUpdateProductsResponse, error) } diff --git a/internal/ozon/products/repository_api.go b/internal/ozon/products/repository_api.go index 3fc8158..d25e6d9 100644 --- a/internal/ozon/products/repository_api.go +++ b/internal/ozon/products/repository_api.go @@ -6,12 +6,14 @@ import ( "fmt" api "git.denco.store/fakz9/ozon-api-client/ozon" "github.com/samber/lo" + pb "sipro-mps/api/generated/v1/ozon/products" "sipro-mps/internal/marketplace" "sipro-mps/internal/ozon" "sipro-mps/internal/ozon/products/mapping/generated" "sipro-mps/internal/redis" "sipro-mps/internal/tasks/client" "sipro-mps/internal/tasks/types" + "strconv" "sync" ) @@ -202,3 +204,125 @@ func (a *apiRepository) StreamAllProductsCache(ctx context.Context, marketplaceI } } } + +func (a *apiRepository) StreamProductAttributesCache(ctx context.Context, marketplaceId int, productIds []int, resultChan chan<- []PbProductAttributes, errChan chan<- error) { + defer close(resultChan) + defer close(errChan) + + mp, err := a.marketplaceRepository.GetMarketplaceByID(ctx, marketplaceId) + if err != nil { + errChan <- err + return + } + ozonClient, err := ozon.GetClientFromMarketplace(mp) + if err != nil { + errChan <- err + return + } + converter := generated.ConverterImpl{} + for _, chunk := range lo.Chunk(productIds, 1000) { + chunkStrings := lo.Map(chunk, func(item int, index int) string { + return strconv.Itoa(item) + }) + request := api.GetDescriptionOfProductsParams{ + LastId: "", + Limit: 1000, + SortBy: "id", + SortDirection: "asc", + Filter: api.GetDescriptionOfProductsFilter{ProductId: chunkStrings}, + } + response, err := ozonClient.Products().GetDescriptionOfProducts(ctx, &request) + if err != nil { + errChan <- err + return + } + resultChan <- lo.Map(response.Result, func(item api.GetDescriptionOfProductsResult, index int) pb.ProductAttributes { + return *converter.AttributesToProto(&item) + }) + + } + //ozonClient.Products().GetDescriptionOfProducts() +} + +func (a *apiRepository) DeleteProducts(ctx context.Context, marketplaceId int, items []*PbDeleteProductRequestItem) ([]*PbDeleteProductResponseItem, error) { + mp, err := a.marketplaceRepository.GetMarketplaceByID(ctx, marketplaceId) + + if err != nil { + + return nil, err + } + ozonClient, err := ozon.GetClientFromMarketplace(mp) + if err != nil { + return nil, err + } + // Step 1: map the items into a slice + mapped := lo.Map(items, func(item *PbDeleteProductRequestItem, _ int) *PbDeleteProductResponseItem { + return &PbDeleteProductResponseItem{ + ProductId: item.ProductId, + OfferId: item.OfferId, + IsDeleted: false, + } + }) + + // Step 2: create the map keyed by OfferId + result := lo.KeyBy(mapped, func(item *PbDeleteProductResponseItem) string { + return item.OfferId + }) + + for _, chunk := range lo.Chunk(items, 100) { + productIds := lo.Map(chunk, func(item *PbDeleteProductRequestItem, index int) int64 { + return item.ProductId + }) + request := api.ArchiveProductParams{ProductId: productIds} + _, err := ozonClient.Products().ArchiveProduct(ctx, &request) + if err != nil { + return nil, err + } + } + + for _, chunk := range lo.Chunk(items, 500) { + products := lo.Map(chunk, func(item *PbDeleteProductRequestItem, index int) api.RemoveProductWithoutSKUProduct { + return api.RemoveProductWithoutSKUProduct{OfferId: item.OfferId} + }) + request := api.RemoveProductWithoutSKUParams{Products: products} + response, err := ozonClient.Products().RemoveProductWithoutSKU(ctx, &request) + if err != nil { + return nil, err + } + for _, status := range response.Status { + if item, ok := result[status.OfferId]; ok { + item.IsDeleted = status.IsDeleted + } + } + } + return lo.Values(result), nil +} + +func (a *apiRepository) CreateOrUpdateProducts(ctx context.Context, marketplaceId int, items []*PbCreateOrUpdateItem) (*PbCreateOrUpdateProductsResponse, error) { + mp, err := a.marketplaceRepository.GetMarketplaceByID(ctx, marketplaceId) + + if err != nil { + + return nil, err + } + ozonClient, err := ozon.GetClientFromMarketplace(mp) + if err != nil { + return nil, err + } + converter := generated.ConverterImpl{} + pageSize := 100 + result := make([]int64, (len(items)+pageSize-1)/pageSize) + for idx, chunk := range lo.Chunk(items, pageSize) { + mappedItems := lo.Map(chunk, func(item *PbCreateOrUpdateItem, index int) api.CreateOrUpdateProductItem { + return *converter.ProtoToUpdateItem(item) + }) + request := api.CreateOrUpdateProductParams{Items: mappedItems} + response, err := ozonClient.Products().CreateOrUpdateProduct(ctx, &request) + if err != nil { + return nil, err + } + result[idx] = response.Result.TaskId + } + + return &pb.CreateOrUpdateProductsResponse{TaskId: result}, nil +}