-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathkomboatserror.py
More file actions
33 lines (26 loc) · 1.05 KB
/
komboatserror.py
File metadata and controls
33 lines (26 loc) · 1.05 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
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from dataclasses import dataclass, field
import httpx
from kombo.errors import SDKError
from kombo.models import komboatserror as models_komboatserror
from kombo.types import BaseModel
from typing import Optional
class KomboAtsErrorData(BaseModel):
status: models_komboatserror.KomboAtsErrorStatus
error: models_komboatserror.KomboAtsErrorError
r"""Error details with structured code for programmatic handling."""
@dataclass(unsafe_hash=True)
class KomboAtsError(SDKError):
r"""The standard error response with the error codes for the ATS use case."""
data: KomboAtsErrorData = field(hash=False)
def __init__(
self,
data: KomboAtsErrorData,
raw_response: httpx.Response,
body: Optional[str] = None,
):
fallback = body or raw_response.text
message = str(data.error.message) or fallback
super().__init__(message, raw_response, body)
object.__setattr__(self, "data", data)