// Code generated by protoc-gen-go-grpc. DO NOT EDIT.

package readerService

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.
const _ = grpc.SupportPackageIsVersion7

// ReaderServiceClient is the client API for ReaderService 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 ReaderServiceClient interface {
	CreateProduct(ctx context.Context, in *CreateProductReq, opts ...grpc.CallOption) (*CreateProductRes, error)
	UpdateProduct(ctx context.Context, in *UpdateProductReq, opts ...grpc.CallOption) (*UpdateProductRes, error)
	GetProductById(ctx context.Context, in *GetProductByIdReq, opts ...grpc.CallOption) (*GetProductByIdRes, error)
	SearchProduct(ctx context.Context, in *SearchReq, opts ...grpc.CallOption) (*SearchRes, error)
	DeleteProductByID(ctx context.Context, in *DeleteProductByIdReq, opts ...grpc.CallOption) (*DeleteProductByIdRes, error)
}

type readerServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewReaderServiceClient(cc grpc.ClientConnInterface) ReaderServiceClient {
	return &readerServiceClient{cc}
}

func (c *readerServiceClient) CreateProduct(ctx context.Context, in *CreateProductReq, opts ...grpc.CallOption) (*CreateProductRes, error) {
	out := new(CreateProductRes)
	err := c.cc.Invoke(ctx, "/readerService.readerService/CreateProduct", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *readerServiceClient) UpdateProduct(ctx context.Context, in *UpdateProductReq, opts ...grpc.CallOption) (*UpdateProductRes, error) {
	out := new(UpdateProductRes)
	err := c.cc.Invoke(ctx, "/readerService.readerService/UpdateProduct", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *readerServiceClient) GetProductById(ctx context.Context, in *GetProductByIdReq, opts ...grpc.CallOption) (*GetProductByIdRes, error) {
	out := new(GetProductByIdRes)
	err := c.cc.Invoke(ctx, "/readerService.readerService/GetProductById", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *readerServiceClient) SearchProduct(ctx context.Context, in *SearchReq, opts ...grpc.CallOption) (*SearchRes, error) {
	out := new(SearchRes)
	err := c.cc.Invoke(ctx, "/readerService.readerService/SearchProduct", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *readerServiceClient) DeleteProductByID(ctx context.Context, in *DeleteProductByIdReq, opts ...grpc.CallOption) (*DeleteProductByIdRes, error) {
	out := new(DeleteProductByIdRes)
	err := c.cc.Invoke(ctx, "/readerService.readerService/DeleteProductByID", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// ReaderServiceServer is the server API for ReaderService service.
// All implementations should embed UnimplementedReaderServiceServer
// for forward compatibility
type ReaderServiceServer interface {
	CreateProduct(context.Context, *CreateProductReq) (*CreateProductRes, error)
	UpdateProduct(context.Context, *UpdateProductReq) (*UpdateProductRes, error)
	GetProductById(context.Context, *GetProductByIdReq) (*GetProductByIdRes, error)
	SearchProduct(context.Context, *SearchReq) (*SearchRes, error)
	DeleteProductByID(context.Context, *DeleteProductByIdReq) (*DeleteProductByIdRes, error)
}

// UnimplementedReaderServiceServer should be embedded to have forward compatible implementations.
type UnimplementedReaderServiceServer struct {
}

func (UnimplementedReaderServiceServer) CreateProduct(context.Context, *CreateProductReq) (*CreateProductRes, error) {
	return nil, status.Errorf(codes.Unimplemented, "method CreateProduct not implemented")
}
func (UnimplementedReaderServiceServer) UpdateProduct(context.Context, *UpdateProductReq) (*UpdateProductRes, error) {
	return nil, status.Errorf(codes.Unimplemented, "method UpdateProduct not implemented")
}
func (UnimplementedReaderServiceServer) GetProductById(context.Context, *GetProductByIdReq) (*GetProductByIdRes, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetProductById not implemented")
}
func (UnimplementedReaderServiceServer) SearchProduct(context.Context, *SearchReq) (*SearchRes, error) {
	return nil, status.Errorf(codes.Unimplemented, "method SearchProduct not implemented")
}
func (UnimplementedReaderServiceServer) DeleteProductByID(context.Context, *DeleteProductByIdReq) (*DeleteProductByIdRes, error) {
	return nil, status.Errorf(codes.Unimplemented, "method DeleteProductByID not implemented")
}

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

func RegisterReaderServiceServer(s grpc.ServiceRegistrar, srv ReaderServiceServer) {
	s.RegisterService(&_ReaderService_serviceDesc, srv)
}

func _ReaderService_CreateProduct_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CreateProductReq)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ReaderServiceServer).CreateProduct(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/readerService.readerService/CreateProduct",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ReaderServiceServer).CreateProduct(ctx, req.(*CreateProductReq))
	}
	return interceptor(ctx, in, info, handler)
}

func _ReaderService_UpdateProduct_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(UpdateProductReq)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ReaderServiceServer).UpdateProduct(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/readerService.readerService/UpdateProduct",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ReaderServiceServer).UpdateProduct(ctx, req.(*UpdateProductReq))
	}
	return interceptor(ctx, in, info, handler)
}

func _ReaderService_GetProductById_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetProductByIdReq)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ReaderServiceServer).GetProductById(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/readerService.readerService/GetProductById",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ReaderServiceServer).GetProductById(ctx, req.(*GetProductByIdReq))
	}
	return interceptor(ctx, in, info, handler)
}

func _ReaderService_SearchProduct_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(SearchReq)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ReaderServiceServer).SearchProduct(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/readerService.readerService/SearchProduct",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ReaderServiceServer).SearchProduct(ctx, req.(*SearchReq))
	}
	return interceptor(ctx, in, info, handler)
}

func _ReaderService_DeleteProductByID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DeleteProductByIdReq)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ReaderServiceServer).DeleteProductByID(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/readerService.readerService/DeleteProductByID",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ReaderServiceServer).DeleteProductByID(ctx, req.(*DeleteProductByIdReq))
	}
	return interceptor(ctx, in, info, handler)
}

var _ReaderService_serviceDesc = grpc.ServiceDesc{
	ServiceName: "readerService.readerService",
	HandlerType: (*ReaderServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateProduct",
			Handler:    _ReaderService_CreateProduct_Handler,
		},
		{
			MethodName: "UpdateProduct",
			Handler:    _ReaderService_UpdateProduct_Handler,
		},
		{
			MethodName: "GetProductById",
			Handler:    _ReaderService_GetProductById_Handler,
		},
		{
			MethodName: "SearchProduct",
			Handler:    _ReaderService_SearchProduct_Handler,
		},
		{
			MethodName: "DeleteProductByID",
			Handler:    _ReaderService_DeleteProductByID_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "product_reader.proto",
}
