# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
import warnings

from yandex.cloud.baremetal.v1alpha import server_pb2 as yandex_dot_cloud_dot_baremetal_dot_v1alpha_dot_server__pb2
from yandex.cloud.baremetal.v1alpha import server_service_pb2 as yandex_dot_cloud_dot_baremetal_dot_v1alpha_dot_server__service__pb2
from yandex.cloud.operation import operation_pb2 as yandex_dot_cloud_dot_operation_dot_operation__pb2

GRPC_GENERATED_VERSION = '1.70.0'
GRPC_VERSION = grpc.__version__
_version_not_supported = False

try:
    from grpc._utilities import first_version_is_lower
    _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
except ImportError:
    _version_not_supported = True

if _version_not_supported:
    raise RuntimeError(
        f'The grpc package installed is at version {GRPC_VERSION},'
        + f' but the generated code in yandex/cloud/baremetal/v1alpha/server_service_pb2_grpc.py depends on'
        + f' grpcio>={GRPC_GENERATED_VERSION}.'
        + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
        + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
    )


class ServerServiceStub(object):
    """A set of methods for managing Server resources.
    """

    def __init__(self, channel):
        """Constructor.

        Args:
            channel: A grpc.Channel.
        """
        self.Get = channel.unary_unary(
                '/yandex.cloud.baremetal.v1alpha.ServerService/Get',
                request_serializer=yandex_dot_cloud_dot_baremetal_dot_v1alpha_dot_server__service__pb2.GetServerRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_baremetal_dot_v1alpha_dot_server__pb2.Server.FromString,
                _registered_method=True)
        self.List = channel.unary_unary(
                '/yandex.cloud.baremetal.v1alpha.ServerService/List',
                request_serializer=yandex_dot_cloud_dot_baremetal_dot_v1alpha_dot_server__service__pb2.ListServerRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_baremetal_dot_v1alpha_dot_server__service__pb2.ListServerResponse.FromString,
                _registered_method=True)
        self.Create = channel.unary_unary(
                '/yandex.cloud.baremetal.v1alpha.ServerService/Create',
                request_serializer=yandex_dot_cloud_dot_baremetal_dot_v1alpha_dot_server__service__pb2.CreateServerRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
                _registered_method=True)
        self.BatchCreate = channel.unary_unary(
                '/yandex.cloud.baremetal.v1alpha.ServerService/BatchCreate',
                request_serializer=yandex_dot_cloud_dot_baremetal_dot_v1alpha_dot_server__service__pb2.BatchCreateServersRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
                _registered_method=True)
        self.Update = channel.unary_unary(
                '/yandex.cloud.baremetal.v1alpha.ServerService/Update',
                request_serializer=yandex_dot_cloud_dot_baremetal_dot_v1alpha_dot_server__service__pb2.UpdateServerRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
                _registered_method=True)
        self.PowerOff = channel.unary_unary(
                '/yandex.cloud.baremetal.v1alpha.ServerService/PowerOff',
                request_serializer=yandex_dot_cloud_dot_baremetal_dot_v1alpha_dot_server__service__pb2.PowerOffServerRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
                _registered_method=True)
        self.PowerOn = channel.unary_unary(
                '/yandex.cloud.baremetal.v1alpha.ServerService/PowerOn',
                request_serializer=yandex_dot_cloud_dot_baremetal_dot_v1alpha_dot_server__service__pb2.PowerOnServerRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
                _registered_method=True)
        self.Reboot = channel.unary_unary(
                '/yandex.cloud.baremetal.v1alpha.ServerService/Reboot',
                request_serializer=yandex_dot_cloud_dot_baremetal_dot_v1alpha_dot_server__service__pb2.RebootServerRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
                _registered_method=True)
        self.Reinstall = channel.unary_unary(
                '/yandex.cloud.baremetal.v1alpha.ServerService/Reinstall',
                request_serializer=yandex_dot_cloud_dot_baremetal_dot_v1alpha_dot_server__service__pb2.ReinstallServerRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
                _registered_method=True)
        self.StartProlongation = channel.unary_unary(
                '/yandex.cloud.baremetal.v1alpha.ServerService/StartProlongation',
                request_serializer=yandex_dot_cloud_dot_baremetal_dot_v1alpha_dot_server__service__pb2.StartProlongationRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
                _registered_method=True)
        self.StopProlongation = channel.unary_unary(
                '/yandex.cloud.baremetal.v1alpha.ServerService/StopProlongation',
                request_serializer=yandex_dot_cloud_dot_baremetal_dot_v1alpha_dot_server__service__pb2.StopProlongationRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
                _registered_method=True)
        self.ListOperations = channel.unary_unary(
                '/yandex.cloud.baremetal.v1alpha.ServerService/ListOperations',
                request_serializer=yandex_dot_cloud_dot_baremetal_dot_v1alpha_dot_server__service__pb2.ListServerOperationsRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_baremetal_dot_v1alpha_dot_server__service__pb2.ListServerOperationsResponse.FromString,
                _registered_method=True)


class ServerServiceServicer(object):
    """A set of methods for managing Server resources.
    """

    def Get(self, request, context):
        """Returns the specific Server resource.

        To get the list of available Server resources, make a [List] request.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def List(self, request, context):
        """Retrieves the list of Server resources in the specified folder.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Create(self, request, context):
        """Creates a server in the specified folder.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def BatchCreate(self, request, context):
        """Creates multiple servers in the specified folder.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Update(self, request, context):
        """Updates the specified server.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def PowerOff(self, request, context):
        """Powers off the specified server.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def PowerOn(self, request, context):
        """Powers on the specified server.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Reboot(self, request, context):
        """Reboots the specified server.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Reinstall(self, request, context):
        """Reinstalls the specified server.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def StartProlongation(self, request, context):
        """Starts prolongation of the specified server.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def StopProlongation(self, request, context):
        """Stops prolongation of the specified server.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ListOperations(self, request, context):
        """Lists operations for the specified server.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_ServerServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'Get': grpc.unary_unary_rpc_method_handler(
                    servicer.Get,
                    request_deserializer=yandex_dot_cloud_dot_baremetal_dot_v1alpha_dot_server__service__pb2.GetServerRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_baremetal_dot_v1alpha_dot_server__pb2.Server.SerializeToString,
            ),
            'List': grpc.unary_unary_rpc_method_handler(
                    servicer.List,
                    request_deserializer=yandex_dot_cloud_dot_baremetal_dot_v1alpha_dot_server__service__pb2.ListServerRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_baremetal_dot_v1alpha_dot_server__service__pb2.ListServerResponse.SerializeToString,
            ),
            'Create': grpc.unary_unary_rpc_method_handler(
                    servicer.Create,
                    request_deserializer=yandex_dot_cloud_dot_baremetal_dot_v1alpha_dot_server__service__pb2.CreateServerRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.SerializeToString,
            ),
            'BatchCreate': grpc.unary_unary_rpc_method_handler(
                    servicer.BatchCreate,
                    request_deserializer=yandex_dot_cloud_dot_baremetal_dot_v1alpha_dot_server__service__pb2.BatchCreateServersRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.SerializeToString,
            ),
            'Update': grpc.unary_unary_rpc_method_handler(
                    servicer.Update,
                    request_deserializer=yandex_dot_cloud_dot_baremetal_dot_v1alpha_dot_server__service__pb2.UpdateServerRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.SerializeToString,
            ),
            'PowerOff': grpc.unary_unary_rpc_method_handler(
                    servicer.PowerOff,
                    request_deserializer=yandex_dot_cloud_dot_baremetal_dot_v1alpha_dot_server__service__pb2.PowerOffServerRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.SerializeToString,
            ),
            'PowerOn': grpc.unary_unary_rpc_method_handler(
                    servicer.PowerOn,
                    request_deserializer=yandex_dot_cloud_dot_baremetal_dot_v1alpha_dot_server__service__pb2.PowerOnServerRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.SerializeToString,
            ),
            'Reboot': grpc.unary_unary_rpc_method_handler(
                    servicer.Reboot,
                    request_deserializer=yandex_dot_cloud_dot_baremetal_dot_v1alpha_dot_server__service__pb2.RebootServerRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.SerializeToString,
            ),
            'Reinstall': grpc.unary_unary_rpc_method_handler(
                    servicer.Reinstall,
                    request_deserializer=yandex_dot_cloud_dot_baremetal_dot_v1alpha_dot_server__service__pb2.ReinstallServerRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.SerializeToString,
            ),
            'StartProlongation': grpc.unary_unary_rpc_method_handler(
                    servicer.StartProlongation,
                    request_deserializer=yandex_dot_cloud_dot_baremetal_dot_v1alpha_dot_server__service__pb2.StartProlongationRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.SerializeToString,
            ),
            'StopProlongation': grpc.unary_unary_rpc_method_handler(
                    servicer.StopProlongation,
                    request_deserializer=yandex_dot_cloud_dot_baremetal_dot_v1alpha_dot_server__service__pb2.StopProlongationRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.SerializeToString,
            ),
            'ListOperations': grpc.unary_unary_rpc_method_handler(
                    servicer.ListOperations,
                    request_deserializer=yandex_dot_cloud_dot_baremetal_dot_v1alpha_dot_server__service__pb2.ListServerOperationsRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_baremetal_dot_v1alpha_dot_server__service__pb2.ListServerOperationsResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'yandex.cloud.baremetal.v1alpha.ServerService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('yandex.cloud.baremetal.v1alpha.ServerService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class ServerService(object):
    """A set of methods for managing Server resources.
    """

    @staticmethod
    def Get(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/yandex.cloud.baremetal.v1alpha.ServerService/Get',
            yandex_dot_cloud_dot_baremetal_dot_v1alpha_dot_server__service__pb2.GetServerRequest.SerializeToString,
            yandex_dot_cloud_dot_baremetal_dot_v1alpha_dot_server__pb2.Server.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def List(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/yandex.cloud.baremetal.v1alpha.ServerService/List',
            yandex_dot_cloud_dot_baremetal_dot_v1alpha_dot_server__service__pb2.ListServerRequest.SerializeToString,
            yandex_dot_cloud_dot_baremetal_dot_v1alpha_dot_server__service__pb2.ListServerResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Create(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/yandex.cloud.baremetal.v1alpha.ServerService/Create',
            yandex_dot_cloud_dot_baremetal_dot_v1alpha_dot_server__service__pb2.CreateServerRequest.SerializeToString,
            yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def BatchCreate(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/yandex.cloud.baremetal.v1alpha.ServerService/BatchCreate',
            yandex_dot_cloud_dot_baremetal_dot_v1alpha_dot_server__service__pb2.BatchCreateServersRequest.SerializeToString,
            yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Update(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/yandex.cloud.baremetal.v1alpha.ServerService/Update',
            yandex_dot_cloud_dot_baremetal_dot_v1alpha_dot_server__service__pb2.UpdateServerRequest.SerializeToString,
            yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def PowerOff(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/yandex.cloud.baremetal.v1alpha.ServerService/PowerOff',
            yandex_dot_cloud_dot_baremetal_dot_v1alpha_dot_server__service__pb2.PowerOffServerRequest.SerializeToString,
            yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def PowerOn(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/yandex.cloud.baremetal.v1alpha.ServerService/PowerOn',
            yandex_dot_cloud_dot_baremetal_dot_v1alpha_dot_server__service__pb2.PowerOnServerRequest.SerializeToString,
            yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Reboot(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/yandex.cloud.baremetal.v1alpha.ServerService/Reboot',
            yandex_dot_cloud_dot_baremetal_dot_v1alpha_dot_server__service__pb2.RebootServerRequest.SerializeToString,
            yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Reinstall(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/yandex.cloud.baremetal.v1alpha.ServerService/Reinstall',
            yandex_dot_cloud_dot_baremetal_dot_v1alpha_dot_server__service__pb2.ReinstallServerRequest.SerializeToString,
            yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def StartProlongation(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/yandex.cloud.baremetal.v1alpha.ServerService/StartProlongation',
            yandex_dot_cloud_dot_baremetal_dot_v1alpha_dot_server__service__pb2.StartProlongationRequest.SerializeToString,
            yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def StopProlongation(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/yandex.cloud.baremetal.v1alpha.ServerService/StopProlongation',
            yandex_dot_cloud_dot_baremetal_dot_v1alpha_dot_server__service__pb2.StopProlongationRequest.SerializeToString,
            yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ListOperations(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/yandex.cloud.baremetal.v1alpha.ServerService/ListOperations',
            yandex_dot_cloud_dot_baremetal_dot_v1alpha_dot_server__service__pb2.ListServerOperationsRequest.SerializeToString,
            yandex_dot_cloud_dot_baremetal_dot_v1alpha_dot_server__service__pb2.ListServerOperationsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
