# 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 Attempt(
    schemas.AnyTypeSchema,
):
    """NOTE: This class is auto generated by OpenAPI Generator.
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """


    class MetaOapg:
        
        class properties:
            id = schemas.UUIDSchema
            webhookID = schemas.UUIDSchema
            createdAt = schemas.DateTimeSchema
            updatedAt = schemas.DateTimeSchema
        
            @staticmethod
            def config() -> typing.Type['WebhooksConfig']:
                return WebhooksConfig
            payload = schemas.StrSchema
            statusCode = schemas.IntSchema
            retryAttempt = schemas.IntSchema
            status = schemas.StrSchema
            nextRetryAfter = schemas.DateTimeSchema
            __annotations__ = {
                "id": id,
                "webhookID": webhookID,
                "createdAt": createdAt,
                "updatedAt": updatedAt,
                "config": config,
                "payload": payload,
                "statusCode": statusCode,
                "retryAttempt": retryAttempt,
                "status": status,
                "nextRetryAfter": nextRetryAfter,
            }

    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["id"]) -> MetaOapg.properties.id: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["webhookID"]) -> MetaOapg.properties.webhookID: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["createdAt"]) -> MetaOapg.properties.createdAt: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["updatedAt"]) -> MetaOapg.properties.updatedAt: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["config"]) -> 'WebhooksConfig': ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["payload"]) -> MetaOapg.properties.payload: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["statusCode"]) -> MetaOapg.properties.statusCode: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["retryAttempt"]) -> MetaOapg.properties.retryAttempt: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["status"]) -> MetaOapg.properties.status: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["nextRetryAfter"]) -> MetaOapg.properties.nextRetryAfter: ...
    
    @typing.overload
    def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ...
    
    def __getitem__(self, name: typing.Union[typing_extensions.Literal["id", "webhookID", "createdAt", "updatedAt", "config", "payload", "statusCode", "retryAttempt", "status", "nextRetryAfter", ], str]):
        # dict_instance[name] accessor
        return super().__getitem__(name)
    
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["id"]) -> typing.Union[MetaOapg.properties.id, schemas.Unset]: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["webhookID"]) -> typing.Union[MetaOapg.properties.webhookID, schemas.Unset]: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["createdAt"]) -> typing.Union[MetaOapg.properties.createdAt, schemas.Unset]: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["updatedAt"]) -> typing.Union[MetaOapg.properties.updatedAt, schemas.Unset]: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["config"]) -> typing.Union['WebhooksConfig', schemas.Unset]: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["payload"]) -> typing.Union[MetaOapg.properties.payload, schemas.Unset]: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["statusCode"]) -> typing.Union[MetaOapg.properties.statusCode, schemas.Unset]: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["retryAttempt"]) -> typing.Union[MetaOapg.properties.retryAttempt, schemas.Unset]: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["status"]) -> typing.Union[MetaOapg.properties.status, schemas.Unset]: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["nextRetryAfter"]) -> typing.Union[MetaOapg.properties.nextRetryAfter, 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["id", "webhookID", "createdAt", "updatedAt", "config", "payload", "statusCode", "retryAttempt", "status", "nextRetryAfter", ], str]):
        return super().get_item_oapg(name)
    

    def __new__(
        cls,
        *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ],
        id: typing.Union[MetaOapg.properties.id, str, uuid.UUID, schemas.Unset] = schemas.unset,
        webhookID: typing.Union[MetaOapg.properties.webhookID, str, uuid.UUID, schemas.Unset] = schemas.unset,
        createdAt: typing.Union[MetaOapg.properties.createdAt, str, datetime, schemas.Unset] = schemas.unset,
        updatedAt: typing.Union[MetaOapg.properties.updatedAt, str, datetime, schemas.Unset] = schemas.unset,
        config: typing.Union['WebhooksConfig', schemas.Unset] = schemas.unset,
        payload: typing.Union[MetaOapg.properties.payload, str, schemas.Unset] = schemas.unset,
        statusCode: typing.Union[MetaOapg.properties.statusCode, decimal.Decimal, int, schemas.Unset] = schemas.unset,
        retryAttempt: typing.Union[MetaOapg.properties.retryAttempt, decimal.Decimal, int, schemas.Unset] = schemas.unset,
        status: typing.Union[MetaOapg.properties.status, str, schemas.Unset] = schemas.unset,
        nextRetryAfter: typing.Union[MetaOapg.properties.nextRetryAfter, 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],
    ) -> 'Attempt':
        return super().__new__(
            cls,
            *_args,
            id=id,
            webhookID=webhookID,
            createdAt=createdAt,
            updatedAt=updatedAt,
            config=config,
            payload=payload,
            statusCode=statusCode,
            retryAttempt=retryAttempt,
            status=status,
            nextRetryAfter=nextRetryAfter,
            _configuration=_configuration,
            **kwargs,
        )

from FormanceHQ.model.webhooks_config import WebhooksConfig
