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

import typing

import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ..core.serialization import FieldMetadata
from .page_identifier import PageIdentifier
from .payabli_api_response_error_400_response_data import PayabliApiResponseError400ResponseData


class PayabliApiResponseError400(UniversalBaseModel):
    is_success: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="isSuccess")] = pydantic.Field(
        default=None
    )
    """
    Boolean indicating whether the operation was successful. A `true` value indicates success. A `false` value indicates failure.
    """

    pageidentifier: typing.Optional[PageIdentifier] = None
    response_code: typing_extensions.Annotated[typing.Optional[int], FieldMetadata(alias="responseCode")] = (
        pydantic.Field(default=None)
    )
    """
    A code that indicates the operation's failure reason. See [API Response Codes](https://docs.payabli.com/api-reference/api-responses) for a full reference.
    """

    response_data: typing_extensions.Annotated[
        typing.Optional[PayabliApiResponseError400ResponseData], FieldMetadata(alias="responseData")
    ] = pydantic.Field(default=None)
    """
    Describes the reason for a failed operation and how to resolve it.
    """

    response_text: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="responseText")] = (
        pydantic.Field(default=None)
    )
    """
    Response text for operation: 'Success' or 'Declined'.
    """

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
