1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Represents the sample size and sampling type for DataBrew to use for interactive data analysis.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Sample {
/// <p>The number of rows in the sample.</p>
pub size: ::std::option::Option<i32>,
/// <p>The way in which DataBrew obtains rows from a dataset.</p>
pub r#type: crate::types::SampleType,
}
impl Sample {
/// <p>The number of rows in the sample.</p>
pub fn size(&self) -> ::std::option::Option<i32> {
self.size
}
/// <p>The way in which DataBrew obtains rows from a dataset.</p>
pub fn r#type(&self) -> &crate::types::SampleType {
&self.r#type
}
}
impl Sample {
/// Creates a new builder-style object to manufacture [`Sample`](crate::types::Sample).
pub fn builder() -> crate::types::builders::SampleBuilder {
crate::types::builders::SampleBuilder::default()
}
}
/// A builder for [`Sample`](crate::types::Sample).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct SampleBuilder {
pub(crate) size: ::std::option::Option<i32>,
pub(crate) r#type: ::std::option::Option<crate::types::SampleType>,
}
impl SampleBuilder {
/// <p>The number of rows in the sample.</p>
pub fn size(mut self, input: i32) -> Self {
self.size = ::std::option::Option::Some(input);
self
}
/// <p>The number of rows in the sample.</p>
pub fn set_size(mut self, input: ::std::option::Option<i32>) -> Self {
self.size = input;
self
}
/// <p>The number of rows in the sample.</p>
pub fn get_size(&self) -> &::std::option::Option<i32> {
&self.size
}
/// <p>The way in which DataBrew obtains rows from a dataset.</p>
/// This field is required.
pub fn r#type(mut self, input: crate::types::SampleType) -> Self {
self.r#type = ::std::option::Option::Some(input);
self
}
/// <p>The way in which DataBrew obtains rows from a dataset.</p>
pub fn set_type(mut self, input: ::std::option::Option<crate::types::SampleType>) -> Self {
self.r#type = input;
self
}
/// <p>The way in which DataBrew obtains rows from a dataset.</p>
pub fn get_type(&self) -> &::std::option::Option<crate::types::SampleType> {
&self.r#type
}
/// Consumes the builder and constructs a [`Sample`](crate::types::Sample).
/// This method will fail if any of the following fields are not set:
/// - [`r#type`](crate::types::builders::SampleBuilder::type)
pub fn build(self) -> ::std::result::Result<crate::types::Sample, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Sample {
size: self.size,
r#type: self.r#type.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"r#type",
"r#type was not specified but it is required when building Sample",
)
})?,
})
}
}