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_export_get_response_result_output_failed_files import WithExportGetResponse_result_output_failedFiles

@dataclass
class WithExportGetResponse_result_output(Parsable):
    """
    The output containing the downloadable signed URL.
    """
    # Only for dwg/rvt files.
    failed_files: Optional[list[WithExportGetResponse_result_output_failedFiles]] = None
    # The signed URL to download the PDF or ZIP file. Expires in 1 hour.
    signed_url: Optional[str] = None
    
    @staticmethod
    def create_from_discriminator_value(parse_node: ParseNode) -> WithExportGetResponse_result_output:
        """
        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: WithExportGetResponse_result_output
        """
        if parse_node is None:
            raise TypeError("parse_node cannot be null.")
        return WithExportGetResponse_result_output()
    
    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_export_get_response_result_output_failed_files import WithExportGetResponse_result_output_failedFiles

        from .with_export_get_response_result_output_failed_files import WithExportGetResponse_result_output_failedFiles

        fields: dict[str, Callable[[Any], None]] = {
            "failedFiles": lambda n : setattr(self, 'failed_files', n.get_collection_of_object_values(WithExportGetResponse_result_output_failedFiles)),
            "signedUrl": lambda n : setattr(self, 'signed_url', 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_object_values("failedFiles", self.failed_files)
        writer.write_str_value("signedUrl", self.signed_url)
    

