# Copyright 2026 Guildhouse Dev
# SPDX-License-Identifier: Apache-2.0

"""Pydantic models for Intune device management."""

from datetime import datetime
from typing import Optional

from pydantic import BaseModel


class DeviceSummary(BaseModel):
    device_id: str
    device_name: str = ""
    os_type: str = ""  # windows, linux, macOS, android, iOS
    os_version: str = ""
    compliance_state: str = ""  # compliant, noncompliant, unknown, configManager, ...
    last_sync: Optional[datetime] = None
    user_principal_name: Optional[str] = None
    entra_device_id: Optional[str] = None


class ComplianceState(BaseModel):
    device_id: str
    compliant: bool
    state: str = ""  # compliant, noncompliant, configManager, ...
    detail: Optional[str] = None
    last_evaluated: datetime
