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 .manifest_get_response_seed_files_databases import ManifestGetResponse_seedFiles_databases
    from .manifest_get_response_seed_files_views import ManifestGetResponse_seedFiles_views

@dataclass
class ManifestGetResponse_seedFiles(Parsable):
    # databases.
    databases: Optional[list[ManifestGetResponse_seedFiles_databases]] = None
    # lineage ID.
    lineage_id: Optional[str] = None
    # lineage URN.
    lineage_urn: Optional[str] = None
    # file version URN.
    version_urn: Optional[str] = None
    # views.
    views: Optional[list[ManifestGetResponse_seedFiles_views]] = None
    
    @staticmethod
    def create_from_discriminator_value(parse_node: ParseNode) -> ManifestGetResponse_seedFiles:
        """
        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
        """
        if parse_node is None:
            raise TypeError("parse_node cannot be null.")
        return ManifestGetResponse_seedFiles()
    
    def get_field_deserializers(self,) -> dict[str, Callable[[ParseNode], None]]:
        """
        The deserialization information for the current model
        Returns: dict[str, Callable[[ParseNode], None]]
        """
        from .manifest_get_response_seed_files_databases import ManifestGetResponse_seedFiles_databases
        from .manifest_get_response_seed_files_views import ManifestGetResponse_seedFiles_views

        from .manifest_get_response_seed_files_databases import ManifestGetResponse_seedFiles_databases
        from .manifest_get_response_seed_files_views import ManifestGetResponse_seedFiles_views

        fields: dict[str, Callable[[Any], None]] = {
            "databases": lambda n : setattr(self, 'databases', n.get_collection_of_object_values(ManifestGetResponse_seedFiles_databases)),
            "lineageId": lambda n : setattr(self, 'lineage_id', n.get_str_value()),
            "lineageUrn": lambda n : setattr(self, 'lineage_urn', n.get_str_value()),
            "versionUrn": lambda n : setattr(self, 'version_urn', n.get_str_value()),
            "views": lambda n : setattr(self, 'views', n.get_collection_of_object_values(ManifestGetResponse_seedFiles_views)),
        }
        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("databases", self.databases)
        writer.write_str_value("lineageId", self.lineage_id)
        writer.write_str_value("lineageUrn", self.lineage_urn)
        writer.write_str_value("versionUrn", self.version_urn)
        writer.write_collection_of_object_values("views", self.views)
    

