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

import docker_controler_pb2 as docker__controler__pb2

GRPC_GENERATED_VERSION = '1.68.1'
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 docker_controler_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 DockerControlerServiceStub(object):
    """DockerControlerService represents the querying service provided by docker controler.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.GetAllContainerNames = channel.unary_unary(
                '/docker_controler.DockerControlerService/GetAllContainerNames',
                request_serializer=docker__controler__pb2.GetAllContainerNamesRequest.SerializeToString,
                response_deserializer=docker__controler__pb2.GetAllContainerNamesResponse.FromString,
                _registered_method=True)
        self.StartContainer = channel.unary_unary(
                '/docker_controler.DockerControlerService/StartContainer',
                request_serializer=docker__controler__pb2.StartContainerRequest.SerializeToString,
                response_deserializer=docker__controler__pb2.StartContainerResponse.FromString,
                _registered_method=True)
        self.StopContainer = channel.unary_unary(
                '/docker_controler.DockerControlerService/StopContainer',
                request_serializer=docker__controler__pb2.StopContainerRequest.SerializeToString,
                response_deserializer=docker__controler__pb2.StopContainerResponse.FromString,
                _registered_method=True)
        self.RestartContainer = channel.unary_unary(
                '/docker_controler.DockerControlerService/RestartContainer',
                request_serializer=docker__controler__pb2.RestartContainerRequest.SerializeToString,
                response_deserializer=docker__controler__pb2.RestartContainerResponse.FromString,
                _registered_method=True)


class DockerControlerServiceServicer(object):
    """DockerControlerService represents the querying service provided by docker controler.
    """

    def GetAllContainerNames(self, request, context):
        """Get all container names.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def StartContainer(self, request, context):
        """Start a container.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def StopContainer(self, request, context):
        """Stop a container.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def RestartContainer(self, request, context):
        """Restart a container.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_DockerControlerServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'GetAllContainerNames': grpc.unary_unary_rpc_method_handler(
                    servicer.GetAllContainerNames,
                    request_deserializer=docker__controler__pb2.GetAllContainerNamesRequest.FromString,
                    response_serializer=docker__controler__pb2.GetAllContainerNamesResponse.SerializeToString,
            ),
            'StartContainer': grpc.unary_unary_rpc_method_handler(
                    servicer.StartContainer,
                    request_deserializer=docker__controler__pb2.StartContainerRequest.FromString,
                    response_serializer=docker__controler__pb2.StartContainerResponse.SerializeToString,
            ),
            'StopContainer': grpc.unary_unary_rpc_method_handler(
                    servicer.StopContainer,
                    request_deserializer=docker__controler__pb2.StopContainerRequest.FromString,
                    response_serializer=docker__controler__pb2.StopContainerResponse.SerializeToString,
            ),
            'RestartContainer': grpc.unary_unary_rpc_method_handler(
                    servicer.RestartContainer,
                    request_deserializer=docker__controler__pb2.RestartContainerRequest.FromString,
                    response_serializer=docker__controler__pb2.RestartContainerResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'docker_controler.DockerControlerService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('docker_controler.DockerControlerService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class DockerControlerService(object):
    """DockerControlerService represents the querying service provided by docker controler.
    """

    @staticmethod
    def GetAllContainerNames(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,
            '/docker_controler.DockerControlerService/GetAllContainerNames',
            docker__controler__pb2.GetAllContainerNamesRequest.SerializeToString,
            docker__controler__pb2.GetAllContainerNamesResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def StartContainer(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,
            '/docker_controler.DockerControlerService/StartContainer',
            docker__controler__pb2.StartContainerRequest.SerializeToString,
            docker__controler__pb2.StartContainerResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def StopContainer(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,
            '/docker_controler.DockerControlerService/StopContainer',
            docker__controler__pb2.StopContainerRequest.SerializeToString,
            docker__controler__pb2.StopContainerResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def RestartContainer(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,
            '/docker_controler.DockerControlerService/RestartContainer',
            docker__controler__pb2.RestartContainerRequest.SerializeToString,
            docker__controler__pb2.RestartContainerResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
