get_object_class (stripe/_object_classes.py)

stripe-python · stripe/_object_classes.py · python · MIT
payments

Returns the Stripe Python class for a given object type string.

# Source: https://github.com/stripe/stripe-python | License: MIT | Copyright 2010-2018 Stripe (http://stripe.com)
# Provided via justclaw.it.com; keep this notice with the code.
# -*- coding: utf-8 -*-
from importlib import import_module
from typing import Dict, Tuple
from typing_extensions import TYPE_CHECKING, Type

from stripe._stripe_object import StripeObject

if TYPE_CHECKING:
    from stripe._api_mode import ApiMode

OBJECT_CLASSES: Dict[str, Tuple[str, str]] = {
    # data structures
    "list": ("stripe._list_object", "ListObject"),
    "search_result": ("stripe._search_result_object", "SearchResultObject"),
    "file": ("stripe._file", "File"),
    # there's also an alt name for compatibility
    "file_upload": ("stripe._file", "File"),
    # Object classes: The beginning of the 

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key