# Path: libcloud_rest/utils.py
# class LastUpdatedOrderedDict(OrderedDict):
#     """Store items in the order the keys were last added"""
# 
#     def __setitem__(self, key, value):
#         if key in self:
#             del self[key]
#         OrderedDict.__setitem__(self, key, value)


import inspect
import re
from collections import defaultdict
from itertools import takewhile
from libcloud_rest.utils import LastUpdatedOrderedDict
from libcloud_rest.errors import MethodParsingException
# -*- coding:utf-8 -*-


#map between request header name and libcloud's internal attribute name
XHEADERS_TO_ARGS_DICT = {
    'x-auth-user': 'key',
    'x-api-key': 'secret',
    'x-provider-path': 'path',
    'x-provider-port': 'port',
    'x-provider-host': 'host',
    'x-dummy-creds': 'creds',  # FIXME: for tests only
    'x-provider-key': 'key',
    'x-provider-uri': 'uri',
    'x-provider-api-version': 'api_version',
    'x-provider-secure': 'secure',
    'x-provider-datacenter': 'datacenter',
}

#FIXME: GK?

# Path: libcloud_rest/utils.py
# class LastUpdatedOrderedDict(OrderedDict):
#     """Store items in the order the keys were last added"""
# 
#     def __setitem__(self, key, value):
#         if key in self:
#             del self[key]
#         OrderedDict.__setitem__(self, key, value)


# Path: libcloud_rest/api/parser.py
import inspect
import re
from collections import defaultdict
from itertools import takewhile
from libcloud_rest.utils import LastUpdatedOrderedDict
from libcloud_rest.errors import MethodParsingException

# -*- coding:utf-8 -*-


#map between request header name and libcloud's internal attribute name
XHEADERS_TO_ARGS_DICT = {
    'x-auth-user': 'key',
    'x-api-key': 'secret',
    'x-provider-path': 'path',
    'x-provider-port': 'port',
    'x-provider-host': 'host',
    'x-dummy-creds': 'creds',  # FIXME: for tests only
    'x-provider-key': 'key',
    'x-provider-uri': 'uri',
    'x-provider-api-version': 'api_version',
    'x-provider-secure': 'secure',
    'x-provider-datacenter': 'datacenter',
}

#FIXME: GK?

ARGS_TO_XHEADERS_DICT = dict(