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
from uuid import UUID

if TYPE_CHECKING:
    from .exports_post_response_status import ExportsPostResponse_status

@dataclass
class ExportsPostResponse(Parsable):
    # The ID of the export job. Use the ID to poll `GET exports/:exportId </en/docs/acc/v1/reference/http/sheets-exports-exportId-GET/>`_ to check the job's status. When the job is complete, you can retrieve the data you need to download the exported sheets.
    id: Optional[UUID] = None
    # The status of the export job; will always be: ``processing``
    status: Optional[ExportsPostResponse_status] = None
    
    @staticmethod
    def create_from_discriminator_value(parse_node: ParseNode) -> ExportsPostResponse:
        """
        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: ExportsPostResponse
        """
        if parse_node is None:
            raise TypeError("parse_node cannot be null.")
        return ExportsPostResponse()
    
    def get_field_deserializers(self,) -> dict[str, Callable[[ParseNode], None]]:
        """
        The deserialization information for the current model
        Returns: dict[str, Callable[[ParseNode], None]]
        """
        from .exports_post_response_status import ExportsPostResponse_status

        from .exports_post_response_status import ExportsPostResponse_status

        fields: dict[str, Callable[[Any], None]] = {
            "id": lambda n : setattr(self, 'id', n.get_uuid_value()),
            "status": lambda n : setattr(self, 'status', n.get_enum_value(ExportsPostResponse_status)),
        }
        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_uuid_value("id", self.id)
        writer.write_enum_value("status", self.status)
    

