aws-sdk-databrew 1.99.0

AWS SDK for AWS Glue DataBrew
Documentation
// 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",
                )
            })?,
        })
    }
}