// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc             v5.26.1
// source: components/network/network.proto

package network

import (
	context "context"
	jobmodels "github.com/aarthikrao/timeMachine/models/jobmodels"
	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.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7

// JobStoreClient is the client API for JobStore 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 JobStoreClient interface {
	// GetJob fetches the job from a time machine instance
	GetJob(ctx context.Context, in *jobmodels.JobFetchDetails, opts ...grpc.CallOption) (*jobmodels.JobCreationDetails, error)
	// SetJob adds the job to a time machine instance
	SetJob(ctx context.Context, in *jobmodels.JobCreationDetails, opts ...grpc.CallOption) (*jobmodels.JobCreationDetails, error)
	// DeleteJob will remove the job from time machine instance
	DeleteJob(ctx context.Context, in *jobmodels.JobFetchDetails, opts ...grpc.CallOption) (*jobmodels.Empty, error)
	// ReplicateSetJob is the same as SetJob. It is called only by the leader to replicate the job on the follower
	ReplicateSetJob(ctx context.Context, in *jobmodels.JobCreationDetails, opts ...grpc.CallOption) (*jobmodels.JobCreationDetails, error)
	// ReplicateDeleteJob is the same as DeleteJobJob. It is called only by the leader to replicate the job on the follower
	ReplicateDeleteJob(ctx context.Context, in *jobmodels.JobFetchDetails, opts ...grpc.CallOption) (*jobmodels.Empty, error)
	// Used only to make sure the node is servicable
	HealthCheck(ctx context.Context, in *jobmodels.HealthRequest, opts ...grpc.CallOption) (*jobmodels.HealthResponse, error)
}

type jobStoreClient struct {
	cc grpc.ClientConnInterface
}

func NewJobStoreClient(cc grpc.ClientConnInterface) JobStoreClient {
	return &jobStoreClient{cc}
}

func (c *jobStoreClient) GetJob(ctx context.Context, in *jobmodels.JobFetchDetails, opts ...grpc.CallOption) (*jobmodels.JobCreationDetails, error) {
	out := new(jobmodels.JobCreationDetails)
	err := c.cc.Invoke(ctx, "/network.JobStore/GetJob", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *jobStoreClient) SetJob(ctx context.Context, in *jobmodels.JobCreationDetails, opts ...grpc.CallOption) (*jobmodels.JobCreationDetails, error) {
	out := new(jobmodels.JobCreationDetails)
	err := c.cc.Invoke(ctx, "/network.JobStore/SetJob", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *jobStoreClient) DeleteJob(ctx context.Context, in *jobmodels.JobFetchDetails, opts ...grpc.CallOption) (*jobmodels.Empty, error) {
	out := new(jobmodels.Empty)
	err := c.cc.Invoke(ctx, "/network.JobStore/DeleteJob", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *jobStoreClient) ReplicateSetJob(ctx context.Context, in *jobmodels.JobCreationDetails, opts ...grpc.CallOption) (*jobmodels.JobCreationDetails, error) {
	out := new(jobmodels.JobCreationDetails)
	err := c.cc.Invoke(ctx, "/network.JobStore/ReplicateSetJob", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *jobStoreClient) ReplicateDeleteJob(ctx context.Context, in *jobmodels.JobFetchDetails, opts ...grpc.CallOption) (*jobmodels.Empty, error) {
	out := new(jobmodels.Empty)
	err := c.cc.Invoke(ctx, "/network.JobStore/ReplicateDeleteJob", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *jobStoreClient) HealthCheck(ctx context.Context, in *jobmodels.HealthRequest, opts ...grpc.CallOption) (*jobmodels.HealthResponse, error) {
	out := new(jobmodels.HealthResponse)
	err := c.cc.Invoke(ctx, "/network.JobStore/HealthCheck", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// JobStoreServer is the server API for JobStore service.
// All implementations must embed UnimplementedJobStoreServer
// for forward compatibility
type JobStoreServer interface {
	// GetJob fetches the job from a time machine instance
	GetJob(context.Context, *jobmodels.JobFetchDetails) (*jobmodels.JobCreationDetails, error)
	// SetJob adds the job to a time machine instance
	SetJob(context.Context, *jobmodels.JobCreationDetails) (*jobmodels.JobCreationDetails, error)
	// DeleteJob will remove the job from time machine instance
	DeleteJob(context.Context, *jobmodels.JobFetchDetails) (*jobmodels.Empty, error)
	// ReplicateSetJob is the same as SetJob. It is called only by the leader to replicate the job on the follower
	ReplicateSetJob(context.Context, *jobmodels.JobCreationDetails) (*jobmodels.JobCreationDetails, error)
	// ReplicateDeleteJob is the same as DeleteJobJob. It is called only by the leader to replicate the job on the follower
	ReplicateDeleteJob(context.Context, *jobmodels.JobFetchDetails) (*jobmodels.Empty, error)
	// Used only to make sure the node is servicable
	HealthCheck(context.Context, *jobmodels.HealthRequest) (*jobmodels.HealthResponse, error)
	mustEmbedUnimplementedJobStoreServer()
}

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

func (UnimplementedJobStoreServer) GetJob(context.Context, *jobmodels.JobFetchDetails) (*jobmodels.JobCreationDetails, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetJob not implemented")
}
func (UnimplementedJobStoreServer) SetJob(context.Context, *jobmodels.JobCreationDetails) (*jobmodels.JobCreationDetails, error) {
	return nil, status.Errorf(codes.Unimplemented, "method SetJob not implemented")
}
func (UnimplementedJobStoreServer) DeleteJob(context.Context, *jobmodels.JobFetchDetails) (*jobmodels.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method DeleteJob not implemented")
}
func (UnimplementedJobStoreServer) ReplicateSetJob(context.Context, *jobmodels.JobCreationDetails) (*jobmodels.JobCreationDetails, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ReplicateSetJob not implemented")
}
func (UnimplementedJobStoreServer) ReplicateDeleteJob(context.Context, *jobmodels.JobFetchDetails) (*jobmodels.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ReplicateDeleteJob not implemented")
}
func (UnimplementedJobStoreServer) HealthCheck(context.Context, *jobmodels.HealthRequest) (*jobmodels.HealthResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method HealthCheck not implemented")
}
func (UnimplementedJobStoreServer) mustEmbedUnimplementedJobStoreServer() {}

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

func RegisterJobStoreServer(s grpc.ServiceRegistrar, srv JobStoreServer) {
	s.RegisterService(&JobStore_ServiceDesc, srv)
}

func _JobStore_GetJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(jobmodels.JobFetchDetails)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(JobStoreServer).GetJob(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/network.JobStore/GetJob",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(JobStoreServer).GetJob(ctx, req.(*jobmodels.JobFetchDetails))
	}
	return interceptor(ctx, in, info, handler)
}

func _JobStore_SetJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(jobmodels.JobCreationDetails)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(JobStoreServer).SetJob(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/network.JobStore/SetJob",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(JobStoreServer).SetJob(ctx, req.(*jobmodels.JobCreationDetails))
	}
	return interceptor(ctx, in, info, handler)
}

func _JobStore_DeleteJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(jobmodels.JobFetchDetails)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(JobStoreServer).DeleteJob(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/network.JobStore/DeleteJob",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(JobStoreServer).DeleteJob(ctx, req.(*jobmodels.JobFetchDetails))
	}
	return interceptor(ctx, in, info, handler)
}

func _JobStore_ReplicateSetJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(jobmodels.JobCreationDetails)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(JobStoreServer).ReplicateSetJob(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/network.JobStore/ReplicateSetJob",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(JobStoreServer).ReplicateSetJob(ctx, req.(*jobmodels.JobCreationDetails))
	}
	return interceptor(ctx, in, info, handler)
}

func _JobStore_ReplicateDeleteJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(jobmodels.JobFetchDetails)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(JobStoreServer).ReplicateDeleteJob(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/network.JobStore/ReplicateDeleteJob",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(JobStoreServer).ReplicateDeleteJob(ctx, req.(*jobmodels.JobFetchDetails))
	}
	return interceptor(ctx, in, info, handler)
}

func _JobStore_HealthCheck_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(jobmodels.HealthRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(JobStoreServer).HealthCheck(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/network.JobStore/HealthCheck",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(JobStoreServer).HealthCheck(ctx, req.(*jobmodels.HealthRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// JobStore_ServiceDesc is the grpc.ServiceDesc for JobStore service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var JobStore_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "network.JobStore",
	HandlerType: (*JobStoreServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetJob",
			Handler:    _JobStore_GetJob_Handler,
		},
		{
			MethodName: "SetJob",
			Handler:    _JobStore_SetJob_Handler,
		},
		{
			MethodName: "DeleteJob",
			Handler:    _JobStore_DeleteJob_Handler,
		},
		{
			MethodName: "ReplicateSetJob",
			Handler:    _JobStore_ReplicateSetJob_Handler,
		},
		{
			MethodName: "ReplicateDeleteJob",
			Handler:    _JobStore_ReplicateDeleteJob_Handler,
		},
		{
			MethodName: "HealthCheck",
			Handler:    _JobStore_HealthCheck_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "components/network/network.proto",
}
