# 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

    @classmethod
    def class_url(cls):
        cls_name = cls.class_name()
        return "v1/%ss/" % (cls_name,)


class Refund(CreateableAPIResource, ListableAPIResource, FetchableAPIResource):
    """
        Refunds are reimbursements for successfully created but unused Transaction.
    """

    @classmethod
    def class_url(cls):
        cls_name = cls.class_name()
        return "v1/%ss/" % (cls_name,)


class Shipment(CreateableAPIResource, ListableAPIResource, FetchableAPIResource):
    """
        The heart of the Shippo API, a Shipment is made up of "to" and "from" Addresses
        and the Parcel to be shipped. Shipments can be created, retrieved and listed.
    """

    @classmethod
    def get_rates(cls, object_id, asynchronous=False, api_key=None, currency=None, **params):
        """
            Given a valid shipment object_id, all possible rates are calculated and returned.
        """
        if not asynchronous:

# 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


    @classmethod
    def class_url(cls):
        cls_name = cls.class_name()
        return "v1/%ss/" % (cls_name,)


class Refund(CreateableAPIResource, ListableAPIResource, FetchableAPIResource):
    """
        Refunds are reimbursements for successfully created but unused Transaction.
    """

    @classmethod
    def class_url(cls):
        cls_name = cls.class_name()
        return "v1/%ss/" % (cls_name,)


class Shipment(CreateableAPIResource, ListableAPIResource, FetchableAPIResource):
    """
        The heart of the Shippo API, a Shipment is made up of "to" and "from" Addresses
        and the Parcel to be shipped. Shipments can be created, retrieved and listed.
    """

    @classmethod
    def get_rates(cls, object_id, asynchronous=False, api_key=None, currency=None, **params):
        """
            Given a valid shipment object_id, all possible rates are calculated and returned.
        """
        if not asynchronous:

            timeout = time.time() + rates_req_timeout