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

if TYPE_CHECKING:
    from .requirements_get_response_spec_sections_submittal_groups_submittal_group_types_submittal_type import RequirementsGetResponse_specSections_submittalGroups_submittalGroupTypes_submittalType

@dataclass
class RequirementsGetResponse_specSections_submittalGroups_submittalGroupTypes(Parsable):
    # The type of submittal. This corresponds to the *Submittal type* column in the UI.Possible values: ``Test Reports``, ``Shop Drawings``, ``Schedules``, ``Samples``, ``Sample Warranty``, ``Reports``, ``Qualification Data``, ``QUALITY ASSURANCE``, ``Product Data``, ``Performance Data``, ``Mfg. Instructions``, ``Meeting/Conferences``, ``Drawings``, ``Delegated-Design``, ``Certifications``, ``Certificates``, ``Calculations``, ``Attic Stock``, ``Demonstrations``, ``General Warranties``, ``O&M Manuals``, ``Special Warranties``, ``LEED``, ``As-Builts``, ``TESTS AND INSPECTIONS``, ``General``, ``Manufacturers Instructions``, ``Substitutions``, ``Mix Design``, ``Others``
    submittal_type: Optional[RequirementsGetResponse_specSections_submittalGroups_submittalGroupTypes_submittalType] = None
    # The number of submittals for the submittal type.
    total: Optional[int] = None
    
    @staticmethod
    def create_from_discriminator_value(parse_node: ParseNode) -> RequirementsGetResponse_specSections_submittalGroups_submittalGroupTypes:
        """
        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: RequirementsGetResponse_specSections_submittalGroups_submittalGroupTypes
        """
        if parse_node is None:
            raise TypeError("parse_node cannot be null.")
        return RequirementsGetResponse_specSections_submittalGroups_submittalGroupTypes()
    
    def get_field_deserializers(self,) -> dict[str, Callable[[ParseNode], None]]:
        """
        The deserialization information for the current model
        Returns: dict[str, Callable[[ParseNode], None]]
        """
        from .requirements_get_response_spec_sections_submittal_groups_submittal_group_types_submittal_type import RequirementsGetResponse_specSections_submittalGroups_submittalGroupTypes_submittalType

        from .requirements_get_response_spec_sections_submittal_groups_submittal_group_types_submittal_type import RequirementsGetResponse_specSections_submittalGroups_submittalGroupTypes_submittalType

        fields: dict[str, Callable[[Any], None]] = {
            "submittalType": lambda n : setattr(self, 'submittal_type', n.get_enum_value(RequirementsGetResponse_specSections_submittalGroups_submittalGroupTypes_submittalType)),
            "total": lambda n : setattr(self, 'total', n.get_int_value()),
        }
        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_enum_value("submittalType", self.submittal_type)
        writer.write_int_value("total", self.total)
    

