(domain, direction=None, days=None)
return query.run().total
:param domain: domain name
    :param direction: can specify INCOMING or OUTGOING, or None to retrieve both
    :param days: only return count of sms docs from the past N days
    :return: number of sms docs fetched based on query parameters specified
:param domain: domain name
    :param direction: can specify INCOMING or OUTGOING, or None to retrieve both
    :param days: only return count of sms docs from the past N days
    :return: number of sms docs fetched based on query parameters specified
: param domain : domain name : param direction : can specify INCOMING or OUTGOING or None to retrieve both : param days : only return count of sms docs from the past N days : return : number of sms docs fetched based on query parameters specified
def get_sms_count(domain, direction=None, days=None):
    """
    :param domain: domain name
    :param direction: can specify INCOMING or OUTGOING, or None to retrieve both
    :param days: only return count of sms docs from the past N days
    :return: number of sms docs fetched based on query parameters specified
    """
    assert direction in (INCOMING, OUTGOING, None), repr(direction)
    query = SMSES().domain(domain).size(0)

    if direction == INCOMING:
        query = query.incoming_messages()
    elif direction == OUTGOING:
        query = query.outgoing_messages()

    if days:
        days = int(days) if isinstance(days, str) else days
        query = query.received(date.today() - relativedelta(days=days))

    return query.run().total
def get_sms_count ( domain , direction = None , days = None ) : assert direction in ( INCOMING , OUTGOING , None ) , repr ( direction ) query = SMSES ( ) . domain ( domain ) . size ( 0 ) if direction == INCOMING : query = query . incoming_messages ( ) elif direction == OUTGOING : query = query . outgoing_messages ( ) if days : days = int ( days ) if isinstance ( days , str ) else days query = query . received ( date . today ( ) - relativedelta ( days = days ) ) return query . run ( ) . total