-
Notifications
You must be signed in to change notification settings - Fork 48
/
Copy pathjsonapi_error_item.py
97 lines (83 loc) · 2.83 KB
/
jsonapi_error_item.py
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations
from typing import Any, Dict, Union, TYPE_CHECKING
from datadog_api_client.model_utils import (
ModelNormal,
cached_property,
date,
datetime,
none_type,
unset,
UnsetType,
UUID,
)
if TYPE_CHECKING:
from datadog_api_client.v2.model.jsonapi_error_item_source import JSONAPIErrorItemSource
class JSONAPIErrorItem(ModelNormal):
@cached_property
def openapi_types(_):
from datadog_api_client.v2.model.jsonapi_error_item_source import JSONAPIErrorItemSource
return {
"detail": (str,),
"meta": (
{
str: (
bool,
date,
datetime,
dict,
float,
int,
list,
str,
UUID,
none_type,
)
},
),
"source": (JSONAPIErrorItemSource,),
"status": (str,),
"title": (str,),
}
attribute_map = {
"detail": "detail",
"meta": "meta",
"source": "source",
"status": "status",
"title": "title",
}
def __init__(
self_,
detail: Union[str, UnsetType] = unset,
meta: Union[Dict[str, Any], UnsetType] = unset,
source: Union[JSONAPIErrorItemSource, UnsetType] = unset,
status: Union[str, UnsetType] = unset,
title: Union[str, UnsetType] = unset,
**kwargs,
):
"""
API error response body
:param detail: A human-readable explanation specific to this occurrence of the error.
:type detail: str, optional
:param meta: Non-standard meta-information about the error
:type meta: {str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)}, optional
:param source: References to the source of the error.
:type source: JSONAPIErrorItemSource, optional
:param status: Status code of the response.
:type status: str, optional
:param title: Short human-readable summary of the error.
:type title: str, optional
"""
if detail is not unset:
kwargs["detail"] = detail
if meta is not unset:
kwargs["meta"] = meta
if source is not unset:
kwargs["source"] = source
if status is not unset:
kwargs["status"] = status
if title is not unset:
kwargs["title"] = title
super().__init__(kwargs)