"""Response schemas for administered endpoints.

This module is automatically @generated from the Meraki API specification.
Do not edit this file manually.
"""

from __future__ import annotations

from datetime import datetime

from pydantic import Field, RootModel

from meraki_client.schemas._base import _BaseSchema


class AdministeredAuthenticationApi(_BaseSchema):
    """API authentication."""

    key: AdministeredKey | None = None


class AdministeredAuthenticationTwoFactor(_BaseSchema):
    """TwoFactor authentication."""

    enabled: bool | None = None


class AdministeredKey(_BaseSchema):
    """API key."""

    created: bool | None = None


class GenerateAdministeredIdentitiesMeApiKeysResponse(_BaseSchema):
    """Response for generateAdministeredIdentitiesMeApiKeys operation."""

    key: str | None = None


class GetAdministeredIdentitiesMeApiKeysResponse(
    RootModel[list["GetAdministeredIdentitiesMeApiKeysResponseItem"]]
):
    """Response for getAdministeredIdentitiesMeApiKeys operation."""


class GetAdministeredIdentitiesMeApiKeysResponseItem(_BaseSchema):
    """Schema for GetAdministeredIdentitiesMeApiKeysResponseItem."""

    suffix: str | None = None
    created_at: str | None = Field(
        default=None, validation_alias="createdAt", serialization_alias="createdAt"
    )


class GetAdministeredIdentitiesMeResponse(_BaseSchema):
    """Response for getAdministeredIdentitiesMe operation."""

    name: str | None = None
    email: str | None = None
    last_used_dashboard_at: datetime | None = Field(
        default=None,
        validation_alias="lastUsedDashboardAt",
        serialization_alias="lastUsedDashboardAt",
    )
    authentication: GetAdministeredIdentitiesMeResponseAuthentication | None = None


class GetAdministeredIdentitiesMeResponseAuthentication(_BaseSchema):
    """Authentication info."""

    mode: str | None = None
    api: AdministeredAuthenticationApi | None = None
    two_factor: AdministeredAuthenticationTwoFactor | None = Field(
        default=None, validation_alias="twoFactor", serialization_alias="twoFactor"
    )
    saml: AdministeredAuthenticationTwoFactor | None = None
