aws_sdk_iotanalytics/operation/update_dataset/
_update_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 UpdateDatasetInput {
6    /// <p>The name of the dataset to update.</p>
7    pub dataset_name: ::std::option::Option<::std::string::String>,
8    /// <p>A list of <code>DatasetAction</code> objects.</p>
9    pub actions: ::std::option::Option<::std::vec::Vec<crate::types::DatasetAction>>,
10    /// <p>A list of <code>DatasetTrigger</code> objects. The list can be empty or can 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>How long, in days, dataset contents are kept for the dataset.</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>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>
19    pub late_data_rules: ::std::option::Option<::std::vec::Vec<crate::types::LateDataRule>>,
20}
21impl UpdateDatasetInput {
22    /// <p>The name of the dataset to update.</p>
23    pub fn dataset_name(&self) -> ::std::option::Option<&str> {
24        self.dataset_name.as_deref()
25    }
26    /// <p>A list of <code>DatasetAction</code> objects.</p>
27    ///
28    /// 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()`.
29    pub fn actions(&self) -> &[crate::types::DatasetAction] {
30        self.actions.as_deref().unwrap_or_default()
31    }
32    /// <p>A list of <code>DatasetTrigger</code> objects. The list can be empty or can contain up to five <code>DatasetTrigger</code> objects.</p>
33    ///
34    /// 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()`.
35    pub fn triggers(&self) -> &[crate::types::DatasetTrigger] {
36        self.triggers.as_deref().unwrap_or_default()
37    }
38    /// <p>When dataset contents are created, they are delivered to destinations specified here.</p>
39    ///
40    /// 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()`.
41    pub fn content_delivery_rules(&self) -> &[crate::types::DatasetContentDeliveryRule] {
42        self.content_delivery_rules.as_deref().unwrap_or_default()
43    }
44    /// <p>How long, in days, dataset contents are kept for the dataset.</p>
45    pub fn retention_period(&self) -> ::std::option::Option<&crate::types::RetentionPeriod> {
46        self.retention_period.as_ref()
47    }
48    /// <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>
49    pub fn versioning_configuration(&self) -> ::std::option::Option<&crate::types::VersioningConfiguration> {
50        self.versioning_configuration.as_ref()
51    }
52    /// <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>
53    ///
54    /// 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()`.
55    pub fn late_data_rules(&self) -> &[crate::types::LateDataRule] {
56        self.late_data_rules.as_deref().unwrap_or_default()
57    }
58}
59impl UpdateDatasetInput {
60    /// Creates a new builder-style object to manufacture [`UpdateDatasetInput`](crate::operation::update_dataset::UpdateDatasetInput).
61    pub fn builder() -> crate::operation::update_dataset::builders::UpdateDatasetInputBuilder {
62        crate::operation::update_dataset::builders::UpdateDatasetInputBuilder::default()
63    }
64}
65
66/// A builder for [`UpdateDatasetInput`](crate::operation::update_dataset::UpdateDatasetInput).
67#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
68#[non_exhaustive]
69pub struct UpdateDatasetInputBuilder {
70    pub(crate) dataset_name: ::std::option::Option<::std::string::String>,
71    pub(crate) actions: ::std::option::Option<::std::vec::Vec<crate::types::DatasetAction>>,
72    pub(crate) triggers: ::std::option::Option<::std::vec::Vec<crate::types::DatasetTrigger>>,
73    pub(crate) content_delivery_rules: ::std::option::Option<::std::vec::Vec<crate::types::DatasetContentDeliveryRule>>,
74    pub(crate) retention_period: ::std::option::Option<crate::types::RetentionPeriod>,
75    pub(crate) versioning_configuration: ::std::option::Option<crate::types::VersioningConfiguration>,
76    pub(crate) late_data_rules: ::std::option::Option<::std::vec::Vec<crate::types::LateDataRule>>,
77}
78impl UpdateDatasetInputBuilder {
79    /// <p>The name of the dataset to update.</p>
80    /// This field is required.
81    pub fn dataset_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
82        self.dataset_name = ::std::option::Option::Some(input.into());
83        self
84    }
85    /// <p>The name of the dataset to update.</p>
86    pub fn set_dataset_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
87        self.dataset_name = input;
88        self
89    }
90    /// <p>The name of the dataset to update.</p>
91    pub fn get_dataset_name(&self) -> &::std::option::Option<::std::string::String> {
92        &self.dataset_name
93    }
94    /// Appends an item to `actions`.
95    ///
96    /// To override the contents of this collection use [`set_actions`](Self::set_actions).
97    ///
98    /// <p>A list of <code>DatasetAction</code> objects.</p>
99    pub fn actions(mut self, input: crate::types::DatasetAction) -> Self {
100        let mut v = self.actions.unwrap_or_default();
101        v.push(input);
102        self.actions = ::std::option::Option::Some(v);
103        self
104    }
105    /// <p>A list of <code>DatasetAction</code> objects.</p>
106    pub fn set_actions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::DatasetAction>>) -> Self {
107        self.actions = input;
108        self
109    }
110    /// <p>A list of <code>DatasetAction</code> objects.</p>
111    pub fn get_actions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DatasetAction>> {
112        &self.actions
113    }
114    /// Appends an item to `triggers`.
115    ///
116    /// To override the contents of this collection use [`set_triggers`](Self::set_triggers).
117    ///
118    /// <p>A list of <code>DatasetTrigger</code> objects. The list can be empty or can contain up to five <code>DatasetTrigger</code> objects.</p>
119    pub fn triggers(mut self, input: crate::types::DatasetTrigger) -> Self {
120        let mut v = self.triggers.unwrap_or_default();
121        v.push(input);
122        self.triggers = ::std::option::Option::Some(v);
123        self
124    }
125    /// <p>A list of <code>DatasetTrigger</code> objects. The list can be empty or can contain up to five <code>DatasetTrigger</code> objects.</p>
126    pub fn set_triggers(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::DatasetTrigger>>) -> Self {
127        self.triggers = input;
128        self
129    }
130    /// <p>A list of <code>DatasetTrigger</code> objects. The list can be empty or can contain up to five <code>DatasetTrigger</code> objects.</p>
131    pub fn get_triggers(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DatasetTrigger>> {
132        &self.triggers
133    }
134    /// Appends an item to `content_delivery_rules`.
135    ///
136    /// To override the contents of this collection use [`set_content_delivery_rules`](Self::set_content_delivery_rules).
137    ///
138    /// <p>When dataset contents are created, they are delivered to destinations specified here.</p>
139    pub fn content_delivery_rules(mut self, input: crate::types::DatasetContentDeliveryRule) -> Self {
140        let mut v = self.content_delivery_rules.unwrap_or_default();
141        v.push(input);
142        self.content_delivery_rules = ::std::option::Option::Some(v);
143        self
144    }
145    /// <p>When dataset contents are created, they are delivered to destinations specified here.</p>
146    pub fn set_content_delivery_rules(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::DatasetContentDeliveryRule>>) -> Self {
147        self.content_delivery_rules = input;
148        self
149    }
150    /// <p>When dataset contents are created, they are delivered to destinations specified here.</p>
151    pub fn get_content_delivery_rules(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DatasetContentDeliveryRule>> {
152        &self.content_delivery_rules
153    }
154    /// <p>How long, in days, dataset contents are kept for the dataset.</p>
155    pub fn retention_period(mut self, input: crate::types::RetentionPeriod) -> Self {
156        self.retention_period = ::std::option::Option::Some(input);
157        self
158    }
159    /// <p>How long, in days, dataset contents are kept for the dataset.</p>
160    pub fn set_retention_period(mut self, input: ::std::option::Option<crate::types::RetentionPeriod>) -> Self {
161        self.retention_period = input;
162        self
163    }
164    /// <p>How long, in days, dataset contents are kept for the dataset.</p>
165    pub fn get_retention_period(&self) -> &::std::option::Option<crate::types::RetentionPeriod> {
166        &self.retention_period
167    }
168    /// <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>
169    pub fn versioning_configuration(mut self, input: crate::types::VersioningConfiguration) -> Self {
170        self.versioning_configuration = ::std::option::Option::Some(input);
171        self
172    }
173    /// <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>
174    pub fn set_versioning_configuration(mut self, input: ::std::option::Option<crate::types::VersioningConfiguration>) -> Self {
175        self.versioning_configuration = input;
176        self
177    }
178    /// <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>
179    pub fn get_versioning_configuration(&self) -> &::std::option::Option<crate::types::VersioningConfiguration> {
180        &self.versioning_configuration
181    }
182    /// Appends an item to `late_data_rules`.
183    ///
184    /// To override the contents of this collection use [`set_late_data_rules`](Self::set_late_data_rules).
185    ///
186    /// <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>
187    pub fn late_data_rules(mut self, input: crate::types::LateDataRule) -> Self {
188        let mut v = self.late_data_rules.unwrap_or_default();
189        v.push(input);
190        self.late_data_rules = ::std::option::Option::Some(v);
191        self
192    }
193    /// <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>
194    pub fn set_late_data_rules(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::LateDataRule>>) -> Self {
195        self.late_data_rules = input;
196        self
197    }
198    /// <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>
199    pub fn get_late_data_rules(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::LateDataRule>> {
200        &self.late_data_rules
201    }
202    /// Consumes the builder and constructs a [`UpdateDatasetInput`](crate::operation::update_dataset::UpdateDatasetInput).
203    pub fn build(
204        self,
205    ) -> ::std::result::Result<crate::operation::update_dataset::UpdateDatasetInput, ::aws_smithy_types::error::operation::BuildError> {
206        ::std::result::Result::Ok(crate::operation::update_dataset::UpdateDatasetInput {
207            dataset_name: self.dataset_name,
208            actions: self.actions,
209            triggers: self.triggers,
210            content_delivery_rules: self.content_delivery_rules,
211            retention_period: self.retention_period,
212            versioning_configuration: self.versioning_configuration,
213            late_data_rules: self.late_data_rules,
214        })
215    }
216}