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

@dataclass
class ManifestGetResponse_seedFiles_views(Parsable):
    # view ID.
    id: Optional[str] = None
    # is this a 3D view?.
    is3d: Optional[bool] = None
    # file version URN.
    urn: Optional[str] = None
    # viewable GUID.
    viewable_guid: Optional[str] = None
    # viewable ID.
    viewable_id: Optional[str] = None
    # viewable name.
    viewable_name: Optional[str] = None
    
    @staticmethod
    def create_from_discriminator_value(parse_node: ParseNode) -> ManifestGetResponse_seedFiles_views:
        """
        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: ManifestGetResponse_seedFiles_views
        """
        if parse_node is None:
            raise TypeError("parse_node cannot be null.")
        return ManifestGetResponse_seedFiles_views()
    
    def get_field_deserializers(self,) -> dict[str, Callable[[ParseNode], None]]:
        """
        The deserialization information for the current model
        Returns: dict[str, Callable[[ParseNode], None]]
        """
        fields: dict[str, Callable[[Any], None]] = {
            "id": lambda n : setattr(self, 'id', n.get_str_value()),
            "is3d": lambda n : setattr(self, 'is3d', n.get_bool_value()),
            "urn": lambda n : setattr(self, 'urn', n.get_str_value()),
            "viewableGuid": lambda n : setattr(self, 'viewable_guid', n.get_str_value()),
            "viewableId": lambda n : setattr(self, 'viewable_id', n.get_str_value()),
            "viewableName": lambda n : setattr(self, 'viewable_name', 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_str_value("id", self.id)
        writer.write_bool_value("is3d", self.is3d)
        writer.write_str_value("urn", self.urn)
        writer.write_str_value("viewableGuid", self.viewable_guid)
        writer.write_str_value("viewableId", self.viewable_id)
        writer.write_str_value("viewableName", self.viewable_name)
    

