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

package housework

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

// RobotMaidClient is the client API for RobotMaid 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 RobotMaidClient interface {
	Add(ctx context.Context, in *Chores, opts ...grpc.CallOption) (*Response, error)
	Complete(ctx context.Context, in *CompleteRequest, opts ...grpc.CallOption) (*Response, error)
	List(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Chores, error)
}

type robotMaidClient struct {
	cc grpc.ClientConnInterface
}

func NewRobotMaidClient(cc grpc.ClientConnInterface) RobotMaidClient {
	return &robotMaidClient{cc}
}

var robotMaidAddStreamDesc = &grpc.StreamDesc{
	StreamName: "Add",
}

func (c *robotMaidClient) Add(ctx context.Context, in *Chores, opts ...grpc.CallOption) (*Response, error) {
	out := new(Response)
	err := c.cc.Invoke(ctx, "/housework.RobotMaid/Add", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

var robotMaidCompleteStreamDesc = &grpc.StreamDesc{
	StreamName: "Complete",
}

func (c *robotMaidClient) Complete(ctx context.Context, in *CompleteRequest, opts ...grpc.CallOption) (*Response, error) {
	out := new(Response)
	err := c.cc.Invoke(ctx, "/housework.RobotMaid/Complete", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

var robotMaidListStreamDesc = &grpc.StreamDesc{
	StreamName: "List",
}

func (c *robotMaidClient) List(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Chores, error) {
	out := new(Chores)
	err := c.cc.Invoke(ctx, "/housework.RobotMaid/List", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// RobotMaidService is the service API for RobotMaid service.
// Fields should be assigned to their respective handler implementations only before
// RegisterRobotMaidService is called.  Any unassigned fields will result in the
// handler for that method returning an Unimplemented error.
type RobotMaidService struct {
	Add      func(context.Context, *Chores) (*Response, error)
	Complete func(context.Context, *CompleteRequest) (*Response, error)
	List     func(context.Context, *Empty) (*Chores, error)
}

func (s *RobotMaidService) add(_ interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(Chores)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return s.Add(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     s,
		FullMethod: "/housework.RobotMaid/Add",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return s.Add(ctx, req.(*Chores))
	}
	return interceptor(ctx, in, info, handler)
}
func (s *RobotMaidService) complete(_ interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CompleteRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return s.Complete(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     s,
		FullMethod: "/housework.RobotMaid/Complete",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return s.Complete(ctx, req.(*CompleteRequest))
	}
	return interceptor(ctx, in, info, handler)
}
func (s *RobotMaidService) list(_ interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(Empty)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return s.List(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     s,
		FullMethod: "/housework.RobotMaid/List",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return s.List(ctx, req.(*Empty))
	}
	return interceptor(ctx, in, info, handler)
}

// RegisterRobotMaidService registers a service implementation with a gRPC server.
func RegisterRobotMaidService(s grpc.ServiceRegistrar, srv *RobotMaidService) {
	srvCopy := *srv
	if srvCopy.Add == nil {
		srvCopy.Add = func(context.Context, *Chores) (*Response, error) {
			return nil, status.Errorf(codes.Unimplemented, "method Add not implemented")
		}
	}
	if srvCopy.Complete == nil {
		srvCopy.Complete = func(context.Context, *CompleteRequest) (*Response, error) {
			return nil, status.Errorf(codes.Unimplemented, "method Complete not implemented")
		}
	}
	if srvCopy.List == nil {
		srvCopy.List = func(context.Context, *Empty) (*Chores, error) {
			return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
		}
	}
	sd := grpc.ServiceDesc{
		ServiceName: "housework.RobotMaid",
		Methods: []grpc.MethodDesc{
			{
				MethodName: "Add",
				Handler:    srvCopy.add,
			},
			{
				MethodName: "Complete",
				Handler:    srvCopy.complete,
			},
			{
				MethodName: "List",
				Handler:    srvCopy.list,
			},
		},
		Streams:  []grpc.StreamDesc{},
		Metadata: "housework/v1/housework.proto",
	}

	s.RegisterService(&sd, nil)
}
