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_patch_request_body_assigned_to import WithRfiPatchRequestBody_assignedTo
    from .with_rfi_patch_request_body_attachments import WithRfiPatchRequestBody_attachments
    from .with_rfi_patch_request_body_co_reviewers import WithRfiPatchRequestBody_coReviewers
    from .with_rfi_patch_request_body_custom_attributes import WithRfiPatchRequestBody_customAttributes
    from .with_rfi_patch_request_body_official_response_status import WithRfiPatchRequestBody_officialResponseStatus
    from .with_rfi_patch_request_body_return_for_reviewer_list import WithRfiPatchRequestBody_returnForReviewerList
    from .with_rfi_patch_request_body_status import WithRfiPatchRequestBody_status
    from .with_rfi_patch_request_body_watchers import WithRfiPatchRequestBody_watchers

@dataclass
class WithRfiPatchRequestBody(Parsable):
    # A list of response IDs to include in the final official response.Use this to reference earlier draft or submitted responses that should appear in the final answer.Only used when closing the RFI.
    aggregated_response_ids: Optional[list[str]] = None
    # The list of users assigned to the RFI.
    assigned_to: Optional[list[WithRfiPatchRequestBody_assignedTo]] = None
    # A list of attachments to include in the official RFI response when closing the RFI.
    attachments: Optional[list[WithRfiPatchRequestBody_attachments]] = None
    # Whether to generate an RFI report for the target projects.
    bridge_generate_rfi_report: Optional[bool] = 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[WithRfiPatchRequestBody_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[WithRfiPatchRequestBody_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 response due date, in the following format: ``YYYY-MM-DDThh:mm:ss.sz``.The due date is not auto-calculated by the API. To determine the recommended due date for a new RFI, call `GET rfi-types </en/docs/acc/v1/reference/http/rfis-rfi-types-GET>`_ and use the value of the ``dueDateOffset`` field to add days to the current date.
    due_date: Optional[str] = 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 location IDs to associate with the RFI. These must be valid UUIDs from the project’s Location Breakdown Structure (LBS).To retrieve them, call `GET nodes </en/docs/acc/v1/reference/http/projects-projectId-locations-nodes-GET>`_.
    locations: Optional[list[str]] = None
    # The text of the final official response to the RFI.Use this field when closing the RFI to submit the final answer.This field is not used in other status transitions.
    official_response: Optional[str] = None
    # The status of the official response. Possible values: ``answered``, ``rejected``.Set this field when closing the RFI to mark the final response as ``answered`` or ``rejected``.This field is not used in other status transitions.
    official_response_status: Optional[WithRfiPatchRequestBody_officialResponseStatus] = 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
    # A free-text field for cross-referencing the RFI with other systems or documents.Max length: 20
    reference: Optional[str] = None
    # A list of watchers who are notified about changes to the RFI. Each entry may represent a user, role, or company.
    return_for_reviewer_list: Optional[list[WithRfiPatchRequestBody_returnForReviewerList]] = 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[WithRfiPatchRequestBody_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[WithRfiPatchRequestBody_watchers]] = None
    
    @staticmethod
    def create_from_discriminator_value(parse_node: ParseNode) -> WithRfiPatchRequestBody:
        """
        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: WithRfiPatchRequestBody
        """
        if parse_node is None:
            raise TypeError("parse_node cannot be null.")
        return WithRfiPatchRequestBody()
    
    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_patch_request_body_assigned_to import WithRfiPatchRequestBody_assignedTo
        from .with_rfi_patch_request_body_attachments import WithRfiPatchRequestBody_attachments
        from .with_rfi_patch_request_body_co_reviewers import WithRfiPatchRequestBody_coReviewers
        from .with_rfi_patch_request_body_custom_attributes import WithRfiPatchRequestBody_customAttributes
        from .with_rfi_patch_request_body_official_response_status import WithRfiPatchRequestBody_officialResponseStatus
        from .with_rfi_patch_request_body_return_for_reviewer_list import WithRfiPatchRequestBody_returnForReviewerList
        from .with_rfi_patch_request_body_status import WithRfiPatchRequestBody_status
        from .with_rfi_patch_request_body_watchers import WithRfiPatchRequestBody_watchers

        from .with_rfi_patch_request_body_assigned_to import WithRfiPatchRequestBody_assignedTo
        from .with_rfi_patch_request_body_attachments import WithRfiPatchRequestBody_attachments
        from .with_rfi_patch_request_body_co_reviewers import WithRfiPatchRequestBody_coReviewers
        from .with_rfi_patch_request_body_custom_attributes import WithRfiPatchRequestBody_customAttributes
        from .with_rfi_patch_request_body_official_response_status import WithRfiPatchRequestBody_officialResponseStatus
        from .with_rfi_patch_request_body_return_for_reviewer_list import WithRfiPatchRequestBody_returnForReviewerList
        from .with_rfi_patch_request_body_status import WithRfiPatchRequestBody_status
        from .with_rfi_patch_request_body_watchers import WithRfiPatchRequestBody_watchers

        fields: dict[str, Callable[[Any], None]] = {
            "aggregatedResponseIds": lambda n : setattr(self, 'aggregated_response_ids', n.get_collection_of_primitive_values(str)),
            "assignedTo": lambda n : setattr(self, 'assigned_to', n.get_collection_of_object_values(WithRfiPatchRequestBody_assignedTo)),
            "attachments": lambda n : setattr(self, 'attachments', n.get_collection_of_object_values(WithRfiPatchRequestBody_attachments)),
            "bridgeGenerateRfiReport": lambda n : setattr(self, 'bridge_generate_rfi_report', n.get_bool_value()),
            "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(WithRfiPatchRequestBody_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(WithRfiPatchRequestBody_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()),
            "locationDescription": lambda n : setattr(self, 'location_description', n.get_str_value()),
            "locations": lambda n : setattr(self, 'locations', n.get_collection_of_primitive_values(str)),
            "officialResponse": lambda n : setattr(self, 'official_response', n.get_str_value()),
            "officialResponseStatus": lambda n : setattr(self, 'official_response_status', n.get_enum_value(WithRfiPatchRequestBody_officialResponseStatus)),
            "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()),
            "returnForReviewerList": lambda n : setattr(self, 'return_for_reviewer_list', n.get_collection_of_object_values(WithRfiPatchRequestBody_returnForReviewerList)),
            "scheduleImpact": lambda n : setattr(self, 'schedule_impact', n.get_str_value()),
            "status": lambda n : setattr(self, 'status', n.get_enum_value(WithRfiPatchRequestBody_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(WithRfiPatchRequestBody_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_primitive_values("aggregatedResponseIds", self.aggregated_response_ids)
        writer.write_collection_of_object_values("assignedTo", self.assigned_to)
        writer.write_collection_of_object_values("attachments", self.attachments)
        writer.write_bool_value("bridgeGenerateRfiReport", self.bridge_generate_rfi_report)
        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_str_value("locationDescription", self.location_description)
        writer.write_collection_of_primitive_values("locations", self.locations)
        writer.write_str_value("officialResponse", self.official_response)
        writer.write_enum_value("officialResponseStatus", self.official_response_status)
        writer.write_str_value("priority", self.priority)
        writer.write_str_value("question", self.question)
        writer.write_str_value("reference", self.reference)
        writer.write_collection_of_object_values("returnForReviewerList", self.return_for_reviewer_list)
        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)
    

