aws_sdk_forecast/types/
_statistics.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Provides statistics for each data field imported into to an Amazon Forecast dataset with the <a href="https://docs.aws.amazon.com/forecast/latest/dg/API_CreateDatasetImportJob.html">CreateDatasetImportJob</a> operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct Statistics {
7    /// <p>The number of values in the field. If the response value is -1, refer to <code>CountLong</code>.</p>
8    pub count: ::std::option::Option<i32>,
9    /// <p>The number of distinct values in the field. If the response value is -1, refer to <code>CountDistinctLong</code>.</p>
10    pub count_distinct: ::std::option::Option<i32>,
11    /// <p>The number of null values in the field. If the response value is -1, refer to <code>CountNullLong</code>.</p>
12    pub count_null: ::std::option::Option<i32>,
13    /// <p>The number of NAN (not a number) values in the field. If the response value is -1, refer to <code>CountNanLong</code>.</p>
14    pub count_nan: ::std::option::Option<i32>,
15    /// <p>For a numeric field, the minimum value in the field.</p>
16    pub min: ::std::option::Option<::std::string::String>,
17    /// <p>For a numeric field, the maximum value in the field.</p>
18    pub max: ::std::option::Option<::std::string::String>,
19    /// <p>For a numeric field, the average value in the field.</p>
20    pub avg: ::std::option::Option<f64>,
21    /// <p>For a numeric field, the standard deviation.</p>
22    pub stddev: ::std::option::Option<f64>,
23    /// <p>The number of values in the field. <code>CountLong</code> is used instead of <code>Count</code> if the value is greater than 2,147,483,647.</p>
24    pub count_long: ::std::option::Option<i64>,
25    /// <p>The number of distinct values in the field. <code>CountDistinctLong</code> is used instead of <code>CountDistinct</code> if the value is greater than 2,147,483,647.</p>
26    pub count_distinct_long: ::std::option::Option<i64>,
27    /// <p>The number of null values in the field. <code>CountNullLong</code> is used instead of <code>CountNull</code> if the value is greater than 2,147,483,647.</p>
28    pub count_null_long: ::std::option::Option<i64>,
29    /// <p>The number of NAN (not a number) values in the field. <code>CountNanLong</code> is used instead of <code>CountNan</code> if the value is greater than 2,147,483,647.</p>
30    pub count_nan_long: ::std::option::Option<i64>,
31}
32impl Statistics {
33    /// <p>The number of values in the field. If the response value is -1, refer to <code>CountLong</code>.</p>
34    pub fn count(&self) -> ::std::option::Option<i32> {
35        self.count
36    }
37    /// <p>The number of distinct values in the field. If the response value is -1, refer to <code>CountDistinctLong</code>.</p>
38    pub fn count_distinct(&self) -> ::std::option::Option<i32> {
39        self.count_distinct
40    }
41    /// <p>The number of null values in the field. If the response value is -1, refer to <code>CountNullLong</code>.</p>
42    pub fn count_null(&self) -> ::std::option::Option<i32> {
43        self.count_null
44    }
45    /// <p>The number of NAN (not a number) values in the field. If the response value is -1, refer to <code>CountNanLong</code>.</p>
46    pub fn count_nan(&self) -> ::std::option::Option<i32> {
47        self.count_nan
48    }
49    /// <p>For a numeric field, the minimum value in the field.</p>
50    pub fn min(&self) -> ::std::option::Option<&str> {
51        self.min.as_deref()
52    }
53    /// <p>For a numeric field, the maximum value in the field.</p>
54    pub fn max(&self) -> ::std::option::Option<&str> {
55        self.max.as_deref()
56    }
57    /// <p>For a numeric field, the average value in the field.</p>
58    pub fn avg(&self) -> ::std::option::Option<f64> {
59        self.avg
60    }
61    /// <p>For a numeric field, the standard deviation.</p>
62    pub fn stddev(&self) -> ::std::option::Option<f64> {
63        self.stddev
64    }
65    /// <p>The number of values in the field. <code>CountLong</code> is used instead of <code>Count</code> if the value is greater than 2,147,483,647.</p>
66    pub fn count_long(&self) -> ::std::option::Option<i64> {
67        self.count_long
68    }
69    /// <p>The number of distinct values in the field. <code>CountDistinctLong</code> is used instead of <code>CountDistinct</code> if the value is greater than 2,147,483,647.</p>
70    pub fn count_distinct_long(&self) -> ::std::option::Option<i64> {
71        self.count_distinct_long
72    }
73    /// <p>The number of null values in the field. <code>CountNullLong</code> is used instead of <code>CountNull</code> if the value is greater than 2,147,483,647.</p>
74    pub fn count_null_long(&self) -> ::std::option::Option<i64> {
75        self.count_null_long
76    }
77    /// <p>The number of NAN (not a number) values in the field. <code>CountNanLong</code> is used instead of <code>CountNan</code> if the value is greater than 2,147,483,647.</p>
78    pub fn count_nan_long(&self) -> ::std::option::Option<i64> {
79        self.count_nan_long
80    }
81}
82impl Statistics {
83    /// Creates a new builder-style object to manufacture [`Statistics`](crate::types::Statistics).
84    pub fn builder() -> crate::types::builders::StatisticsBuilder {
85        crate::types::builders::StatisticsBuilder::default()
86    }
87}
88
89/// A builder for [`Statistics`](crate::types::Statistics).
90#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
91#[non_exhaustive]
92pub struct StatisticsBuilder {
93    pub(crate) count: ::std::option::Option<i32>,
94    pub(crate) count_distinct: ::std::option::Option<i32>,
95    pub(crate) count_null: ::std::option::Option<i32>,
96    pub(crate) count_nan: ::std::option::Option<i32>,
97    pub(crate) min: ::std::option::Option<::std::string::String>,
98    pub(crate) max: ::std::option::Option<::std::string::String>,
99    pub(crate) avg: ::std::option::Option<f64>,
100    pub(crate) stddev: ::std::option::Option<f64>,
101    pub(crate) count_long: ::std::option::Option<i64>,
102    pub(crate) count_distinct_long: ::std::option::Option<i64>,
103    pub(crate) count_null_long: ::std::option::Option<i64>,
104    pub(crate) count_nan_long: ::std::option::Option<i64>,
105}
106impl StatisticsBuilder {
107    /// <p>The number of values in the field. If the response value is -1, refer to <code>CountLong</code>.</p>
108    pub fn count(mut self, input: i32) -> Self {
109        self.count = ::std::option::Option::Some(input);
110        self
111    }
112    /// <p>The number of values in the field. If the response value is -1, refer to <code>CountLong</code>.</p>
113    pub fn set_count(mut self, input: ::std::option::Option<i32>) -> Self {
114        self.count = input;
115        self
116    }
117    /// <p>The number of values in the field. If the response value is -1, refer to <code>CountLong</code>.</p>
118    pub fn get_count(&self) -> &::std::option::Option<i32> {
119        &self.count
120    }
121    /// <p>The number of distinct values in the field. If the response value is -1, refer to <code>CountDistinctLong</code>.</p>
122    pub fn count_distinct(mut self, input: i32) -> Self {
123        self.count_distinct = ::std::option::Option::Some(input);
124        self
125    }
126    /// <p>The number of distinct values in the field. If the response value is -1, refer to <code>CountDistinctLong</code>.</p>
127    pub fn set_count_distinct(mut self, input: ::std::option::Option<i32>) -> Self {
128        self.count_distinct = input;
129        self
130    }
131    /// <p>The number of distinct values in the field. If the response value is -1, refer to <code>CountDistinctLong</code>.</p>
132    pub fn get_count_distinct(&self) -> &::std::option::Option<i32> {
133        &self.count_distinct
134    }
135    /// <p>The number of null values in the field. If the response value is -1, refer to <code>CountNullLong</code>.</p>
136    pub fn count_null(mut self, input: i32) -> Self {
137        self.count_null = ::std::option::Option::Some(input);
138        self
139    }
140    /// <p>The number of null values in the field. If the response value is -1, refer to <code>CountNullLong</code>.</p>
141    pub fn set_count_null(mut self, input: ::std::option::Option<i32>) -> Self {
142        self.count_null = input;
143        self
144    }
145    /// <p>The number of null values in the field. If the response value is -1, refer to <code>CountNullLong</code>.</p>
146    pub fn get_count_null(&self) -> &::std::option::Option<i32> {
147        &self.count_null
148    }
149    /// <p>The number of NAN (not a number) values in the field. If the response value is -1, refer to <code>CountNanLong</code>.</p>
150    pub fn count_nan(mut self, input: i32) -> Self {
151        self.count_nan = ::std::option::Option::Some(input);
152        self
153    }
154    /// <p>The number of NAN (not a number) values in the field. If the response value is -1, refer to <code>CountNanLong</code>.</p>
155    pub fn set_count_nan(mut self, input: ::std::option::Option<i32>) -> Self {
156        self.count_nan = input;
157        self
158    }
159    /// <p>The number of NAN (not a number) values in the field. If the response value is -1, refer to <code>CountNanLong</code>.</p>
160    pub fn get_count_nan(&self) -> &::std::option::Option<i32> {
161        &self.count_nan
162    }
163    /// <p>For a numeric field, the minimum value in the field.</p>
164    pub fn min(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
165        self.min = ::std::option::Option::Some(input.into());
166        self
167    }
168    /// <p>For a numeric field, the minimum value in the field.</p>
169    pub fn set_min(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
170        self.min = input;
171        self
172    }
173    /// <p>For a numeric field, the minimum value in the field.</p>
174    pub fn get_min(&self) -> &::std::option::Option<::std::string::String> {
175        &self.min
176    }
177    /// <p>For a numeric field, the maximum value in the field.</p>
178    pub fn max(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
179        self.max = ::std::option::Option::Some(input.into());
180        self
181    }
182    /// <p>For a numeric field, the maximum value in the field.</p>
183    pub fn set_max(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
184        self.max = input;
185        self
186    }
187    /// <p>For a numeric field, the maximum value in the field.</p>
188    pub fn get_max(&self) -> &::std::option::Option<::std::string::String> {
189        &self.max
190    }
191    /// <p>For a numeric field, the average value in the field.</p>
192    pub fn avg(mut self, input: f64) -> Self {
193        self.avg = ::std::option::Option::Some(input);
194        self
195    }
196    /// <p>For a numeric field, the average value in the field.</p>
197    pub fn set_avg(mut self, input: ::std::option::Option<f64>) -> Self {
198        self.avg = input;
199        self
200    }
201    /// <p>For a numeric field, the average value in the field.</p>
202    pub fn get_avg(&self) -> &::std::option::Option<f64> {
203        &self.avg
204    }
205    /// <p>For a numeric field, the standard deviation.</p>
206    pub fn stddev(mut self, input: f64) -> Self {
207        self.stddev = ::std::option::Option::Some(input);
208        self
209    }
210    /// <p>For a numeric field, the standard deviation.</p>
211    pub fn set_stddev(mut self, input: ::std::option::Option<f64>) -> Self {
212        self.stddev = input;
213        self
214    }
215    /// <p>For a numeric field, the standard deviation.</p>
216    pub fn get_stddev(&self) -> &::std::option::Option<f64> {
217        &self.stddev
218    }
219    /// <p>The number of values in the field. <code>CountLong</code> is used instead of <code>Count</code> if the value is greater than 2,147,483,647.</p>
220    pub fn count_long(mut self, input: i64) -> Self {
221        self.count_long = ::std::option::Option::Some(input);
222        self
223    }
224    /// <p>The number of values in the field. <code>CountLong</code> is used instead of <code>Count</code> if the value is greater than 2,147,483,647.</p>
225    pub fn set_count_long(mut self, input: ::std::option::Option<i64>) -> Self {
226        self.count_long = input;
227        self
228    }
229    /// <p>The number of values in the field. <code>CountLong</code> is used instead of <code>Count</code> if the value is greater than 2,147,483,647.</p>
230    pub fn get_count_long(&self) -> &::std::option::Option<i64> {
231        &self.count_long
232    }
233    /// <p>The number of distinct values in the field. <code>CountDistinctLong</code> is used instead of <code>CountDistinct</code> if the value is greater than 2,147,483,647.</p>
234    pub fn count_distinct_long(mut self, input: i64) -> Self {
235        self.count_distinct_long = ::std::option::Option::Some(input);
236        self
237    }
238    /// <p>The number of distinct values in the field. <code>CountDistinctLong</code> is used instead of <code>CountDistinct</code> if the value is greater than 2,147,483,647.</p>
239    pub fn set_count_distinct_long(mut self, input: ::std::option::Option<i64>) -> Self {
240        self.count_distinct_long = input;
241        self
242    }
243    /// <p>The number of distinct values in the field. <code>CountDistinctLong</code> is used instead of <code>CountDistinct</code> if the value is greater than 2,147,483,647.</p>
244    pub fn get_count_distinct_long(&self) -> &::std::option::Option<i64> {
245        &self.count_distinct_long
246    }
247    /// <p>The number of null values in the field. <code>CountNullLong</code> is used instead of <code>CountNull</code> if the value is greater than 2,147,483,647.</p>
248    pub fn count_null_long(mut self, input: i64) -> Self {
249        self.count_null_long = ::std::option::Option::Some(input);
250        self
251    }
252    /// <p>The number of null values in the field. <code>CountNullLong</code> is used instead of <code>CountNull</code> if the value is greater than 2,147,483,647.</p>
253    pub fn set_count_null_long(mut self, input: ::std::option::Option<i64>) -> Self {
254        self.count_null_long = input;
255        self
256    }
257    /// <p>The number of null values in the field. <code>CountNullLong</code> is used instead of <code>CountNull</code> if the value is greater than 2,147,483,647.</p>
258    pub fn get_count_null_long(&self) -> &::std::option::Option<i64> {
259        &self.count_null_long
260    }
261    /// <p>The number of NAN (not a number) values in the field. <code>CountNanLong</code> is used instead of <code>CountNan</code> if the value is greater than 2,147,483,647.</p>
262    pub fn count_nan_long(mut self, input: i64) -> Self {
263        self.count_nan_long = ::std::option::Option::Some(input);
264        self
265    }
266    /// <p>The number of NAN (not a number) values in the field. <code>CountNanLong</code> is used instead of <code>CountNan</code> if the value is greater than 2,147,483,647.</p>
267    pub fn set_count_nan_long(mut self, input: ::std::option::Option<i64>) -> Self {
268        self.count_nan_long = input;
269        self
270    }
271    /// <p>The number of NAN (not a number) values in the field. <code>CountNanLong</code> is used instead of <code>CountNan</code> if the value is greater than 2,147,483,647.</p>
272    pub fn get_count_nan_long(&self) -> &::std::option::Option<i64> {
273        &self.count_nan_long
274    }
275    /// Consumes the builder and constructs a [`Statistics`](crate::types::Statistics).
276    pub fn build(self) -> crate::types::Statistics {
277        crate::types::Statistics {
278            count: self.count,
279            count_distinct: self.count_distinct,
280            count_null: self.count_null,
281            count_nan: self.count_nan,
282            min: self.min,
283            max: self.max,
284            avg: self.avg,
285            stddev: self.stddev,
286            count_long: self.count_long,
287            count_distinct_long: self.count_distinct_long,
288            count_null_long: self.count_null_long,
289            count_nan_long: self.count_nan_long,
290        }
291    }
292}