aws_sdk_iotanalytics/operation/create_dataset/
_create_dataset_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateDatasetInput {
6    /// <p>The name of the dataset.</p>
7    pub dataset_name: ::std::option::Option<::std::string::String>,
8    /// <p>A list of actions that create the dataset contents.</p>
9    pub actions: ::std::option::Option<::std::vec::Vec<crate::types::DatasetAction>>,
10    /// <p>A list of triggers. A trigger causes dataset contents to be populated at a specified time interval or when another dataset's contents are created. The list of triggers can be empty or contain up to five <code>DataSetTrigger</code> objects.</p>
11    pub triggers: ::std::option::Option<::std::vec::Vec<crate::types::DatasetTrigger>>,
12    /// <p>When dataset contents are created, they are delivered to destinations specified here.</p>
13    pub content_delivery_rules: ::std::option::Option<::std::vec::Vec<crate::types::DatasetContentDeliveryRule>>,
14    /// <p>Optional. How long, in days, versions of dataset contents are kept for the dataset. If not specified or set to <code>null</code>, versions of dataset contents are retained for at most 90 days. The number of versions of dataset contents retained is determined by the <code>versioningConfiguration</code> parameter. For more information, see <a href="https://docs.aws.amazon.com/iotanalytics/latest/userguide/getting-started.html#aws-iot-analytics-dataset-versions"> Keeping Multiple Versions of IoT Analytics datasets</a> in the <i>IoT Analytics User Guide</i>.</p>
15    pub retention_period: ::std::option::Option<crate::types::RetentionPeriod>,
16    /// <p>Optional. How many versions of dataset contents are kept. If not specified or set to null, only the latest version plus the latest succeeded version (if they are different) are kept for the time period specified by the <code>retentionPeriod</code> parameter. For more information, see <a href="https://docs.aws.amazon.com/iotanalytics/latest/userguide/getting-started.html#aws-iot-analytics-dataset-versions">Keeping Multiple Versions of IoT Analytics datasets</a> in the <i>IoT Analytics User Guide</i>.</p>
17    pub versioning_configuration: ::std::option::Option<crate::types::VersioningConfiguration>,
18    /// <p>Metadata which can be used to manage the dataset.</p>
19    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
20    /// <p>A list of data rules that send notifications to CloudWatch, when data arrives late. To specify <code>lateDataRules</code>, the dataset must use a <a href="https://docs.aws.amazon.com/iotanalytics/latest/APIReference/API_DeltaTime.html">DeltaTimer</a> filter.</p>
21    pub late_data_rules: ::std::option::Option<::std::vec::Vec<crate::types::LateDataRule>>,
22}
23impl CreateDatasetInput {
24    /// <p>The name of the dataset.</p>
25    pub fn dataset_name(&self) -> ::std::option::Option<&str> {
26        self.dataset_name.as_deref()
27    }
28    /// <p>A list of actions that create the dataset contents.</p>
29    ///
30    /// 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()`.
31    pub fn actions(&self) -> &[crate::types::DatasetAction] {
32        self.actions.as_deref().unwrap_or_default()
33    }
34    /// <p>A list of triggers. A trigger causes dataset contents to be populated at a specified time interval or when another dataset's contents are created. The list of triggers can be empty or contain up to five <code>DataSetTrigger</code> objects.</p>
35    ///
36    /// 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()`.
37    pub fn triggers(&self) -> &[crate::types::DatasetTrigger] {
38        self.triggers.as_deref().unwrap_or_default()
39    }
40    /// <p>When dataset contents are created, they are delivered to destinations specified here.</p>
41    ///
42    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.content_delivery_rules.is_none()`.
43    pub fn content_delivery_rules(&self) -> &[crate::types::DatasetContentDeliveryRule] {
44        self.content_delivery_rules.as_deref().unwrap_or_default()
45    }
46    /// <p>Optional. How long, in days, versions of dataset contents are kept for the dataset. If not specified or set to <code>null</code>, versions of dataset contents are retained for at most 90 days. The number of versions of dataset contents retained is determined by the <code>versioningConfiguration</code> parameter. For more information, see <a href="https://docs.aws.amazon.com/iotanalytics/latest/userguide/getting-started.html#aws-iot-analytics-dataset-versions"> Keeping Multiple Versions of IoT Analytics datasets</a> in the <i>IoT Analytics User Guide</i>.</p>
47    pub fn retention_period(&self) -> ::std::option::Option<&crate::types::RetentionPeriod> {
48        self.retention_period.as_ref()
49    }
50    /// <p>Optional. How many versions of dataset contents are kept. If not specified or set to null, only the latest version plus the latest succeeded version (if they are different) are kept for the time period specified by the <code>retentionPeriod</code> parameter. For more information, see <a href="https://docs.aws.amazon.com/iotanalytics/latest/userguide/getting-started.html#aws-iot-analytics-dataset-versions">Keeping Multiple Versions of IoT Analytics datasets</a> in the <i>IoT Analytics User Guide</i>.</p>
51    pub fn versioning_configuration(&self) -> ::std::option::Option<&crate::types::VersioningConfiguration> {
52        self.versioning_configuration.as_ref()
53    }
54    /// <p>Metadata which can be used to manage the dataset.</p>
55    ///
56    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
57    pub fn tags(&self) -> &[crate::types::Tag] {
58        self.tags.as_deref().unwrap_or_default()
59    }
60    /// <p>A list of data rules that send notifications to CloudWatch, when data arrives late. To specify <code>lateDataRules</code>, the dataset must use a <a href="https://docs.aws.amazon.com/iotanalytics/latest/APIReference/API_DeltaTime.html">DeltaTimer</a> filter.</p>
61    ///
62    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.late_data_rules.is_none()`.
63    pub fn late_data_rules(&self) -> &[crate::types::LateDataRule] {
64        self.late_data_rules.as_deref().unwrap_or_default()
65    }
66}
67impl CreateDatasetInput {
68    /// Creates a new builder-style object to manufacture [`CreateDatasetInput`](crate::operation::create_dataset::CreateDatasetInput).
69    pub fn builder() -> crate::operation::create_dataset::builders::CreateDatasetInputBuilder {
70        crate::operation::create_dataset::builders::CreateDatasetInputBuilder::default()
71    }
72}
73
74/// A builder for [`CreateDatasetInput`](crate::operation::create_dataset::CreateDatasetInput).
75#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
76#[non_exhaustive]
77pub struct CreateDatasetInputBuilder {
78    pub(crate) dataset_name: ::std::option::Option<::std::string::String>,
79    pub(crate) actions: ::std::option::Option<::std::vec::Vec<crate::types::DatasetAction>>,
80    pub(crate) triggers: ::std::option::Option<::std::vec::Vec<crate::types::DatasetTrigger>>,
81    pub(crate) content_delivery_rules: ::std::option::Option<::std::vec::Vec<crate::types::DatasetContentDeliveryRule>>,
82    pub(crate) retention_period: ::std::option::Option<crate::types::RetentionPeriod>,
83    pub(crate) versioning_configuration: ::std::option::Option<crate::types::VersioningConfiguration>,
84    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
85    pub(crate) late_data_rules: ::std::option::Option<::std::vec::Vec<crate::types::LateDataRule>>,
86}
87impl CreateDatasetInputBuilder {
88    /// <p>The name of the dataset.</p>
89    /// This field is required.
90    pub fn dataset_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
91        self.dataset_name = ::std::option::Option::Some(input.into());
92        self
93    }
94    /// <p>The name of the dataset.</p>
95    pub fn set_dataset_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
96        self.dataset_name = input;
97        self
98    }
99    /// <p>The name of the dataset.</p>
100    pub fn get_dataset_name(&self) -> &::std::option::Option<::std::string::String> {
101        &self.dataset_name
102    }
103    /// Appends an item to `actions`.
104    ///
105    /// To override the contents of this collection use [`set_actions`](Self::set_actions).
106    ///
107    /// <p>A list of actions that create the dataset contents.</p>
108    pub fn actions(mut self, input: crate::types::DatasetAction) -> Self {
109        let mut v = self.actions.unwrap_or_default();
110        v.push(input);
111        self.actions = ::std::option::Option::Some(v);
112        self
113    }
114    /// <p>A list of actions that create the dataset contents.</p>
115    pub fn set_actions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::DatasetAction>>) -> Self {
116        self.actions = input;
117        self
118    }
119    /// <p>A list of actions that create the dataset contents.</p>
120    pub fn get_actions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DatasetAction>> {
121        &self.actions
122    }
123    /// Appends an item to `triggers`.
124    ///
125    /// To override the contents of this collection use [`set_triggers`](Self::set_triggers).
126    ///
127    /// <p>A list of triggers. A trigger causes dataset contents to be populated at a specified time interval or when another dataset's contents are created. The list of triggers can be empty or contain up to five <code>DataSetTrigger</code> objects.</p>
128    pub fn triggers(mut self, input: crate::types::DatasetTrigger) -> Self {
129        let mut v = self.triggers.unwrap_or_default();
130        v.push(input);
131        self.triggers = ::std::option::Option::Some(v);
132        self
133    }
134    /// <p>A list of triggers. A trigger causes dataset contents to be populated at a specified time interval or when another dataset's contents are created. The list of triggers can be empty or contain up to five <code>DataSetTrigger</code> objects.</p>
135    pub fn set_triggers(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::DatasetTrigger>>) -> Self {
136        self.triggers = input;
137        self
138    }
139    /// <p>A list of triggers. A trigger causes dataset contents to be populated at a specified time interval or when another dataset's contents are created. The list of triggers can be empty or contain up to five <code>DataSetTrigger</code> objects.</p>
140    pub fn get_triggers(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DatasetTrigger>> {
141        &self.triggers
142    }
143    /// Appends an item to `content_delivery_rules`.
144    ///
145    /// To override the contents of this collection use [`set_content_delivery_rules`](Self::set_content_delivery_rules).
146    ///
147    /// <p>When dataset contents are created, they are delivered to destinations specified here.</p>
148    pub fn content_delivery_rules(mut self, input: crate::types::DatasetContentDeliveryRule) -> Self {
149        let mut v = self.content_delivery_rules.unwrap_or_default();
150        v.push(input);
151        self.content_delivery_rules = ::std::option::Option::Some(v);
152        self
153    }
154    /// <p>When dataset contents are created, they are delivered to destinations specified here.</p>
155    pub fn set_content_delivery_rules(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::DatasetContentDeliveryRule>>) -> Self {
156        self.content_delivery_rules = input;
157        self
158    }
159    /// <p>When dataset contents are created, they are delivered to destinations specified here.</p>
160    pub fn get_content_delivery_rules(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DatasetContentDeliveryRule>> {
161        &self.content_delivery_rules
162    }
163    /// <p>Optional. How long, in days, versions of dataset contents are kept for the dataset. If not specified or set to <code>null</code>, versions of dataset contents are retained for at most 90 days. The number of versions of dataset contents retained is determined by the <code>versioningConfiguration</code> parameter. For more information, see <a href="https://docs.aws.amazon.com/iotanalytics/latest/userguide/getting-started.html#aws-iot-analytics-dataset-versions"> Keeping Multiple Versions of IoT Analytics datasets</a> in the <i>IoT Analytics User Guide</i>.</p>
164    pub fn retention_period(mut self, input: crate::types::RetentionPeriod) -> Self {
165        self.retention_period = ::std::option::Option::Some(input);
166        self
167    }
168    /// <p>Optional. How long, in days, versions of dataset contents are kept for the dataset. If not specified or set to <code>null</code>, versions of dataset contents are retained for at most 90 days. The number of versions of dataset contents retained is determined by the <code>versioningConfiguration</code> parameter. For more information, see <a href="https://docs.aws.amazon.com/iotanalytics/latest/userguide/getting-started.html#aws-iot-analytics-dataset-versions"> Keeping Multiple Versions of IoT Analytics datasets</a> in the <i>IoT Analytics User Guide</i>.</p>
169    pub fn set_retention_period(mut self, input: ::std::option::Option<crate::types::RetentionPeriod>) -> Self {
170        self.retention_period = input;
171        self
172    }
173    /// <p>Optional. How long, in days, versions of dataset contents are kept for the dataset. If not specified or set to <code>null</code>, versions of dataset contents are retained for at most 90 days. The number of versions of dataset contents retained is determined by the <code>versioningConfiguration</code> parameter. For more information, see <a href="https://docs.aws.amazon.com/iotanalytics/latest/userguide/getting-started.html#aws-iot-analytics-dataset-versions"> Keeping Multiple Versions of IoT Analytics datasets</a> in the <i>IoT Analytics User Guide</i>.</p>
174    pub fn get_retention_period(&self) -> &::std::option::Option<crate::types::RetentionPeriod> {
175        &self.retention_period
176    }
177    /// <p>Optional. How many versions of dataset contents are kept. If not specified or set to null, only the latest version plus the latest succeeded version (if they are different) are kept for the time period specified by the <code>retentionPeriod</code> parameter. For more information, see <a href="https://docs.aws.amazon.com/iotanalytics/latest/userguide/getting-started.html#aws-iot-analytics-dataset-versions">Keeping Multiple Versions of IoT Analytics datasets</a> in the <i>IoT Analytics User Guide</i>.</p>
178    pub fn versioning_configuration(mut self, input: crate::types::VersioningConfiguration) -> Self {
179        self.versioning_configuration = ::std::option::Option::Some(input);
180        self
181    }
182    /// <p>Optional. How many versions of dataset contents are kept. If not specified or set to null, only the latest version plus the latest succeeded version (if they are different) are kept for the time period specified by the <code>retentionPeriod</code> parameter. For more information, see <a href="https://docs.aws.amazon.com/iotanalytics/latest/userguide/getting-started.html#aws-iot-analytics-dataset-versions">Keeping Multiple Versions of IoT Analytics datasets</a> in the <i>IoT Analytics User Guide</i>.</p>
183    pub fn set_versioning_configuration(mut self, input: ::std::option::Option<crate::types::VersioningConfiguration>) -> Self {
184        self.versioning_configuration = input;
185        self
186    }
187    /// <p>Optional. How many versions of dataset contents are kept. If not specified or set to null, only the latest version plus the latest succeeded version (if they are different) are kept for the time period specified by the <code>retentionPeriod</code> parameter. For more information, see <a href="https://docs.aws.amazon.com/iotanalytics/latest/userguide/getting-started.html#aws-iot-analytics-dataset-versions">Keeping Multiple Versions of IoT Analytics datasets</a> in the <i>IoT Analytics User Guide</i>.</p>
188    pub fn get_versioning_configuration(&self) -> &::std::option::Option<crate::types::VersioningConfiguration> {
189        &self.versioning_configuration
190    }
191    /// Appends an item to `tags`.
192    ///
193    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
194    ///
195    /// <p>Metadata which can be used to manage the dataset.</p>
196    pub fn tags(mut self, input: crate::types::Tag) -> Self {
197        let mut v = self.tags.unwrap_or_default();
198        v.push(input);
199        self.tags = ::std::option::Option::Some(v);
200        self
201    }
202    /// <p>Metadata which can be used to manage the dataset.</p>
203    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
204        self.tags = input;
205        self
206    }
207    /// <p>Metadata which can be used to manage the dataset.</p>
208    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
209        &self.tags
210    }
211    /// Appends an item to `late_data_rules`.
212    ///
213    /// To override the contents of this collection use [`set_late_data_rules`](Self::set_late_data_rules).
214    ///
215    /// <p>A list of data rules that send notifications to CloudWatch, when data arrives late. To specify <code>lateDataRules</code>, the dataset must use a <a href="https://docs.aws.amazon.com/iotanalytics/latest/APIReference/API_DeltaTime.html">DeltaTimer</a> filter.</p>
216    pub fn late_data_rules(mut self, input: crate::types::LateDataRule) -> Self {
217        let mut v = self.late_data_rules.unwrap_or_default();
218        v.push(input);
219        self.late_data_rules = ::std::option::Option::Some(v);
220        self
221    }
222    /// <p>A list of data rules that send notifications to CloudWatch, when data arrives late. To specify <code>lateDataRules</code>, the dataset must use a <a href="https://docs.aws.amazon.com/iotanalytics/latest/APIReference/API_DeltaTime.html">DeltaTimer</a> filter.</p>
223    pub fn set_late_data_rules(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::LateDataRule>>) -> Self {
224        self.late_data_rules = input;
225        self
226    }
227    /// <p>A list of data rules that send notifications to CloudWatch, when data arrives late. To specify <code>lateDataRules</code>, the dataset must use a <a href="https://docs.aws.amazon.com/iotanalytics/latest/APIReference/API_DeltaTime.html">DeltaTimer</a> filter.</p>
228    pub fn get_late_data_rules(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::LateDataRule>> {
229        &self.late_data_rules
230    }
231    /// Consumes the builder and constructs a [`CreateDatasetInput`](crate::operation::create_dataset::CreateDatasetInput).
232    pub fn build(
233        self,
234    ) -> ::std::result::Result<crate::operation::create_dataset::CreateDatasetInput, ::aws_smithy_types::error::operation::BuildError> {
235        ::std::result::Result::Ok(crate::operation::create_dataset::CreateDatasetInput {
236            dataset_name: self.dataset_name,
237            actions: self.actions,
238            triggers: self.triggers,
239            content_delivery_rules: self.content_delivery_rules,
240            retention_period: self.retention_period,
241            versioning_configuration: self.versioning_configuration,
242            tags: self.tags,
243            late_data_rules: self.late_data_rules,
244        })
245    }
246}