# 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 ziplime.data.data_sources.grpc.grpc_stubs.grpc.tradeapi.v1.accounts import accounts_service_pb2 as grpc_dot_tradeapi_dot_v1_dot_accounts_dot_accounts__service__pb2

GRPC_GENERATED_VERSION = '1.74.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 grpc/tradeapi/v1/accounts/accounts_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 AccountsServiceStub(object):
    def __init__(self, channel):
        self.GetAccount = channel.unary_unary(
                '/grpc.tradeapi.v1.accounts.AccountsService/GetAccount',
                request_serializer=grpc_dot_tradeapi_dot_v1_dot_accounts_dot_accounts__service__pb2.GetAccountRequest.SerializeToString,
                response_deserializer=grpc_dot_tradeapi_dot_v1_dot_accounts_dot_accounts__service__pb2.GetAccountResponse.FromString,
                _registered_method=True)
        self.Trades = channel.unary_unary(
                '/grpc.tradeapi.v1.accounts.AccountsService/Trades',
                request_serializer=grpc_dot_tradeapi_dot_v1_dot_accounts_dot_accounts__service__pb2.TradesRequest.SerializeToString,
                response_deserializer=grpc_dot_tradeapi_dot_v1_dot_accounts_dot_accounts__service__pb2.TradesResponse.FromString,
                _registered_method=True)
        self.Transactions = channel.unary_unary(
                '/grpc.tradeapi.v1.accounts.AccountsService/Transactions',
                request_serializer=grpc_dot_tradeapi_dot_v1_dot_accounts_dot_accounts__service__pb2.TransactionsRequest.SerializeToString,
                response_deserializer=grpc_dot_tradeapi_dot_v1_dot_accounts_dot_accounts__service__pb2.TransactionsResponse.FromString,
                _registered_method=True)


class AccountsServiceServicer(object):
    def GetAccount(self, request, context):
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Trades(self, request, context):
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Transactions(self, request, context):
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_AccountsServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'GetAccount': grpc.unary_unary_rpc_method_handler(
                    servicer.GetAccount,
                    request_deserializer=grpc_dot_tradeapi_dot_v1_dot_accounts_dot_accounts__service__pb2.GetAccountRequest.FromString,
                    response_serializer=grpc_dot_tradeapi_dot_v1_dot_accounts_dot_accounts__service__pb2.GetAccountResponse.SerializeToString,
            ),
            'Trades': grpc.unary_unary_rpc_method_handler(
                    servicer.Trades,
                    request_deserializer=grpc_dot_tradeapi_dot_v1_dot_accounts_dot_accounts__service__pb2.TradesRequest.FromString,
                    response_serializer=grpc_dot_tradeapi_dot_v1_dot_accounts_dot_accounts__service__pb2.TradesResponse.SerializeToString,
            ),
            'Transactions': grpc.unary_unary_rpc_method_handler(
                    servicer.Transactions,
                    request_deserializer=grpc_dot_tradeapi_dot_v1_dot_accounts_dot_accounts__service__pb2.TransactionsRequest.FromString,
                    response_serializer=grpc_dot_tradeapi_dot_v1_dot_accounts_dot_accounts__service__pb2.TransactionsResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'grpc.tradeapi.v1.accounts.AccountsService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('grpc.tradeapi.v1.accounts.AccountsService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class AccountsService(object):
    @staticmethod
    def GetAccount(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,
            '/grpc.tradeapi.v1.accounts.AccountsService/GetAccount',
            grpc_dot_tradeapi_dot_v1_dot_accounts_dot_accounts__service__pb2.GetAccountRequest.SerializeToString,
            grpc_dot_tradeapi_dot_v1_dot_accounts_dot_accounts__service__pb2.GetAccountResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Trades(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,
            '/grpc.tradeapi.v1.accounts.AccountsService/Trades',
            grpc_dot_tradeapi_dot_v1_dot_accounts_dot_accounts__service__pb2.TradesRequest.SerializeToString,
            grpc_dot_tradeapi_dot_v1_dot_accounts_dot_accounts__service__pb2.TradesResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Transactions(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,
            '/grpc.tradeapi.v1.accounts.AccountsService/Transactions',
            grpc_dot_tradeapi_dot_v1_dot_accounts_dot_accounts__service__pb2.TransactionsRequest.SerializeToString,
            grpc_dot_tradeapi_dot_v1_dot_accounts_dot_accounts__service__pb2.TransactionsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
