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 .me_get_response_workflow_type import MeGetResponse_workflow_type

@dataclass
class MeGetResponse_workflow(Parsable):
    # The list of RFI workflow roles assigned to the user. Possible values:``projectSC`` — Creator``projectGC`` — Manager``projectCoordinator`` — Reviewer 1 (EMEA workflow only)``projectReviewer`` — Reviewer 1 (US) or Reviewer 2 (EMEA)For information about workflow roles, see the `RFIs Permission <https://help.autodesk.com/view/BUILD/ENU/?guid=RFI_Statuses>`_ documentation.
    roles: Optional[list[str]] = None
    # The RFI workflow type assigned to the project.Possible values:``US`` Single-reviewer workflow``EU`` Two-reviewer workflowNote that you cannot set the workflow type via the API. To change it, use the Project Admin UI.
    type: Optional[MeGetResponse_workflow_type] = None
    
    @staticmethod
    def create_from_discriminator_value(parse_node: ParseNode) -> MeGetResponse_workflow:
        """
        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: MeGetResponse_workflow
        """
        if parse_node is None:
            raise TypeError("parse_node cannot be null.")
        return MeGetResponse_workflow()
    
    def get_field_deserializers(self,) -> dict[str, Callable[[ParseNode], None]]:
        """
        The deserialization information for the current model
        Returns: dict[str, Callable[[ParseNode], None]]
        """
        from .me_get_response_workflow_type import MeGetResponse_workflow_type

        from .me_get_response_workflow_type import MeGetResponse_workflow_type

        fields: dict[str, Callable[[Any], None]] = {
            "roles": lambda n : setattr(self, 'roles', n.get_collection_of_primitive_values(str)),
            "type": lambda n : setattr(self, 'type', n.get_enum_value(MeGetResponse_workflow_type)),
        }
        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_primitive_values("roles", self.roles)
        writer.write_enum_value("type", self.type)
    

