// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc             v6.31.1
// source: ozon/products.proto

package products

import (
	context "context"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
)

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9

const (
	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.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type 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 {
	cc grpc.ClientConnInterface
}

func NewProductsServiceClient(cc grpc.ClientConnInterface) ProductsServiceClient {
	return &productsServiceClient{cc}
}

func (c *productsServiceClient) GetListOfProducts(ctx context.Context, in *GetListOfProductsRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[GetListOfProductsResponse], error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	stream, err := c.cc.NewStream(ctx, &ProductsService_ServiceDesc.Streams[0], ProductsService_GetListOfProducts_FullMethodName, cOpts...)
	if err != nil {
		return nil, err
	}
	x := &grpc.GenericClientStream[GetListOfProductsRequest, GetListOfProductsResponse]{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_GetListOfProductsClient = grpc.ServerStreamingClient[GetListOfProductsResponse]

func (c *productsServiceClient) GetProductPrice(ctx context.Context, in *GetProductPriceRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[GetProductPriceResponse], error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	stream, err := c.cc.NewStream(ctx, &ProductsService_ServiceDesc.Streams[1], ProductsService_GetProductPrice_FullMethodName, cOpts...)
	if err != nil {
		return nil, err
	}
	x := &grpc.GenericClientStream[GetProductPriceRequest, GetProductPriceResponse]{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_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.
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()
}

// UnimplementedProductsServiceServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedProductsServiceServer struct{}

func (UnimplementedProductsServiceServer) GetListOfProducts(*GetListOfProductsRequest, grpc.ServerStreamingServer[GetListOfProductsResponse]) error {
	return status.Errorf(codes.Unimplemented, "method GetListOfProducts not implemented")
}
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()                         {}

// UnsafeProductsServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to ProductsServiceServer will
// result in compilation errors.
type UnsafeProductsServiceServer interface {
	mustEmbedUnimplementedProductsServiceServer()
}

func RegisterProductsServiceServer(s grpc.ServiceRegistrar, srv ProductsServiceServer) {
	// If the following call pancis, it indicates UnimplementedProductsServiceServer was
	// embedded by pointer and is nil.  This will cause panics if an
	// unimplemented method is ever invoked, so we test this at initialization
	// time to prevent it from happening at runtime later due to I/O.
	if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
		t.testEmbeddedByValue()
	}
	s.RegisterService(&ProductsService_ServiceDesc, srv)
}

func _ProductsService_GetListOfProducts_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(GetListOfProductsRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(ProductsServiceServer).GetListOfProducts(m, &grpc.GenericServerStream[GetListOfProductsRequest, GetListOfProductsResponse]{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_GetListOfProductsServer = grpc.ServerStreamingServer[GetListOfProductsResponse]

func _ProductsService_GetProductPrice_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(GetProductPriceRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(ProductsServiceServer).GetProductPrice(m, &grpc.GenericServerStream[GetProductPriceRequest, GetProductPriceResponse]{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_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{
		{
			MethodName: "DeleteProducts",
			Handler:    _ProductsService_DeleteProducts_Handler,
		},
		{
			MethodName: "CreateOrUpdateProducts",
			Handler:    _ProductsService_CreateOrUpdateProducts_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "GetListOfProducts",
			Handler:       _ProductsService_GetListOfProducts_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "GetProductPrice",
			Handler:       _ProductsService_GetProductPrice_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "GetProductAttributes",
			Handler:       _ProductsService_GetProductAttributes_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "ozon/products.proto",
}
