# 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
    def construct_from(cls, values, api_key):
        instance = cls(values.get('object_id'), api_key)
        instance.refresh_from(values, api_key)
        return instance

    def refresh_from(self, values, api_key=None, partial=False):
        self.api_key = api_key or getattr(values, 'api_key', None)

        # Wipe old state before setting new.
        if partial:
            self._unsaved_values = (self._unsaved_values - set(values))
        else:
            removed = set(self.keys()) - set(values)
            self._transient_values = self._transient_values | removed
            self._unsaved_values = set()

            self.clear()

        self._transient_values = self._transient_values - set(values)

        for k, v in list(values.items()):
            super(ShippoObject, self).__setitem__(
                k, convert_to_shippo_object(v, api_key))

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

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


# 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

    def construct_from(cls, values, api_key):
        instance = cls(values.get('object_id'), api_key)
        instance.refresh_from(values, api_key)
        return instance

    def refresh_from(self, values, api_key=None, partial=False):
        self.api_key = api_key or getattr(values, 'api_key', None)

        # Wipe old state before setting new.
        if partial:
            self._unsaved_values = (self._unsaved_values - set(values))
        else:
            removed = set(self.keys()) - set(values)
            self._transient_values = self._transient_values | removed
            self._unsaved_values = set()

            self.clear()

        self._transient_values = self._transient_values - set(values)

        for k, v in list(values.items()):
            super(ShippoObject, self).__setitem__(
                k, convert_to_shippo_object(v, api_key))

        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)