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

import typing_extensions
import typing_extensions
import typing
from .money import MoneyParams
from ..types.dispute_reason import DisputeReason
from ..types.dispute_state import DisputeState
from .disputed_payment import DisputedPaymentParams
from ..types.card_brand import CardBrand


class DisputeParams(typing_extensions.TypedDict):
    """
    Represents a [dispute](https://developer.squareup.com/docs/disputes-api/overview) a cardholder initiated with their bank.
    """

    dispute_id: typing_extensions.NotRequired[typing.Optional[str]]
    """
    The unique ID for this `Dispute`, generated by Square.
    """

    id: typing_extensions.NotRequired[str]
    """
    The unique ID for this `Dispute`, generated by Square.
    """

    amount_money: typing_extensions.NotRequired[MoneyParams]
    """
    The disputed amount, which can be less than the total transaction amount.
    For instance, if multiple items were purchased but the cardholder only initiates a dispute over some of the items.
    """

    reason: typing_extensions.NotRequired[DisputeReason]
    """
    The reason why the cardholder initiated the dispute.
    See [DisputeReason](#type-disputereason) for possible values
    """

    state: typing_extensions.NotRequired[DisputeState]
    """
    The current state of this dispute.
    See [DisputeState](#type-disputestate) for possible values
    """

    due_at: typing_extensions.NotRequired[typing.Optional[str]]
    """
    The deadline by which the seller must respond to the dispute, in [RFC 3339 format](https://developer.squareup.com/docs/build-basics/common-data-types/working-with-dates).
    """

    disputed_payment: typing_extensions.NotRequired[DisputedPaymentParams]
    """
    The payment challenged in this dispute.
    """

    evidence_ids: typing_extensions.NotRequired[typing.Optional[typing.Sequence[str]]]
    """
    The IDs of the evidence associated with the dispute.
    """

    card_brand: typing_extensions.NotRequired[CardBrand]
    """
    The card brand used in the disputed payment.
    See [CardBrand](#type-cardbrand) for possible values
    """

    created_at: typing_extensions.NotRequired[str]
    """
    The timestamp when the dispute was created, in RFC 3339 format.
    """

    updated_at: typing_extensions.NotRequired[str]
    """
    The timestamp when the dispute was last updated, in RFC 3339 format.
    """

    brand_dispute_id: typing_extensions.NotRequired[typing.Optional[str]]
    """
    The ID of the dispute in the card brand system, generated by the card brand.
    """

    reported_date: typing_extensions.NotRequired[typing.Optional[str]]
    """
    The timestamp when the dispute was reported, in RFC 3339 format.
    """

    reported_at: typing_extensions.NotRequired[typing.Optional[str]]
    """
    The timestamp when the dispute was reported, in RFC 3339 format.
    """

    version: typing_extensions.NotRequired[int]
    """
    The current version of the `Dispute`.
    """

    location_id: typing_extensions.NotRequired[typing.Optional[str]]
    """
    The ID of the location where the dispute originated.
    """
