"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from .signerrefdto import SignerRefDto, SignerRefDtoTypedDict
from enum import Enum
from que_media.types import BaseModel
from typing import List, Optional, Union
from typing_extensions import NotRequired, TypeAliasType, TypedDict


class TypeSeparate(str, Enum):
    SEPARATE = "separate"


class SignerSeparateTypedDict(TypedDict):
    type: TypeSeparate
    signer: SignerRefDtoTypedDict
    r"""Reference to credentials for signing."""


class SignerSeparate(BaseModel):
    type: TypeSeparate

    signer: SignerRefDto
    r"""Reference to credentials for signing."""


class TypeUseMainSigner(str, Enum):
    USE_MAIN_SIGNER = "use_main_signer"


class SignerUseMainSignerTypedDict(TypedDict):
    type: TypeUseMainSigner


class SignerUseMainSigner(BaseModel):
    type: TypeUseMainSigner


SignerTypedDict = TypeAliasType(
    "SignerTypedDict", Union[SignerUseMainSignerTypedDict, SignerSeparateTypedDict]
)


Signer = TypeAliasType("Signer", Union[SignerUseMainSigner, SignerSeparate])


class SigningAlg(str, Enum):
    r"""Algorithm used for the CAWG identity signature."""

    ED25519 = "ed25519"
    ES256 = "es256"
    ES384 = "es384"
    PS256 = "ps256"


class CawgIdentityDtoTypedDict(TypedDict):
    r"""Configuration to add a CAWG identity assertion during signing. Presence of this object enables CAWG."""

    signer: NotRequired[SignerTypedDict]
    signing_alg: NotRequired[SigningAlg]
    r"""Algorithm used for the CAWG identity signature."""
    referenced_assertions: NotRequired[List[str]]
    r"""Assertion labels that the identity assertion should reference."""
    timestamper: NotRequired[str]
    r"""Timestamper to use (\"digicert\" or \"custom:<url>\")."""


class CawgIdentityDto(BaseModel):
    r"""Configuration to add a CAWG identity assertion during signing. Presence of this object enables CAWG."""

    signer: Optional[Signer] = None

    signing_alg: Optional[SigningAlg] = SigningAlg.ED25519
    r"""Algorithm used for the CAWG identity signature."""

    referenced_assertions: Optional[List[str]] = None
    r"""Assertion labels that the identity assertion should reference."""

    timestamper: Optional[str] = None
    r"""Timestamper to use (\"digicert\" or \"custom:<url>\")."""
