# Path: zaqarclient/_i18n.py

# 
# Path: zaqarclient/errors.py
# class ZaqarError(Exception):
# class DriverLoadFailure(ZaqarError):
# class InvalidOperation(ZaqarError):
# class UnsupportedVersion(ZaqarError):
#     def __init__(self, driver, ex):
# 
# Path: zaqarclient/queues/v1/claim.py
# class Claim(object):
#     def __init__(self, queue, id=None,
#                  ttl=None, grace=None, limit=None):
#     def __repr__(self):
#     def _get(self):
#     def _create(self):
#     def __iter__(self):
#     def age(self):
#     def ttl(self):
#     def delete(self):
#     def update(self, ttl=None, grace=None):
# 
# Path: zaqarclient/queues/v1/core.py
# def _common_queue_ops(operation, transport, request, name, callback=None):
# def queue_create(transport, request, name,
#                  metadata=None, callback=None):
# def queue_update(transport, request, name, metadata, callback=None):
# def queue_exists(transport, request, name, callback=None):
# def queue_get(transport, request, name, callback=None):
# def queue_get_metadata(transport, request, name, callback=None):
# def queue_set_metadata(transport, request, name, metadata, callback=None):
# def queue_get_stats(transport, request, name):
# def queue_delete(transport, request, name, callback=None):
# def queue_list(transport, request, callback=None, **kwargs):
# def message_list(transport, request, queue_name, callback=None, **kwargs):
# def message_post(transport, request, queue_name, messages, callback=None):
# def message_get(transport, request, queue_name, message_id, callback=None):
# def message_get_many(transport, request, queue_name, messages, callback=None):
# def message_delete(transport, request, queue_name, message_id,
#                    claim_id=None, callback=None):
# def message_delete_many(transport, request, queue_name,
#                         ids, callback=None):
# def message_pop(transport, request, queue_name,
#                 count, callback=None):
# def claim_create(transport, request, queue_name, **kwargs):
# def claim_get(transport, request, queue_name, claim_id):
# def claim_update(transport, request, queue_name, claim_id, **kwargs):
# def claim_delete(transport, request, queue_name, claim_id):
# def pool_get(transport, request, pool_name, callback=None):
# def pool_create(transport, request, pool_name, pool_data):
# def pool_update(transport, request, pool_name, pool_data):
# def pool_list(transport, request, **kwargs):
# def pool_delete(transport, request, pool_name):
# def flavor_create(transport, request, name, flavor_data):
# def flavor_get(transport, request, flavor_name, callback=None):
# def flavor_update(transport, request, flavor_name, flavor_data):
# def flavor_list(transport, request, **kwargs):
# def flavor_delete(transport, request, name):
# def health(transport, request, callback=None):
# 
# Path: zaqarclient/queues/v1/iterator.py
# class _Iterator(object):
#     def __init__(self, client, listing_response, iter_key, create_function):
#     def __iter__(self):
#     def get_iterables(self, iterables):
#     def stream(self, enabled=True):
#     def _next_page(self):
#     def __next__(self):
# 
# Path: zaqarclient/queues/v1/message.py
# class Message(object):
#     def __init__(self, queue, ttl, age, body, href=None, id=None,
#                  claim_id=None, claim_count=0, checksum=None):
#     def __repr__(self):
#     def claim_id(self):
#     def delete(self):
# def create_object(parent):


import re
from zaqarclient._i18n import _  # noqa
from zaqarclient import errors
from zaqarclient.queues.v1 import claim as claim_api
from zaqarclient.queues.v1 import core
from zaqarclient.queues.v1 import iterator
from zaqarclient.queues.v1 import message
        req, trans = self.client._request_and_transport()
        return core.queue_get_stats(trans, req, self._name)

    def delete(self):
        req, trans = self.client._request_and_transport()
        core.queue_delete(trans, req, self._name)

    # Messages API

    def post(self, messages):
        """Posts one or more messages to this queue

        :param messages: One or more messages to post
        :type messages: `list` or `dict`

        :returns: A dict with the result of this operation.
        :rtype: `dict`
        """
        if not isinstance(messages, list):
            messages = [messages]

        if self.client.api_version >= 1.1:
            messages = {'messages': messages}

        req, trans = self.client._request_and_transport()

        # TODO(flaper87): Return a list of messages
        return core.message_post(trans, req,
                                 self._name, messages)


# Path: zaqarclient/_i18n.py

# 
# Path: zaqarclient/errors.py
# class ZaqarError(Exception):
# class DriverLoadFailure(ZaqarError):
# class InvalidOperation(ZaqarError):
# class UnsupportedVersion(ZaqarError):
#     def __init__(self, driver, ex):
# 
# Path: zaqarclient/queues/v1/claim.py
# class Claim(object):
#     def __init__(self, queue, id=None,
#                  ttl=None, grace=None, limit=None):
#     def __repr__(self):
#     def _get(self):
#     def _create(self):
#     def __iter__(self):
#     def age(self):
#     def ttl(self):
#     def delete(self):
#     def update(self, ttl=None, grace=None):
# 
# Path: zaqarclient/queues/v1/core.py
# def _common_queue_ops(operation, transport, request, name, callback=None):
# def queue_create(transport, request, name,
#                  metadata=None, callback=None):
# def queue_update(transport, request, name, metadata, callback=None):
# def queue_exists(transport, request, name, callback=None):
# def queue_get(transport, request, name, callback=None):
# def queue_get_metadata(transport, request, name, callback=None):
# def queue_set_metadata(transport, request, name, metadata, callback=None):
# def queue_get_stats(transport, request, name):
# def queue_delete(transport, request, name, callback=None):
# def queue_list(transport, request, callback=None, **kwargs):
# def message_list(transport, request, queue_name, callback=None, **kwargs):
# def message_post(transport, request, queue_name, messages, callback=None):
# def message_get(transport, request, queue_name, message_id, callback=None):
# def message_get_many(transport, request, queue_name, messages, callback=None):
# def message_delete(transport, request, queue_name, message_id,
#                    claim_id=None, callback=None):
# def message_delete_many(transport, request, queue_name,
#                         ids, callback=None):
# def message_pop(transport, request, queue_name,
#                 count, callback=None):
# def claim_create(transport, request, queue_name, **kwargs):
# def claim_get(transport, request, queue_name, claim_id):
# def claim_update(transport, request, queue_name, claim_id, **kwargs):
# def claim_delete(transport, request, queue_name, claim_id):
# def pool_get(transport, request, pool_name, callback=None):
# def pool_create(transport, request, pool_name, pool_data):
# def pool_update(transport, request, pool_name, pool_data):
# def pool_list(transport, request, **kwargs):
# def pool_delete(transport, request, pool_name):
# def flavor_create(transport, request, name, flavor_data):
# def flavor_get(transport, request, flavor_name, callback=None):
# def flavor_update(transport, request, flavor_name, flavor_data):
# def flavor_list(transport, request, **kwargs):
# def flavor_delete(transport, request, name):
# def health(transport, request, callback=None):
# 
# Path: zaqarclient/queues/v1/iterator.py
# class _Iterator(object):
#     def __init__(self, client, listing_response, iter_key, create_function):
#     def __iter__(self):
#     def get_iterables(self, iterables):
#     def stream(self, enabled=True):
#     def _next_page(self):
#     def __next__(self):
# 
# Path: zaqarclient/queues/v1/message.py
# class Message(object):
#     def __init__(self, queue, ttl, age, body, href=None, id=None,
#                  claim_id=None, claim_count=0, checksum=None):
#     def __repr__(self):
#     def claim_id(self):
#     def delete(self):
# def create_object(parent):


# Path: zaqarclient/queues/v1/queues.py
import re
from zaqarclient._i18n import _  # noqa
from zaqarclient import errors
from zaqarclient.queues.v1 import claim as claim_api
from zaqarclient.queues.v1 import core
from zaqarclient.queues.v1 import iterator
from zaqarclient.queues.v1 import message

        req, trans = self.client._request_and_transport()
        return core.queue_get_stats(trans, req, self._name)

    def delete(self):
        req, trans = self.client._request_and_transport()
        core.queue_delete(trans, req, self._name)

    # Messages API

    def post(self, messages):
        """Posts one or more messages to this queue

        :param messages: One or more messages to post
        :type messages: `list` or `dict`

        :returns: A dict with the result of this operation.
        :rtype: `dict`
        """
        if not isinstance(messages, list):
            messages = [messages]

        if self.client.api_version >= 1.1:
            messages = {'messages': messages}

        req, trans = self.client._request_and_transport()

        # TODO(flaper87): Return a list of messages
        return core.message_post(trans, req,
                                 self._name, messages)


    def message(self, message_id):