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 ReviewSheetsPatchRequestBody(Parsable):
    # - ``true`` if you want to delete the review sheet.- ``false`` if you want to restore the review sheet.Note that if the review sheet has been deleted, it will not be published.
    deleted: Optional[bool] = None
    # The ID of the review sheet to update.
    id: Optional[str] = None
    # The new number of the review sheet. Note the following limitations:- 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 review 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 new tags of the review sheet.- The max length is 100.- The tags should not be space only.- The max number of items is 50.The API will format the tags in the following ways before applying them to the review sheet:- 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.Note that the tags that you specify overwrite existing tags.
    tags: Optional[list[str]] = None
    # The new title of the review 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 review 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
    
    @staticmethod
    def create_from_discriminator_value(parse_node: ParseNode) -> ReviewSheetsPatchRequestBody:
        """
        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: ReviewSheetsPatchRequestBody
        """
        if parse_node is None:
            raise TypeError("parse_node cannot be null.")
        return ReviewSheetsPatchRequestBody()
    
    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]] = {
            "deleted": lambda n : setattr(self, 'deleted', n.get_bool_value()),
            "id": lambda n : setattr(self, 'id', n.get_str_value()),
            "number": lambda n : setattr(self, 'number', n.get_str_value()),
            "tags": lambda n : setattr(self, 'tags', n.get_collection_of_primitive_values(str)),
            "title": lambda n : setattr(self, 'title', 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_bool_value("deleted", self.deleted)
        writer.write_str_value("id", self.id)
        writer.write_str_value("number", self.number)
        writer.write_collection_of_primitive_values("tags", self.tags)
        writer.write_str_value("title", self.title)
    

