"""
Pydantic Models for MONITOR - registration/forticare/create

Runtime validation models for registration/forticare/create configuration.
Generated from FortiOS schema version unknown.
"""

from __future__ import annotations

from pydantic import BaseModel, Field
from typing import Any, Optional

# ============================================================================
# Enum Definitions (for fields with 4+ allowed values)
# ============================================================================


# ============================================================================
# Main Model
# ============================================================================

class CreateModel(BaseModel):
    """
    Pydantic model for registration/forticare/create configuration.
    
    Create a new FortiCare account.
    
    Validation Rules:        - email: pattern=        - password: pattern=        - first_name: pattern=        - last_name: pattern=        - title: pattern=        - company: pattern=        - address: pattern=        - city: pattern=        - country_code: pattern=        - state: pattern=        - state_code: pattern=        - postal_code: pattern=        - phone: pattern=        - industry: pattern=        - industry_id: pattern=        - orgsize_id: pattern=        - reseller_name: pattern=        - reseller_id: pattern=        - is_government: pattern=    """
    
    class Config:
        """Pydantic model configuration."""
        extra = "allow"  # Allow additional fields from API
        str_strip_whitespace = True
        validate_assignment = True  # Validate on attribute assignment
        use_enum_values = True  # Use enum values instead of names
    
    # ========================================================================
    # Model Fields
    # ========================================================================
    
    email: str = Field()    
    password: str = Field()    
    first_name: str = Field()    
    last_name: str = Field()    
    title: str | None = Field(default=None)    
    company: str = Field()    
    address: str = Field()    
    city: str = Field()    
    country_code: Any = Field()    
    state: str = Field()    
    state_code: str | None = Field(default=None)    
    postal_code: str = Field()    
    phone: str = Field()    
    industry: str = Field()    
    industry_id: Any = Field()    
    orgsize_id: Any = Field()    
    reseller_name: str = Field()    
    reseller_id: Any = Field()    
    is_government: Any = Field(default=None)    
    # ========================================================================
    # Custom Validators
    # ========================================================================
    
    # ========================================================================
    # Helper Methods
    # ========================================================================
    
    def to_fortios_dict(self) -> dict[str, Any]:
        """
        Convert model to FortiOS API payload format.
        
        Returns:
            Dict suitable for POST/PUT operations
        """
        # Export with exclude_none to avoid sending null values
        return self.model_dump(exclude_none=True, by_alias=True)
    
    @classmethod
    def from_fortios_response(cls, data: dict[str, Any]) -> "CreateModel":
        """
        Create model instance from FortiOS API response.
        
        Args:
            data: Response data from API
            
        Returns:
            Validated model instance
        """
        return cls(**data)

# ============================================================================
# Type Aliases for Convenience
# ============================================================================

Dict = dict[str, Any]  # For backward compatibility

# ============================================================================
# Module Exports
# ============================================================================

__all__ = [
    "CreateModel",]


# ============================================================================
# Generated by hfortix generator v0.6.0
# Schema: 1.7.0
# Generated: 2026-01-16T15:43:10.367839Z
# ============================================================================