# This file is auto-generated by oagen. Do not edit.

from __future__ import annotations

from dataclasses import dataclass
from typing import Any, Dict
from workos._types import _raise_deserialize_error


@dataclass(slots=True)
class DirectoryMetadataUser:
    """Counts of active and inactive directory users."""

    active: int
    """Count of active directory users."""
    inactive: int
    """Count of inactive directory users."""

    @classmethod
    def from_dict(cls, data: Dict[str, Any]) -> "DirectoryMetadataUser":
        """Deserialize from a dictionary."""
        try:
            return cls(
                active=data["active"],
                inactive=data["inactive"],
            )
        except (KeyError, ValueError) as e:
            _raise_deserialize_error("DirectoryMetadataUser", e)

    def to_dict(self) -> Dict[str, Any]:
        """Serialize to a dictionary."""
        result: Dict[str, Any] = {}
        result["active"] = self.active
        result["inactive"] = self.inactive
        return result
