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_e_u_required_attributes_values import RfisPostResponse_permittedActions_updateRfi_permittedStatuses_wfEU_requiredAttributes_values

@dataclass
class RfisPostResponse_permittedActions_updateRfi_permittedStatuses_wfEU_requiredAttributes(Parsable):
    # The name of the RFI attribute that must be provided when updating or creating an RFI in the specified status.
    name: Optional[str] = None
    # The list of allowed values for the required attribute.
    values: Optional[list[RfisPostResponse_permittedActions_updateRfi_permittedStatuses_wfEU_requiredAttributes_values]] = None
    
    @staticmethod
    def create_from_discriminator_value(parse_node: ParseNode) -> RfisPostResponse_permittedActions_updateRfi_permittedStatuses_wfEU_requiredAttributes:
        """
        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_wfEU_requiredAttributes
        """
        if parse_node is None:
            raise TypeError("parse_node cannot be null.")
        return RfisPostResponse_permittedActions_updateRfi_permittedStatuses_wfEU_requiredAttributes()
    
    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_e_u_required_attributes_values import RfisPostResponse_permittedActions_updateRfi_permittedStatuses_wfEU_requiredAttributes_values

        from .rfis_post_response_permitted_actions_update_rfi_permitted_statuses_wf_e_u_required_attributes_values import RfisPostResponse_permittedActions_updateRfi_permittedStatuses_wfEU_requiredAttributes_values

        fields: dict[str, Callable[[Any], None]] = {
            "name": lambda n : setattr(self, 'name', n.get_str_value()),
            "values": lambda n : setattr(self, 'values', n.get_collection_of_object_values(RfisPostResponse_permittedActions_updateRfi_permittedStatuses_wfEU_requiredAttributes_values)),
        }
        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("name", self.name)
        writer.write_collection_of_object_values("values", self.values)
    

