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 SheetsBatchUpdatePostRequestBody_updates(Parsable):
    # The tags to be attached to the sheets.- The max length is 100.- The tags should not be space only.- After applying addTags and removeTags, the number of remain tags of the sheets should not exceed 100.The API will format the tags in the following ways before applying them to the sheets:- Remove spaces at the end and beginning of the tags.- Reduce multiple continuous spaces to a single space.- The tags are case insensitive. Upper case letters will be transformed to lower case.
    add_tags: Optional[list[str]] = None
    # The new sheet number.Only available for single sheet update.- The number should not contain these reserved characters: ``<``, ``>``, ``:``, ``````, ``/``, ````, ``|``, ``?``, ``*``, ``n``, ``r``, ``t``, ``0``, ``f``, ``'``.- You cannot assign the following reserved names to the number: CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9.- You cannot put a period at the end of the number.- The number should not be space only.- The max length is 255.The API will format the number in the following ways before applying it to the sheet:- Remove spaces at the end and beginning of the number.- Reduce multiple continuous spaces to a single space.Max length: 255
    number: Optional[str] = None
    # The tags to be detached from the sheets.- The max length is 100.- The tags should not be space only.The API will format the tags in the following ways before comparing them to the existing tags:- Remove spaces at the end and beginning of the tags.- Reduce multiple continuous spaces to a single space.- The tags are case insensitive. Upper case letters will be transformed to lower case.
    remove_tags: Optional[list[str]] = None
    # The new title of the sheet.Only available for single sheet.- The title should not be space only.- The max length is 255.The API will format the title in the following ways before applying it to the sheet:- Remove spaces at the end and beginning of the title.- Reduce multiple continuous spaces to a single space.Max length: 255
    title: Optional[str] = None
    # The ID of the new version set.
    version_set_id: Optional[str] = None
    
    @staticmethod
    def create_from_discriminator_value(parse_node: ParseNode) -> SheetsBatchUpdatePostRequestBody_updates:
        """
        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: SheetsBatchUpdatePostRequestBody_updates
        """
        if parse_node is None:
            raise TypeError("parse_node cannot be null.")
        return SheetsBatchUpdatePostRequestBody_updates()
    
    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]] = {
            "addTags": lambda n : setattr(self, 'add_tags', n.get_collection_of_primitive_values(str)),
            "number": lambda n : setattr(self, 'number', n.get_str_value()),
            "removeTags": lambda n : setattr(self, 'remove_tags', n.get_collection_of_primitive_values(str)),
            "title": lambda n : setattr(self, 'title', n.get_str_value()),
            "versionSetId": lambda n : setattr(self, 'version_set_id', 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_primitive_values("addTags", self.add_tags)
        writer.write_str_value("number", self.number)
        writer.write_collection_of_primitive_values("removeTags", self.remove_tags)
        writer.write_str_value("title", self.title)
        writer.write_str_value("versionSetId", self.version_set_id)
    

