# Stripe Python bindings
# API docs at http://stripe.com/docs/api
# Authors:
# Patrick Collison <patrick@stripe.com>
# Greg Brockman <gdb@stripe.com>
# Andrew Metcalf <andrew@stripe.com>

# Configuration variables

api_key = None
api_base = 'https://api.stripe.com'
api_version = None
verify_ssl_certs = True

# Resource
from stripe.resource import (  # noqa
    Account, Balance, BalanceTransaction, Card, Charge, Customer, Invoice,
    InvoiceItem, Plan, Token, Coupon, Event, Transfer, Recipient,
    ApplicationFee, Subscription)

# Error imports.  Note that we may want to move these out of the root
# namespace in the future and you should prefer to access them via
# the fully qualified `stripe.error` module.

from stripe.error import (  # noqa
    StripeError, APIError, APIConnectionError, AuthenticationError, CardError,
    InvalidRequestError)

# DEPRECATED: These imports will be moved out of the root stripe namespace
# in version 2.0

from stripe.version import VERSION  # noqa
from stripe.api_requestor import APIRequestor  # noqa
from stripe.resource import (  # noqa
    convert_to_stripe_object, StripeObject, StripeObjectEncoder,
    APIResource, ListObject, SingletonAPIResource, ListableAPIResource,
    CreateableAPIResource, UpdateableAPIResource, DeletableAPIResource)
from stripe.util import json, logger  # noqa


# This is a pretty ugly solution to deprecating modules but a similar
# approach is used in Zope, Twisted and sanctioned in:
# https://mail.python.org/pipermail/python-ideas/2012-May/014969.html
import sys as _sys
import warnings as _warnings
from inspect import isclass as _isclass, ismodule as _ismodule

_dogetattr = object.__getattribute__
_ALLOWED_ATTRIBUTES = (
    'api_key',
    'api_base',
    'api_version',
    'verify_ssl_certs'
)
_original_module = _sys.modules[__name__]


class _DeprecationWrapper(object):

    def __getattribute__(self, name):
        value = getattr(_original_module, name)

        # Allow specific names and resources
        if not (name[0] == '_' or
                name in _ALLOWED_ATTRIBUTES or
                _ismodule(value) or
                (_isclass(value) and
                 issubclass(value, APIResource) and
                 value is not APIResource)):
            _warnings.warn(
                'Attribute `%s` is being moved out of the `stripe` module '
                'in version 2.0 of the Stripe bindings.  Please access it '
                'in the appropriate submodule instead' % (name,),
                DeprecationWarning, stacklevel=2)

        return value

    def __setattr__(self, name, value):
        setattr(_original_module, name, value)

    def __delattr__(self, name):
        delattr(_original_module, name)

_sys.modules[__name__] = _DeprecationWrapper()

@@ -1337,1440 +1337,4 @@
 oqa%0A
-%0A%0A# This is a pretty ugly solution to deprecating modules but a similar%0A# approach is used in Zope, Twisted and sanctioned in:%0A# https://mail.python.org/pipermail/python-ideas/2012-May/014969.html%0Aimport sys as _sys%0Aimport warnings as _warnings%0Afrom inspect import isclass as _isclass, ismodule as _ismodule%0A%0A_dogetattr = object.__getattribute__%0A_ALLOWED_ATTRIBUTES = (%0A    'api_key',%0A    'api_base',%0A    'api_version',%0A    'verify_ssl_certs'%0A)%0A_original_module = _sys.modules%5B__name__%5D%0A%0A%0Aclass _DeprecationWrapper(object):%0A%0A    def __getattribute__(self, name):%0A        value = getattr(_original_module, name)%0A%0A        # Allow specific names and resources%0A        if not (name%5B0%5D == '_' or%0A                name in _ALLOWED_ATTRIBUTES or%0A                _ismodule(value) or%0A                (_isclass(value) and%0A                 issubclass(value, APIResource) and%0A                 value is not APIResource)):%0A            _warnings.warn(%0A                'Attribute %60%25s%60 is being moved out of the %60stripe%60 module '%0A                'in version 2.0 of the Stripe bindings.  Please access it '%0A                'in the appropriate submodule instead' %25 (name,),%0A                DeprecationWarning, stacklevel=2)%0A%0A        return value%0A%0A    def __setattr__(self, name, value):%0A        setattr(_original_module, name, value)%0A%0A    def __delattr__(self, name):%0A        delattr(_original_module, name)%0A%0A_sys.modules%5B__name__%5D = _DeprecationWrapper()%0A

Remove deprecation warnings from the top level module