# This file was auto-generated by Fern from our API Definition.

# isort: skip_file

import typing
from importlib import import_module

if typing.TYPE_CHECKING:
    from .types import (
        Aggregation,
        Aggregation_Count,
        Aggregation_Last,
        Aggregation_Max,
        Aggregation_Sum,
        Amount,
        BillingStateResponse,
        CountAggregationPricingMetricInterface,
        CountAggregationPricingMetricResource,
        CreateCustomerPortalSessionResponse,
        CreateFixedRateRequest,
        CreateSimpleUsageBasedRateRequest,
        CreateSubjectResponse,
        CreateSubscriptionCheckoutSessionResponse,
        CustomAggregationPricingMetricInterface,
        FixedRateInterface,
        FlatPrice,
        HttpValidationError,
        InvoiceLineItemResource,
        InvoiceResource,
        InvoiceStatus,
        LastAggregationPricingMetricInterface,
        LastAggregationPricingMetricResource,
        ListInvoicesResponse,
        ListPricingMetricsResponse,
        ListRateCardsResponse,
        ListSubjectsResponse,
        ListSubscriptionsResponse,
        MaxAggregationPricingMetricInterface,
        MaxAggregationPricingMetricResource,
        PackagePrice,
        PackagePriceInputRoundingBehavior,
        PackagePriceOutputRoundingBehavior,
        Period,
        PeriodResource,
        Price,
        Price_Flat,
        Price_Package,
        PricingMetricResource,
        PricingMetricSummaryResource,
        RateCardResource,
        RateCardResourceBillingInterval,
        RateCardResourceUsageBasedRatesItem,
        RateCardResourceUsageBasedRatesItem_Simple,
        SimpleUsageBasedRateInterface,
        SubjectResource,
        SubscriptionResource,
        SubscriptionStatus,
        SumAggregationPricingMetricInterface,
        SumAggregationPricingMetricResource,
        ValidationError,
        ValidationErrorLocItem,
    )
    from .errors import UnprocessableEntityError
    from . import (
        checkout,
        customer_access,
        customer_portal,
        invoices,
        pricing_metrics,
        rate_cards,
        subjects,
        subscriptions,
        usage_events,
    )
    from .client import AsyncLark, Lark
    from .environment import LarkEnvironment
    from .pricing_metrics import (
        PricingMetricAggregation,
        PricingMetricAggregation_Count,
        PricingMetricAggregation_Custom,
        PricingMetricAggregation_Last,
        PricingMetricAggregation_Max,
        PricingMetricAggregation_Sum,
    )
    from .rate_cards import (
        CreateRateCardRequestBillingInterval,
        CreateRateCardRequestUsageBasedRatesItem,
        CreateRateCardRequestUsageBasedRatesItem_Simple,
    )
    from .usage_events import CreateUsageEventRequestDataValue
    from .version import __version__
_dynamic_imports: typing.Dict[str, str] = {
    "Aggregation": ".types",
    "Aggregation_Count": ".types",
    "Aggregation_Last": ".types",
    "Aggregation_Max": ".types",
    "Aggregation_Sum": ".types",
    "Amount": ".types",
    "AsyncLark": ".client",
    "BillingStateResponse": ".types",
    "CountAggregationPricingMetricInterface": ".types",
    "CountAggregationPricingMetricResource": ".types",
    "CreateCustomerPortalSessionResponse": ".types",
    "CreateFixedRateRequest": ".types",
    "CreateRateCardRequestBillingInterval": ".rate_cards",
    "CreateRateCardRequestUsageBasedRatesItem": ".rate_cards",
    "CreateRateCardRequestUsageBasedRatesItem_Simple": ".rate_cards",
    "CreateSimpleUsageBasedRateRequest": ".types",
    "CreateSubjectResponse": ".types",
    "CreateSubscriptionCheckoutSessionResponse": ".types",
    "CreateUsageEventRequestDataValue": ".usage_events",
    "CustomAggregationPricingMetricInterface": ".types",
    "FixedRateInterface": ".types",
    "FlatPrice": ".types",
    "HttpValidationError": ".types",
    "InvoiceLineItemResource": ".types",
    "InvoiceResource": ".types",
    "InvoiceStatus": ".types",
    "Lark": ".client",
    "LarkEnvironment": ".environment",
    "LastAggregationPricingMetricInterface": ".types",
    "LastAggregationPricingMetricResource": ".types",
    "ListInvoicesResponse": ".types",
    "ListPricingMetricsResponse": ".types",
    "ListRateCardsResponse": ".types",
    "ListSubjectsResponse": ".types",
    "ListSubscriptionsResponse": ".types",
    "MaxAggregationPricingMetricInterface": ".types",
    "MaxAggregationPricingMetricResource": ".types",
    "PackagePrice": ".types",
    "PackagePriceInputRoundingBehavior": ".types",
    "PackagePriceOutputRoundingBehavior": ".types",
    "Period": ".types",
    "PeriodResource": ".types",
    "Price": ".types",
    "Price_Flat": ".types",
    "Price_Package": ".types",
    "PricingMetricAggregation": ".pricing_metrics",
    "PricingMetricAggregation_Count": ".pricing_metrics",
    "PricingMetricAggregation_Custom": ".pricing_metrics",
    "PricingMetricAggregation_Last": ".pricing_metrics",
    "PricingMetricAggregation_Max": ".pricing_metrics",
    "PricingMetricAggregation_Sum": ".pricing_metrics",
    "PricingMetricResource": ".types",
    "PricingMetricSummaryResource": ".types",
    "RateCardResource": ".types",
    "RateCardResourceBillingInterval": ".types",
    "RateCardResourceUsageBasedRatesItem": ".types",
    "RateCardResourceUsageBasedRatesItem_Simple": ".types",
    "SimpleUsageBasedRateInterface": ".types",
    "SubjectResource": ".types",
    "SubscriptionResource": ".types",
    "SubscriptionStatus": ".types",
    "SumAggregationPricingMetricInterface": ".types",
    "SumAggregationPricingMetricResource": ".types",
    "UnprocessableEntityError": ".errors",
    "ValidationError": ".types",
    "ValidationErrorLocItem": ".types",
    "__version__": ".version",
    "checkout": ".checkout",
    "customer_access": ".customer_access",
    "customer_portal": ".customer_portal",
    "invoices": ".invoices",
    "pricing_metrics": ".pricing_metrics",
    "rate_cards": ".rate_cards",
    "subjects": ".subjects",
    "subscriptions": ".subscriptions",
    "usage_events": ".usage_events",
}


def __getattr__(attr_name: str) -> typing.Any:
    module_name = _dynamic_imports.get(attr_name)
    if module_name is None:
        raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
    try:
        module = import_module(module_name, __package__)
        if module_name == f".{attr_name}":
            return module
        else:
            return getattr(module, attr_name)
    except ImportError as e:
        raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
    except AttributeError as e:
        raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e


def __dir__():
    lazy_attrs = list(_dynamic_imports.keys())
    return sorted(lazy_attrs)


__all__ = [
    "Aggregation",
    "Aggregation_Count",
    "Aggregation_Last",
    "Aggregation_Max",
    "Aggregation_Sum",
    "Amount",
    "AsyncLark",
    "BillingStateResponse",
    "CountAggregationPricingMetricInterface",
    "CountAggregationPricingMetricResource",
    "CreateCustomerPortalSessionResponse",
    "CreateFixedRateRequest",
    "CreateRateCardRequestBillingInterval",
    "CreateRateCardRequestUsageBasedRatesItem",
    "CreateRateCardRequestUsageBasedRatesItem_Simple",
    "CreateSimpleUsageBasedRateRequest",
    "CreateSubjectResponse",
    "CreateSubscriptionCheckoutSessionResponse",
    "CreateUsageEventRequestDataValue",
    "CustomAggregationPricingMetricInterface",
    "FixedRateInterface",
    "FlatPrice",
    "HttpValidationError",
    "InvoiceLineItemResource",
    "InvoiceResource",
    "InvoiceStatus",
    "Lark",
    "LarkEnvironment",
    "LastAggregationPricingMetricInterface",
    "LastAggregationPricingMetricResource",
    "ListInvoicesResponse",
    "ListPricingMetricsResponse",
    "ListRateCardsResponse",
    "ListSubjectsResponse",
    "ListSubscriptionsResponse",
    "MaxAggregationPricingMetricInterface",
    "MaxAggregationPricingMetricResource",
    "PackagePrice",
    "PackagePriceInputRoundingBehavior",
    "PackagePriceOutputRoundingBehavior",
    "Period",
    "PeriodResource",
    "Price",
    "Price_Flat",
    "Price_Package",
    "PricingMetricAggregation",
    "PricingMetricAggregation_Count",
    "PricingMetricAggregation_Custom",
    "PricingMetricAggregation_Last",
    "PricingMetricAggregation_Max",
    "PricingMetricAggregation_Sum",
    "PricingMetricResource",
    "PricingMetricSummaryResource",
    "RateCardResource",
    "RateCardResourceBillingInterval",
    "RateCardResourceUsageBasedRatesItem",
    "RateCardResourceUsageBasedRatesItem_Simple",
    "SimpleUsageBasedRateInterface",
    "SubjectResource",
    "SubscriptionResource",
    "SubscriptionStatus",
    "SumAggregationPricingMetricInterface",
    "SumAggregationPricingMetricResource",
    "UnprocessableEntityError",
    "ValidationError",
    "ValidationErrorLocItem",
    "__version__",
    "checkout",
    "customer_access",
    "customer_portal",
    "invoices",
    "pricing_metrics",
    "rate_cards",
    "subjects",
    "subscriptions",
    "usage_events",
]
