# generated by datamodel-codegen:
#   timestamp: 2025-10-13T03:49:55+00:00
#


from typing import Any

from pydantic import BaseModel


class IpInfo(BaseModel):  # type: ignore
    ip: str
    country: str
    isoStateCode: str
    lat: float
    lon: float


class User(BaseModel):  # type: ignore
    id: int
    roleId: int
    email: str
    tz: str
    locale: str
    orgId: int
    status: str
    lastLoggedAt: int
    registeredAt: int
    ipInfo: IpInfo
    country: str
    phoneNumber: str
    customFields: dict[str, Any]
    isDev: bool
    isDarkMode: bool
    address: dict[str, Any]


class Role(BaseModel):  # type: ignore
    id: int
    name: str
    permissionGroup1: int
    permissionGroup2: int
    permissionGroup3: int
    permissionGroup4: int


class Address(BaseModel):  # type: ignore
    fullAddress: str
    city: str
    country: str
    state: str
    zip: str


class SmsSettings(BaseModel):  # type: ignore
    enabled: bool
    provider: str


class Organization(BaseModel):  # type: ignore
    id: int
    name: str
    type: str
    tz: str
    lastModifiedTs: int
    parentId: int
    parentOrgName: str
    roles: list[Role]
    hierarchy: list[int]
    deviceCount: int
    childrenCount: int
    userCount: int
    totalUserCount: int
    templatesCount: int
    hasAnalytic: bool
    address: Address
    phoneNumber: str
    areAutomationConditionsEnabled: bool
    areAutomationActionsEnabled: bool
    hasAutomations: bool
    hasProductWithContentEvent: bool
    hasEventAnalyticsDashboards: bool
    smsSettings: SmsSettings
    isShared: bool


class GeneralSettings(BaseModel):  # type: ignore
    appName: str
    locationTerm: str
    isGeoCloud: bool
    isBillingEnabled: bool
    allowedClientTypes: list[str]
    allowRegisterFrom: list[str]
    theme: str
    period: str
    websiteUrl: str
    docsUrl: str
    defaultRoleId: int
    isFleetEnabled: bool
    isDREnabled: bool
    isRuleEngineEnabled: bool
    isInAppCampaignsEnabled: bool
    isSharingEnabled: bool
    isInviteWithoutVerificationEnabled: bool
    useOldReportingFormat: bool
    isTranslationEnabled: bool
    isBLEAssistEnabled: bool
    isBlueprintsEnabled: bool
    isImageStreamingEnabled: bool
    isUnitConversionEnabled: bool
    isHealthCheckWorkerEnabled: bool
    isShipmentsMobileDownloadEnabled: bool
    isOrgDataStoragePeriodEnabled: bool
    isMobileConnectedRuleEnabled: bool
    isUserInMultipleOrganizationsEnabled: bool
    isCustomDataEnabled: bool
    isCustomRolesEnabled: bool
    isRawStringStorageEnabled: bool
    isAiEnabled: bool
    isDecodersEnabled: bool
    isWLBillingEnabled: bool
    isManagementApiEnabled: bool


class EviqoUserModel(BaseModel):  # type: ignore
    user: User
    organization: Organization
    role: Role
    showSurvey: bool
    generalSettings: GeneralSettings
    mapboxToken: str
    hasSimCardInfo: bool
    deviceFileStorageEnabled: bool
    serverVersion: str
    sharedOrgsCount: int
