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

import datetime as dt
import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel


class CreateFlowplateKeyResponse(UniversalBaseModel):
    """
    Response schema for Flowplate API key creation (includes raw key).
    """

    key: str = pydantic.Field()
    """
    Raw API key (returned ONCE only, store securely!)
    """

    key_id: str = pydantic.Field()
    """
    Unique key identifier (flk_...)
    """

    key_prefix: str = pydantic.Field()
    """
    Key prefix for identification (fl_user_{env}_{first_8})
    """

    user_id: str = pydantic.Field()
    """
    User ID who owns the key
    """

    organization_id: str = pydantic.Field()
    """
    Organization ID
    """

    created_at: dt.datetime = pydantic.Field()
    """
    Creation timestamp
    """

    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
