-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathunprocessableresponse.py
More file actions
59 lines (43 loc) · 1.91 KB
/
unprocessableresponse.py
File metadata and controls
59 lines (43 loc) · 1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from apideck_unify.models import ApideckError
from apideck_unify.types import BaseModel
from dataclasses import dataclass, field
import httpx
from typing import Any, Dict, Optional, Union
from typing_extensions import TypeAliasType
UnprocessableResponseDetailTypedDict = TypeAliasType(
"UnprocessableResponseDetailTypedDict", Union[str, Dict[str, Any]]
)
r"""Contains parameter or domain specific information related to the error and why it occurred."""
UnprocessableResponseDetail = TypeAliasType(
"UnprocessableResponseDetail", Union[str, Dict[str, Any]]
)
r"""Contains parameter or domain specific information related to the error and why it occurred."""
class UnprocessableResponseData(BaseModel):
status_code: Optional[float] = None
r"""HTTP status code"""
error: Optional[str] = None
r"""Contains an explanation of the status_code as defined in HTTP/1.1 standard (RFC 7231)"""
type_name: Optional[str] = None
r"""The type of error returned"""
message: Optional[str] = None
r"""A human-readable message providing more details about the error."""
detail: Optional[UnprocessableResponseDetail] = None
r"""Contains parameter or domain specific information related to the error and why it occurred."""
ref: Optional[str] = None
r"""Link to documentation of error type"""
@dataclass(unsafe_hash=True)
class UnprocessableResponse(ApideckError):
r"""Unprocessable"""
data: UnprocessableResponseData = field(hash=False)
def __init__(
self,
data: UnprocessableResponseData,
raw_response: httpx.Response,
body: Optional[str] = None,
):
fallback = body or raw_response.text
message = str(data.message) or fallback
super().__init__(message, raw_response, body)
object.__setattr__(self, "data", data)