# coding: utf-8

"""
    Formance Stack API

    Open, modular foundation for unique payments flows  # Introduction This API is documented in **OpenAPI format**.  # Authentication Formance Stack offers one forms of authentication:   - OAuth2 OAuth2 - an open protocol to allow secure authorization in a simple and standard method from web, mobile and desktop applications. <SecurityDefinitions />   # noqa: E501

    The version of the OpenAPI document: v1.0.20230301
    Contact: support@formance.com
    Generated by: https://openapi-generator.tech
"""

from datetime import date, datetime  # noqa: F401
import decimal  # noqa: F401
import functools  # noqa: F401
import io  # noqa: F401
import re  # noqa: F401
import typing  # noqa: F401
import typing_extensions  # noqa: F401
import uuid  # noqa: F401

import frozendict  # noqa: F401

from FormanceHQ import schemas  # noqa: F401


class WorkflowInstanceHistoryStage(
    schemas.DictSchema
):
    """NOTE: This class is auto generated by OpenAPI Generator.
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """


    class MetaOapg:
        required = {
            "input",
            "name",
            "startedAt",
            "attempt",
            "terminated",
        }
        
        class properties:
            name = schemas.StrSchema
        
            @staticmethod
            def input() -> typing.Type['WorkflowInstanceHistoryStageInput']:
                return WorkflowInstanceHistoryStageInput
            terminated = schemas.BoolSchema
            startedAt = schemas.DateTimeSchema
            attempt = schemas.IntSchema
        
            @staticmethod
            def output() -> typing.Type['WorkflowInstanceHistoryStageOutput']:
                return WorkflowInstanceHistoryStageOutput
            error = schemas.StrSchema
            terminatedAt = schemas.DateTimeSchema
            lastFailure = schemas.StrSchema
            nextExecution = schemas.DateTimeSchema
            __annotations__ = {
                "name": name,
                "input": input,
                "terminated": terminated,
                "startedAt": startedAt,
                "attempt": attempt,
                "output": output,
                "error": error,
                "terminatedAt": terminatedAt,
                "lastFailure": lastFailure,
                "nextExecution": nextExecution,
            }
    
    input: 'WorkflowInstanceHistoryStageInput'
    name: MetaOapg.properties.name
    startedAt: MetaOapg.properties.startedAt
    attempt: MetaOapg.properties.attempt
    terminated: MetaOapg.properties.terminated
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["input"]) -> 'WorkflowInstanceHistoryStageInput': ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["terminated"]) -> MetaOapg.properties.terminated: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["startedAt"]) -> MetaOapg.properties.startedAt: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["attempt"]) -> MetaOapg.properties.attempt: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["output"]) -> 'WorkflowInstanceHistoryStageOutput': ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["error"]) -> MetaOapg.properties.error: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["terminatedAt"]) -> MetaOapg.properties.terminatedAt: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["lastFailure"]) -> MetaOapg.properties.lastFailure: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["nextExecution"]) -> MetaOapg.properties.nextExecution: ...
    
    @typing.overload
    def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ...
    
    def __getitem__(self, name: typing.Union[typing_extensions.Literal["name", "input", "terminated", "startedAt", "attempt", "output", "error", "terminatedAt", "lastFailure", "nextExecution", ], str]):
        # dict_instance[name] accessor
        return super().__getitem__(name)
    
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["input"]) -> 'WorkflowInstanceHistoryStageInput': ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["terminated"]) -> MetaOapg.properties.terminated: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["startedAt"]) -> MetaOapg.properties.startedAt: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["attempt"]) -> MetaOapg.properties.attempt: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["output"]) -> typing.Union['WorkflowInstanceHistoryStageOutput', schemas.Unset]: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["error"]) -> typing.Union[MetaOapg.properties.error, schemas.Unset]: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["terminatedAt"]) -> typing.Union[MetaOapg.properties.terminatedAt, schemas.Unset]: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["lastFailure"]) -> typing.Union[MetaOapg.properties.lastFailure, schemas.Unset]: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["nextExecution"]) -> typing.Union[MetaOapg.properties.nextExecution, schemas.Unset]: ...
    
    @typing.overload
    def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ...
    
    def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["name", "input", "terminated", "startedAt", "attempt", "output", "error", "terminatedAt", "lastFailure", "nextExecution", ], str]):
        return super().get_item_oapg(name)
    

    def __new__(
        cls,
        *_args: typing.Union[dict, frozendict.frozendict, ],
        input: 'WorkflowInstanceHistoryStageInput',
        name: typing.Union[MetaOapg.properties.name, str, ],
        startedAt: typing.Union[MetaOapg.properties.startedAt, str, datetime, ],
        attempt: typing.Union[MetaOapg.properties.attempt, decimal.Decimal, int, ],
        terminated: typing.Union[MetaOapg.properties.terminated, bool, ],
        output: typing.Union['WorkflowInstanceHistoryStageOutput', schemas.Unset] = schemas.unset,
        error: typing.Union[MetaOapg.properties.error, str, schemas.Unset] = schemas.unset,
        terminatedAt: typing.Union[MetaOapg.properties.terminatedAt, str, datetime, schemas.Unset] = schemas.unset,
        lastFailure: typing.Union[MetaOapg.properties.lastFailure, str, schemas.Unset] = schemas.unset,
        nextExecution: typing.Union[MetaOapg.properties.nextExecution, str, datetime, schemas.Unset] = schemas.unset,
        _configuration: typing.Optional[schemas.Configuration] = None,
        **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes],
    ) -> 'WorkflowInstanceHistoryStage':
        return super().__new__(
            cls,
            *_args,
            input=input,
            name=name,
            startedAt=startedAt,
            attempt=attempt,
            terminated=terminated,
            output=output,
            error=error,
            terminatedAt=terminatedAt,
            lastFailure=lastFailure,
            nextExecution=nextExecution,
            _configuration=_configuration,
            **kwargs,
        )

from FormanceHQ.model.workflow_instance_history_stage_input import WorkflowInstanceHistoryStageInput
from FormanceHQ.model.workflow_instance_history_stage_output import WorkflowInstanceHistoryStageOutput
