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 .values_batch_update_put_request_body_tabular_values_columns import ValuesBatchUpdatePutRequestBody_tabularValues_columns
    from .values_batch_update_put_request_body_tabular_values_table import ValuesBatchUpdatePutRequestBody_tabularValues_table

@dataclass
class ValuesBatchUpdatePutRequestBody_tabularValues(Parsable):
    # The set of values for the columns in the row.
    columns: Optional[list[ValuesBatchUpdatePutRequestBody_tabularValues_columns]] = None
    # The ID of the table row. You need to generarte the ID (UUID) for the row.
    id: Optional[UUID] = None
    # The table to update.Possible values: ``worklogEntries``, ``materialsEntries``, ``equipmentEntries``
    table: Optional[ValuesBatchUpdatePutRequestBody_tabularValues_table] = None
    
    @staticmethod
    def create_from_discriminator_value(parse_node: ParseNode) -> ValuesBatchUpdatePutRequestBody_tabularValues:
        """
        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: ValuesBatchUpdatePutRequestBody_tabularValues
        """
        if parse_node is None:
            raise TypeError("parse_node cannot be null.")
        return ValuesBatchUpdatePutRequestBody_tabularValues()
    
    def get_field_deserializers(self,) -> dict[str, Callable[[ParseNode], None]]:
        """
        The deserialization information for the current model
        Returns: dict[str, Callable[[ParseNode], None]]
        """
        from .values_batch_update_put_request_body_tabular_values_columns import ValuesBatchUpdatePutRequestBody_tabularValues_columns
        from .values_batch_update_put_request_body_tabular_values_table import ValuesBatchUpdatePutRequestBody_tabularValues_table

        from .values_batch_update_put_request_body_tabular_values_columns import ValuesBatchUpdatePutRequestBody_tabularValues_columns
        from .values_batch_update_put_request_body_tabular_values_table import ValuesBatchUpdatePutRequestBody_tabularValues_table

        fields: dict[str, Callable[[Any], None]] = {
            "columns": lambda n : setattr(self, 'columns', n.get_collection_of_object_values(ValuesBatchUpdatePutRequestBody_tabularValues_columns)),
            "id": lambda n : setattr(self, 'id', n.get_uuid_value()),
            "table": lambda n : setattr(self, 'table', n.get_enum_value(ValuesBatchUpdatePutRequestBody_tabularValues_table)),
        }
        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("columns", self.columns)
        writer.write_uuid_value("id", self.id)
        writer.write_enum_value("table", self.table)
    

