|
19 | 19 | import json
|
20 | 20 |
|
21 | 21 | from datetime import datetime
|
22 |
| -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr |
| 22 | +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator |
23 | 23 | from typing import Any, ClassVar, Dict, List, Optional
|
24 |
| -from cdo_sdk_python.models.cdo_transaction_status import CdoTransactionStatus |
25 |
| -from cdo_sdk_python.models.cdo_transaction_type import CdoTransactionType |
26 | 24 | from typing import Optional, Set
|
27 | 25 | from typing_extensions import Self
|
28 | 26 |
|
29 | 27 | class CdoTransaction(BaseModel):
|
30 | 28 | """
|
31 | 29 | CdoTransaction
|
32 | 30 | """ # noqa: E501
|
33 |
| - tenant_uid: Optional[StrictStr] = Field(default=None, description="The unique identifier, represented as a UUID, of the tenant that asynchronous transaction triggered on.", alias="tenantUid") |
34 |
| - sort_key: Optional[StrictStr] = Field(default=None, description="DynamoDB sort key to provide us with efficient query capabilities.", alias="sortKey") |
35 |
| - transaction_uid: Optional[StrictStr] = Field(default=None, description="The unique identifier, represented as a UUID, of the asynchronous transaction triggered.", alias="transactionUid") |
36 |
| - entity_uid: Optional[StrictStr] = Field(default=None, description="The unique identifier, represented as a UUID, of the entity that the asynchronous transaction is triggered on.", alias="entityUid") |
37 |
| - entity_url: Optional[StrictStr] = Field(default=None, description="A URL to access the entity that the asynchronous transaction is triggered on.", alias="entityUrl") |
| 31 | + tenant_uid: Optional[StrictStr] = Field(default=None, description="The unique identifier of the tenant that the transaction triggered on.", alias="tenantUid") |
| 32 | + transaction_uid: Optional[StrictStr] = Field(default=None, description="The unique identifier of the transaction triggered.", alias="transactionUid") |
| 33 | + entity_uid: Optional[StrictStr] = Field(default=None, description="The unique identifier of the entity that the transaction is triggered on. This can be empty, for a transaction that is not tied to an entity, such as transactions which refresh RA VPN sessions.", alias="entityUid") |
| 34 | + entity_url: Optional[StrictStr] = Field(default=None, description="A URL to access the entity that the transaction is triggered on. This can also be empty", alias="entityUrl") |
38 | 35 | transaction_polling_url: Optional[StrictStr] = Field(default=None, description="The URL to poll to track the progress of the transaction.", alias="transactionPollingUrl")
|
39 | 36 | submission_time: Optional[datetime] = Field(default=None, description="The time (UTC; represented using the RFC-3339 standard) at which the transaction was triggered", alias="submissionTime")
|
40 | 37 | last_updated_time: Optional[datetime] = Field(default=None, description="The time (UTC; represented using the RFC-3339 standard) at which the transaction status was last updated", alias="lastUpdatedTime")
|
41 |
| - transaction_type: Optional[CdoTransactionType] = Field(default=None, alias="transactionType") |
42 |
| - cdo_transaction_status: Optional[CdoTransactionStatus] = Field(default=None, alias="cdoTransactionStatus") |
43 | 38 | transaction_details: Optional[Dict[str, StrictStr]] = Field(default=None, description="Transaction details, if any", alias="transactionDetails")
|
44 | 39 | error_message: Optional[StrictStr] = Field(default=None, description="Transaction error message, if any", alias="errorMessage")
|
45 | 40 | error_details: Optional[Dict[str, StrictStr]] = Field(default=None, description="Transaction error details, if any", alias="errorDetails")
|
46 |
| - expire_at: Optional[StrictInt] = Field(default=None, description="TTL attribute detailing the expiry time this item should be deleted", alias="expireAt") |
47 |
| - __properties: ClassVar[List[str]] = ["tenantUid", "sortKey", "transactionUid", "entityUid", "entityUrl", "transactionPollingUrl", "submissionTime", "lastUpdatedTime", "transactionType", "cdoTransactionStatus", "transactionDetails", "errorMessage", "errorDetails", "expireAt"] |
| 41 | + transaction_type: Optional[StrictStr] = Field(default=None, description="the type of the transaction", alias="transactionType") |
| 42 | + cdo_transaction_status: Optional[StrictStr] = Field(default=None, description="The status of the CDO transaction", alias="cdoTransactionStatus") |
| 43 | + __properties: ClassVar[List[str]] = ["tenantUid", "transactionUid", "entityUid", "entityUrl", "transactionPollingUrl", "submissionTime", "lastUpdatedTime", "transactionDetails", "errorMessage", "errorDetails", "transactionType", "cdoTransactionStatus"] |
| 44 | + |
| 45 | + @field_validator('transaction_type') |
| 46 | + def transaction_type_validate_enum(cls, value): |
| 47 | + """Validates the enum""" |
| 48 | + if value is None: |
| 49 | + return value |
| 50 | + |
| 51 | + if value not in set(['ONBOARD_ASA', 'ONBOARD_IOS', 'ONBOARD_DUO_ADMIN_PANEL', 'CREATE_FTD', 'ONBOARD_FTD_ZTP', 'REGISTER_FTD', 'DELETE_CDFMC_MANAGED_FTD', 'RECONNECT_ASA', 'READ_ASA', 'EXECUTE_CLI_COMMAND', 'DEPLOY_ASA_DEVICE_CHANGES', 'INDEX_TENANT', 'TERMINATE_DEVICE_RA_VPN_SESSIONS', 'REFRESH_RA_VPN_SESSIONS', 'TERMINATE_USER_RA_VPN_SESSIONS', 'CREATE_SDC', 'SEND_AI_ASSISTANT_MESSAGE', 'MSP_CREATE_TENANT', 'MSP_ADD_USERS_TO_TENANT', 'MSP_ADD_USER_GROUPS_TO_TENANT', 'MSP_ADD_EXISTING_TENANT', 'MSP_ENABLE_MULTICLOUD_DEFENSE', 'MSP_PROVISION_CDFMC']): |
| 52 | + raise ValueError("must be one of enum values ('ONBOARD_ASA', 'ONBOARD_IOS', 'ONBOARD_DUO_ADMIN_PANEL', 'CREATE_FTD', 'ONBOARD_FTD_ZTP', 'REGISTER_FTD', 'DELETE_CDFMC_MANAGED_FTD', 'RECONNECT_ASA', 'READ_ASA', 'EXECUTE_CLI_COMMAND', 'DEPLOY_ASA_DEVICE_CHANGES', 'INDEX_TENANT', 'TERMINATE_DEVICE_RA_VPN_SESSIONS', 'REFRESH_RA_VPN_SESSIONS', 'TERMINATE_USER_RA_VPN_SESSIONS', 'CREATE_SDC', 'SEND_AI_ASSISTANT_MESSAGE', 'MSP_CREATE_TENANT', 'MSP_ADD_USERS_TO_TENANT', 'MSP_ADD_USER_GROUPS_TO_TENANT', 'MSP_ADD_EXISTING_TENANT', 'MSP_ENABLE_MULTICLOUD_DEFENSE', 'MSP_PROVISION_CDFMC')") |
| 53 | + return value |
| 54 | + |
| 55 | + @field_validator('cdo_transaction_status') |
| 56 | + def cdo_transaction_status_validate_enum(cls, value): |
| 57 | + """Validates the enum""" |
| 58 | + if value is None: |
| 59 | + return value |
| 60 | + |
| 61 | + if value not in set(['PENDING', 'IN_PROGRESS', 'DONE', 'ERROR']): |
| 62 | + raise ValueError("must be one of enum values ('PENDING', 'IN_PROGRESS', 'DONE', 'ERROR')") |
| 63 | + return value |
48 | 64 |
|
49 | 65 | model_config = ConfigDict(
|
50 | 66 | populate_by_name=True,
|
@@ -98,19 +114,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
98 | 114 |
|
99 | 115 | _obj = cls.model_validate({
|
100 | 116 | "tenantUid": obj.get("tenantUid"),
|
101 |
| - "sortKey": obj.get("sortKey"), |
102 | 117 | "transactionUid": obj.get("transactionUid"),
|
103 | 118 | "entityUid": obj.get("entityUid"),
|
104 | 119 | "entityUrl": obj.get("entityUrl"),
|
105 | 120 | "transactionPollingUrl": obj.get("transactionPollingUrl"),
|
106 | 121 | "submissionTime": obj.get("submissionTime"),
|
107 | 122 | "lastUpdatedTime": obj.get("lastUpdatedTime"),
|
108 |
| - "transactionType": obj.get("transactionType"), |
109 |
| - "cdoTransactionStatus": obj.get("cdoTransactionStatus"), |
110 | 123 | "transactionDetails": obj.get("transactionDetails"),
|
111 | 124 | "errorMessage": obj.get("errorMessage"),
|
112 | 125 | "errorDetails": obj.get("errorDetails"),
|
113 |
| - "expireAt": obj.get("expireAt") |
| 126 | + "transactionType": obj.get("transactionType"), |
| 127 | + "cdoTransactionStatus": obj.get("cdoTransactionStatus") |
114 | 128 | })
|
115 | 129 | return _obj
|
116 | 130 |
|
|
0 commit comments