# -*- coding: utf-8 -*-
# File generated from our OpenAPI spec
from stripe._request_options import RequestOptions
from typing import List, Union
from typing_extensions import Literal, NotRequired, TypedDict


class SessionCreateParams(RequestOptions):
    account_holder: NotRequired["SessionCreateParamsAccountHolder"]
    """
    The account holder to link accounts for.
    """
    expand: NotRequired[List[str]]
    """
    Specifies which fields in the response should be expanded.
    """
    filters: NotRequired["SessionCreateParamsFilters"]
    """
    Filters to restrict the kinds of accounts to collect.
    """
    hosted: NotRequired["SessionCreateParamsHosted"]
    """
    Settings for hosted Sessions. Required if `ui_mode` is `hosted`.
    """
    limits: NotRequired["SessionCreateParamsLimits"]
    """
    Settings for configuring Session-specific limits.
    """
    manual_entry: NotRequired["SessionCreateParamsManualEntry"]
    """
    Customize manual entry behavior
    """
    permissions: List[
        Literal["balances", "ownership", "payment_method", "transactions"]
    ]
    """
    List of data features that you would like to request access to.

    Possible values are `balances`, `transactions`, `ownership`, and `payment_method`.
    """
    prefetch: NotRequired[
        List[
            Literal[
                "balances", "inferred_balances", "ownership", "transactions"
            ]
        ]
    ]
    """
    List of data features that you would like to retrieve upon account creation.
    """
    relink_options: NotRequired["SessionCreateParamsRelinkOptions"]
    """
    Options for specifying a Session targeted to relinking an authorization.
    """
    return_url: NotRequired[str]
    """
    For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app.
    """
    ui_mode: NotRequired[Literal["hosted", "modal"]]
    """
    The UI mode of the Session. Defaults to `modal`.
    """


class SessionCreateParamsAccountHolder(TypedDict):
    account: NotRequired[str]
    """
    The ID of the Stripe account whose accounts you will retrieve. Only available when `type` is `account`.
    """
    customer: NotRequired[str]
    """
    The ID of the Stripe customer whose accounts you will retrieve. Only available when `type` is `customer`.
    """
    customer_account: NotRequired[str]
    """
    The ID of Account representing a customer whose accounts you will retrieve. Only available when `type` is `customer`.
    """
    type: Literal["account", "customer"]
    """
    Type of account holder to collect accounts for.
    """


class SessionCreateParamsFilters(TypedDict):
    account_subcategories: NotRequired[
        List[
            Literal[
                "checking",
                "credit_card",
                "line_of_credit",
                "mortgage",
                "savings",
            ]
        ]
    ]
    """
    Restricts the Session to subcategories of accounts that can be linked. Valid subcategories are: `checking`, `savings`, `mortgage`, `line_of_credit`, `credit_card`.
    """
    countries: NotRequired[List[str]]
    """
    List of countries from which to collect accounts.
    """
    institution: NotRequired[str]
    """
    Stripe ID of the institution with which the customer should be directed to log in.
    """


class SessionCreateParamsHosted(TypedDict):
    delivery_method: NotRequired[Literal["email", "url"]]
    """
    How the user should enter the hosted flow. The values `email` and `url` can only be used if `relink_options` is provided.
    """


class SessionCreateParamsLimits(TypedDict):
    accounts: Union[Literal[""], int]
    """
    The number of accounts that can be linked in this Session. Pass an empty value to allow any number of accounts.
    """


class SessionCreateParamsManualEntry(TypedDict):
    mode: NotRequired[Literal["automatic", "custom"]]
    """
    How manual entry should be handled.
    """


class SessionCreateParamsRelinkOptions(TypedDict):
    account: NotRequired[str]
    """
    The account to relink. Must belong to the authorization specified in `authorization`.
    """
    authorization: str
    """
    The authorization to relink.
    """
