Skip to main content

aws_sdk_iotanalytics/types/
_dataset_summary.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>A summary of information about a dataset.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct DatasetSummary {
7    /// <p>The name of the dataset.</p>
8    pub dataset_name: ::std::option::Option<::std::string::String>,
9    /// <p>The status of the dataset.</p>
10    pub status: ::std::option::Option<crate::types::DatasetStatus>,
11    /// <p>The time the dataset was created.</p>
12    pub creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
13    /// <p>The last time the dataset was updated.</p>
14    pub last_update_time: ::std::option::Option<::aws_smithy_types::DateTime>,
15    /// <p>A list of triggers. A trigger causes dataset content to be populated at a specified time interval or when another dataset is populated. The list of triggers can be empty or contain up to five <code>DataSetTrigger</code> objects</p>
16    pub triggers: ::std::option::Option<::std::vec::Vec<crate::types::DatasetTrigger>>,
17    /// <p>A list of <code>DataActionSummary</code> objects.</p>
18    pub actions: ::std::option::Option<::std::vec::Vec<crate::types::DatasetActionSummary>>,
19}
20impl DatasetSummary {
21    /// <p>The name of the dataset.</p>
22    pub fn dataset_name(&self) -> ::std::option::Option<&str> {
23        self.dataset_name.as_deref()
24    }
25    /// <p>The status of the dataset.</p>
26    pub fn status(&self) -> ::std::option::Option<&crate::types::DatasetStatus> {
27        self.status.as_ref()
28    }
29    /// <p>The time the dataset was created.</p>
30    pub fn creation_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
31        self.creation_time.as_ref()
32    }
33    /// <p>The last time the dataset was updated.</p>
34    pub fn last_update_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
35        self.last_update_time.as_ref()
36    }
37    /// <p>A list of triggers. A trigger causes dataset content to be populated at a specified time interval or when another dataset is populated. The list of triggers can be empty or contain up to five <code>DataSetTrigger</code> objects</p>
38    ///
39    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.triggers.is_none()`.
40    pub fn triggers(&self) -> &[crate::types::DatasetTrigger] {
41        self.triggers.as_deref().unwrap_or_default()
42    }
43    /// <p>A list of <code>DataActionSummary</code> objects.</p>
44    ///
45    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.actions.is_none()`.
46    pub fn actions(&self) -> &[crate::types::DatasetActionSummary] {
47        self.actions.as_deref().unwrap_or_default()
48    }
49}
50impl DatasetSummary {
51    /// Creates a new builder-style object to manufacture [`DatasetSummary`](crate::types::DatasetSummary).
52    pub fn builder() -> crate::types::builders::DatasetSummaryBuilder {
53        crate::types::builders::DatasetSummaryBuilder::default()
54    }
55}
56
57/// A builder for [`DatasetSummary`](crate::types::DatasetSummary).
58#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
59#[non_exhaustive]
60pub struct DatasetSummaryBuilder {
61    pub(crate) dataset_name: ::std::option::Option<::std::string::String>,
62    pub(crate) status: ::std::option::Option<crate::types::DatasetStatus>,
63    pub(crate) creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
64    pub(crate) last_update_time: ::std::option::Option<::aws_smithy_types::DateTime>,
65    pub(crate) triggers: ::std::option::Option<::std::vec::Vec<crate::types::DatasetTrigger>>,
66    pub(crate) actions: ::std::option::Option<::std::vec::Vec<crate::types::DatasetActionSummary>>,
67}
68impl DatasetSummaryBuilder {
69    /// <p>The name of the dataset.</p>
70    pub fn dataset_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
71        self.dataset_name = ::std::option::Option::Some(input.into());
72        self
73    }
74    /// <p>The name of the dataset.</p>
75    pub fn set_dataset_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
76        self.dataset_name = input;
77        self
78    }
79    /// <p>The name of the dataset.</p>
80    pub fn get_dataset_name(&self) -> &::std::option::Option<::std::string::String> {
81        &self.dataset_name
82    }
83    /// <p>The status of the dataset.</p>
84    pub fn status(mut self, input: crate::types::DatasetStatus) -> Self {
85        self.status = ::std::option::Option::Some(input);
86        self
87    }
88    /// <p>The status of the dataset.</p>
89    pub fn set_status(mut self, input: ::std::option::Option<crate::types::DatasetStatus>) -> Self {
90        self.status = input;
91        self
92    }
93    /// <p>The status of the dataset.</p>
94    pub fn get_status(&self) -> &::std::option::Option<crate::types::DatasetStatus> {
95        &self.status
96    }
97    /// <p>The time the dataset was created.</p>
98    pub fn creation_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
99        self.creation_time = ::std::option::Option::Some(input);
100        self
101    }
102    /// <p>The time the dataset was created.</p>
103    pub fn set_creation_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
104        self.creation_time = input;
105        self
106    }
107    /// <p>The time the dataset was created.</p>
108    pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
109        &self.creation_time
110    }
111    /// <p>The last time the dataset was updated.</p>
112    pub fn last_update_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
113        self.last_update_time = ::std::option::Option::Some(input);
114        self
115    }
116    /// <p>The last time the dataset was updated.</p>
117    pub fn set_last_update_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
118        self.last_update_time = input;
119        self
120    }
121    /// <p>The last time the dataset was updated.</p>
122    pub fn get_last_update_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
123        &self.last_update_time
124    }
125    /// Appends an item to `triggers`.
126    ///
127    /// To override the contents of this collection use [`set_triggers`](Self::set_triggers).
128    ///
129    /// <p>A list of triggers. A trigger causes dataset content to be populated at a specified time interval or when another dataset is populated. The list of triggers can be empty or contain up to five <code>DataSetTrigger</code> objects</p>
130    pub fn triggers(mut self, input: crate::types::DatasetTrigger) -> Self {
131        let mut v = self.triggers.unwrap_or_default();
132        v.push(input);
133        self.triggers = ::std::option::Option::Some(v);
134        self
135    }
136    /// <p>A list of triggers. A trigger causes dataset content to be populated at a specified time interval or when another dataset is populated. The list of triggers can be empty or contain up to five <code>DataSetTrigger</code> objects</p>
137    pub fn set_triggers(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::DatasetTrigger>>) -> Self {
138        self.triggers = input;
139        self
140    }
141    /// <p>A list of triggers. A trigger causes dataset content to be populated at a specified time interval or when another dataset is populated. The list of triggers can be empty or contain up to five <code>DataSetTrigger</code> objects</p>
142    pub fn get_triggers(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DatasetTrigger>> {
143        &self.triggers
144    }
145    /// Appends an item to `actions`.
146    ///
147    /// To override the contents of this collection use [`set_actions`](Self::set_actions).
148    ///
149    /// <p>A list of <code>DataActionSummary</code> objects.</p>
150    pub fn actions(mut self, input: crate::types::DatasetActionSummary) -> Self {
151        let mut v = self.actions.unwrap_or_default();
152        v.push(input);
153        self.actions = ::std::option::Option::Some(v);
154        self
155    }
156    /// <p>A list of <code>DataActionSummary</code> objects.</p>
157    pub fn set_actions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::DatasetActionSummary>>) -> Self {
158        self.actions = input;
159        self
160    }
161    /// <p>A list of <code>DataActionSummary</code> objects.</p>
162    pub fn get_actions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DatasetActionSummary>> {
163        &self.actions
164    }
165    /// Consumes the builder and constructs a [`DatasetSummary`](crate::types::DatasetSummary).
166    pub fn build(self) -> crate::types::DatasetSummary {
167        crate::types::DatasetSummary {
168            dataset_name: self.dataset_name,
169            status: self.status,
170            creation_time: self.creation_time,
171            last_update_time: self.last_update_time,
172            triggers: self.triggers,
173            actions: self.actions,
174        }
175    }
176}