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 .search_rfis_post_request_body_filter_custom_attributes import SearchRfisPostRequestBody_filter_customAttributes

@dataclass
class SearchRfisPostRequestBody_filter(Parsable):
    # Filter RFIs assigned to specific users.To find the ID call `GET users/me </en/docs/bim360/v1/reference/http/rfis-users-me-GET/>`_ and check ``user.id``.
    assigned_to: Optional[list[str]] = None
    # Filter RFIs by category.Categories are customizable per project. Examples include ``Constructability``, ``Code Compliance``. For example, ``filter[category]=Constructability``.Possible values: ``Code Compliance``, ``Constructability``, ``Design Coordination``, ``Documentation Conflict``, ``Documentation Incomplete``, ``Field condition``, ``Other``, ``Unspecified``.
    category: Optional[list[str]] = None
    # Filter RFIs by close date or date range.Format: ``YYYY-MM-DDThh:mm:ss.sz..YYYY-MM-DDThh:mm:ss.sz``.
    closed_at: Optional[str] = None
    # Filter RFIs by cost impact value.Possible values: ``Yes``, ``No``, ``Unknown``. For example, ``filter[costImpact]=Yes``'
    cost_impact: Optional[list[str]] = None
    # Filter RFIs created after a specific date or within a date range.Format: ``YYYY-MM-DDThh:mm:ss.sz..YYYY-MM-DDThh:mm:ss.sz``.
    created_at: Optional[str] = None
    # Filter RFIs by the user who created them.To find the ID call `GET users/me </en/docs/bim360/v1/reference/http/rfis-users-me-GET/>`_ and check ``user.id``.``
    created_by: Optional[list[str]] = None
    # Filter RFIs by custom attributes.Provide a map of key-value pairs using attribute ID and selected value ID.For example, ``fd9a1234-aaaa-4444-bbbb-8888aa77ee66: value-id-1``.
    custom_attributes: Optional[SearchRfisPostRequestBody_filter_customAttributes] = None
    # Filter RFIs by discipline.Values depend on the project configuration. Examples include ``Architectural``. For example, ``filter[discipline]=Architectural``.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``, ``Unspecified``.
    discipline: Optional[list[str]] = None
    # Filter RFIs by due date or due date range.Format: ``YYYY-MM-DDThh:mm:ss.sz..YYYY-MM-DDThh:mm:ss.sz``.
    due_date: Optional[str] = None
    # Filter by a list of specific RFI IDs.To find the RFI IDs call `GET rfis </en/docs/bim360/v1/reference/http/rfis-v2-rfis-GET/>`_ and check ``results.id``.
    id: Optional[list[str]] = None
    # ``true``: include RFIs that are hidden from the user.``false``: (default) exclude hidden RFIs from the results.
    include_hidden: Optional[bool] = None
    # Filter RFIs by location using Location Breakdown Structure (LBS) node IDs.To retrieve location IDs, call `GET nodes </en/docs/acc/v1/reference/http/locations-nodes-GET/>`_.'
    locations: Optional[list[str]] = None
    # Filters RFIs by the official response status. Possible values: ``answered``, ``unanswered``.
    official_response_status: Optional[list[str]] = None
    # Filter RFIs by priority level.Possible values: ``High``, ``Normal``, ``Low``. For example, ``filter[priority]=High``.'
    priority: Optional[list[str]] = None
    # Filter RFIs by the external reference ID (e.g., model number or spec reference).Max length: 20 characters.Max length: 20
    reference: Optional[str] = None
    # Filter RFIs by RFI type ID.RFI types are defined at the project level. Use UUIDs returned from the project configuration.
    rfi_type_id: Optional[list[str]] = None
    # Filter RFIs by schedule impact value.Possible values**: ``Yes``, ``No``, ``Unknown``. For example, ``filter[scheduleImpact]=Yes``'
    schedule_impact: Optional[list[str]] = None
    # Filter by RFI status. Possible values: ``draft``, ``submitted``, ``open``, ``openRev1``, ``openRev2``, answered, ``answeredRev1``, ``answeredManager``, ``closed``, ``void``. Note that workflow types determine which statuses are used.
    status: Optional[list[str]] = None
    # Filter RFIs updated after a specific date, or within a date range.Format: ``YYYY-MM-DDThh:mm:ss.sz..YYYY-MM-DDThh:mm:ss.sz``.
    updated_at: Optional[str] = None
    
    @staticmethod
    def create_from_discriminator_value(parse_node: ParseNode) -> SearchRfisPostRequestBody_filter:
        """
        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: SearchRfisPostRequestBody_filter
        """
        if parse_node is None:
            raise TypeError("parse_node cannot be null.")
        return SearchRfisPostRequestBody_filter()
    
    def get_field_deserializers(self,) -> dict[str, Callable[[ParseNode], None]]:
        """
        The deserialization information for the current model
        Returns: dict[str, Callable[[ParseNode], None]]
        """
        from .search_rfis_post_request_body_filter_custom_attributes import SearchRfisPostRequestBody_filter_customAttributes

        from .search_rfis_post_request_body_filter_custom_attributes import SearchRfisPostRequestBody_filter_customAttributes

        fields: dict[str, Callable[[Any], None]] = {
            "assignedTo": lambda n : setattr(self, 'assigned_to', n.get_collection_of_primitive_values(str)),
            "category": lambda n : setattr(self, 'category', n.get_collection_of_primitive_values(str)),
            "closedAt": lambda n : setattr(self, 'closed_at', n.get_str_value()),
            "costImpact": lambda n : setattr(self, 'cost_impact', n.get_collection_of_primitive_values(str)),
            "createdAt": lambda n : setattr(self, 'created_at', n.get_str_value()),
            "createdBy": lambda n : setattr(self, 'created_by', n.get_collection_of_primitive_values(str)),
            "customAttributes": lambda n : setattr(self, 'custom_attributes', n.get_object_value(SearchRfisPostRequestBody_filter_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_collection_of_primitive_values(str)),
            "includeHidden": lambda n : setattr(self, 'include_hidden', n.get_bool_value()),
            "locations": lambda n : setattr(self, 'locations', n.get_collection_of_primitive_values(str)),
            "officialResponseStatus": lambda n : setattr(self, 'official_response_status', n.get_collection_of_primitive_values(str)),
            "priority": lambda n : setattr(self, 'priority', n.get_collection_of_primitive_values(str)),
            "reference": lambda n : setattr(self, 'reference', n.get_str_value()),
            "rfiTypeId": lambda n : setattr(self, 'rfi_type_id', n.get_collection_of_primitive_values(str)),
            "scheduleImpact": lambda n : setattr(self, 'schedule_impact', n.get_collection_of_primitive_values(str)),
            "status": lambda n : setattr(self, 'status', n.get_collection_of_primitive_values(str)),
            "updatedAt": lambda n : setattr(self, 'updated_at', n.get_str_value()),
        }
        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("assignedTo", self.assigned_to)
        writer.write_collection_of_primitive_values("category", self.category)
        writer.write_str_value("closedAt", self.closed_at)
        writer.write_collection_of_primitive_values("costImpact", self.cost_impact)
        writer.write_str_value("createdAt", self.created_at)
        writer.write_collection_of_primitive_values("createdBy", self.created_by)
        writer.write_object_value("customAttributes", self.custom_attributes)
        writer.write_collection_of_primitive_values("discipline", self.discipline)
        writer.write_str_value("dueDate", self.due_date)
        writer.write_collection_of_primitive_values("id", self.id)
        writer.write_bool_value("includeHidden", self.include_hidden)
        writer.write_collection_of_primitive_values("locations", self.locations)
        writer.write_collection_of_primitive_values("officialResponseStatus", self.official_response_status)
        writer.write_collection_of_primitive_values("priority", self.priority)
        writer.write_str_value("reference", self.reference)
        writer.write_collection_of_primitive_values("rfiTypeId", self.rfi_type_id)
        writer.write_collection_of_primitive_values("scheduleImpact", self.schedule_impact)
        writer.write_collection_of_primitive_values("status", self.status)
        writer.write_str_value("updatedAt", self.updated_at)
    

