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_custom_values_toggle_val import ValuesBatchUpdatePutRequestBody_customValues_toggleVal

@dataclass
class ValuesBatchUpdatePutRequestBody_customValues(Parsable):
    # The attribute used for updating multi-select fields. For example, ``arrayVal:`` ``[``Answer 1``, ``Answer 2``]``.Each non-tabular field is assigned a specific value type, which you need to specify when updating the field. ``arrayVal`` is only relevant for updating multi-select fields. To verify whether the field you want to update is a multi-select field, call GET forms and check the field's ``valueName``.
    array_val: Optional[list[str]] = None
    # The attribute used for updating single-select and dropdown fields. For example, ``choiceVal: Answer 3``.Each non-tabular field is assigned a specific value type, which you need to specify when updating the field. ``choiceVal`` is only relevant for updating single-select and dropdown fields. To verify whether the field you want to update is a single-select or dropdown field, call GET forms and check the field's ``valueName``.
    choice_val: Optional[str] = None
    # The attribute used for updating date fields, in the following format ``(YYYY-MM-DD)``. For example, ````dateVal``: ``1999-12-31````.Each non-tabular field is assigned a specific value type, which you need to specify when updating the field. ``dateVal`` is only relevant for updating date fields. To verify whether the field you want to update is a date field, call GET forms and check the field's ``valueName``.
    date_val: Optional[str] = None
    # The unique identifier of the field.
    field_id: Optional[UUID] = None
    # The name of the person who signed the form. By default, it is the name of the logged in user. It is only relevant for signature fields. To update the name you need to use the signature field ID.
    name: Optional[str] = None
    # Text for the field's notes section. This is relevant for all fields.Max length: 8000
    notes: Optional[str] = None
    # The attribute used for updating number fields. For example, ````numberVal``: ``42````.Each non-tabular field is assigned a specific value type, which you need to specify when updating the field. ``numberVal`` is only relevant for updating number fields. To verify whether the field you want to update is a number field, call GET forms and check the field's ``valueName``.
    number_val: Optional[float] = None
    # The attribute used for updating signature fields.Each non-tabular field is assigned a specific value type, which you need to specify when updating the field. ``svgVal`` is only relevant for updating signature fields. To verify whether the field you want to update is a signature field, call GET forms and check the field's ``valueName``.The signature needs to be in SVG format and it needs to be base64 encoded.
    svg_val: Optional[str] = None
    # The attribute used for updating text value fields, For example, ``textVal: This is my response!``.Each non-tabular field is assigned a specific value type, which you need to specify when updating the field. ``textVal`` is only relevant for updating text value fields. To verify whether the field you want to update is a text value field, call GET forms and check the field's ``valueName``.Max length: 8000
    text_val: Optional[str] = None
    # The attribute used for updating preconfigured fields. For example, ``toggleVal``: ``Yes``.Each non-tabular field is assigned a specific value type, which you need to specify when updating the field. ``toggleVal`` is only relevant for updating preconfigured fields. To verify whether the field you want to update is a preconfigured field, call GET forms and check the field's ``valueName``.Possible values: ``Yes``, ``No``, ``False``, ``True``, ``Minus``, ``Plus``, ``Fail``, ``Pass``, ``NA``
    toggle_val: Optional[ValuesBatchUpdatePutRequestBody_customValues_toggleVal] = None
    
    @staticmethod
    def create_from_discriminator_value(parse_node: ParseNode) -> ValuesBatchUpdatePutRequestBody_customValues:
        """
        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_customValues
        """
        if parse_node is None:
            raise TypeError("parse_node cannot be null.")
        return ValuesBatchUpdatePutRequestBody_customValues()
    
    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_custom_values_toggle_val import ValuesBatchUpdatePutRequestBody_customValues_toggleVal

        from .values_batch_update_put_request_body_custom_values_toggle_val import ValuesBatchUpdatePutRequestBody_customValues_toggleVal

        fields: dict[str, Callable[[Any], None]] = {
            "arrayVal": lambda n : setattr(self, 'array_val', n.get_collection_of_primitive_values(str)),
            "choiceVal": lambda n : setattr(self, 'choice_val', n.get_str_value()),
            "dateVal": lambda n : setattr(self, 'date_val', n.get_str_value()),
            "fieldId": lambda n : setattr(self, 'field_id', n.get_uuid_value()),
            "name": lambda n : setattr(self, 'name', n.get_str_value()),
            "notes": lambda n : setattr(self, 'notes', n.get_str_value()),
            "numberVal": lambda n : setattr(self, 'number_val', n.get_float_value()),
            "svgVal": lambda n : setattr(self, 'svg_val', n.get_str_value()),
            "textVal": lambda n : setattr(self, 'text_val', n.get_str_value()),
            "toggleVal": lambda n : setattr(self, 'toggle_val', n.get_enum_value(ValuesBatchUpdatePutRequestBody_customValues_toggleVal)),
        }
        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("arrayVal", self.array_val)
        writer.write_str_value("choiceVal", self.choice_val)
        writer.write_str_value("dateVal", self.date_val)
        writer.write_uuid_value("fieldId", self.field_id)
        writer.write_str_value("name", self.name)
        writer.write_str_value("notes", self.notes)
        writer.write_float_value("numberVal", self.number_val)
        writer.write_str_value("svgVal", self.svg_val)
        writer.write_str_value("textVal", self.text_val)
        writer.write_enum_value("toggleVal", self.toggle_val)
    

