-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy pathnotebook_create_data_attributes.py
More file actions
101 lines (84 loc) · 3.68 KB
/
notebook_create_data_attributes.py
File metadata and controls
101 lines (84 loc) · 3.68 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
# 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,
unset,
UnsetType,
)
if TYPE_CHECKING:
from datadog_api_client.v1.model.notebook_cell_create_request import NotebookCellCreateRequest
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 NotebookCreateDataAttributes(ModelNormal):
validations = {
"name": {
"max_length": 80,
"min_length": 0,
},
}
@cached_property
def openapi_types(_):
from datadog_api_client.v1.model.notebook_cell_create_request import NotebookCellCreateRequest
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 {
"cells": ([NotebookCellCreateRequest],),
"metadata": (NotebookMetadata,),
"name": (str,),
"status": (NotebookStatus,),
"template_variables": ([NotebookTemplateVariable],),
"time": (NotebookGlobalTime,),
}
attribute_map = {
"cells": "cells",
"metadata": "metadata",
"name": "name",
"status": "status",
"template_variables": "template_variables",
"time": "time",
}
def __init__(
self_,
cells: List[NotebookCellCreateRequest],
name: str,
time: Union[NotebookGlobalTime, NotebookRelativeTime, NotebookAbsoluteTime],
metadata: Union[NotebookMetadata, UnsetType] = unset,
status: Union[NotebookStatus, UnsetType] = unset,
template_variables: Union[List[NotebookTemplateVariable], UnsetType] = unset,
**kwargs,
):
"""
The data attributes of a notebook.
:param cells: List of cells to display in the notebook.
:type cells: [NotebookCellCreateRequest]
:param metadata: Metadata associated with the notebook.
:type metadata: NotebookMetadata, 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
"""
if metadata is not unset:
kwargs["metadata"] = metadata
if status is not unset:
kwargs["status"] = status
if template_variables is not unset:
kwargs["template_variables"] = template_variables
super().__init__(kwargs)
self_.cells = cells
self_.name = name
self_.time = time