// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc             v3.15.8
// source: giveaway.proto

package core

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"
	wrapperspb "google.golang.org/protobuf/types/known/wrapperspb"
)

// 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

// GiveAwayServiceClient is the client API for GiveAwayService 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 GiveAwayServiceClient interface {
	CreateGiveaway(ctx context.Context, in *CreateGiveAwayRequest, opts ...grpc.CallOption) (*wrapperspb.StringValue, error)
	GetGiveaway(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*GiveAway, error)
	GetGiveaways(ctx context.Context, in *CommonAddress, opts ...grpc.CallOption) (GiveAwayService_GetGiveawaysClient, error)
	GetGiveawaysByOwner(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (GiveAwayService_GetGiveawaysByOwnerClient, error)
	UpdateGiveaway(ctx context.Context, in *GiveAway, opts ...grpc.CallOption) (*emptypb.Empty, error)
	DeleteGiveaway(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// candidates
	GetCandidatesForGiveaway(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (GiveAwayService_GetCandidatesForGiveawayClient, error)
}

type giveAwayServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewGiveAwayServiceClient(cc grpc.ClientConnInterface) GiveAwayServiceClient {
	return &giveAwayServiceClient{cc}
}

func (c *giveAwayServiceClient) CreateGiveaway(ctx context.Context, in *CreateGiveAwayRequest, opts ...grpc.CallOption) (*wrapperspb.StringValue, error) {
	out := new(wrapperspb.StringValue)
	err := c.cc.Invoke(ctx, "/event.GiveAwayService/create_giveaway", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *giveAwayServiceClient) GetGiveaway(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*GiveAway, error) {
	out := new(GiveAway)
	err := c.cc.Invoke(ctx, "/event.GiveAwayService/get_giveaway", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *giveAwayServiceClient) GetGiveaways(ctx context.Context, in *CommonAddress, opts ...grpc.CallOption) (GiveAwayService_GetGiveawaysClient, error) {
	stream, err := c.cc.NewStream(ctx, &GiveAwayService_ServiceDesc.Streams[0], "/event.GiveAwayService/get_giveaways", opts...)
	if err != nil {
		return nil, err
	}
	x := &giveAwayServiceGetGiveawaysClient{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
}

type GiveAwayService_GetGiveawaysClient interface {
	Recv() (*GiveAwayList, error)
	grpc.ClientStream
}

type giveAwayServiceGetGiveawaysClient struct {
	grpc.ClientStream
}

func (x *giveAwayServiceGetGiveawaysClient) Recv() (*GiveAwayList, error) {
	m := new(GiveAwayList)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

func (c *giveAwayServiceClient) GetGiveawaysByOwner(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (GiveAwayService_GetGiveawaysByOwnerClient, error) {
	stream, err := c.cc.NewStream(ctx, &GiveAwayService_ServiceDesc.Streams[1], "/event.GiveAwayService/get_giveaways_by_owner", opts...)
	if err != nil {
		return nil, err
	}
	x := &giveAwayServiceGetGiveawaysByOwnerClient{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
}

type GiveAwayService_GetGiveawaysByOwnerClient interface {
	Recv() (*GiveAwayList, error)
	grpc.ClientStream
}

type giveAwayServiceGetGiveawaysByOwnerClient struct {
	grpc.ClientStream
}

func (x *giveAwayServiceGetGiveawaysByOwnerClient) Recv() (*GiveAwayList, error) {
	m := new(GiveAwayList)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

func (c *giveAwayServiceClient) UpdateGiveaway(ctx context.Context, in *GiveAway, opts ...grpc.CallOption) (*emptypb.Empty, error) {
	out := new(emptypb.Empty)
	err := c.cc.Invoke(ctx, "/event.GiveAwayService/update_giveaway", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *giveAwayServiceClient) DeleteGiveaway(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*emptypb.Empty, error) {
	out := new(emptypb.Empty)
	err := c.cc.Invoke(ctx, "/event.GiveAwayService/delete_giveaway", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *giveAwayServiceClient) GetCandidatesForGiveaway(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (GiveAwayService_GetCandidatesForGiveawayClient, error) {
	stream, err := c.cc.NewStream(ctx, &GiveAwayService_ServiceDesc.Streams[2], "/event.GiveAwayService/get_candidates_for_giveaway", opts...)
	if err != nil {
		return nil, err
	}
	x := &giveAwayServiceGetCandidatesForGiveawayClient{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
}

type GiveAwayService_GetCandidatesForGiveawayClient interface {
	Recv() (*GiveawayCandidateList, error)
	grpc.ClientStream
}

type giveAwayServiceGetCandidatesForGiveawayClient struct {
	grpc.ClientStream
}

func (x *giveAwayServiceGetCandidatesForGiveawayClient) Recv() (*GiveawayCandidateList, error) {
	m := new(GiveawayCandidateList)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

// GiveAwayServiceServer is the server API for GiveAwayService service.
// All implementations must embed UnimplementedGiveAwayServiceServer
// for forward compatibility
type GiveAwayServiceServer interface {
	CreateGiveaway(context.Context, *CreateGiveAwayRequest) (*wrapperspb.StringValue, error)
	GetGiveaway(context.Context, *wrapperspb.StringValue) (*GiveAway, error)
	GetGiveaways(*CommonAddress, GiveAwayService_GetGiveawaysServer) error
	GetGiveawaysByOwner(*wrapperspb.StringValue, GiveAwayService_GetGiveawaysByOwnerServer) error
	UpdateGiveaway(context.Context, *GiveAway) (*emptypb.Empty, error)
	DeleteGiveaway(context.Context, *wrapperspb.StringValue) (*emptypb.Empty, error)
	// candidates
	GetCandidatesForGiveaway(*wrapperspb.StringValue, GiveAwayService_GetCandidatesForGiveawayServer) error
	mustEmbedUnimplementedGiveAwayServiceServer()
}

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

func (UnimplementedGiveAwayServiceServer) CreateGiveaway(context.Context, *CreateGiveAwayRequest) (*wrapperspb.StringValue, error) {
	return nil, status.Errorf(codes.Unimplemented, "method CreateGiveaway not implemented")
}
func (UnimplementedGiveAwayServiceServer) GetGiveaway(context.Context, *wrapperspb.StringValue) (*GiveAway, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetGiveaway not implemented")
}
func (UnimplementedGiveAwayServiceServer) GetGiveaways(*CommonAddress, GiveAwayService_GetGiveawaysServer) error {
	return status.Errorf(codes.Unimplemented, "method GetGiveaways not implemented")
}
func (UnimplementedGiveAwayServiceServer) GetGiveawaysByOwner(*wrapperspb.StringValue, GiveAwayService_GetGiveawaysByOwnerServer) error {
	return status.Errorf(codes.Unimplemented, "method GetGiveawaysByOwner not implemented")
}
func (UnimplementedGiveAwayServiceServer) UpdateGiveaway(context.Context, *GiveAway) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method UpdateGiveaway not implemented")
}
func (UnimplementedGiveAwayServiceServer) DeleteGiveaway(context.Context, *wrapperspb.StringValue) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method DeleteGiveaway not implemented")
}
func (UnimplementedGiveAwayServiceServer) GetCandidatesForGiveaway(*wrapperspb.StringValue, GiveAwayService_GetCandidatesForGiveawayServer) error {
	return status.Errorf(codes.Unimplemented, "method GetCandidatesForGiveaway not implemented")
}
func (UnimplementedGiveAwayServiceServer) mustEmbedUnimplementedGiveAwayServiceServer() {}

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

func RegisterGiveAwayServiceServer(s grpc.ServiceRegistrar, srv GiveAwayServiceServer) {
	s.RegisterService(&GiveAwayService_ServiceDesc, srv)
}

func _GiveAwayService_CreateGiveaway_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CreateGiveAwayRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(GiveAwayServiceServer).CreateGiveaway(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/event.GiveAwayService/create_giveaway",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(GiveAwayServiceServer).CreateGiveaway(ctx, req.(*CreateGiveAwayRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _GiveAwayService_GetGiveaway_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(wrapperspb.StringValue)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(GiveAwayServiceServer).GetGiveaway(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/event.GiveAwayService/get_giveaway",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(GiveAwayServiceServer).GetGiveaway(ctx, req.(*wrapperspb.StringValue))
	}
	return interceptor(ctx, in, info, handler)
}

func _GiveAwayService_GetGiveaways_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(CommonAddress)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(GiveAwayServiceServer).GetGiveaways(m, &giveAwayServiceGetGiveawaysServer{stream})
}

type GiveAwayService_GetGiveawaysServer interface {
	Send(*GiveAwayList) error
	grpc.ServerStream
}

type giveAwayServiceGetGiveawaysServer struct {
	grpc.ServerStream
}

func (x *giveAwayServiceGetGiveawaysServer) Send(m *GiveAwayList) error {
	return x.ServerStream.SendMsg(m)
}

func _GiveAwayService_GetGiveawaysByOwner_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(wrapperspb.StringValue)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(GiveAwayServiceServer).GetGiveawaysByOwner(m, &giveAwayServiceGetGiveawaysByOwnerServer{stream})
}

type GiveAwayService_GetGiveawaysByOwnerServer interface {
	Send(*GiveAwayList) error
	grpc.ServerStream
}

type giveAwayServiceGetGiveawaysByOwnerServer struct {
	grpc.ServerStream
}

func (x *giveAwayServiceGetGiveawaysByOwnerServer) Send(m *GiveAwayList) error {
	return x.ServerStream.SendMsg(m)
}

func _GiveAwayService_UpdateGiveaway_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GiveAway)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(GiveAwayServiceServer).UpdateGiveaway(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/event.GiveAwayService/update_giveaway",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(GiveAwayServiceServer).UpdateGiveaway(ctx, req.(*GiveAway))
	}
	return interceptor(ctx, in, info, handler)
}

func _GiveAwayService_DeleteGiveaway_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(wrapperspb.StringValue)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(GiveAwayServiceServer).DeleteGiveaway(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/event.GiveAwayService/delete_giveaway",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(GiveAwayServiceServer).DeleteGiveaway(ctx, req.(*wrapperspb.StringValue))
	}
	return interceptor(ctx, in, info, handler)
}

func _GiveAwayService_GetCandidatesForGiveaway_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(wrapperspb.StringValue)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(GiveAwayServiceServer).GetCandidatesForGiveaway(m, &giveAwayServiceGetCandidatesForGiveawayServer{stream})
}

type GiveAwayService_GetCandidatesForGiveawayServer interface {
	Send(*GiveawayCandidateList) error
	grpc.ServerStream
}

type giveAwayServiceGetCandidatesForGiveawayServer struct {
	grpc.ServerStream
}

func (x *giveAwayServiceGetCandidatesForGiveawayServer) Send(m *GiveawayCandidateList) error {
	return x.ServerStream.SendMsg(m)
}

// GiveAwayService_ServiceDesc is the grpc.ServiceDesc for GiveAwayService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var GiveAwayService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "event.GiveAwayService",
	HandlerType: (*GiveAwayServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "create_giveaway",
			Handler:    _GiveAwayService_CreateGiveaway_Handler,
		},
		{
			MethodName: "get_giveaway",
			Handler:    _GiveAwayService_GetGiveaway_Handler,
		},
		{
			MethodName: "update_giveaway",
			Handler:    _GiveAwayService_UpdateGiveaway_Handler,
		},
		{
			MethodName: "delete_giveaway",
			Handler:    _GiveAwayService_DeleteGiveaway_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "get_giveaways",
			Handler:       _GiveAwayService_GetGiveaways_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "get_giveaways_by_owner",
			Handler:       _GiveAwayService_GetGiveawaysByOwner_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "get_candidates_for_giveaway",
			Handler:       _GiveAwayService_GetCandidatesForGiveaway_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "giveaway.proto",
}
