# 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):


from zaqarclient.queues.v1 import core
from zaqarclient.queues.v1 import iterator as iterate
from zaqarclient.queues.v1 import message
        claim_res = core.claim_get(trans, req, self._queue._name,
                                   self.id)
        self._age = claim_res['age']
        self._ttl = claim_res['ttl']
        self._grace = claim_res.get('grace')
        msgs = claim_res.get('messages', [])
        self._message_iter = iterate._Iterator(self._queue.client,
                                               msgs,
                                               'messages',
                                               message.create_object(
                                                   self._queue
                                               ))

    def _create(self):
        req, trans = self._queue.client._request_and_transport()
        msgs = core.claim_create(trans, req,
                                 self._queue._name,
                                 ttl=self._ttl,
                                 grace=self._grace,
                                 limit=self._limit)

        # extract the id from the first message
        if msgs is not None:
            if self._queue.client.api_version >= 1.1:
                msgs = msgs['messages']
            self.id = msgs[0]['href'].split('=')[-1]

        self._message_iter = iterate._Iterator(self._queue.client,
                                               msgs or [],
                                               'messages',

# 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/claim.py
from zaqarclient.queues.v1 import core
from zaqarclient.queues.v1 import iterator as iterate
from zaqarclient.queues.v1 import message

        claim_res = core.claim_get(trans, req, self._queue._name,
                                   self.id)
        self._age = claim_res['age']
        self._ttl = claim_res['ttl']
        self._grace = claim_res.get('grace')
        msgs = claim_res.get('messages', [])
        self._message_iter = iterate._Iterator(self._queue.client,
                                               msgs,
                                               'messages',
                                               message.create_object(
                                                   self._queue
                                               ))

    def _create(self):
        req, trans = self._queue.client._request_and_transport()
        msgs = core.claim_create(trans, req,
                                 self._queue._name,
                                 ttl=self._ttl,
                                 grace=self._grace,
                                 limit=self._limit)

        # extract the id from the first message
        if msgs is not None:
            if self._queue.client.api_version >= 1.1:
                msgs = msgs['messages']
            self.id = msgs[0]['href'].split('=')[-1]

        self._message_iter = iterate._Iterator(self._queue.client,
                                               msgs or [],
                                               'messages',

                                               message.create_object(