#[non_exhaustive]pub struct NotebookCreateData {
pub attributes: NotebookCreateDataAttributes,
pub type_: NotebookResourceType,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
The data for a notebook create request.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.attributes: NotebookCreateDataAttributes
The data attributes of a notebook.
type_: NotebookResourceType
Type of the Notebook resource.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl NotebookCreateData
impl NotebookCreateData
Sourcepub fn new(
attributes: NotebookCreateDataAttributes,
type_: NotebookResourceType,
) -> NotebookCreateData
pub fn new( attributes: NotebookCreateDataAttributes, type_: NotebookResourceType, ) -> NotebookCreateData
Examples found in repository?
examples/v1_notebooks_CreateNotebook.rs (lines 32-85)
31async fn main() {
32 let body = NotebookCreateRequest::new(NotebookCreateData::new(
33 NotebookCreateDataAttributes::new(
34 vec![
35 NotebookCellCreateRequest::new(
36 NotebookCellCreateRequestAttributes::NotebookMarkdownCellAttributes(Box::new(
37 NotebookMarkdownCellAttributes::new(NotebookMarkdownCellDefinition::new(
38 r#"## Some test markdown
39
40```js
41var x, y;
42x = 5;
43y = 6;
44```"#
45 .to_string(),
46 NotebookMarkdownCellDefinitionType::MARKDOWN,
47 )),
48 )),
49 NotebookCellResourceType::NOTEBOOK_CELLS,
50 ),
51 NotebookCellCreateRequest::new(
52 NotebookCellCreateRequestAttributes::NotebookTimeseriesCellAttributes(
53 Box::new(
54 NotebookTimeseriesCellAttributes::new(
55 TimeseriesWidgetDefinition::new(
56 vec![TimeseriesWidgetRequest::new()
57 .display_type(WidgetDisplayType::LINE)
58 .q("avg:system.load.1{*}".to_string())
59 .style(
60 WidgetRequestStyle::new()
61 .line_type(WidgetLineType::SOLID)
62 .line_width(WidgetLineWidth::NORMAL)
63 .palette("dog_classic".to_string()),
64 )],
65 TimeseriesWidgetDefinitionType::TIMESERIES,
66 )
67 .show_legend(true)
68 .yaxis(WidgetAxis::new().scale("linear".to_string())),
69 )
70 .graph_size(NotebookGraphSize::MEDIUM)
71 .split_by(NotebookSplitBy::new(vec![], vec![]))
72 .time(None),
73 ),
74 ),
75 NotebookCellResourceType::NOTEBOOK_CELLS,
76 ),
77 ],
78 "Example-Notebook".to_string(),
79 NotebookGlobalTime::NotebookRelativeTime(Box::new(NotebookRelativeTime::new(
80 WidgetLiveSpan::PAST_ONE_HOUR,
81 ))),
82 )
83 .status(NotebookStatus::PUBLISHED),
84 NotebookResourceType::NOTEBOOKS,
85 ));
86 let configuration = datadog::Configuration::new();
87 let api = NotebooksAPI::with_config(configuration);
88 let resp = api.create_notebook(body).await;
89 if let Ok(value) = resp {
90 println!("{:#?}", value);
91 } else {
92 println!("{:#?}", resp.unwrap_err());
93 }
94}
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for NotebookCreateData
impl Clone for NotebookCreateData
Source§fn clone(&self) -> NotebookCreateData
fn clone(&self) -> NotebookCreateData
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for NotebookCreateData
impl Debug for NotebookCreateData
Source§impl<'de> Deserialize<'de> for NotebookCreateData
impl<'de> Deserialize<'de> for NotebookCreateData
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for NotebookCreateData
impl PartialEq for NotebookCreateData
Source§impl Serialize for NotebookCreateData
impl Serialize for NotebookCreateData
impl StructuralPartialEq for NotebookCreateData
Auto Trait Implementations§
impl Freeze for NotebookCreateData
impl RefUnwindSafe for NotebookCreateData
impl Send for NotebookCreateData
impl Sync for NotebookCreateData
impl Unpin for NotebookCreateData
impl UnwindSafe for NotebookCreateData
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more