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

if TYPE_CHECKING:
    from .reviews_post_request_body_workflow_options_copy_files_options import ReviewsPostRequestBody_workflowOptions_copyFilesOptions
    from .reviews_post_request_body_workflow_options_steps import ReviewsPostRequestBody_workflowOptions_steps

@dataclass
class ReviewsPostRequestBody_workflowOptions(Parsable):
    # (``Copy approved files`` in the UI) Option for copying approved files when the review is complete.
    copy_files_options: Optional[ReviewsPostRequestBody_workflowOptions_copyFilesOptions] = None
    # Assigns participants to the steps defined in the approval workflow. If omitted, the review inherits default candidates from the workflow. If provided, your assignments replace the defaults for that step. Multiple ``REVIEWER`` steps run sequentially in the order returned by `GET workflows </en/docs/acc/v1/reference/http/reviews-workflows-GET/>`_.
    steps: Optional[list[ReviewsPostRequestBody_workflowOptions_steps]] = None
    
    @staticmethod
    def create_from_discriminator_value(parse_node: ParseNode) -> ReviewsPostRequestBody_workflowOptions:
        """
        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: ReviewsPostRequestBody_workflowOptions
        """
        if parse_node is None:
            raise TypeError("parse_node cannot be null.")
        return ReviewsPostRequestBody_workflowOptions()
    
    def get_field_deserializers(self,) -> dict[str, Callable[[ParseNode], None]]:
        """
        The deserialization information for the current model
        Returns: dict[str, Callable[[ParseNode], None]]
        """
        from .reviews_post_request_body_workflow_options_copy_files_options import ReviewsPostRequestBody_workflowOptions_copyFilesOptions
        from .reviews_post_request_body_workflow_options_steps import ReviewsPostRequestBody_workflowOptions_steps

        from .reviews_post_request_body_workflow_options_copy_files_options import ReviewsPostRequestBody_workflowOptions_copyFilesOptions
        from .reviews_post_request_body_workflow_options_steps import ReviewsPostRequestBody_workflowOptions_steps

        fields: dict[str, Callable[[Any], None]] = {
            "copyFilesOptions": lambda n : setattr(self, 'copy_files_options', n.get_object_value(ReviewsPostRequestBody_workflowOptions_copyFilesOptions)),
            "steps": lambda n : setattr(self, 'steps', n.get_collection_of_object_values(ReviewsPostRequestBody_workflowOptions_steps)),
        }
        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_object_value("copyFilesOptions", self.copy_files_options)
        writer.write_collection_of_object_values("steps", self.steps)
    

