# Path: zaqarclient/queues/v1/queues.py
# QUEUE_NAME_REGEX = re.compile(r'^[a-zA-Z0-9_\-]+$')
# class Queue(object):
#     def __init__(self, client, name, href=None, metadata=None,
#                  auto_create=True, force_create=False):
#     def name(self):
#     def href(self):
#     def metadata_dict(self):
#     def exists(self):
#     def ensure_exists(self, force_create=False):
#     def metadata(self, new_meta=None, force_reload=False):
#     def stats(self):
#     def delete(self):
#     def post(self, messages):
#     def message(self, message_id):
#     def messages(self, *messages, **params):
#     def delete_messages(self, *messages):
#     def pop(self, count=1):
#     def claim(self, id=None, ttl=None, grace=None,
#               limit=None):
# def create_object(parent):
# 
# Path: zaqarclient/queues/v2/claim.py
# class Claim(claim.Claim):
#     def _create(self):
# 
# Path: zaqarclient/queues/v2/core.py
# def queue_update(transport, request, name, metadata, callback=None):
# def queue_purge(transport, request, name, resource_types=None):
# def signed_url_create(transport, request, queue_name, paths=None,
#                       ttl_seconds=None, project_id=None, methods=None):
# def subscription_create(transport, request, queue_name, subscription_data):
# def subscription_get(transport, request, queue_name, subscription_id):
# def subscription_update(transport, request, queue_name, subscription_id,
#                         subscription_data):
# def subscription_delete(transport, request, queue_name, subscription_id):
# def subscription_list(transport, request, queue_name, **kwargs):
# def ping(transport, request, callback=None):
# def health(transport, request, callback=None):
# def homedoc(transport, request, callback=None):
# 
# Path: zaqarclient/queues/v2/message.py
# class Message(message.Message):
#     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 queues
from zaqarclient.queues.v2 import claim as claim_api
from zaqarclient.queues.v2 import core
from zaqarclient.queues.v2 import message
            self._metadata = core.queue_get(trans, req, self._name)

        if new_meta is not None:
            temp_metadata = self._metadata.copy()
            changes = []
            for key, value in new_meta.items():
                # If key exists, replace it's value.
                if self._metadata.get(key, None) is not None:
                    changes.append({'op': 'replace',
                                    'path': '/metadata/%s' % key,
                                    'value': value})
                    temp_metadata.pop(key)
                # If not, add the new key.
                else:
                    changes.append({'op': 'add',
                                    'path': '/metadata/%s' % key,
                                    'value': value})
            # For the keys which are not included in the new metadata, remove
            # them.
            for key, value in temp_metadata.items():
                changes.append({'op': 'remove',
                                'path': '/metadata/%s' % key})

            self._metadata = core.queue_update(trans, req, self._name,
                                               metadata=changes)

        return self._metadata

    def purge(self, resource_types=None):
        req, trans = self.client._request_and_transport()

# Path: zaqarclient/queues/v1/queues.py
# QUEUE_NAME_REGEX = re.compile(r'^[a-zA-Z0-9_\-]+$')
# class Queue(object):
#     def __init__(self, client, name, href=None, metadata=None,
#                  auto_create=True, force_create=False):
#     def name(self):
#     def href(self):
#     def metadata_dict(self):
#     def exists(self):
#     def ensure_exists(self, force_create=False):
#     def metadata(self, new_meta=None, force_reload=False):
#     def stats(self):
#     def delete(self):
#     def post(self, messages):
#     def message(self, message_id):
#     def messages(self, *messages, **params):
#     def delete_messages(self, *messages):
#     def pop(self, count=1):
#     def claim(self, id=None, ttl=None, grace=None,
#               limit=None):
# def create_object(parent):
# 
# Path: zaqarclient/queues/v2/claim.py
# class Claim(claim.Claim):
#     def _create(self):
# 
# Path: zaqarclient/queues/v2/core.py
# def queue_update(transport, request, name, metadata, callback=None):
# def queue_purge(transport, request, name, resource_types=None):
# def signed_url_create(transport, request, queue_name, paths=None,
#                       ttl_seconds=None, project_id=None, methods=None):
# def subscription_create(transport, request, queue_name, subscription_data):
# def subscription_get(transport, request, queue_name, subscription_id):
# def subscription_update(transport, request, queue_name, subscription_id,
#                         subscription_data):
# def subscription_delete(transport, request, queue_name, subscription_id):
# def subscription_list(transport, request, queue_name, **kwargs):
# def ping(transport, request, callback=None):
# def health(transport, request, callback=None):
# def homedoc(transport, request, callback=None):
# 
# Path: zaqarclient/queues/v2/message.py
# class Message(message.Message):
#     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/v2/queues.py
from zaqarclient.queues.v1 import queues
from zaqarclient.queues.v2 import claim as claim_api
from zaqarclient.queues.v2 import core
from zaqarclient.queues.v2 import message

            self._metadata = core.queue_get(trans, req, self._name)

        if new_meta is not None:
            temp_metadata = self._metadata.copy()
            changes = []
            for key, value in new_meta.items():
                # If key exists, replace it's value.
                if self._metadata.get(key, None) is not None:
                    changes.append({'op': 'replace',
                                    'path': '/metadata/%s' % key,
                                    'value': value})
                    temp_metadata.pop(key)
                # If not, add the new key.
                else:
                    changes.append({'op': 'add',
                                    'path': '/metadata/%s' % key,
                                    'value': value})
            # For the keys which are not included in the new metadata, remove
            # them.
            for key, value in temp_metadata.items():
                changes.append({'op': 'remove',
                                'path': '/metadata/%s' % key})

            self._metadata = core.queue_update(trans, req, self._name,
                                               metadata=changes)

        return self._metadata

    def purge(self, resource_types=None):
        req, trans = self.client._request_and_transport()

        core.queue_purge(trans, req, self._name,