# 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(
            alias="isSuccess",
            description="Boolean indicating whether the operation was successful. A `true` value indicates success. A `false` value indicates failure.",
        ),
    ] = None
    pageidentifier: typing.Optional[PageIdentifier] = None
    response_code: typing_extensions.Annotated[
        typing.Optional[int],
        FieldMetadata(alias="responseCode"),
        pydantic.Field(
            alias="responseCode",
            description="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.",
        ),
    ] = None
    response_data: typing_extensions.Annotated[
        typing.Optional[PayabliApiResponseError400ResponseData],
        FieldMetadata(alias="responseData"),
        pydantic.Field(
            alias="responseData", description="Describes the reason for a failed operation and how to resolve it."
        ),
    ] = None
    response_text: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="responseText"),
        pydantic.Field(alias="responseText", description="Response text for operation: 'Success' or 'Declined'."),
    ] = None

    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
