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
from uuid import UUID

if TYPE_CHECKING:
    from .rfi_types_get_response_results_manager import RfiTypesGetResponse_results_manager
    from .rfi_types_get_response_results_project_coordinator import RfiTypesGetResponse_results_projectCoordinator
    from .rfi_types_get_response_results_project_reviewer import RfiTypesGetResponse_results_projectReviewer
    from .rfi_types_get_response_results_status import RfiTypesGetResponse_results_status
    from .rfi_types_get_response_results_watchers import RfiTypesGetResponse_results_watchers
    from .rfi_types_get_response_results_wf_type import RfiTypesGetResponse_results_wfType

@dataclass
class RfiTypesGetResponse_results(Parsable):
    # Not relevant
    bridge_target_project_ids: Optional[list[str]] = None
    # A list of predefined categories to assign to the RFI.Categories help group RFIs for filtering and reporting. Each value must match a category configured in the project’s RFI settings. Categories are case-sensitive and project-specific.RFI categories are configured in Project Admin and may differ between projects.Some possible values: ``Code Compliance``, ``Constructability``, ``Design Coordination``, ``Documentation Conflict``, ``Documentation Incomplete``, ``Field condition``, ``Other``.
    category: Optional[list[str]] = None
    # The default cost impact value for new RFIs of this type.Possible values: ``null``, ``Yes``, ``No``, ``Unknown``.
    cost_impact: Optional[str] = None
    # The list of available disciplines for RFIs.Each discipline is configured in Project Admin.Some possible values: ``Architectural``, ``Civil/Site``, ``Concrete``, ``Electrical``, ``Exterior Envelope``, ``Fire Protection``, ``Interior/Finishes``, ``Landscaping``, ``Masonry``, ``Mechanical``, ``Plumbing``, ``Structural``, ``Other``.
    discipline: Optional[list[str]] = None
    # The number of calendar days from the RFI creation date to the default due date. Used to automatically calculate the RFI due date when creating a new RFI of this type.
    due_date_offset: Optional[int] = None
    # The ID of the default RFI type assigned to the project. This is the unique identifier of the RFI type that will be selected by default when creating a new RFI.
    id: Optional[UUID] = None
    # ``true``: This RFI type is the default for the project.``false``: (default) This RFI type is not the default.
    is_default: Optional[bool] = None
    # The default text for the **Location** field when creating a new RFI.Note that the API does not auto-populate this value.Clients are responsible for applying the default if desired.
    location_description: Optional[str] = None
    # A list of users, companies, or roles who can be assigned to this workflow role.
    manager: Optional[list[RfiTypesGetResponse_results_manager]] = None
    # The name of the RFI type, as configured by the project admin. This name is shown in the ACC UI and in the API when selecting an RFI type.Max length: 50
    name: Optional[str] = None
    # The default priority for new RFIs of this type.The available priority values are configured in Project Admin.If no default is set, this field is ``null``.Note that the API does not auto-populate this value when creating an RFI.Clients are responsible for applying the default if desired.Some possible values: ``null``, ``High``, ``Normal``, ``Low``.
    priority: Optional[str] = None
    # A list of users, companies, or roles that can be assigned to this project role.
    project_coordinator: Optional[list[RfiTypesGetResponse_results_projectCoordinator]] = None
    # A list of users, companies, or roles that can be assigned to this project role.
    project_reviewer: Optional[list[RfiTypesGetResponse_results_projectReviewer]] = None
    # The default value for the Reference field when creating a new RFI.This is typically used when the RFI was created in another system.Note that the API does not auto-populate this value.Clients are responsible for applying the default if desired.Max length: 1000
    reference: Optional[str] = None
    # The default schedule impact value for new RFIs of this type.Possible values: ``null``, ``Yes``, ``No``, ``Unknown``.
    schedule_impact: Optional[str] = None
    # The current status of the RFI type.Possible values:- ``active``: The type is available for use when creating or updating RFIs.- ``inactive``: The type exists but cannot currently be selected when creating RFIs.- ``hidden``: The type is hidden from users in the UI but may still appear in the API.Only active types are available by default when creating new RFIs.
    status: Optional[RfiTypesGetResponse_results_status] = None
    # A list of users, companies, or roles that can be assigned to this project role.
    watchers: Optional[list[RfiTypesGetResponse_results_watchers]] = None
    # The workflow type used for this RFI type.Possible values:- ``US``: The US-style workflow, with a Reviewer and optional Manager.- ``EU``: The EU-style workflow, with a Project Coordinator and Project Reviewer.The workflow type determines the available statuses and workflow roles for RFIs of this type.
    wf_type: Optional[RfiTypesGetResponse_results_wfType] = None
    
    @staticmethod
    def create_from_discriminator_value(parse_node: ParseNode) -> RfiTypesGetResponse_results:
        """
        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: RfiTypesGetResponse_results
        """
        if parse_node is None:
            raise TypeError("parse_node cannot be null.")
        return RfiTypesGetResponse_results()
    
    def get_field_deserializers(self,) -> dict[str, Callable[[ParseNode], None]]:
        """
        The deserialization information for the current model
        Returns: dict[str, Callable[[ParseNode], None]]
        """
        from .rfi_types_get_response_results_manager import RfiTypesGetResponse_results_manager
        from .rfi_types_get_response_results_project_coordinator import RfiTypesGetResponse_results_projectCoordinator
        from .rfi_types_get_response_results_project_reviewer import RfiTypesGetResponse_results_projectReviewer
        from .rfi_types_get_response_results_status import RfiTypesGetResponse_results_status
        from .rfi_types_get_response_results_watchers import RfiTypesGetResponse_results_watchers
        from .rfi_types_get_response_results_wf_type import RfiTypesGetResponse_results_wfType

        from .rfi_types_get_response_results_manager import RfiTypesGetResponse_results_manager
        from .rfi_types_get_response_results_project_coordinator import RfiTypesGetResponse_results_projectCoordinator
        from .rfi_types_get_response_results_project_reviewer import RfiTypesGetResponse_results_projectReviewer
        from .rfi_types_get_response_results_status import RfiTypesGetResponse_results_status
        from .rfi_types_get_response_results_watchers import RfiTypesGetResponse_results_watchers
        from .rfi_types_get_response_results_wf_type import RfiTypesGetResponse_results_wfType

        fields: dict[str, Callable[[Any], None]] = {
            "bridgeTargetProjectIds": lambda n : setattr(self, 'bridge_target_project_ids', n.get_collection_of_primitive_values(str)),
            "category": lambda n : setattr(self, 'category', n.get_collection_of_primitive_values(str)),
            "costImpact": lambda n : setattr(self, 'cost_impact', n.get_str_value()),
            "discipline": lambda n : setattr(self, 'discipline', n.get_collection_of_primitive_values(str)),
            "dueDateOffset": lambda n : setattr(self, 'due_date_offset', n.get_int_value()),
            "id": lambda n : setattr(self, 'id', n.get_uuid_value()),
            "isDefault": lambda n : setattr(self, 'is_default', n.get_bool_value()),
            "locationDescription": lambda n : setattr(self, 'location_description', n.get_str_value()),
            "manager": lambda n : setattr(self, 'manager', n.get_collection_of_object_values(RfiTypesGetResponse_results_manager)),
            "name": lambda n : setattr(self, 'name', n.get_str_value()),
            "priority": lambda n : setattr(self, 'priority', n.get_str_value()),
            "projectCoordinator": lambda n : setattr(self, 'project_coordinator', n.get_collection_of_object_values(RfiTypesGetResponse_results_projectCoordinator)),
            "projectReviewer": lambda n : setattr(self, 'project_reviewer', n.get_collection_of_object_values(RfiTypesGetResponse_results_projectReviewer)),
            "reference": lambda n : setattr(self, 'reference', n.get_str_value()),
            "scheduleImpact": lambda n : setattr(self, 'schedule_impact', n.get_str_value()),
            "status": lambda n : setattr(self, 'status', n.get_enum_value(RfiTypesGetResponse_results_status)),
            "watchers": lambda n : setattr(self, 'watchers', n.get_collection_of_object_values(RfiTypesGetResponse_results_watchers)),
            "wfType": lambda n : setattr(self, 'wf_type', n.get_enum_value(RfiTypesGetResponse_results_wfType)),
        }
        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("bridgeTargetProjectIds", self.bridge_target_project_ids)
        writer.write_collection_of_primitive_values("category", self.category)
        writer.write_str_value("costImpact", self.cost_impact)
        writer.write_collection_of_primitive_values("discipline", self.discipline)
        writer.write_int_value("dueDateOffset", self.due_date_offset)
        writer.write_uuid_value("id", self.id)
        writer.write_bool_value("isDefault", self.is_default)
        writer.write_str_value("locationDescription", self.location_description)
        writer.write_collection_of_object_values("manager", self.manager)
        writer.write_str_value("name", self.name)
        writer.write_str_value("priority", self.priority)
        writer.write_collection_of_object_values("projectCoordinator", self.project_coordinator)
        writer.write_collection_of_object_values("projectReviewer", self.project_reviewer)
        writer.write_str_value("reference", self.reference)
        writer.write_str_value("scheduleImpact", self.schedule_impact)
        writer.write_enum_value("status", self.status)
        writer.write_collection_of_object_values("watchers", self.watchers)
        writer.write_enum_value("wfType", self.wf_type)
    

