from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass, field
from kiota_abstractions.serialization import Parsable, ParseNode, SerializationWriter
from typing import Any, Optional, TYPE_CHECKING, Union
from uuid import UUID

if TYPE_CHECKING:
    from .metadata_get_response_admin_mappings_submittal_roles import MetadataGetResponse_adminMappingsSubmittalRoles
    from .metadata_get_response_attachment_categories import MetadataGetResponse_attachmentCategories
    from .metadata_get_response_attachment_types import MetadataGetResponse_attachmentTypes
    from .metadata_get_response_attachment_urn_types import MetadataGetResponse_attachmentUrnTypes
    from .metadata_get_response_custom_identifier_sequence_type import MetadataGetResponse_customIdentifierSequenceType
    from .metadata_get_response_default_values import MetadataGetResponse_defaultValues
    from .metadata_get_response_item_types import MetadataGetResponse_itemTypes
    from .metadata_get_response_responses import MetadataGetResponse_responses
    from .metadata_get_response_response_categories import MetadataGetResponse_responseCategories
    from .metadata_get_response_statuses import MetadataGetResponse_statuses
    from .metadata_get_response_submittal_roles import MetadataGetResponse_submittalRoles
    from .metadata_get_response_user_types import MetadataGetResponse_userTypes

@dataclass
class MetadataGetResponse(Parsable):
    # A list of admin mappings for submittal roles.
    admin_mappings_submittal_roles: Optional[list[MetadataGetResponse_adminMappingsSubmittalRoles]] = None
    # A list of attachment categories.
    attachment_categories: Optional[list[MetadataGetResponse_attachmentCategories]] = None
    # A list of attachment types.
    attachment_types: Optional[list[MetadataGetResponse_attachmentTypes]] = None
    # A list of attachment URN types.
    attachment_urn_types: Optional[list[MetadataGetResponse_attachmentUrnTypes]] = None
    # The custom numbering sequence type for the current project. Possible values: ``1`` (Global sequence), ``2`` (Spec sequence).
    custom_identifier_sequence_type: Optional[MetadataGetResponse_customIdentifierSequenceType] = None
    # An object containing the default values for various settings and configurations in the project.
    default_values: Optional[list[MetadataGetResponse_defaultValues]] = None
    # The unique identifier (UUID) for the metadata object.
    id: Optional[UUID] = None
    # ``true``: if there is at least one manager mapping in the project.``false``: if there are no manager mappings in the project.
    is_manager_mapping_defined: Optional[bool] = None
    # A list of submittal item types. This is the same as calling `GET item-types </en/docs/acc/v1/reference/http/submittals-item-types-GET/>`_
    item_types: Optional[list[MetadataGetResponse_itemTypes]] = None
    # ``true``: if there are no submittal items in the project.``false``: if there are submittal items in the project.
    no_items_in_project: Optional[bool] = None
    # ``true``: if there are no packages in the project.``false``: if there are packages in the project.
    no_packages_in_project: Optional[bool] = None
    # A list of categories for responses to submittals.
    response_categories: Optional[list[MetadataGetResponse_responseCategories]] = None
    # A list of responses.This is the same as calling `GET responses </en/docs/acc/v1/reference/http/submittals-responses-GET/>`_
    responses: Optional[list[MetadataGetResponse_responses]] = None
    # A list of statuses representing different stages of a submittal item.
    statuses: Optional[list[MetadataGetResponse_statuses]] = None
    # A list of submittal roles within the project.
    submittal_roles: Optional[list[MetadataGetResponse_submittalRoles]] = None
    # Types of users, such as individual users, companies, and roles.
    user_types: Optional[list[MetadataGetResponse_userTypes]] = None
    
    @staticmethod
    def create_from_discriminator_value(parse_node: ParseNode) -> MetadataGetResponse:
        """
        Creates a new instance of the appropriate class based on discriminator value
        param parse_node: The parse node to use to read the discriminator value and create the object
        Returns: MetadataGetResponse
        """
        if parse_node is None:
            raise TypeError("parse_node cannot be null.")
        return MetadataGetResponse()
    
    def get_field_deserializers(self,) -> dict[str, Callable[[ParseNode], None]]:
        """
        The deserialization information for the current model
        Returns: dict[str, Callable[[ParseNode], None]]
        """
        from .metadata_get_response_admin_mappings_submittal_roles import MetadataGetResponse_adminMappingsSubmittalRoles
        from .metadata_get_response_attachment_categories import MetadataGetResponse_attachmentCategories
        from .metadata_get_response_attachment_types import MetadataGetResponse_attachmentTypes
        from .metadata_get_response_attachment_urn_types import MetadataGetResponse_attachmentUrnTypes
        from .metadata_get_response_custom_identifier_sequence_type import MetadataGetResponse_customIdentifierSequenceType
        from .metadata_get_response_default_values import MetadataGetResponse_defaultValues
        from .metadata_get_response_item_types import MetadataGetResponse_itemTypes
        from .metadata_get_response_responses import MetadataGetResponse_responses
        from .metadata_get_response_response_categories import MetadataGetResponse_responseCategories
        from .metadata_get_response_statuses import MetadataGetResponse_statuses
        from .metadata_get_response_submittal_roles import MetadataGetResponse_submittalRoles
        from .metadata_get_response_user_types import MetadataGetResponse_userTypes

        from .metadata_get_response_admin_mappings_submittal_roles import MetadataGetResponse_adminMappingsSubmittalRoles
        from .metadata_get_response_attachment_categories import MetadataGetResponse_attachmentCategories
        from .metadata_get_response_attachment_types import MetadataGetResponse_attachmentTypes
        from .metadata_get_response_attachment_urn_types import MetadataGetResponse_attachmentUrnTypes
        from .metadata_get_response_custom_identifier_sequence_type import MetadataGetResponse_customIdentifierSequenceType
        from .metadata_get_response_default_values import MetadataGetResponse_defaultValues
        from .metadata_get_response_item_types import MetadataGetResponse_itemTypes
        from .metadata_get_response_responses import MetadataGetResponse_responses
        from .metadata_get_response_response_categories import MetadataGetResponse_responseCategories
        from .metadata_get_response_statuses import MetadataGetResponse_statuses
        from .metadata_get_response_submittal_roles import MetadataGetResponse_submittalRoles
        from .metadata_get_response_user_types import MetadataGetResponse_userTypes

        fields: dict[str, Callable[[Any], None]] = {
            "adminMappingsSubmittalRoles": lambda n : setattr(self, 'admin_mappings_submittal_roles', n.get_collection_of_object_values(MetadataGetResponse_adminMappingsSubmittalRoles)),
            "attachmentCategories": lambda n : setattr(self, 'attachment_categories', n.get_collection_of_object_values(MetadataGetResponse_attachmentCategories)),
            "attachmentTypes": lambda n : setattr(self, 'attachment_types', n.get_collection_of_object_values(MetadataGetResponse_attachmentTypes)),
            "attachmentUrnTypes": lambda n : setattr(self, 'attachment_urn_types', n.get_collection_of_object_values(MetadataGetResponse_attachmentUrnTypes)),
            "customIdentifierSequenceType": lambda n : setattr(self, 'custom_identifier_sequence_type', n.get_enum_value(MetadataGetResponse_customIdentifierSequenceType)),
            "defaultValues": lambda n : setattr(self, 'default_values', n.get_collection_of_object_values(MetadataGetResponse_defaultValues)),
            "id": lambda n : setattr(self, 'id', n.get_uuid_value()),
            "isManagerMappingDefined": lambda n : setattr(self, 'is_manager_mapping_defined', n.get_bool_value()),
            "itemTypes": lambda n : setattr(self, 'item_types', n.get_collection_of_object_values(MetadataGetResponse_itemTypes)),
            "noItemsInProject": lambda n : setattr(self, 'no_items_in_project', n.get_bool_value()),
            "noPackagesInProject": lambda n : setattr(self, 'no_packages_in_project', n.get_bool_value()),
            "responseCategories": lambda n : setattr(self, 'response_categories', n.get_collection_of_object_values(MetadataGetResponse_responseCategories)),
            "responses": lambda n : setattr(self, 'responses', n.get_collection_of_object_values(MetadataGetResponse_responses)),
            "statuses": lambda n : setattr(self, 'statuses', n.get_collection_of_object_values(MetadataGetResponse_statuses)),
            "submittalRoles": lambda n : setattr(self, 'submittal_roles', n.get_collection_of_object_values(MetadataGetResponse_submittalRoles)),
            "userTypes": lambda n : setattr(self, 'user_types', n.get_collection_of_object_values(MetadataGetResponse_userTypes)),
        }
        return fields
    
    def serialize(self,writer: SerializationWriter) -> None:
        """
        Serializes information the current object
        param writer: Serialization writer to use to serialize this model
        Returns: None
        """
        if writer is None:
            raise TypeError("writer cannot be null.")
        writer.write_collection_of_object_values("adminMappingsSubmittalRoles", self.admin_mappings_submittal_roles)
        writer.write_collection_of_object_values("attachmentCategories", self.attachment_categories)
        writer.write_collection_of_object_values("attachmentTypes", self.attachment_types)
        writer.write_collection_of_object_values("attachmentUrnTypes", self.attachment_urn_types)
        writer.write_enum_value("customIdentifierSequenceType", self.custom_identifier_sequence_type)
        writer.write_collection_of_object_values("defaultValues", self.default_values)
        writer.write_uuid_value("id", self.id)
        writer.write_bool_value("isManagerMappingDefined", self.is_manager_mapping_defined)
        writer.write_collection_of_object_values("itemTypes", self.item_types)
        writer.write_bool_value("noItemsInProject", self.no_items_in_project)
        writer.write_bool_value("noPackagesInProject", self.no_packages_in_project)
        writer.write_collection_of_object_values("responseCategories", self.response_categories)
        writer.write_collection_of_object_values("responses", self.responses)
        writer.write_collection_of_object_values("statuses", self.statuses)
        writer.write_collection_of_object_values("submittalRoles", self.submittal_roles)
        writer.write_collection_of_object_values("userTypes", self.user_types)
    

