# 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.indy_proof_req_attr_spec import IndyProofReqAttrSpec
from acapy_wrapper.models.indy_proof_req_pred_spec import IndyProofReqPredSpec
from acapy_wrapper.models.indy_proof_request_non_revoked import (
    IndyProofRequestNonRevoked,
)


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

    Do not edit the class manually.

    IndyProofRequest - a model defined in OpenAPI

        name: The name of this IndyProofRequest [Optional].
        non_revoked: The non_revoked of this IndyProofRequest [Optional].
        nonce: The nonce of this IndyProofRequest [Optional].
        requested_attributes: The requested_attributes of this IndyProofRequest.
        requested_predicates: The requested_predicates of this IndyProofRequest.
        version: The version of this IndyProofRequest [Optional].
    """

    name: Optional[str] = None
    non_revoked: Optional[IndyProofRequestNonRevoked] = None
    nonce: Optional[str] = None
    requested_attributes: Dict[str, IndyProofReqAttrSpec]
    requested_predicates: Dict[str, IndyProofReqPredSpec]
    version: Optional[str] = None

    @validator("nonce")
    def nonce_pattern(cls, value):
        assert value is not None and re.match(r"^[1-9][0-9]*$", value)
        return value

    @validator("version")
    def version_pattern(cls, value):
        assert value is not None and re.match(r"^[0-9.]+$", value)
        return value


IndyProofRequest.update_forward_refs()
