# -*- coding: utf-8 -*-
# ----  AUTO-GENERATED BY redox_lib_gen. DO NOT MODIFY MANUALLY!!  ---- #

from typing import List, Union

from pydantic import Field

from ..abstract_base import EventTypeAbstractModel, RedoxAbstractModel
from ..field_types import Number


class QueryResponse(EventTypeAbstractModel):

    Directory: str = Field(...)
    Meta: "QueryResponseMeta" = Field(...)
    Organizations: List["QueryResponseOrganization"] = Field(...)
    Paging: "QueryResponsePaging" = Field(None)


class QueryResponseMeta(RedoxAbstractModel):

    DataModel: str = Field(...)
    Destinations: List["QueryResponseMetaDestination"] = Field(None)
    EventDateTime: Union[str, None] = Field(None)
    EventType: str = Field(...)
    FacilityCode: Union[str, None] = Field(None)
    Logs: List["QueryResponseMetaLog"] = Field(None)
    Message: "QueryResponseMetaMessage" = Field(None)
    Source: "QueryResponseMetaSource" = Field(None)
    Test: Union[bool, None] = Field(None)
    Transmission: "QueryResponseMetaTransmission" = Field(None)


class QueryResponseMetaDestination(RedoxAbstractModel):

    ID: Union[str, None] = Field(None)
    Name: Union[str, None] = Field(None)


class QueryResponseMetaLog(RedoxAbstractModel):

    AttemptID: Union[str, None] = Field(None)
    ID: Union[str, None] = Field(None)


class QueryResponseMetaMessage(RedoxAbstractModel):

    ID: Union[Number, None] = Field(None)


class QueryResponseMetaSource(RedoxAbstractModel):

    ID: Union[str, None] = Field(None)
    Name: Union[str, None] = Field(None)


class QueryResponseMetaTransmission(RedoxAbstractModel):

    ID: Union[Number, None] = Field(None)


class QueryResponseOrganization(RedoxAbstractModel):

    Active: bool = Field(...)
    Address: "QueryResponseOrganizationAddress" = Field(None)
    Aliases: List[str] = Field(None)
    Contacts: List["QueryResponseOrganizationContact"] = Field(None)
    Identifiers: List["QueryResponseOrganizationIdentifier"] = Field(None)
    ManagingOrg: Union[str, None] = Field(None)
    Name: str = Field(...)
    PartOf: "QueryResponseOrganizationPartOf" = Field(None)
    Type: "QueryResponseOrganizationType" = Field(None)


class QueryResponseOrganizationAddress(RedoxAbstractModel):

    City: Union[str, None] = Field(None)
    Country: Union[str, None] = Field(None)
    County: Union[str, None] = Field(None)
    State: Union[str, None] = Field(None)
    StreetAddress: Union[str, None] = Field(None)
    ZIP: Union[str, None] = Field(None)


class QueryResponseOrganizationContact(RedoxAbstractModel):

    EmailAddresses: List[str] = Field(None)
    Name: Union[str, None] = Field(None)
    PhoneNumber: "QueryResponseOrganizationContactPhoneNumber" = Field(None)
    Purpose: Union[str, None] = Field(None)


class QueryResponseOrganizationContactPhoneNumber(RedoxAbstractModel):

    Home: Union[str, None] = Field(None)
    Mobile: Union[str, None] = Field(None)
    Work: Union[str, None] = Field(None)


class QueryResponseOrganizationIdentifier(RedoxAbstractModel):

    ID: Union[str, None] = Field(None)
    IDType: Union[str, None] = Field(None)


class QueryResponseOrganizationPartOf(RedoxAbstractModel):

    Identifier: "QueryResponseOrganizationPartOfIdentifier" = Field(None)


class QueryResponseOrganizationPartOfIdentifier(RedoxAbstractModel):

    System: Union[str, None] = Field(None)
    Type: Union[str, None] = Field(None)
    Value: Union[str, None] = Field(None)


class QueryResponseOrganizationType(RedoxAbstractModel):

    System: Union[str, None] = Field(None)
    Value: Union[str, None] = Field(None)


class QueryResponsePaging(RedoxAbstractModel):

    Count: Union[Number, None] = Field(None)
    Index: Union[Number, None] = Field(None)


QueryResponse.update_forward_refs()
QueryResponseMeta.update_forward_refs()
QueryResponseOrganization.update_forward_refs()
QueryResponseOrganizationContact.update_forward_refs()
QueryResponseOrganizationPartOf.update_forward_refs()
