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 ActionHistoriesGetResponse_results_options(Parsable):
    """
    Additional context for the action. The fields present in this object depend on the action history type.For Approval workflows, the object includes:``stepName`` – the name of the workflow step.``taskDefinitionKey`` – the key that identifies the workflow task.``workflowInstanceId`` – the ID of the workflow instance.These fields provide task-level process information.For Normal workflows, the object may include fields such as to and from that indicate a change in status.
    """
    # The name of the workflow step where the action occurred.
    step_name: Optional[str] = None
    # The key that identifies the specific workflow task.
    task_definition_key: Optional[str] = None
    # The ID of the workflow instance the action belongs to.
    workflow_instance_id: Optional[str] = None
    
    @staticmethod
    def create_from_discriminator_value(parse_node: ParseNode) -> ActionHistoriesGetResponse_results_options:
        """
        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: ActionHistoriesGetResponse_results_options
        """
        if parse_node is None:
            raise TypeError("parse_node cannot be null.")
        return ActionHistoriesGetResponse_results_options()
    
    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]] = {
            "stepName": lambda n : setattr(self, 'step_name', n.get_str_value()),
            "taskDefinitionKey": lambda n : setattr(self, 'task_definition_key', n.get_str_value()),
            "workflowInstanceId": lambda n : setattr(self, 'workflow_instance_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_str_value("stepName", self.step_name)
        writer.write_str_value("taskDefinitionKey", self.task_definition_key)
        writer.write_str_value("workflowInstanceId", self.workflow_instance_id)
    

