# 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


class ApplePayMetadata(UniversalBaseModel):
    """
    This metadata appears only when the domain verification check fails. It gives more information about why the check failed.
    """

    is_file_available: typing_extensions.Annotated[
        typing.Optional[bool],
        FieldMetadata(alias="isFileAvailable"),
        pydantic.Field(
            alias="isFileAvailable",
            description="When `true`, indicates whether the domain verification file is available at the expected path. When `false`, Payabli was unable to find the file at the expected path. If the file is missing, make sure it's hosted at the correct path: `/.well-known/apple-developer-merchantid-domain-association`",
        ),
    ] = None
    is_file_content_valid: typing_extensions.Annotated[
        typing.Optional[bool],
        FieldMetadata(alias="isFileContentValid"),
        pydantic.Field(
            alias="isFileContentValid",
            description="Indicates whether the domain verification file content is valid. If the file is invalid, try downloading it and hosting it again.",
        ),
    ] = None
    redirect_domain_name: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="redirectDomainName"),
        pydantic.Field(
            alias="redirectDomainName", description="The domain name if the domain verification URL returns a redirect."
        ),
    ] = None
    redirect_url: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="redirectUrl"),
        pydantic.Field(
            alias="redirectUrl",
            description="If the domain verification URL is redirected, this is the URL it's redirected to. \nFor example, www.partner.com could redirect to www.partners-new-home-page.com. In this case, you should add www.partners-new-home-page.com as a domain instead of www.partner.com.",
        ),
    ] = None
    status_code: typing_extensions.Annotated[
        typing.Optional[int],
        FieldMetadata(alias="statusCode"),
        pydantic.Field(alias="statusCode", description="The status code return by the domain verification URL."),
    ] = 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
