// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc             v3.21.12
// source: yandex/cloud/loadtesting/agent/v1/job_service.proto

package agent

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.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9

const (
	JobService_ClaimStatus_FullMethodName      = "/yandex.cloud.loadtesting.agent.v1.JobService/ClaimStatus"
	JobService_Get_FullMethodName              = "/yandex.cloud.loadtesting.agent.v1.JobService/Get"
	JobService_GetSignal_FullMethodName        = "/yandex.cloud.loadtesting.agent.v1.JobService/GetSignal"
	JobService_GetTransientFile_FullMethodName = "/yandex.cloud.loadtesting.agent.v1.JobService/GetTransientFile"
)

// JobServiceClient is the client API for JobService 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 JobServiceClient interface {
	// Claims status for the specified job.
	ClaimStatus(ctx context.Context, in *ClaimJobStatusRequest, opts ...grpc.CallOption) (*ClaimJobStatusResponse, error)
	// Returns the job for the specified agent.
	Get(ctx context.Context, in *GetJobRequest, opts ...grpc.CallOption) (*Job, error)
	// Returns the signal for the specified job.
	GetSignal(ctx context.Context, in *JobSignalRequest, opts ...grpc.CallOption) (*JobSignalResponse, error)
	GetTransientFile(ctx context.Context, in *GetJobTransientFile, opts ...grpc.CallOption) (*File, error)
}

type jobServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewJobServiceClient(cc grpc.ClientConnInterface) JobServiceClient {
	return &jobServiceClient{cc}
}

func (c *jobServiceClient) ClaimStatus(ctx context.Context, in *ClaimJobStatusRequest, opts ...grpc.CallOption) (*ClaimJobStatusResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ClaimJobStatusResponse)
	err := c.cc.Invoke(ctx, JobService_ClaimStatus_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *jobServiceClient) Get(ctx context.Context, in *GetJobRequest, opts ...grpc.CallOption) (*Job, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(Job)
	err := c.cc.Invoke(ctx, JobService_Get_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *jobServiceClient) GetSignal(ctx context.Context, in *JobSignalRequest, opts ...grpc.CallOption) (*JobSignalResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(JobSignalResponse)
	err := c.cc.Invoke(ctx, JobService_GetSignal_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *jobServiceClient) GetTransientFile(ctx context.Context, in *GetJobTransientFile, opts ...grpc.CallOption) (*File, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(File)
	err := c.cc.Invoke(ctx, JobService_GetTransientFile_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// JobServiceServer is the server API for JobService service.
// All implementations should embed UnimplementedJobServiceServer
// for forward compatibility.
type JobServiceServer interface {
	// Claims status for the specified job.
	ClaimStatus(context.Context, *ClaimJobStatusRequest) (*ClaimJobStatusResponse, error)
	// Returns the job for the specified agent.
	Get(context.Context, *GetJobRequest) (*Job, error)
	// Returns the signal for the specified job.
	GetSignal(context.Context, *JobSignalRequest) (*JobSignalResponse, error)
	GetTransientFile(context.Context, *GetJobTransientFile) (*File, error)
}

// UnimplementedJobServiceServer should be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedJobServiceServer struct{}

func (UnimplementedJobServiceServer) ClaimStatus(context.Context, *ClaimJobStatusRequest) (*ClaimJobStatusResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ClaimStatus not implemented")
}
func (UnimplementedJobServiceServer) Get(context.Context, *GetJobRequest) (*Job, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Get not implemented")
}
func (UnimplementedJobServiceServer) GetSignal(context.Context, *JobSignalRequest) (*JobSignalResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetSignal not implemented")
}
func (UnimplementedJobServiceServer) GetTransientFile(context.Context, *GetJobTransientFile) (*File, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetTransientFile not implemented")
}
func (UnimplementedJobServiceServer) testEmbeddedByValue() {}

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

func RegisterJobServiceServer(s grpc.ServiceRegistrar, srv JobServiceServer) {
	// If the following call pancis, it indicates UnimplementedJobServiceServer was
	// embedded by pointer and is nil.  This will cause panics if an
	// unimplemented method is ever invoked, so we test this at initialization
	// time to prevent it from happening at runtime later due to I/O.
	if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
		t.testEmbeddedByValue()
	}
	s.RegisterService(&JobService_ServiceDesc, srv)
}

func _JobService_ClaimStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ClaimJobStatusRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(JobServiceServer).ClaimStatus(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: JobService_ClaimStatus_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(JobServiceServer).ClaimStatus(ctx, req.(*ClaimJobStatusRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _JobService_Get_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.(JobServiceServer).Get(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: JobService_Get_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(JobServiceServer).Get(ctx, req.(*GetJobRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _JobService_GetSignal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(JobSignalRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(JobServiceServer).GetSignal(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: JobService_GetSignal_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(JobServiceServer).GetSignal(ctx, req.(*JobSignalRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _JobService_GetTransientFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetJobTransientFile)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(JobServiceServer).GetTransientFile(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: JobService_GetTransientFile_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(JobServiceServer).GetTransientFile(ctx, req.(*GetJobTransientFile))
	}
	return interceptor(ctx, in, info, handler)
}

// JobService_ServiceDesc is the grpc.ServiceDesc for JobService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var JobService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "yandex.cloud.loadtesting.agent.v1.JobService",
	HandlerType: (*JobServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ClaimStatus",
			Handler:    _JobService_ClaimStatus_Handler,
		},
		{
			MethodName: "Get",
			Handler:    _JobService_Get_Handler,
		},
		{
			MethodName: "GetSignal",
			Handler:    _JobService_GetSignal_Handler,
		},
		{
			MethodName: "GetTransientFile",
			Handler:    _JobService_GetTransientFile_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "yandex/cloud/loadtesting/agent/v1/job_service.proto",
}
