// 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/datasphere/v1/node_service.proto

package datasphere

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 (
	NodeService_Execute_FullMethodName      = "/yandex.cloud.datasphere.v1.NodeService/Execute"
	NodeService_ExecuteAlias_FullMethodName = "/yandex.cloud.datasphere.v1.NodeService/ExecuteAlias"
)

// NodeServiceClient is the client API for NodeService 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.
//
// A set of methods for managing Node resources.
type NodeServiceClient interface {
	// Executes deployed Node.
	Execute(ctx context.Context, in *NodeExecutionRequest, opts ...grpc.CallOption) (*NodeExecutionResponse, error)
	// Executes NodeAlias requests.
	ExecuteAlias(ctx context.Context, in *AliasExecutionRequest, opts ...grpc.CallOption) (*AliasExecutionResponse, error)
}

type nodeServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewNodeServiceClient(cc grpc.ClientConnInterface) NodeServiceClient {
	return &nodeServiceClient{cc}
}

func (c *nodeServiceClient) Execute(ctx context.Context, in *NodeExecutionRequest, opts ...grpc.CallOption) (*NodeExecutionResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(NodeExecutionResponse)
	err := c.cc.Invoke(ctx, NodeService_Execute_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *nodeServiceClient) ExecuteAlias(ctx context.Context, in *AliasExecutionRequest, opts ...grpc.CallOption) (*AliasExecutionResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(AliasExecutionResponse)
	err := c.cc.Invoke(ctx, NodeService_ExecuteAlias_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// NodeServiceServer is the server API for NodeService service.
// All implementations should embed UnimplementedNodeServiceServer
// for forward compatibility.
//
// A set of methods for managing Node resources.
type NodeServiceServer interface {
	// Executes deployed Node.
	Execute(context.Context, *NodeExecutionRequest) (*NodeExecutionResponse, error)
	// Executes NodeAlias requests.
	ExecuteAlias(context.Context, *AliasExecutionRequest) (*AliasExecutionResponse, error)
}

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

func (UnimplementedNodeServiceServer) Execute(context.Context, *NodeExecutionRequest) (*NodeExecutionResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Execute not implemented")
}
func (UnimplementedNodeServiceServer) ExecuteAlias(context.Context, *AliasExecutionRequest) (*AliasExecutionResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ExecuteAlias not implemented")
}
func (UnimplementedNodeServiceServer) testEmbeddedByValue() {}

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

func RegisterNodeServiceServer(s grpc.ServiceRegistrar, srv NodeServiceServer) {
	// If the following call pancis, it indicates UnimplementedNodeServiceServer 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(&NodeService_ServiceDesc, srv)
}

func _NodeService_Execute_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(NodeExecutionRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(NodeServiceServer).Execute(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: NodeService_Execute_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(NodeServiceServer).Execute(ctx, req.(*NodeExecutionRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _NodeService_ExecuteAlias_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(AliasExecutionRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(NodeServiceServer).ExecuteAlias(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: NodeService_ExecuteAlias_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(NodeServiceServer).ExecuteAlias(ctx, req.(*AliasExecutionRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// NodeService_ServiceDesc is the grpc.ServiceDesc for NodeService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var NodeService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "yandex.cloud.datasphere.v1.NodeService",
	HandlerType: (*NodeServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Execute",
			Handler:    _NodeService_Execute_Handler,
		},
		{
			MethodName: "ExecuteAlias",
			Handler:    _NodeService_ExecuteAlias_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "yandex/cloud/datasphere/v1/node_service.proto",
}
