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 .properties_get_response_bbox_max import PropertiesGetResponse_bboxMax
    from .properties_get_response_bbox_min import PropertiesGetResponse_bboxMin
    from .properties_get_response_props import PropertiesGetResponse_props
    from .properties_get_response_props_ignored import PropertiesGetResponse_propsIgnored

@dataclass
class PropertiesGetResponse(Parsable):
    # maximum [x, y, z]-coords of the 3D-bbox.
    bbox_max: Optional[PropertiesGetResponse_bboxMax] = None
    # minimum [x, y, z]-coords of the 3D-bbox.
    bbox_min: Optional[PropertiesGetResponse_bboxMin] = None
    # Property database id (the property database the object originated from).
    db_id: Optional[str] = None
    # The external ID of the object.
    external_id: Optional[str] = None
    # Hash used to determine whether the object geometry has changed between different versions.
    geom_hash: Optional[str] = None
    # The lineage ID of the object; the (svf2Id, lineageId)-pair allows to track a specific object across several versions
    lineage_id: Optional[str] = None
    # Object database id from the original seed file property database (_objects_id.id).
    lmv_id: Optional[int] = None
    # Property database property keyed values.
    props: Optional[PropertiesGetResponse_props] = None
    # Hash used to determine whether object properties have changed between different versions.
    props_hash: Optional[str] = None
    # Property database property values that are not considered for property change tracking.
    props_ignored: Optional[PropertiesGetResponse_propsIgnored] = None
    # The stable SVF2 ID of the object.
    svf2_id: Optional[int] = None
    # List of corresponding view IDs in the index manifest that this object is visible in.
    views: Optional[list[str]] = None
    
    @staticmethod
    def create_from_discriminator_value(parse_node: ParseNode) -> PropertiesGetResponse:
        """
        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: PropertiesGetResponse
        """
        if parse_node is None:
            raise TypeError("parse_node cannot be null.")
        return PropertiesGetResponse()
    
    def get_field_deserializers(self,) -> dict[str, Callable[[ParseNode], None]]:
        """
        The deserialization information for the current model
        Returns: dict[str, Callable[[ParseNode], None]]
        """
        from .properties_get_response_bbox_max import PropertiesGetResponse_bboxMax
        from .properties_get_response_bbox_min import PropertiesGetResponse_bboxMin
        from .properties_get_response_props import PropertiesGetResponse_props
        from .properties_get_response_props_ignored import PropertiesGetResponse_propsIgnored

        from .properties_get_response_bbox_max import PropertiesGetResponse_bboxMax
        from .properties_get_response_bbox_min import PropertiesGetResponse_bboxMin
        from .properties_get_response_props import PropertiesGetResponse_props
        from .properties_get_response_props_ignored import PropertiesGetResponse_propsIgnored

        fields: dict[str, Callable[[Any], None]] = {
            "bboxMax": lambda n : setattr(self, 'bbox_max', n.get_object_value(PropertiesGetResponse_bboxMax)),
            "bboxMin": lambda n : setattr(self, 'bbox_min', n.get_object_value(PropertiesGetResponse_bboxMin)),
            "dbId": lambda n : setattr(self, 'db_id', n.get_str_value()),
            "externalId": lambda n : setattr(self, 'external_id', n.get_str_value()),
            "geomHash": lambda n : setattr(self, 'geom_hash', n.get_str_value()),
            "lineageId": lambda n : setattr(self, 'lineage_id', n.get_str_value()),
            "lmvId": lambda n : setattr(self, 'lmv_id', n.get_int_value()),
            "props": lambda n : setattr(self, 'props', n.get_object_value(PropertiesGetResponse_props)),
            "propsHash": lambda n : setattr(self, 'props_hash', n.get_str_value()),
            "propsIgnored": lambda n : setattr(self, 'props_ignored', n.get_object_value(PropertiesGetResponse_propsIgnored)),
            "svf2Id": lambda n : setattr(self, 'svf2_id', n.get_int_value()),
            "views": lambda n : setattr(self, 'views', n.get_collection_of_primitive_values(str)),
        }
        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_object_value("bboxMax", self.bbox_max)
        writer.write_object_value("bboxMin", self.bbox_min)
        writer.write_str_value("dbId", self.db_id)
        writer.write_str_value("externalId", self.external_id)
        writer.write_str_value("geomHash", self.geom_hash)
        writer.write_str_value("lineageId", self.lineage_id)
        writer.write_int_value("lmvId", self.lmv_id)
        writer.write_object_value("props", self.props)
        writer.write_str_value("propsHash", self.props_hash)
        writer.write_object_value("propsIgnored", self.props_ignored)
        writer.write_int_value("svf2Id", self.svf2_id)
        writer.write_collection_of_primitive_values("views", self.views)
    

