# 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 .create_credential_request_credential import CreateCredentialRequestCredential
from .skyvern_forge_sdk_schemas_credentials_credential_type import SkyvernForgeSdkSchemasCredentialsCredentialType


class CreateCredentialRequest(UniversalBaseModel):
    """
    Request model for creating a new credential.
    """

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

    credential_type: SkyvernForgeSdkSchemasCredentialsCredentialType = pydantic.Field()
    """
    Type of credential to create
    """

    credential: CreateCredentialRequestCredential = pydantic.Field()
    """
    The credential data to store
    """

    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
