# 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/http_client.py
# def new_default_http_client(*args, **kwargs):
#     def __init__(self, verify_ssl_certs=True):
#     def request(self, method, url, headers, post_data=None):
#     def request(self, method, url, headers, post_data=None):
#     def _handle_request_error(self, e):
#     def request(self, method, url, headers, post_data=None):
#     def _handle_request_error(self, e, url):
# class HTTPClient(object):
# class RequestsClient(HTTPClient):
# class UrlFetchClient(HTTPClient):
# 
# Path: shippo/util.py

# 
# Path: shippo/certificate_blacklist.py
# BLACKLISTED_DIGESTS = {
# }
# def verify(hostname, certificate):
# 
# Path: shippo/version.py
# VERSION = '2.1.2'


import calendar
import datetime
import os
import platform
import socket
import ssl
import time
import urllib.parse
import warnings
import shippo
from shippo import error, http_client, util, certificate_blacklist
from shippo.version import VERSION
        from shippo.config import verify_ssl_certs
        from shippo.config import api_version
            from shippo.config import api_key
        from shippo.config import verify_ssl_certs

        if my_api_key is None:
            raise error.AuthenticationError(
                'No API key provided. (HINT: set your API key using '
                '"shippo.config.api_key = shippo_test_d90f00698a0a8def0495fddb4212bb08051469d3"). You can generate API keys '
                'from the Shippo web interface.  See https://goshippo.com/api '
                'for details, or email support@goshippo.com if you have any '
                'questions.')

        token_type = 'ShippoToken'
        if my_api_key.startswith('oauth.'):
            token_type = 'Bearer'

        abs_url = '%s%s' % (shippo.config.api_base, url)

        if method == 'get' or method == 'delete':
            if params:
                encoded_params = urllib.parse.urlencode(
                    list(_api_encode(params or {})))
                abs_url = _build_api_url(abs_url, encoded_params)
            post_data = None
        elif method == 'post' or method == 'put':
            post_data = util.json.dumps(params)
        else:
            raise error.APIConnectionError(
                'Unrecognized HTTP method %r.  This may indicate a bug in the '
                'Shippo bindings.  Please contact support@goshippo.com for '
                'assistance.' % (method,))

        ua = {

# 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/http_client.py
# def new_default_http_client(*args, **kwargs):
#     def __init__(self, verify_ssl_certs=True):
#     def request(self, method, url, headers, post_data=None):
#     def request(self, method, url, headers, post_data=None):
#     def _handle_request_error(self, e):
#     def request(self, method, url, headers, post_data=None):
#     def _handle_request_error(self, e, url):
# class HTTPClient(object):
# class RequestsClient(HTTPClient):
# class UrlFetchClient(HTTPClient):
# 
# Path: shippo/util.py

# 
# Path: shippo/certificate_blacklist.py
# BLACKLISTED_DIGESTS = {
# }
# def verify(hostname, certificate):
# 
# Path: shippo/version.py
# VERSION = '2.1.2'


# Path: shippo/api_requestor.py
import calendar
import datetime
import os
import platform
import socket
import ssl
import time
import urllib.parse
import warnings
import shippo
from shippo import error, http_client, util, certificate_blacklist
from shippo.version import VERSION
        from shippo.config import verify_ssl_certs
        from shippo.config import api_version
            from shippo.config import api_key
        from shippo.config import verify_ssl_certs


        if my_api_key is None:
            raise error.AuthenticationError(
                'No API key provided. (HINT: set your API key using '
                '"shippo.config.api_key = shippo_test_d90f00698a0a8def0495fddb4212bb08051469d3"). You can generate API keys '
                'from the Shippo web interface.  See https://goshippo.com/api '
                'for details, or email support@goshippo.com if you have any '
                'questions.')

        token_type = 'ShippoToken'
        if my_api_key.startswith('oauth.'):
            token_type = 'Bearer'

        abs_url = '%s%s' % (shippo.config.api_base, url)

        if method == 'get' or method == 'delete':
            if params:
                encoded_params = urllib.parse.urlencode(
                    list(_api_encode(params or {})))
                abs_url = _build_api_url(abs_url, encoded_params)
            post_data = None
        elif method == 'post' or method == 'put':
            post_data = util.json.dumps(params)
        else:
            raise error.APIConnectionError(
                'Unrecognized HTTP method %r.  This may indicate a bug in the '
                'Shippo bindings.  Please contact support@goshippo.com for '
                'assistance.' % (method,))

        ua = {

            'bindings_version': VERSION,