| 1 |
|
| 2 |
|
| 3 |
import datetime as dt |
| 4 |
import typing |
| 5 |
|
| 6 |
import pydantic |
| 7 |
import typing_extensions |
| 8 |
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel |
| 9 |
from ..core.serialization import FieldMetadata |
| 10 |
from .client_credential_algorithm_enum import ClientCredentialAlgorithmEnum |
| 11 |
from .client_credential_type_enum import ClientCredentialTypeEnum |
| 12 |
|
| 13 |
|
| 14 |
class ClientCredential(UniversalBaseModel): |
| 15 |
id: typing.Optional[str] = pydantic.Field(default=None) |
| 16 |
""" |
| 17 |
ID of the credential. Generated on creation. |
| 18 |
""" |
| 19 |
|
| 20 |
name: typing.Optional[str] = pydantic.Field(default=None) |
| 21 |
""" |
| 22 |
The name given to the credential by the user. |
| 23 |
""" |
| 24 |
|
| 25 |
kid: typing.Optional[str] = pydantic.Field(default=None) |
| 26 |
""" |
| 27 |
The key identifier of the credential, generated on creation. |
| 28 |
""" |
| 29 |
|
| 30 |
alg: typing.Optional[ClientCredentialAlgorithmEnum] = None |
| 31 |
credential_type: typing.Optional[ClientCredentialTypeEnum] = None |
| 32 |
subject_dn: typing.Optional[str] = pydantic.Field(default=None) |
| 33 |
""" |
| 34 |
The X509 certificate's Subject Distinguished Name |
| 35 |
""" |
| 36 |
|
| 37 |
thumbprint_sha_256: typing_extensions.Annotated[ |
| 38 |
typing.Optional[str], |
| 39 |
FieldMetadata(alias="thumbprint_sha256"), |
| 40 |
pydantic.Field(alias="thumbprint_sha256", description="The X509 certificate's SHA256 thumbprint"), |
| 41 |
] = None |
| 42 |
""" |
| 43 |
The X509 certificate's SHA256 thumbprint |
| 44 |
""" |
| 45 |
|
| 46 |
created_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) |
| 47 |
""" |
| 48 |
The ISO 8601 formatted date the credential was created. |
| 49 |
""" |
| 50 |
|
| 51 |
updated_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) |
| 52 |
""" |
| 53 |
The ISO 8601 formatted date the credential was updated. |
| 54 |
""" |
| 55 |
|
| 56 |
expires_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) |
| 57 |
""" |
| 58 |
The ISO 8601 formatted date representing the expiration of the credential. |
| 59 |
""" |
| 60 |
|
| 61 |
if IS_PYDANTIC_V2: |
| 62 |
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) |
| 63 |
else: |
| 64 |
|
| 65 |
class Config: |
| 66 |
frozen = True |
| 67 |
smart_union = True |
| 68 |
extra = pydantic.Extra.allow |