# Path: shippo/api_requestor.py
# def _encode_datetime(dttime):
# def _api_encode(data):
# def _build_api_url(url, query):
#     def __init__(self, key=None, client=None):
#     def request(self, method, url, params=None):
#     def handle_api_error(self, rbody, rcode, resp):
#     def request_raw(self, method, url, params=None):
#     def interpret_response(self, rbody, rcode):
#     def _check_ssl_cert(self):
# class APIRequestor(object):
#     _CERTIFICATE_VERIFIED = False
# 
# Path: shippo/error.py
# class ShippoError(Exception):
# class APIError(ShippoError):
# class APIConnectionError(ShippoError):
# class AddressError(ShippoError):
# class InvalidRequestError(ShippoError):
# class AuthenticationError(ShippoError):
#     def __init__(self, message=None, http_body=None, http_status=None,
#                  json_body=None):
#     def __init__(self, message, param, code, http_body=None,
#                  http_status=None, json_body=None):
#     def __init__(self, message, param, http_body=None,
#                  http_status=None, json_body=None):
# 
# Path: shippo/util.py

# 
# Path: shippo/config.py



import urllib.parse
import sys
import time
import warnings
import shippo.config as config
from shippo import api_requestor, error, util
from shippo.config import rates_req_timeout

        self._previous_metadata = values.get('metadata')

    def request(self, method, url, params=None):
        if params is None:
            params = self._retrieve_params

        requestor = api_requestor.APIRequestor(self.api_key)
        response, api_key = requestor.request(method, url, params)

        return convert_to_shippo_object(response, api_key)

    def __repr__(self):
        ident_parts = [type(self).__name__]

        if isinstance(self.get('object'), str):
            ident_parts.append(self.get('object'))

        if isinstance(self.get('object_id'), str):
            ident_parts.append('object_id=%s' % (self.get('object_id'),))

        unicode_repr = '<%s at %s> JSON: %s' % (
            ' '.join(ident_parts), hex(id(self)), str(self))

        if sys.version_info[0] < 3:
            return unicode_repr.encode('utf-8')
        else:
            return unicode_repr

    def __str__(self):

# Path: shippo/api_requestor.py
# def _encode_datetime(dttime):
# def _api_encode(data):
# def _build_api_url(url, query):
#     def __init__(self, key=None, client=None):
#     def request(self, method, url, params=None):
#     def handle_api_error(self, rbody, rcode, resp):
#     def request_raw(self, method, url, params=None):
#     def interpret_response(self, rbody, rcode):
#     def _check_ssl_cert(self):
# class APIRequestor(object):
#     _CERTIFICATE_VERIFIED = False
# 
# Path: shippo/error.py
# class ShippoError(Exception):
# class APIError(ShippoError):
# class APIConnectionError(ShippoError):
# class AddressError(ShippoError):
# class InvalidRequestError(ShippoError):
# class AuthenticationError(ShippoError):
#     def __init__(self, message=None, http_body=None, http_status=None,
#                  json_body=None):
#     def __init__(self, message, param, code, http_body=None,
#                  http_status=None, json_body=None):
#     def __init__(self, message, param, http_body=None,
#                  http_status=None, json_body=None):
# 
# Path: shippo/util.py

# 
# Path: shippo/config.py



# Path: shippo/resource.py
import urllib.parse
import sys
import time
import warnings
import shippo.config as config
from shippo import api_requestor, error, util
from shippo.config import rates_req_timeout


        self._previous_metadata = values.get('metadata')

    def request(self, method, url, params=None):
        if params is None:
            params = self._retrieve_params

        requestor = api_requestor.APIRequestor(self.api_key)
        response, api_key = requestor.request(method, url, params)

        return convert_to_shippo_object(response, api_key)

    def __repr__(self):
        ident_parts = [type(self).__name__]

        if isinstance(self.get('object'), str):
            ident_parts.append(self.get('object'))

        if isinstance(self.get('object_id'), str):
            ident_parts.append('object_id=%s' % (self.get('object_id'),))

        unicode_repr = '<%s at %s> JSON: %s' % (
            ' '.join(ident_parts), hex(id(self)), str(self))

        if sys.version_info[0] < 3:
            return unicode_repr.encode('utf-8')
        else:
            return unicode_repr

    def __str__(self):

        return util.json.dumps(self, sort_keys=True, indent=2)