85 lines
2.4 KiB
Python
85 lines
2.4 KiB
Python
from collections.abc import Mapping
|
|
from typing import Any, TypeVar
|
|
|
|
from attrs import define as _attrs_define
|
|
from attrs import field as _attrs_field
|
|
|
|
from .. import types
|
|
|
|
T = TypeVar("T", bound="UserVerification")
|
|
|
|
|
|
@_attrs_define
|
|
class UserVerification:
|
|
"""Serializer for PolyTicketUser verification
|
|
|
|
Attributes:
|
|
user_id_b64 (str):
|
|
account_activation_token_b64 (str):
|
|
"""
|
|
|
|
user_id_b64: str
|
|
account_activation_token_b64: str
|
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
|
|
def to_dict(self) -> dict[str, Any]:
|
|
user_id_b64 = self.user_id_b64
|
|
|
|
account_activation_token_b64 = self.account_activation_token_b64
|
|
|
|
field_dict: dict[str, Any] = {}
|
|
field_dict.update(self.additional_properties)
|
|
field_dict.update(
|
|
{
|
|
"user_id_b64": user_id_b64,
|
|
"account_activation_token_b64": account_activation_token_b64,
|
|
}
|
|
)
|
|
|
|
return field_dict
|
|
|
|
def to_multipart(self) -> types.RequestFiles:
|
|
files: types.RequestFiles = []
|
|
|
|
files.append(("user_id_b64", (None, str(self.user_id_b64).encode(), "text/plain")))
|
|
|
|
files.append(
|
|
("account_activation_token_b64", (None, str(self.account_activation_token_b64).encode(), "text/plain"))
|
|
)
|
|
|
|
for prop_name, prop in self.additional_properties.items():
|
|
files.append((prop_name, (None, str(prop).encode(), "text/plain")))
|
|
|
|
return files
|
|
|
|
@classmethod
|
|
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
d = dict(src_dict)
|
|
user_id_b64 = d.pop("user_id_b64")
|
|
|
|
account_activation_token_b64 = d.pop("account_activation_token_b64")
|
|
|
|
user_verification = cls(
|
|
user_id_b64=user_id_b64,
|
|
account_activation_token_b64=account_activation_token_b64,
|
|
)
|
|
|
|
user_verification.additional_properties = d
|
|
return user_verification
|
|
|
|
@property
|
|
def additional_keys(self) -> list[str]:
|
|
return list(self.additional_properties.keys())
|
|
|
|
def __getitem__(self, key: str) -> Any:
|
|
return self.additional_properties[key]
|
|
|
|
def __setitem__(self, key: str, value: Any) -> None:
|
|
self.additional_properties[key] = value
|
|
|
|
def __delitem__(self, key: str) -> None:
|
|
del self.additional_properties[key]
|
|
|
|
def __contains__(self, key: str) -> bool:
|
|
return key in self.additional_properties
|