// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.4.0
// - protoc             (unknown)
// source: executor/v1/services.proto

package executorv1

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.62.0 or later.
const _ = grpc.SupportPackageIsVersion8

const (
	ExecutorService_Submit_FullMethodName        = "/executor.v1.ExecutorService/Submit"
	ExecutorService_Abort_FullMethodName         = "/executor.v1.ExecutorService/Abort"
	ExecutorService_QueryRunnings_FullMethodName = "/executor.v1.ExecutorService/QueryRunnings"
)

// ExecutorServiceClient is the client API for ExecutorService 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 ExecutorServiceClient interface {
	Submit(ctx context.Context, in *SubmitRequest, opts ...grpc.CallOption) (*SubmitResponse, error)
	Abort(ctx context.Context, in *AbortRequest, opts ...grpc.CallOption) (*AbortResponse, error)
	QueryRunnings(ctx context.Context, in *QueryRunningsRequest, opts ...grpc.CallOption) (*QueryRunningsResponse, error)
}

type executorServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewExecutorServiceClient(cc grpc.ClientConnInterface) ExecutorServiceClient {
	return &executorServiceClient{cc}
}

func (c *executorServiceClient) Submit(ctx context.Context, in *SubmitRequest, opts ...grpc.CallOption) (*SubmitResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(SubmitResponse)
	err := c.cc.Invoke(ctx, ExecutorService_Submit_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *executorServiceClient) Abort(ctx context.Context, in *AbortRequest, opts ...grpc.CallOption) (*AbortResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(AbortResponse)
	err := c.cc.Invoke(ctx, ExecutorService_Abort_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *executorServiceClient) QueryRunnings(ctx context.Context, in *QueryRunningsRequest, opts ...grpc.CallOption) (*QueryRunningsResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(QueryRunningsResponse)
	err := c.cc.Invoke(ctx, ExecutorService_QueryRunnings_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// ExecutorServiceServer is the server API for ExecutorService service.
// All implementations should embed UnimplementedExecutorServiceServer
// for forward compatibility
type ExecutorServiceServer interface {
	Submit(context.Context, *SubmitRequest) (*SubmitResponse, error)
	Abort(context.Context, *AbortRequest) (*AbortResponse, error)
	QueryRunnings(context.Context, *QueryRunningsRequest) (*QueryRunningsResponse, error)
}

// UnimplementedExecutorServiceServer should be embedded to have forward compatible implementations.
type UnimplementedExecutorServiceServer struct {
}

func (UnimplementedExecutorServiceServer) Submit(context.Context, *SubmitRequest) (*SubmitResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Submit not implemented")
}
func (UnimplementedExecutorServiceServer) Abort(context.Context, *AbortRequest) (*AbortResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Abort not implemented")
}
func (UnimplementedExecutorServiceServer) QueryRunnings(context.Context, *QueryRunningsRequest) (*QueryRunningsResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method QueryRunnings not implemented")
}

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

func RegisterExecutorServiceServer(s grpc.ServiceRegistrar, srv ExecutorServiceServer) {
	s.RegisterService(&ExecutorService_ServiceDesc, srv)
}

func _ExecutorService_Submit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(SubmitRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ExecutorServiceServer).Submit(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: ExecutorService_Submit_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ExecutorServiceServer).Submit(ctx, req.(*SubmitRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _ExecutorService_Abort_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(AbortRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ExecutorServiceServer).Abort(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: ExecutorService_Abort_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ExecutorServiceServer).Abort(ctx, req.(*AbortRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _ExecutorService_QueryRunnings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(QueryRunningsRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ExecutorServiceServer).QueryRunnings(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: ExecutorService_QueryRunnings_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ExecutorServiceServer).QueryRunnings(ctx, req.(*QueryRunningsRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// ExecutorService_ServiceDesc is the grpc.ServiceDesc for ExecutorService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var ExecutorService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "executor.v1.ExecutorService",
	HandlerType: (*ExecutorServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Submit",
			Handler:    _ExecutorService_Submit_Handler,
		},
		{
			MethodName: "Abort",
			Handler:    _ExecutorService_Abort_Handler,
		},
		{
			MethodName: "QueryRunnings",
			Handler:    _ExecutorService_QueryRunnings_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "executor/v1/services.proto",
}
