// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.1
// - protoc             v3.21.12
// source: yandex/cloud/serverless/workflows/v1/execution_service.proto

package workflows

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 (
	ExecutionService_Start_FullMethodName      = "/yandex.cloud.serverless.workflows.v1.ExecutionService/Start"
	ExecutionService_Stop_FullMethodName       = "/yandex.cloud.serverless.workflows.v1.ExecutionService/Stop"
	ExecutionService_Terminate_FullMethodName  = "/yandex.cloud.serverless.workflows.v1.ExecutionService/Terminate"
	ExecutionService_Get_FullMethodName        = "/yandex.cloud.serverless.workflows.v1.ExecutionService/Get"
	ExecutionService_GetHistory_FullMethodName = "/yandex.cloud.serverless.workflows.v1.ExecutionService/GetHistory"
	ExecutionService_List_FullMethodName       = "/yandex.cloud.serverless.workflows.v1.ExecutionService/List"
)

// ExecutionServiceClient is the client API for ExecutionService 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.
//
// Set of methods for managing Workflows Executions.
type ExecutionServiceClient interface {
	// Starts new Workflow execution.
	Start(ctx context.Context, in *StartExecutionRequest, opts ...grpc.CallOption) (*StartExecutionResponse, error)
	// Stops specified Workflow execution.
	Stop(ctx context.Context, in *StopExecutionRequest, opts ...grpc.CallOption) (*StopExecutionResponse, error)
	// Terminates specified Workflow execution.
	Terminate(ctx context.Context, in *TerminateExecutionRequest, opts ...grpc.CallOption) (*TerminateExecutionResponse, error)
	// Retrieves specified Workflow execution.
	Get(ctx context.Context, in *GetExecutionRequest, opts ...grpc.CallOption) (*GetExecutionResponse, error)
	// Retrieves detailed history of specified Workflow execution.
	GetHistory(ctx context.Context, in *GetExecutionHistoryRequest, opts ...grpc.CallOption) (*GetExecutionHistoryResponse, error)
	// Retrieves list of Workflow executions.
	List(ctx context.Context, in *ListExecutionsRequest, opts ...grpc.CallOption) (*ListExecutionsResponse, error)
}

type executionServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewExecutionServiceClient(cc grpc.ClientConnInterface) ExecutionServiceClient {
	return &executionServiceClient{cc}
}

func (c *executionServiceClient) Start(ctx context.Context, in *StartExecutionRequest, opts ...grpc.CallOption) (*StartExecutionResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(StartExecutionResponse)
	err := c.cc.Invoke(ctx, ExecutionService_Start_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *executionServiceClient) Stop(ctx context.Context, in *StopExecutionRequest, opts ...grpc.CallOption) (*StopExecutionResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(StopExecutionResponse)
	err := c.cc.Invoke(ctx, ExecutionService_Stop_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *executionServiceClient) Terminate(ctx context.Context, in *TerminateExecutionRequest, opts ...grpc.CallOption) (*TerminateExecutionResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(TerminateExecutionResponse)
	err := c.cc.Invoke(ctx, ExecutionService_Terminate_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

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

func (c *executionServiceClient) GetHistory(ctx context.Context, in *GetExecutionHistoryRequest, opts ...grpc.CallOption) (*GetExecutionHistoryResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(GetExecutionHistoryResponse)
	err := c.cc.Invoke(ctx, ExecutionService_GetHistory_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *executionServiceClient) List(ctx context.Context, in *ListExecutionsRequest, opts ...grpc.CallOption) (*ListExecutionsResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ListExecutionsResponse)
	err := c.cc.Invoke(ctx, ExecutionService_List_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// ExecutionServiceServer is the server API for ExecutionService service.
// All implementations should embed UnimplementedExecutionServiceServer
// for forward compatibility.
//
// Set of methods for managing Workflows Executions.
type ExecutionServiceServer interface {
	// Starts new Workflow execution.
	Start(context.Context, *StartExecutionRequest) (*StartExecutionResponse, error)
	// Stops specified Workflow execution.
	Stop(context.Context, *StopExecutionRequest) (*StopExecutionResponse, error)
	// Terminates specified Workflow execution.
	Terminate(context.Context, *TerminateExecutionRequest) (*TerminateExecutionResponse, error)
	// Retrieves specified Workflow execution.
	Get(context.Context, *GetExecutionRequest) (*GetExecutionResponse, error)
	// Retrieves detailed history of specified Workflow execution.
	GetHistory(context.Context, *GetExecutionHistoryRequest) (*GetExecutionHistoryResponse, error)
	// Retrieves list of Workflow executions.
	List(context.Context, *ListExecutionsRequest) (*ListExecutionsResponse, error)
}

// UnimplementedExecutionServiceServer 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 UnimplementedExecutionServiceServer struct{}

func (UnimplementedExecutionServiceServer) Start(context.Context, *StartExecutionRequest) (*StartExecutionResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method Start not implemented")
}
func (UnimplementedExecutionServiceServer) Stop(context.Context, *StopExecutionRequest) (*StopExecutionResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method Stop not implemented")
}
func (UnimplementedExecutionServiceServer) Terminate(context.Context, *TerminateExecutionRequest) (*TerminateExecutionResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method Terminate not implemented")
}
func (UnimplementedExecutionServiceServer) Get(context.Context, *GetExecutionRequest) (*GetExecutionResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method Get not implemented")
}
func (UnimplementedExecutionServiceServer) GetHistory(context.Context, *GetExecutionHistoryRequest) (*GetExecutionHistoryResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method GetHistory not implemented")
}
func (UnimplementedExecutionServiceServer) List(context.Context, *ListExecutionsRequest) (*ListExecutionsResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method List not implemented")
}
func (UnimplementedExecutionServiceServer) testEmbeddedByValue() {}

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

func RegisterExecutionServiceServer(s grpc.ServiceRegistrar, srv ExecutionServiceServer) {
	// If the following call panics, it indicates UnimplementedExecutionServiceServer 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(&ExecutionService_ServiceDesc, srv)
}

func _ExecutionService_Start_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(StartExecutionRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ExecutionServiceServer).Start(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: ExecutionService_Start_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ExecutionServiceServer).Start(ctx, req.(*StartExecutionRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _ExecutionService_Stop_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(StopExecutionRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ExecutionServiceServer).Stop(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: ExecutionService_Stop_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ExecutionServiceServer).Stop(ctx, req.(*StopExecutionRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _ExecutionService_Terminate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(TerminateExecutionRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ExecutionServiceServer).Terminate(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: ExecutionService_Terminate_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ExecutionServiceServer).Terminate(ctx, req.(*TerminateExecutionRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _ExecutionService_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetExecutionRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ExecutionServiceServer).Get(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: ExecutionService_Get_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ExecutionServiceServer).Get(ctx, req.(*GetExecutionRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _ExecutionService_GetHistory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetExecutionHistoryRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ExecutionServiceServer).GetHistory(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: ExecutionService_GetHistory_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ExecutionServiceServer).GetHistory(ctx, req.(*GetExecutionHistoryRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _ExecutionService_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ListExecutionsRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ExecutionServiceServer).List(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: ExecutionService_List_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ExecutionServiceServer).List(ctx, req.(*ListExecutionsRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// ExecutionService_ServiceDesc is the grpc.ServiceDesc for ExecutionService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var ExecutionService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "yandex.cloud.serverless.workflows.v1.ExecutionService",
	HandlerType: (*ExecutionServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Start",
			Handler:    _ExecutionService_Start_Handler,
		},
		{
			MethodName: "Stop",
			Handler:    _ExecutionService_Stop_Handler,
		},
		{
			MethodName: "Terminate",
			Handler:    _ExecutionService_Terminate_Handler,
		},
		{
			MethodName: "Get",
			Handler:    _ExecutionService_Get_Handler,
		},
		{
			MethodName: "GetHistory",
			Handler:    _ExecutionService_GetHistory_Handler,
		},
		{
			MethodName: "List",
			Handler:    _ExecutionService_List_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "yandex/cloud/serverless/workflows/v1/execution_service.proto",
}
