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 .rfis_post_response_permitted_actions_update_rfi_permitted_statuses_wf_u_s_permitted_attributes import RfisPostResponse_permittedActions_updateRfi_permittedStatuses_wfUS_permittedAttributes
    from .rfis_post_response_permitted_actions_update_rfi_permitted_statuses_wf_u_s_required_attributes import RfisPostResponse_permittedActions_updateRfi_permittedStatuses_wfUS_requiredAttributes
    from .rfis_post_response_permitted_actions_update_rfi_permitted_statuses_wf_u_s_status import RfisPostResponse_permittedActions_updateRfi_permittedStatuses_wfUS_status

@dataclass
class RfisPostResponse_permittedActions_updateRfi_permittedStatuses_wfUS(Parsable):
    # The maximum number of users that can be assigned to this RFI.
    max_assignees: Optional[int] = None
    # The list of attributes that the user is optionally allowed to include when updating or creating the RFI in the specified status.
    permitted_attributes: Optional[list[RfisPostResponse_permittedActions_updateRfi_permittedStatuses_wfUS_permittedAttributes]] = None
    # The list of attributes that are required when creating or updating an RFI.
    required_attributes: Optional[list[RfisPostResponse_permittedActions_updateRfi_permittedStatuses_wfUS_requiredAttributes]] = None
    # The current response status of the RFI for single-reviewer workflows (US):Possible values:``draft``, ``submitted``, ``open``, ``answered``, ``rejected``, ``closed``, ``void``.For more information about workflows, see `About RFI Workflows – Autodesk Help <https://help.autodesk.com/view/BUILD/ENU/?guid=RFI_Types>`_.
    status: Optional[RfisPostResponse_permittedActions_updateRfi_permittedStatuses_wfUS_status] = None
    
    @staticmethod
    def create_from_discriminator_value(parse_node: ParseNode) -> RfisPostResponse_permittedActions_updateRfi_permittedStatuses_wfUS:
        """
        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: RfisPostResponse_permittedActions_updateRfi_permittedStatuses_wfUS
        """
        if parse_node is None:
            raise TypeError("parse_node cannot be null.")
        return RfisPostResponse_permittedActions_updateRfi_permittedStatuses_wfUS()
    
    def get_field_deserializers(self,) -> dict[str, Callable[[ParseNode], None]]:
        """
        The deserialization information for the current model
        Returns: dict[str, Callable[[ParseNode], None]]
        """
        from .rfis_post_response_permitted_actions_update_rfi_permitted_statuses_wf_u_s_permitted_attributes import RfisPostResponse_permittedActions_updateRfi_permittedStatuses_wfUS_permittedAttributes
        from .rfis_post_response_permitted_actions_update_rfi_permitted_statuses_wf_u_s_required_attributes import RfisPostResponse_permittedActions_updateRfi_permittedStatuses_wfUS_requiredAttributes
        from .rfis_post_response_permitted_actions_update_rfi_permitted_statuses_wf_u_s_status import RfisPostResponse_permittedActions_updateRfi_permittedStatuses_wfUS_status

        from .rfis_post_response_permitted_actions_update_rfi_permitted_statuses_wf_u_s_permitted_attributes import RfisPostResponse_permittedActions_updateRfi_permittedStatuses_wfUS_permittedAttributes
        from .rfis_post_response_permitted_actions_update_rfi_permitted_statuses_wf_u_s_required_attributes import RfisPostResponse_permittedActions_updateRfi_permittedStatuses_wfUS_requiredAttributes
        from .rfis_post_response_permitted_actions_update_rfi_permitted_statuses_wf_u_s_status import RfisPostResponse_permittedActions_updateRfi_permittedStatuses_wfUS_status

        fields: dict[str, Callable[[Any], None]] = {
            "maxAssignees": lambda n : setattr(self, 'max_assignees', n.get_int_value()),
            "permittedAttributes": lambda n : setattr(self, 'permitted_attributes', n.get_collection_of_object_values(RfisPostResponse_permittedActions_updateRfi_permittedStatuses_wfUS_permittedAttributes)),
            "requiredAttributes": lambda n : setattr(self, 'required_attributes', n.get_collection_of_object_values(RfisPostResponse_permittedActions_updateRfi_permittedStatuses_wfUS_requiredAttributes)),
            "status": lambda n : setattr(self, 'status', n.get_enum_value(RfisPostResponse_permittedActions_updateRfi_permittedStatuses_wfUS_status)),
        }
        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_int_value("maxAssignees", self.max_assignees)
        writer.write_collection_of_object_values("permittedAttributes", self.permitted_attributes)
        writer.write_collection_of_object_values("requiredAttributes", self.required_attributes)
        writer.write_enum_value("status", self.status)
    

