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 WithWorkflowGetResponse_copyFilesOptions(Parsable):
    """
    (``Copy approved files`` in the UI) The configuration for copying approved files to a target folder when the review is complete.
    """
    # (``Allow the initiator to change the target folder`` in the UI)  Allows the initiator to change the target folder when creating a review.``true``: the initiator can choose a different target folder.``false``: the folder defined in the workflow is used.
    allow_override: Optional[bool] = None
    # (``All/Any files in the review have been approved`` in the UI)Specifies the condition under which approved files will be copied.Possible values:``ANY``: copy files if at least one file in the review is approved.``ALL``: copy files only if all files in the review are approved.
    condition: Optional[str] = None
    # (``Allow approvers to change whether or not markups are included`` in the UI)Controls whether approvers or admins can change the markup inclusion setting when starting the review.``true``: the markup setting is locked and cannot be changed.``false``: the setting can be changed during review setup.
    disable_override_markup_setting: Optional[bool] = None
    # Indicates whether approved files should be copied to a target folder after the review is complete.``true``: copy approved files to the target folder.``false``: do not copy approved files.
    enabled: Optional[bool] = None
    # (``Then copy approved files to`` in the UI)The URN of the target folder where approved files will be copied.
    folder_urn: Optional[str] = None
    # (``Include all published markups on approved files`` in the UI)Indicates whether published markups should be included when copying files.``true``: include all published (unarchived) markups from the source version.``false``: (default) do not include markups.
    include_markups: Optional[bool] = None
    
    @staticmethod
    def create_from_discriminator_value(parse_node: ParseNode) -> WithWorkflowGetResponse_copyFilesOptions:
        """
        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: WithWorkflowGetResponse_copyFilesOptions
        """
        if parse_node is None:
            raise TypeError("parse_node cannot be null.")
        return WithWorkflowGetResponse_copyFilesOptions()
    
    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]] = {
            "allowOverride": lambda n : setattr(self, 'allow_override', n.get_bool_value()),
            "condition": lambda n : setattr(self, 'condition', n.get_str_value()),
            "disableOverrideMarkupSetting": lambda n : setattr(self, 'disable_override_markup_setting', n.get_bool_value()),
            "enabled": lambda n : setattr(self, 'enabled', n.get_bool_value()),
            "folderUrn": lambda n : setattr(self, 'folder_urn', n.get_str_value()),
            "includeMarkups": lambda n : setattr(self, 'include_markups', n.get_bool_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("allowOverride", self.allow_override)
        writer.write_str_value("condition", self.condition)
        writer.write_bool_value("disableOverrideMarkupSetting", self.disable_override_markup_setting)
        writer.write_bool_value("enabled", self.enabled)
        writer.write_str_value("folderUrn", self.folder_urn)
        writer.write_bool_value("includeMarkups", self.include_markups)
    

