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

from v4_proto.dydxprotocol.subaccounts import query_pb2 as dydxprotocol_dot_subaccounts_dot_query__pb2


class QueryStub(object):
    """Query defines the gRPC querier service.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.Subaccount = channel.unary_unary(
                '/dydxprotocol.subaccounts.Query/Subaccount',
                request_serializer=dydxprotocol_dot_subaccounts_dot_query__pb2.QueryGetSubaccountRequest.SerializeToString,
                response_deserializer=dydxprotocol_dot_subaccounts_dot_query__pb2.QuerySubaccountResponse.FromString,
                )
        self.SubaccountAll = channel.unary_unary(
                '/dydxprotocol.subaccounts.Query/SubaccountAll',
                request_serializer=dydxprotocol_dot_subaccounts_dot_query__pb2.QueryAllSubaccountRequest.SerializeToString,
                response_deserializer=dydxprotocol_dot_subaccounts_dot_query__pb2.QuerySubaccountAllResponse.FromString,
                )
        self.GetWithdrawalAndTransfersBlockedInfo = channel.unary_unary(
                '/dydxprotocol.subaccounts.Query/GetWithdrawalAndTransfersBlockedInfo',
                request_serializer=dydxprotocol_dot_subaccounts_dot_query__pb2.QueryGetWithdrawalAndTransfersBlockedInfoRequest.SerializeToString,
                response_deserializer=dydxprotocol_dot_subaccounts_dot_query__pb2.QueryGetWithdrawalAndTransfersBlockedInfoResponse.FromString,
                )


class QueryServicer(object):
    """Query defines the gRPC querier service.
    """

    def Subaccount(self, request, context):
        """Queries a Subaccount by id
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def SubaccountAll(self, request, context):
        """Queries a list of Subaccount items.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetWithdrawalAndTransfersBlockedInfo(self, request, context):
        """Queries information about whether withdrawal and transfers are blocked, and
        if so which block they are re-enabled on.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_QueryServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'Subaccount': grpc.unary_unary_rpc_method_handler(
                    servicer.Subaccount,
                    request_deserializer=dydxprotocol_dot_subaccounts_dot_query__pb2.QueryGetSubaccountRequest.FromString,
                    response_serializer=dydxprotocol_dot_subaccounts_dot_query__pb2.QuerySubaccountResponse.SerializeToString,
            ),
            'SubaccountAll': grpc.unary_unary_rpc_method_handler(
                    servicer.SubaccountAll,
                    request_deserializer=dydxprotocol_dot_subaccounts_dot_query__pb2.QueryAllSubaccountRequest.FromString,
                    response_serializer=dydxprotocol_dot_subaccounts_dot_query__pb2.QuerySubaccountAllResponse.SerializeToString,
            ),
            'GetWithdrawalAndTransfersBlockedInfo': grpc.unary_unary_rpc_method_handler(
                    servicer.GetWithdrawalAndTransfersBlockedInfo,
                    request_deserializer=dydxprotocol_dot_subaccounts_dot_query__pb2.QueryGetWithdrawalAndTransfersBlockedInfoRequest.FromString,
                    response_serializer=dydxprotocol_dot_subaccounts_dot_query__pb2.QueryGetWithdrawalAndTransfersBlockedInfoResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'dydxprotocol.subaccounts.Query', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class Query(object):
    """Query defines the gRPC querier service.
    """

    @staticmethod
    def Subaccount(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, '/dydxprotocol.subaccounts.Query/Subaccount',
            dydxprotocol_dot_subaccounts_dot_query__pb2.QueryGetSubaccountRequest.SerializeToString,
            dydxprotocol_dot_subaccounts_dot_query__pb2.QuerySubaccountResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def SubaccountAll(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, '/dydxprotocol.subaccounts.Query/SubaccountAll',
            dydxprotocol_dot_subaccounts_dot_query__pb2.QueryAllSubaccountRequest.SerializeToString,
            dydxprotocol_dot_subaccounts_dot_query__pb2.QuerySubaccountAllResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetWithdrawalAndTransfersBlockedInfo(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, '/dydxprotocol.subaccounts.Query/GetWithdrawalAndTransfersBlockedInfo',
            dydxprotocol_dot_subaccounts_dot_query__pb2.QueryGetWithdrawalAndTransfersBlockedInfoRequest.SerializeToString,
            dydxprotocol_dot_subaccounts_dot_query__pb2.QueryGetWithdrawalAndTransfersBlockedInfoResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
