-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauthenticationerror.py
More file actions
29 lines (23 loc) · 940 Bytes
/
authenticationerror.py
File metadata and controls
29 lines (23 loc) · 940 Bytes
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
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from .authenticationerrordetail import AuthenticationErrorDetail
from censys_platform.models import SDKBaseError
from censys_platform.types import BaseModel
from dataclasses import dataclass, field
import httpx
from typing import Optional
class AuthenticationErrorData(BaseModel):
error: Optional[AuthenticationErrorDetail] = None
@dataclass(unsafe_hash=True)
class AuthenticationError(SDKBaseError):
data: AuthenticationErrorData = field(hash=False)
def __init__(
self,
data: AuthenticationErrorData,
raw_response: httpx.Response,
body: Optional[str] = None,
):
fallback = body or raw_response.text
message = str(data.error.message) if data.error else fallback
super().__init__(message, raw_response, body)
object.__setattr__(self, "data", data)