Update api spec (#125)
* YOYO NEW API SPEC! * I have generated the latest API! --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
@ -2,51 +2,51 @@ from typing import Any, Dict, List, Type, TypeVar, Union
|
||||
|
||||
import attr
|
||||
|
||||
from ..models.error_code import ErrorCode
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
MS = TypeVar("MS", bound="Error")
|
||||
LT = TypeVar("LT", bound="Error")
|
||||
|
||||
|
||||
@attr.s(auto_attribs=True)
|
||||
class Error:
|
||||
"""An error.""" # noqa: E501
|
||||
"""Error information from a response.""" # noqa: E501
|
||||
|
||||
code: Union[Unset, ErrorCode] = UNSET
|
||||
error_code: Union[Unset, str] = UNSET
|
||||
message: Union[Unset, str] = UNSET
|
||||
request_id: Union[Unset, str] = UNSET
|
||||
|
||||
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
if not isinstance(self.code, Unset):
|
||||
code = self.code
|
||||
error_code = self.error_code
|
||||
message = self.message
|
||||
request_id = self.request_id
|
||||
|
||||
field_dict: Dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({})
|
||||
if code is not UNSET:
|
||||
field_dict["code"] = code
|
||||
if error_code is not UNSET:
|
||||
field_dict["error_code"] = error_code
|
||||
if message is not UNSET:
|
||||
field_dict["message"] = message
|
||||
if request_id is not UNSET:
|
||||
field_dict["request_id"] = request_id
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: Type[MS], src_dict: Dict[str, Any]) -> MS:
|
||||
def from_dict(cls: Type[LT], src_dict: Dict[str, Any]) -> LT:
|
||||
d = src_dict.copy()
|
||||
_code = d.pop("code", UNSET)
|
||||
code: Union[Unset, ErrorCode]
|
||||
if isinstance(_code, Unset):
|
||||
code = UNSET
|
||||
else:
|
||||
code = _code # type: ignore[arg-type]
|
||||
error_code = d.pop("error_code", UNSET)
|
||||
|
||||
message = d.pop("message", UNSET)
|
||||
|
||||
request_id = d.pop("request_id", UNSET)
|
||||
|
||||
error = cls(
|
||||
code=code,
|
||||
error_code=error_code,
|
||||
message=message,
|
||||
request_id=request_id,
|
||||
)
|
||||
|
||||
error.additional_properties = d
|
||||
|
Reference in New Issue
Block a user