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

package comments

import (
	context "context"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
	emptypb "google.golang.org/protobuf/types/known/emptypb"
)

// 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.32.0 or later.
const _ = grpc.SupportPackageIsVersion7

// CommentsClient is the client API for Comments 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 CommentsClient interface {
	CommentAdd(ctx context.Context, in *CreateCommentRequest, opts ...grpc.CallOption) (*CreateCommentResponse, error)
	CommentGetByID(ctx context.Context, in *GetCommentRequest, opts ...grpc.CallOption) (*GetCommentResponse, error)
	CommentEdit(ctx context.Context, in *EditCommentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	CommentListBySKU(ctx context.Context, in *ListBySkuRequest, opts ...grpc.CallOption) (*ListBySkuResponse, error)
	CommentListByUser(ctx context.Context, in *ListByUserRequest, opts ...grpc.CallOption) (*ListByUserResponse, error)
}

type commentsClient struct {
	cc grpc.ClientConnInterface
}

func NewCommentsClient(cc grpc.ClientConnInterface) CommentsClient {
	return &commentsClient{cc}
}

func (c *commentsClient) CommentAdd(ctx context.Context, in *CreateCommentRequest, opts ...grpc.CallOption) (*CreateCommentResponse, error) {
	out := new(CreateCommentResponse)
	err := c.cc.Invoke(ctx, "/Comments/CommentAdd", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *commentsClient) CommentGetByID(ctx context.Context, in *GetCommentRequest, opts ...grpc.CallOption) (*GetCommentResponse, error) {
	out := new(GetCommentResponse)
	err := c.cc.Invoke(ctx, "/Comments/CommentGetByID", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *commentsClient) CommentEdit(ctx context.Context, in *EditCommentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
	out := new(emptypb.Empty)
	err := c.cc.Invoke(ctx, "/Comments/CommentEdit", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *commentsClient) CommentListBySKU(ctx context.Context, in *ListBySkuRequest, opts ...grpc.CallOption) (*ListBySkuResponse, error) {
	out := new(ListBySkuResponse)
	err := c.cc.Invoke(ctx, "/Comments/CommentListBySKU", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *commentsClient) CommentListByUser(ctx context.Context, in *ListByUserRequest, opts ...grpc.CallOption) (*ListByUserResponse, error) {
	out := new(ListByUserResponse)
	err := c.cc.Invoke(ctx, "/Comments/CommentListByUser", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// CommentsServer is the server API for Comments service.
// All implementations must embed UnimplementedCommentsServer
// for forward compatibility
type CommentsServer interface {
	CommentAdd(context.Context, *CreateCommentRequest) (*CreateCommentResponse, error)
	CommentGetByID(context.Context, *GetCommentRequest) (*GetCommentResponse, error)
	CommentEdit(context.Context, *EditCommentRequest) (*emptypb.Empty, error)
	CommentListBySKU(context.Context, *ListBySkuRequest) (*ListBySkuResponse, error)
	CommentListByUser(context.Context, *ListByUserRequest) (*ListByUserResponse, error)
	mustEmbedUnimplementedCommentsServer()
}

// UnimplementedCommentsServer must be embedded to have forward compatible implementations.
type UnimplementedCommentsServer struct {
}

func (UnimplementedCommentsServer) CommentAdd(context.Context, *CreateCommentRequest) (*CreateCommentResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method CommentAdd not implemented")
}
func (UnimplementedCommentsServer) CommentGetByID(context.Context, *GetCommentRequest) (*GetCommentResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method CommentGetByID not implemented")
}
func (UnimplementedCommentsServer) CommentEdit(context.Context, *EditCommentRequest) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method CommentEdit not implemented")
}
func (UnimplementedCommentsServer) CommentListBySKU(context.Context, *ListBySkuRequest) (*ListBySkuResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method CommentListBySKU not implemented")
}
func (UnimplementedCommentsServer) CommentListByUser(context.Context, *ListByUserRequest) (*ListByUserResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method CommentListByUser not implemented")
}
func (UnimplementedCommentsServer) mustEmbedUnimplementedCommentsServer() {}

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

func RegisterCommentsServer(s grpc.ServiceRegistrar, srv CommentsServer) {
	s.RegisterService(&Comments_ServiceDesc, srv)
}

func _Comments_CommentAdd_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CreateCommentRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(CommentsServer).CommentAdd(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/Comments/CommentAdd",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(CommentsServer).CommentAdd(ctx, req.(*CreateCommentRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Comments_CommentGetByID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetCommentRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(CommentsServer).CommentGetByID(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/Comments/CommentGetByID",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(CommentsServer).CommentGetByID(ctx, req.(*GetCommentRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Comments_CommentEdit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(EditCommentRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(CommentsServer).CommentEdit(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/Comments/CommentEdit",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(CommentsServer).CommentEdit(ctx, req.(*EditCommentRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Comments_CommentListBySKU_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ListBySkuRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(CommentsServer).CommentListBySKU(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/Comments/CommentListBySKU",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(CommentsServer).CommentListBySKU(ctx, req.(*ListBySkuRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Comments_CommentListByUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ListByUserRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(CommentsServer).CommentListByUser(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/Comments/CommentListByUser",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(CommentsServer).CommentListByUser(ctx, req.(*ListByUserRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// Comments_ServiceDesc is the grpc.ServiceDesc for Comments service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Comments_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "Comments",
	HandlerType: (*CommentsServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CommentAdd",
			Handler:    _Comments_CommentAdd_Handler,
		},
		{
			MethodName: "CommentGetByID",
			Handler:    _Comments_CommentGetByID_Handler,
		},
		{
			MethodName: "CommentEdit",
			Handler:    _Comments_CommentEdit_Handler,
		},
		{
			MethodName: "CommentListBySKU",
			Handler:    _Comments_CommentListBySKU_Handler,
		},
		{
			MethodName: "CommentListByUser",
			Handler:    _Comments_CommentListByUser_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "comments/v1/comments.proto",
}
