# coding: utf-8

from __future__ import annotations
from datetime import date, datetime  # noqa: F401

import re  # noqa: F401
from typing import Any, Dict, List, Optional  # noqa: F401

from pydantic import AnyUrl, BaseModel, EmailStr, validator  # noqa: F401
from acapy_wrapper.models.attach_decorator import AttachDecorator


class DIDXRequest(BaseModel):
    """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

    Do not edit the class manually.

    DIDXRequest - a model defined in OpenAPI

        id: The id of this DIDXRequest [Optional].
        type: The type of this DIDXRequest [Optional].
        did: The did of this DIDXRequest [Optional].
        did_docattach: The did_docattach of this DIDXRequest [Optional].
        label: The label of this DIDXRequest.
    """

    id: Optional[str] = None
    type: Optional[str] = None
    did: Optional[str] = None
    did_docattach: Optional[AttachDecorator] = None
    label: str

    @validator("did")
    def did_pattern(cls, value):
        assert value is not None and re.match(
            r"^(did:sov:)?[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}$",
            value,
        )
        return value


DIDXRequest.update_forward_refs()
