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

package types

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

// DkronClient is the client API for Dkron 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 DkronClient interface {
	GetJob(ctx context.Context, in *GetJobRequest, opts ...grpc.CallOption) (*GetJobResponse, error)
	ExecutionDone(ctx context.Context, in *ExecutionDoneRequest, opts ...grpc.CallOption) (*ExecutionDoneResponse, error)
	Leave(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error)
	SetJob(ctx context.Context, in *SetJobRequest, opts ...grpc.CallOption) (*SetJobResponse, error)
	DeleteJob(ctx context.Context, in *DeleteJobRequest, opts ...grpc.CallOption) (*DeleteJobResponse, error)
	RunJob(ctx context.Context, in *RunJobRequest, opts ...grpc.CallOption) (*RunJobResponse, error)
	ToggleJob(ctx context.Context, in *ToggleJobRequest, opts ...grpc.CallOption) (*ToggleJobResponse, error)
	RaftGetConfiguration(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*RaftGetConfigurationResponse, error)
	RaftRemovePeerByID(ctx context.Context, in *RaftRemovePeerByIDRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	GetActiveExecutions(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetActiveExecutionsResponse, error)
	SetExecution(ctx context.Context, in *Execution, opts ...grpc.CallOption) (*emptypb.Empty, error)
}

type dkronClient struct {
	cc grpc.ClientConnInterface
}

func NewDkronClient(cc grpc.ClientConnInterface) DkronClient {
	return &dkronClient{cc}
}

func (c *dkronClient) GetJob(ctx context.Context, in *GetJobRequest, opts ...grpc.CallOption) (*GetJobResponse, error) {
	out := new(GetJobResponse)
	err := c.cc.Invoke(ctx, "/types.Dkron/GetJob", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *dkronClient) ExecutionDone(ctx context.Context, in *ExecutionDoneRequest, opts ...grpc.CallOption) (*ExecutionDoneResponse, error) {
	out := new(ExecutionDoneResponse)
	err := c.cc.Invoke(ctx, "/types.Dkron/ExecutionDone", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

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

func (c *dkronClient) SetJob(ctx context.Context, in *SetJobRequest, opts ...grpc.CallOption) (*SetJobResponse, error) {
	out := new(SetJobResponse)
	err := c.cc.Invoke(ctx, "/types.Dkron/SetJob", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *dkronClient) DeleteJob(ctx context.Context, in *DeleteJobRequest, opts ...grpc.CallOption) (*DeleteJobResponse, error) {
	out := new(DeleteJobResponse)
	err := c.cc.Invoke(ctx, "/types.Dkron/DeleteJob", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *dkronClient) RunJob(ctx context.Context, in *RunJobRequest, opts ...grpc.CallOption) (*RunJobResponse, error) {
	out := new(RunJobResponse)
	err := c.cc.Invoke(ctx, "/types.Dkron/RunJob", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *dkronClient) ToggleJob(ctx context.Context, in *ToggleJobRequest, opts ...grpc.CallOption) (*ToggleJobResponse, error) {
	out := new(ToggleJobResponse)
	err := c.cc.Invoke(ctx, "/types.Dkron/ToggleJob", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *dkronClient) RaftGetConfiguration(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*RaftGetConfigurationResponse, error) {
	out := new(RaftGetConfigurationResponse)
	err := c.cc.Invoke(ctx, "/types.Dkron/RaftGetConfiguration", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *dkronClient) RaftRemovePeerByID(ctx context.Context, in *RaftRemovePeerByIDRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
	out := new(emptypb.Empty)
	err := c.cc.Invoke(ctx, "/types.Dkron/RaftRemovePeerByID", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *dkronClient) GetActiveExecutions(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetActiveExecutionsResponse, error) {
	out := new(GetActiveExecutionsResponse)
	err := c.cc.Invoke(ctx, "/types.Dkron/GetActiveExecutions", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *dkronClient) SetExecution(ctx context.Context, in *Execution, opts ...grpc.CallOption) (*emptypb.Empty, error) {
	out := new(emptypb.Empty)
	err := c.cc.Invoke(ctx, "/types.Dkron/SetExecution", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// DkronServer is the server API for Dkron service.
// All implementations must embed UnimplementedDkronServer
// for forward compatibility
type DkronServer interface {
	GetJob(context.Context, *GetJobRequest) (*GetJobResponse, error)
	ExecutionDone(context.Context, *ExecutionDoneRequest) (*ExecutionDoneResponse, error)
	Leave(context.Context, *emptypb.Empty) (*emptypb.Empty, error)
	SetJob(context.Context, *SetJobRequest) (*SetJobResponse, error)
	DeleteJob(context.Context, *DeleteJobRequest) (*DeleteJobResponse, error)
	RunJob(context.Context, *RunJobRequest) (*RunJobResponse, error)
	ToggleJob(context.Context, *ToggleJobRequest) (*ToggleJobResponse, error)
	RaftGetConfiguration(context.Context, *emptypb.Empty) (*RaftGetConfigurationResponse, error)
	RaftRemovePeerByID(context.Context, *RaftRemovePeerByIDRequest) (*emptypb.Empty, error)
	GetActiveExecutions(context.Context, *emptypb.Empty) (*GetActiveExecutionsResponse, error)
	SetExecution(context.Context, *Execution) (*emptypb.Empty, error)
	mustEmbedUnimplementedDkronServer()
}

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

func (UnimplementedDkronServer) GetJob(context.Context, *GetJobRequest) (*GetJobResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetJob not implemented")
}
func (UnimplementedDkronServer) ExecutionDone(context.Context, *ExecutionDoneRequest) (*ExecutionDoneResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ExecutionDone not implemented")
}
func (UnimplementedDkronServer) Leave(context.Context, *emptypb.Empty) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Leave not implemented")
}
func (UnimplementedDkronServer) SetJob(context.Context, *SetJobRequest) (*SetJobResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method SetJob not implemented")
}
func (UnimplementedDkronServer) DeleteJob(context.Context, *DeleteJobRequest) (*DeleteJobResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method DeleteJob not implemented")
}
func (UnimplementedDkronServer) RunJob(context.Context, *RunJobRequest) (*RunJobResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method RunJob not implemented")
}
func (UnimplementedDkronServer) ToggleJob(context.Context, *ToggleJobRequest) (*ToggleJobResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ToggleJob not implemented")
}
func (UnimplementedDkronServer) RaftGetConfiguration(context.Context, *emptypb.Empty) (*RaftGetConfigurationResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method RaftGetConfiguration not implemented")
}
func (UnimplementedDkronServer) RaftRemovePeerByID(context.Context, *RaftRemovePeerByIDRequest) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method RaftRemovePeerByID not implemented")
}
func (UnimplementedDkronServer) GetActiveExecutions(context.Context, *emptypb.Empty) (*GetActiveExecutionsResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetActiveExecutions not implemented")
}
func (UnimplementedDkronServer) SetExecution(context.Context, *Execution) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method SetExecution not implemented")
}
func (UnimplementedDkronServer) mustEmbedUnimplementedDkronServer() {}

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

func RegisterDkronServer(s grpc.ServiceRegistrar, srv DkronServer) {
	s.RegisterService(&Dkron_ServiceDesc, srv)
}

func _Dkron_GetJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetJobRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(DkronServer).GetJob(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/types.Dkron/GetJob",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(DkronServer).GetJob(ctx, req.(*GetJobRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Dkron_ExecutionDone_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ExecutionDoneRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(DkronServer).ExecutionDone(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/types.Dkron/ExecutionDone",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(DkronServer).ExecutionDone(ctx, req.(*ExecutionDoneRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Dkron_Leave_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(emptypb.Empty)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(DkronServer).Leave(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/types.Dkron/Leave",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(DkronServer).Leave(ctx, req.(*emptypb.Empty))
	}
	return interceptor(ctx, in, info, handler)
}

func _Dkron_SetJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(SetJobRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(DkronServer).SetJob(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/types.Dkron/SetJob",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(DkronServer).SetJob(ctx, req.(*SetJobRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Dkron_DeleteJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DeleteJobRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(DkronServer).DeleteJob(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/types.Dkron/DeleteJob",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(DkronServer).DeleteJob(ctx, req.(*DeleteJobRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Dkron_RunJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(RunJobRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(DkronServer).RunJob(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/types.Dkron/RunJob",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(DkronServer).RunJob(ctx, req.(*RunJobRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Dkron_ToggleJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ToggleJobRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(DkronServer).ToggleJob(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/types.Dkron/ToggleJob",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(DkronServer).ToggleJob(ctx, req.(*ToggleJobRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Dkron_RaftGetConfiguration_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(emptypb.Empty)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(DkronServer).RaftGetConfiguration(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/types.Dkron/RaftGetConfiguration",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(DkronServer).RaftGetConfiguration(ctx, req.(*emptypb.Empty))
	}
	return interceptor(ctx, in, info, handler)
}

func _Dkron_RaftRemovePeerByID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(RaftRemovePeerByIDRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(DkronServer).RaftRemovePeerByID(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/types.Dkron/RaftRemovePeerByID",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(DkronServer).RaftRemovePeerByID(ctx, req.(*RaftRemovePeerByIDRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Dkron_GetActiveExecutions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(emptypb.Empty)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(DkronServer).GetActiveExecutions(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/types.Dkron/GetActiveExecutions",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(DkronServer).GetActiveExecutions(ctx, req.(*emptypb.Empty))
	}
	return interceptor(ctx, in, info, handler)
}

func _Dkron_SetExecution_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(Execution)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(DkronServer).SetExecution(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/types.Dkron/SetExecution",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(DkronServer).SetExecution(ctx, req.(*Execution))
	}
	return interceptor(ctx, in, info, handler)
}

// Dkron_ServiceDesc is the grpc.ServiceDesc for Dkron service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Dkron_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "types.Dkron",
	HandlerType: (*DkronServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetJob",
			Handler:    _Dkron_GetJob_Handler,
		},
		{
			MethodName: "ExecutionDone",
			Handler:    _Dkron_ExecutionDone_Handler,
		},
		{
			MethodName: "Leave",
			Handler:    _Dkron_Leave_Handler,
		},
		{
			MethodName: "SetJob",
			Handler:    _Dkron_SetJob_Handler,
		},
		{
			MethodName: "DeleteJob",
			Handler:    _Dkron_DeleteJob_Handler,
		},
		{
			MethodName: "RunJob",
			Handler:    _Dkron_RunJob_Handler,
		},
		{
			MethodName: "ToggleJob",
			Handler:    _Dkron_ToggleJob_Handler,
		},
		{
			MethodName: "RaftGetConfiguration",
			Handler:    _Dkron_RaftGetConfiguration_Handler,
		},
		{
			MethodName: "RaftRemovePeerByID",
			Handler:    _Dkron_RaftRemovePeerByID_Handler,
		},
		{
			MethodName: "GetActiveExecutions",
			Handler:    _Dkron_GetActiveExecutions_Handler,
		},
		{
			MethodName: "SetExecution",
			Handler:    _Dkron_SetExecution_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "dkron.proto",
}

// AgentClient is the client API for Agent 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 AgentClient interface {
	AgentRun(ctx context.Context, in *AgentRunRequest, opts ...grpc.CallOption) (Agent_AgentRunClient, error)
}

type agentClient struct {
	cc grpc.ClientConnInterface
}

func NewAgentClient(cc grpc.ClientConnInterface) AgentClient {
	return &agentClient{cc}
}

func (c *agentClient) AgentRun(ctx context.Context, in *AgentRunRequest, opts ...grpc.CallOption) (Agent_AgentRunClient, error) {
	stream, err := c.cc.NewStream(ctx, &Agent_ServiceDesc.Streams[0], "/types.Agent/AgentRun", opts...)
	if err != nil {
		return nil, err
	}
	x := &agentAgentRunClient{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 Agent_AgentRunClient interface {
	Recv() (*AgentRunStream, error)
	grpc.ClientStream
}

type agentAgentRunClient struct {
	grpc.ClientStream
}

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

// AgentServer is the server API for Agent service.
// All implementations must embed UnimplementedAgentServer
// for forward compatibility
type AgentServer interface {
	AgentRun(*AgentRunRequest, Agent_AgentRunServer) error
	mustEmbedUnimplementedAgentServer()
}

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

func (UnimplementedAgentServer) AgentRun(*AgentRunRequest, Agent_AgentRunServer) error {
	return status.Errorf(codes.Unimplemented, "method AgentRun not implemented")
}
func (UnimplementedAgentServer) mustEmbedUnimplementedAgentServer() {}

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

func RegisterAgentServer(s grpc.ServiceRegistrar, srv AgentServer) {
	s.RegisterService(&Agent_ServiceDesc, srv)
}

func _Agent_AgentRun_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(AgentRunRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(AgentServer).AgentRun(m, &agentAgentRunServer{stream})
}

type Agent_AgentRunServer interface {
	Send(*AgentRunStream) error
	grpc.ServerStream
}

type agentAgentRunServer struct {
	grpc.ServerStream
}

func (x *agentAgentRunServer) Send(m *AgentRunStream) error {
	return x.ServerStream.SendMsg(m)
}

// Agent_ServiceDesc is the grpc.ServiceDesc for Agent service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Agent_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "types.Agent",
	HandlerType: (*AgentServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "AgentRun",
			Handler:       _Agent_AgentRun_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "dkron.proto",
}
