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

from . import mt5_term_api_connection_pb2 as mt5__term__api__connection__pb2


class ConnectionStub(object):
    """-------------------------------------!!!! MT5 CONNECTION SERVICE START !!!!!!!---------------------------------------

    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.ConnectEx = channel.unary_unary(
                '/mt5_term_api.Connection/ConnectEx',
                request_serializer=mt5__term__api__connection__pb2.ConnectExRequest.SerializeToString,
                response_deserializer=mt5__term__api__connection__pb2.ConnectExReply.FromString,
                )
        self.Connect = channel.unary_unary(
                '/mt5_term_api.Connection/Connect',
                request_serializer=mt5__term__api__connection__pb2.ConnectRequest.SerializeToString,
                response_deserializer=mt5__term__api__connection__pb2.ConnectReply.FromString,
                )
        self.ConnectProxy = channel.unary_unary(
                '/mt5_term_api.Connection/ConnectProxy',
                request_serializer=mt5__term__api__connection__pb2.ConnectProxyRequest.SerializeToString,
                response_deserializer=mt5__term__api__connection__pb2.ConnectProxyReply.FromString,
                )
        self.CheckConnect = channel.unary_unary(
                '/mt5_term_api.Connection/CheckConnect',
                request_serializer=mt5__term__api__connection__pb2.CheckConnectRequest.SerializeToString,
                response_deserializer=mt5__term__api__connection__pb2.CheckConnectReply.FromString,
                )
        self.Disconnect = channel.unary_unary(
                '/mt5_term_api.Connection/Disconnect',
                request_serializer=mt5__term__api__connection__pb2.DisconnectRequest.SerializeToString,
                response_deserializer=mt5__term__api__connection__pb2.DisconnectReply.FromString,
                )
        self.Reconnect = channel.unary_unary(
                '/mt5_term_api.Connection/Reconnect',
                request_serializer=mt5__term__api__connection__pb2.ReconnectRequest.SerializeToString,
                response_deserializer=mt5__term__api__connection__pb2.ReconnectReply.FromString,
                )


class ConnectionServicer(object):
    """-------------------------------------!!!! MT5 CONNECTION SERVICE START !!!!!!!---------------------------------------

    """

    def ConnectEx(self, request, context):
        """Creates terminal connection to the MT5 server by MT cluster name, waits for connection and returns Guid of it 
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Connect(self, request, context):
        """Creates terminal connection to the MT5 server and returns Guid of it 
        [DefaultValues]
        {
        "user": "21455",
        "password": "1nJeS+Ae",
        "host": "95.217.147.61",
        "port": "443",
        "baseChartSymbol": "EURUSD",  
        "waitForTerminalIsAlive": "true"
        }  
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ConnectProxy(self, request, context):
        """Connect to account with user, password, host, port.
        [DefaultValues] 
        { 
        "user": "21455", 
        "password": "1nJeS+Ae", 
        "host": "95.217.147.61", 
        "port": "443", 
        "proxyUser": "ProxyUser123", 
        "proxyPassword": "qwerty123", 
        "proxyHost": "65.108.126.217", 
        "proxyPort": "1080", 
        "proxyType": "Socks5" 
        }
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def CheckConnect(self, request, context):
        """Checks if terminal connection to MT5 server is alive
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Disconnect(self, request, context):
        """Close terminal connection to MT5 server
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Reconnect(self, request, context):
        """If you need to recreate terminal instance with the same id
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_ConnectionServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'ConnectEx': grpc.unary_unary_rpc_method_handler(
                    servicer.ConnectEx,
                    request_deserializer=mt5__term__api__connection__pb2.ConnectExRequest.FromString,
                    response_serializer=mt5__term__api__connection__pb2.ConnectExReply.SerializeToString,
            ),
            'Connect': grpc.unary_unary_rpc_method_handler(
                    servicer.Connect,
                    request_deserializer=mt5__term__api__connection__pb2.ConnectRequest.FromString,
                    response_serializer=mt5__term__api__connection__pb2.ConnectReply.SerializeToString,
            ),
            'ConnectProxy': grpc.unary_unary_rpc_method_handler(
                    servicer.ConnectProxy,
                    request_deserializer=mt5__term__api__connection__pb2.ConnectProxyRequest.FromString,
                    response_serializer=mt5__term__api__connection__pb2.ConnectProxyReply.SerializeToString,
            ),
            'CheckConnect': grpc.unary_unary_rpc_method_handler(
                    servicer.CheckConnect,
                    request_deserializer=mt5__term__api__connection__pb2.CheckConnectRequest.FromString,
                    response_serializer=mt5__term__api__connection__pb2.CheckConnectReply.SerializeToString,
            ),
            'Disconnect': grpc.unary_unary_rpc_method_handler(
                    servicer.Disconnect,
                    request_deserializer=mt5__term__api__connection__pb2.DisconnectRequest.FromString,
                    response_serializer=mt5__term__api__connection__pb2.DisconnectReply.SerializeToString,
            ),
            'Reconnect': grpc.unary_unary_rpc_method_handler(
                    servicer.Reconnect,
                    request_deserializer=mt5__term__api__connection__pb2.ReconnectRequest.FromString,
                    response_serializer=mt5__term__api__connection__pb2.ReconnectReply.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'mt5_term_api.Connection', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class Connection(object):
    """-------------------------------------!!!! MT5 CONNECTION SERVICE START !!!!!!!---------------------------------------

    """

    @staticmethod
    def ConnectEx(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, '/mt5_term_api.Connection/ConnectEx',
            mt5__term__api__connection__pb2.ConnectExRequest.SerializeToString,
            mt5__term__api__connection__pb2.ConnectExReply.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Connect(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, '/mt5_term_api.Connection/Connect',
            mt5__term__api__connection__pb2.ConnectRequest.SerializeToString,
            mt5__term__api__connection__pb2.ConnectReply.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def ConnectProxy(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, '/mt5_term_api.Connection/ConnectProxy',
            mt5__term__api__connection__pb2.ConnectProxyRequest.SerializeToString,
            mt5__term__api__connection__pb2.ConnectProxyReply.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def CheckConnect(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, '/mt5_term_api.Connection/CheckConnect',
            mt5__term__api__connection__pb2.CheckConnectRequest.SerializeToString,
            mt5__term__api__connection__pb2.CheckConnectReply.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Disconnect(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, '/mt5_term_api.Connection/Disconnect',
            mt5__term__api__connection__pb2.DisconnectRequest.SerializeToString,
            mt5__term__api__connection__pb2.DisconnectReply.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Reconnect(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, '/mt5_term_api.Connection/Reconnect',
            mt5__term__api__connection__pb2.ReconnectRequest.SerializeToString,
            mt5__term__api__connection__pb2.ReconnectReply.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
