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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .credential_response_credential import CredentialResponseCredential
from .credential_type_output import CredentialTypeOutput


class CredentialResponse(UniversalBaseModel):
    """
    Response model for credential operations.
    """

    credential_id: str = pydantic.Field()
    """
    Unique identifier for the credential
    """

    credential: CredentialResponseCredential = pydantic.Field()
    """
    The credential data
    """

    credential_type: CredentialTypeOutput = pydantic.Field()
    """
    Type of the credential
    """

    name: str = pydantic.Field()
    """
    Name of the credential
    """

    browser_profile_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    Browser profile ID linked to this credential
    """

    tested_url: typing.Optional[str] = pydantic.Field(default=None)
    """
    Login page URL used during the credential test
    """

    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
