-
Notifications
You must be signed in to change notification settings - Fork 52
Expand file tree
/
Copy pathnotebooks_response_data_attributes.py
More file actions
134 lines (114 loc) · 4.96 KB
/
notebooks_response_data_attributes.py
File metadata and controls
134 lines (114 loc) · 4.96 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
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# 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 List, Union, TYPE_CHECKING
from datadog_api_client.model_utils import (
ModelNormal,
cached_property,
datetime,
unset,
UnsetType,
)
if TYPE_CHECKING:
from datadog_api_client.v1.model.notebook_author import NotebookAuthor
from datadog_api_client.v1.model.notebook_cell_response import NotebookCellResponse
from datadog_api_client.v1.model.notebook_metadata import NotebookMetadata
from datadog_api_client.v1.model.notebook_status import NotebookStatus
from datadog_api_client.v1.model.notebook_template_variable import NotebookTemplateVariable
from datadog_api_client.v1.model.notebook_global_time import NotebookGlobalTime
from datadog_api_client.v1.model.notebook_relative_time import NotebookRelativeTime
from datadog_api_client.v1.model.notebook_absolute_time import NotebookAbsoluteTime
class NotebooksResponseDataAttributes(ModelNormal):
validations = {
"name": {
"max_length": 80,
"min_length": 0,
},
}
@cached_property
def openapi_types(_):
from datadog_api_client.v1.model.notebook_author import NotebookAuthor
from datadog_api_client.v1.model.notebook_cell_response import NotebookCellResponse
from datadog_api_client.v1.model.notebook_metadata import NotebookMetadata
from datadog_api_client.v1.model.notebook_status import NotebookStatus
from datadog_api_client.v1.model.notebook_template_variable import NotebookTemplateVariable
from datadog_api_client.v1.model.notebook_global_time import NotebookGlobalTime
return {
"author": (NotebookAuthor,),
"cells": ([NotebookCellResponse],),
"created": (datetime,),
"metadata": (NotebookMetadata,),
"modified": (datetime,),
"name": (str,),
"status": (NotebookStatus,),
"template_variables": ([NotebookTemplateVariable],),
"time": (NotebookGlobalTime,),
}
attribute_map = {
"author": "author",
"cells": "cells",
"created": "created",
"metadata": "metadata",
"modified": "modified",
"name": "name",
"status": "status",
"template_variables": "template_variables",
"time": "time",
}
read_only_vars = {
"created",
"modified",
}
def __init__(
self_,
name: str,
author: Union[NotebookAuthor, UnsetType] = unset,
cells: Union[List[NotebookCellResponse], UnsetType] = unset,
created: Union[datetime, UnsetType] = unset,
metadata: Union[NotebookMetadata, UnsetType] = unset,
modified: Union[datetime, UnsetType] = unset,
status: Union[NotebookStatus, UnsetType] = unset,
template_variables: Union[List[NotebookTemplateVariable], UnsetType] = unset,
time: Union[NotebookGlobalTime, NotebookRelativeTime, NotebookAbsoluteTime, UnsetType] = unset,
**kwargs,
):
"""
The attributes of a notebook in get all response.
:param author: Attributes of user object returned by the API.
:type author: NotebookAuthor, optional
:param cells: List of cells to display in the notebook.
:type cells: [NotebookCellResponse], optional
:param created: UTC time stamp for when the notebook was created.
:type created: datetime, optional
:param metadata: Metadata associated with the notebook.
:type metadata: NotebookMetadata, optional
:param modified: UTC time stamp for when the notebook was last modified.
:type modified: datetime, optional
:param name: The name of the notebook.
:type name: str
:param status: Publication status of the notebook. For now, always "published".
:type status: NotebookStatus, optional
:param template_variables: List of template variables for this notebook.
:type template_variables: [NotebookTemplateVariable], optional
:param time: Notebook global timeframe.
:type time: NotebookGlobalTime, optional
"""
if author is not unset:
kwargs["author"] = author
if cells is not unset:
kwargs["cells"] = cells
if created is not unset:
kwargs["created"] = created
if metadata is not unset:
kwargs["metadata"] = metadata
if modified is not unset:
kwargs["modified"] = modified
if status is not unset:
kwargs["status"] = status
if template_variables is not unset:
kwargs["template_variables"] = template_variables
if time is not unset:
kwargs["time"] = time
super().__init__(kwargs)
self_.name = name