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 .with_rfi_get_response_permitted_actions_update_rfi_permitted_statuses_wf_e_u import WithRfiGetResponse_permittedActions_updateRfi_permittedStatuses_wfEU
    from .with_rfi_get_response_permitted_actions_update_rfi_permitted_statuses_wf_u_s import WithRfiGetResponse_permittedActions_updateRfi_permittedStatuses_wfUS

@dataclass
class WithRfiGetResponse_permittedActions_updateRfi_permittedStatuses(Parsable):
    """
    A list of statuses the user is permitted to transition an RFI to.
    """
    # A list of statuses the user is permitted to transition an RFI to in workflows of type ``EMEA``.
    wf_e_u: Optional[list[WithRfiGetResponse_permittedActions_updateRfi_permittedStatuses_wfEU]] = None
    # A list of statuses the user is permitted to transition an RFI to in workflows of type ``US``.
    wf_u_s: Optional[list[WithRfiGetResponse_permittedActions_updateRfi_permittedStatuses_wfUS]] = None
    
    @staticmethod
    def create_from_discriminator_value(parse_node: ParseNode) -> WithRfiGetResponse_permittedActions_updateRfi_permittedStatuses:
        """
        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: WithRfiGetResponse_permittedActions_updateRfi_permittedStatuses
        """
        if parse_node is None:
            raise TypeError("parse_node cannot be null.")
        return WithRfiGetResponse_permittedActions_updateRfi_permittedStatuses()
    
    def get_field_deserializers(self,) -> dict[str, Callable[[ParseNode], None]]:
        """
        The deserialization information for the current model
        Returns: dict[str, Callable[[ParseNode], None]]
        """
        from .with_rfi_get_response_permitted_actions_update_rfi_permitted_statuses_wf_e_u import WithRfiGetResponse_permittedActions_updateRfi_permittedStatuses_wfEU
        from .with_rfi_get_response_permitted_actions_update_rfi_permitted_statuses_wf_u_s import WithRfiGetResponse_permittedActions_updateRfi_permittedStatuses_wfUS

        from .with_rfi_get_response_permitted_actions_update_rfi_permitted_statuses_wf_e_u import WithRfiGetResponse_permittedActions_updateRfi_permittedStatuses_wfEU
        from .with_rfi_get_response_permitted_actions_update_rfi_permitted_statuses_wf_u_s import WithRfiGetResponse_permittedActions_updateRfi_permittedStatuses_wfUS

        fields: dict[str, Callable[[Any], None]] = {
            "wfEU": lambda n : setattr(self, 'wf_e_u', n.get_collection_of_object_values(WithRfiGetResponse_permittedActions_updateRfi_permittedStatuses_wfEU)),
            "wfUS": lambda n : setattr(self, 'wf_u_s', n.get_collection_of_object_values(WithRfiGetResponse_permittedActions_updateRfi_permittedStatuses_wfUS)),
        }
        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("wfEU", self.wf_e_u)
        writer.write_collection_of_object_values("wfUS", self.wf_u_s)
    

