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 .smartregister_get_response_spec_category import SmartregisterGetResponse_specCategory
    from .smartregister_get_response_target_group import SmartregisterGetResponse_targetGroup

@dataclass
class SmartregisterGetResponse(Parsable):
    # The division code associated with the submittal. This is the equivalent to the *Division* column in the UI.
    division_code: Optional[str] = None
    # The division name associated with the submittal. This is equivalent to the name in the *Division* filter in the UI.
    division_name: Optional[str] = None
    # The submittal sub section code. This is equivalent to the *Sub section number* column in the UI.
    para_code: Optional[str] = None
    # The type of specification category associated with the submittal. This is equivalent to *Submittal type* 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``
    spec_category: Optional[SmartregisterGetResponse_specCategory] = None
    # The CSI specification name of the submittal. This is equivalent of the *Section name* column in the UI.
    spec_name: Optional[str] = None
    # The CSI specification code of the submittal. This is equivalent to the *Section number* column in the UI.
    spec_number: Optional[str] = None
    # The description of the submittal. This is equivalent to the *Submittal description* column in the UI.
    submittal_description: Optional[str] = None
    # The index of the submittal in the submittal log. This is the equivalent to the *Submittal number* column in the UI.
    submittal_id: Optional[str] = None
    # The name of the submittal sub section. This is equivalent to *Sub section name* column in the UI.
    submittals_heading: Optional[str] = None
    # The submittal target date, in ISO 8601 format. This is equivalent to the *Target date* column in the UI.
    target_date: Optional[str] = None
    # The submittal group associcated with the submittal. This is equivalent to the *Submittal group* column in the UI.Possible values: ``ACTION AND INFORMATIONAL``, ``Closeout Submittals``, ``DIVISION 01 REQUIREMENTS``, ``Field Quality Control``, ``Mockups``, ``QUALITY ASSURANCE``, ``TESTS AND INSPECTIONS``
    target_group: Optional[SmartregisterGetResponse_targetGroup] = None
    # The user notes associcated with the submittal. This is equivalent to the *User notes* column in the UI.
    user_notes: Optional[str] = None
    # The version name provided by the user when creating the version.
    version_name: Optional[str] = None
    
    @staticmethod
    def create_from_discriminator_value(parse_node: ParseNode) -> SmartregisterGetResponse:
        """
        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: SmartregisterGetResponse
        """
        if parse_node is None:
            raise TypeError("parse_node cannot be null.")
        return SmartregisterGetResponse()
    
    def get_field_deserializers(self,) -> dict[str, Callable[[ParseNode], None]]:
        """
        The deserialization information for the current model
        Returns: dict[str, Callable[[ParseNode], None]]
        """
        from .smartregister_get_response_spec_category import SmartregisterGetResponse_specCategory
        from .smartregister_get_response_target_group import SmartregisterGetResponse_targetGroup

        from .smartregister_get_response_spec_category import SmartregisterGetResponse_specCategory
        from .smartregister_get_response_target_group import SmartregisterGetResponse_targetGroup

        fields: dict[str, Callable[[Any], None]] = {
            "divisionCode": lambda n : setattr(self, 'division_code', n.get_str_value()),
            "divisionName": lambda n : setattr(self, 'division_name', n.get_str_value()),
            "paraCode": lambda n : setattr(self, 'para_code', n.get_str_value()),
            "specCategory": lambda n : setattr(self, 'spec_category', n.get_enum_value(SmartregisterGetResponse_specCategory)),
            "specName": lambda n : setattr(self, 'spec_name', n.get_str_value()),
            "specNumber": lambda n : setattr(self, 'spec_number', n.get_str_value()),
            "submittalDescription": lambda n : setattr(self, 'submittal_description', n.get_str_value()),
            "submittalId": lambda n : setattr(self, 'submittal_id', n.get_str_value()),
            "submittalsHeading": lambda n : setattr(self, 'submittals_heading', n.get_str_value()),
            "targetDate": lambda n : setattr(self, 'target_date', n.get_str_value()),
            "targetGroup": lambda n : setattr(self, 'target_group', n.get_enum_value(SmartregisterGetResponse_targetGroup)),
            "userNotes": lambda n : setattr(self, 'user_notes', n.get_str_value()),
            "versionName": lambda n : setattr(self, 'version_name', n.get_str_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_str_value("divisionCode", self.division_code)
        writer.write_str_value("divisionName", self.division_name)
        writer.write_str_value("paraCode", self.para_code)
        writer.write_enum_value("specCategory", self.spec_category)
        writer.write_str_value("specName", self.spec_name)
        writer.write_str_value("specNumber", self.spec_number)
        writer.write_str_value("submittalDescription", self.submittal_description)
        writer.write_str_value("submittalId", self.submittal_id)
        writer.write_str_value("submittalsHeading", self.submittals_heading)
        writer.write_str_value("targetDate", self.target_date)
        writer.write_enum_value("targetGroup", self.target_group)
        writer.write_str_value("userNotes", self.user_notes)
        writer.write_str_value("versionName", self.version_name)
    

