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 .rfis_post_request_body_assigned_to import RfisPostRequestBody_assignedTo
    from .rfis_post_request_body_co_reviewers import RfisPostRequestBody_coReviewers
    from .rfis_post_request_body_custom_attributes import RfisPostRequestBody_customAttributes
    from .rfis_post_request_body_status import RfisPostRequestBody_status
    from .rfis_post_request_body_watchers import RfisPostRequestBody_watchers

@dataclass
class RfisPostRequestBody(Parsable):
    # The list of users assigned to the RFI.
    assigned_to: Optional[list[RfisPostRequestBody_assignedTo]] = 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. Call `GET rfi-types </en/docs/acc/v1/reference/http/rfis-rfi-types-GET>`_ to retrieve the allowed values for this field.Some possible values: ``Code Compliance``, ``Constructability``, ``Design Coordination``, ``Documentation Conflict``, ``Documentation Incomplete``, ``Field condition``, ``Other``.
    category: Optional[list[str]] = None
    # A list of reviewers assigned to the RFI. Each entry may represent a user, role, or company.
    co_reviewers: Optional[list[RfisPostRequestBody_coReviewers]] = None
    # The default cost impact value for new RFIs of this type.Possible values: ``null``, ``Yes``, ``No``, ``Unknown``.To check whether cost impact options are enabled and to retrieve the default value, call `GET rfi-types <en/docs/acc/v1/reference/http/rfis-RFI-types-GET/>`_.
    cost_impact: Optional[str] = None
    # A list of custom attributes associated with the RFI.
    custom_attributes: Optional[list[RfisPostRequestBody_customAttributes]] = None
    # The discipline associated with the RFI. To retrieve the supported values for the current project, call `GET rfi-types </en/docs/acc/v1/reference/http/rfis-rfi-types-GET>`_.Some possible values: ``Building Management System``, ``Electrical Substation``, ``Security``, ``Audio Visual``, ``Food Service``, ``Fire Alarm``, ``Power Systems``, ``Design Systems Integrator``, ``Signage``, ``Pathways``, ``Cabling``, ``Networks``, ``Distributed Antenna System``, ``Lighting``, ``Vertical Transportation``, ``Roofing``, ``Architectural``, ``Civil/Site``, ``Concrete``, ``Electrical``, ``Exterior Envelope``, ``Fire Protection``, ``Interior/Finishes``, ``Landscaping``, ``Masonry``, ``Mechanical``, ``Plumbing``, ``Structural``, ``Other``.'
    discipline: Optional[list[str]] = None
    # The timestamp of the due date for the RFI, in the following format: YYYY-MM-DDThh:mm:ss.sz.
    due_date: Optional[str] = None
    # Unique identifier for the RFI. This is system-generated and should not be included when creating a new RFI unless the client needs to set the RFI ID in advance.
    id: Optional[UUID] = 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.To retrieve the default value configured for this field, call `GET rfi-types </en/docs/acc/v1/reference/http/rfis-rfi-types-GET>`_.
    location_description: Optional[str] = None
    # A list of predefined location IDs associated with the RFI, based on the project’s Location Breakdown Structure (LBS). To get more information about the locations, call `GET nodes </en/docs/acc/v1/reference/http/locations-nodes-GET/>`_.
    locations: Optional[list[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.The valid priority options can be retrieved by calling `GET rfi-types <en/docs/acc/v1/reference/http/rfis-RFI-types-GET/>_. Some possible values: ``null``, ``High``, ``Normal``, ``Low``.
    priority: Optional[str] = None
    # The RFI question.
    question: Optional[str] = None
    # An external ID. Typically used when the RFI was created in another system.Max length: 20
    reference: Optional[str] = None
    # The default schedule impact value for new RFIs of this type.Possible values: ``null``, ``Yes``, ``No``, ``Unknown``.To verify whether schedule impact tracking is enabled for the project and what the default value is, call `GET rfi-types <en/docs/acc/v1/reference/http/rfis-RFI-types-GET/>`_.
    schedule_impact: Optional[str] = None
    # The current status of the RFI. Available values depend on the RFI’s workflow type:- For single-reviewer workflows (US):Possible values:``draft``, ``submitted``, ``open``, ``answered``, ``rejected``, ``closed``, ``void``.- For multi-reviewer workflows (EMEA):Possible values:``draft``, ``submitted``, ``openRev1`` (manager), ``openRev2`` (reviewers), ``answeredRev1``, ``answeredManager``, ``closed``, ``void``.To determine the workflow type, call `GET users/me </en/docs/acc/v1/reference/http/rfis-users-me-GET/>`_ and check the ``workflowType`` value.For details on RFI workflows in the ACC UI, see `About RFI  Workflows – Autodesk Help <https://help.autodesk.com/view/BUILD/ENU/?guid=RFI_Workflow_Setup>`_.
    status: Optional[RfisPostRequestBody_status] = None
    # The suggested answer for the RFI.
    suggested_answer: Optional[str] = None
    # The title of the RFI.
    title: Optional[str] = None
    # A list of watchers who are notified about changes to the RFI. Each entry may represent a user, role, or company.
    watchers: Optional[list[RfisPostRequestBody_watchers]] = None
    
    @staticmethod
    def create_from_discriminator_value(parse_node: ParseNode) -> RfisPostRequestBody:
        """
        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: RfisPostRequestBody
        """
        if parse_node is None:
            raise TypeError("parse_node cannot be null.")
        return RfisPostRequestBody()
    
    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_request_body_assigned_to import RfisPostRequestBody_assignedTo
        from .rfis_post_request_body_co_reviewers import RfisPostRequestBody_coReviewers
        from .rfis_post_request_body_custom_attributes import RfisPostRequestBody_customAttributes
        from .rfis_post_request_body_status import RfisPostRequestBody_status
        from .rfis_post_request_body_watchers import RfisPostRequestBody_watchers

        from .rfis_post_request_body_assigned_to import RfisPostRequestBody_assignedTo
        from .rfis_post_request_body_co_reviewers import RfisPostRequestBody_coReviewers
        from .rfis_post_request_body_custom_attributes import RfisPostRequestBody_customAttributes
        from .rfis_post_request_body_status import RfisPostRequestBody_status
        from .rfis_post_request_body_watchers import RfisPostRequestBody_watchers

        fields: dict[str, Callable[[Any], None]] = {
            "assignedTo": lambda n : setattr(self, 'assigned_to', n.get_collection_of_object_values(RfisPostRequestBody_assignedTo)),
            "category": lambda n : setattr(self, 'category', n.get_collection_of_primitive_values(str)),
            "coReviewers": lambda n : setattr(self, 'co_reviewers', n.get_collection_of_object_values(RfisPostRequestBody_coReviewers)),
            "costImpact": lambda n : setattr(self, 'cost_impact', n.get_str_value()),
            "customAttributes": lambda n : setattr(self, 'custom_attributes', n.get_collection_of_object_values(RfisPostRequestBody_customAttributes)),
            "discipline": lambda n : setattr(self, 'discipline', n.get_collection_of_primitive_values(str)),
            "dueDate": lambda n : setattr(self, 'due_date', n.get_str_value()),
            "id": lambda n : setattr(self, 'id', n.get_uuid_value()),
            "locationDescription": lambda n : setattr(self, 'location_description', n.get_str_value()),
            "locations": lambda n : setattr(self, 'locations', n.get_collection_of_primitive_values(str)),
            "priority": lambda n : setattr(self, 'priority', n.get_str_value()),
            "question": lambda n : setattr(self, 'question', n.get_str_value()),
            "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(RfisPostRequestBody_status)),
            "suggestedAnswer": lambda n : setattr(self, 'suggested_answer', n.get_str_value()),
            "title": lambda n : setattr(self, 'title', n.get_str_value()),
            "watchers": lambda n : setattr(self, 'watchers', n.get_collection_of_object_values(RfisPostRequestBody_watchers)),
        }
        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("assignedTo", self.assigned_to)
        writer.write_collection_of_primitive_values("category", self.category)
        writer.write_collection_of_object_values("coReviewers", self.co_reviewers)
        writer.write_str_value("costImpact", self.cost_impact)
        writer.write_collection_of_object_values("customAttributes", self.custom_attributes)
        writer.write_collection_of_primitive_values("discipline", self.discipline)
        writer.write_str_value("dueDate", self.due_date)
        writer.write_uuid_value("id", self.id)
        writer.write_str_value("locationDescription", self.location_description)
        writer.write_collection_of_primitive_values("locations", self.locations)
        writer.write_str_value("priority", self.priority)
        writer.write_str_value("question", self.question)
        writer.write_str_value("reference", self.reference)
        writer.write_str_value("scheduleImpact", self.schedule_impact)
        writer.write_enum_value("status", self.status)
        writer.write_str_value("suggestedAnswer", self.suggested_answer)
        writer.write_str_value("title", self.title)
        writer.write_collection_of_object_values("watchers", self.watchers)
    

