Receive one or more messages from a queue in a region

    queue
        The name of the queue to receive messages from

    region
        Region where SQS queues exists

    num : 1
        The max number of messages to receive

    opts : None
        Any additional options to add to the command line

    user : None
        Run as a user other than what the minion runs as

    CLI Example:

    .. code-block:: bash

        salt '*' aws_sqs.receive_message <sqs queue> <region>
        salt '*' aws_sqs.receive_message <sqs queue> <region> num=10

    .. versionadded:: 2014.7.0

def receive_message(queue, region, num=1, opts=None, user=None):
    '''
    Receive one or more messages from a queue in a region

    queue
        The name of the queue to receive messages from

    region
        Region where SQS queues exists

    num : 1
        The max number of messages to receive

    opts : None
        Any additional options to add to the command line

    user : None
        Run as a user other than what the minion runs as

    CLI Example:

    .. code-block:: bash

        salt '*' aws_sqs.receive_message <sqs queue> <region>
        salt '*' aws_sqs.receive_message <sqs queue> <region> num=10

    .. versionadded:: 2014.7.0

    '''
    ret = {
            'Messages': None,
          }
    queues = list_queues(region, opts, user)
    url_map = _parse_queue_list(queues)
    if queue not in url_map:
        log.info('"%s" queue does not exist.', queue)
        return ret

    out = _run_aws('receive-message', region, opts, user, queue=url_map[queue],
                   num=num)
    ret['Messages'] = out['Messages']
    return ret