Skip to main content

aws_sdk_glue/types/
_fill_missing_values.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Specifies a transform that locates records in the dataset that have missing values and adds a new field with a value determined by imputation. The input data set is used to train the machine learning model that determines what the missing value should be.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct FillMissingValues {
7    /// <p>The name of the transform node.</p>
8    pub name: ::std::string::String,
9    /// <p>The data inputs identified by their node names.</p>
10    pub inputs: ::std::vec::Vec<::std::string::String>,
11    /// <p>A JSON path to a variable in the data structure for the dataset that is imputed.</p>
12    pub imputed_path: ::std::string::String,
13    /// <p>A JSON path to a variable in the data structure for the dataset that is filled.</p>
14    pub filled_path: ::std::option::Option<::std::string::String>,
15}
16impl FillMissingValues {
17    /// <p>The name of the transform node.</p>
18    pub fn name(&self) -> &str {
19        use std::ops::Deref;
20        self.name.deref()
21    }
22    /// <p>The data inputs identified by their node names.</p>
23    pub fn inputs(&self) -> &[::std::string::String] {
24        use std::ops::Deref;
25        self.inputs.deref()
26    }
27    /// <p>A JSON path to a variable in the data structure for the dataset that is imputed.</p>
28    pub fn imputed_path(&self) -> &str {
29        use std::ops::Deref;
30        self.imputed_path.deref()
31    }
32    /// <p>A JSON path to a variable in the data structure for the dataset that is filled.</p>
33    pub fn filled_path(&self) -> ::std::option::Option<&str> {
34        self.filled_path.as_deref()
35    }
36}
37impl FillMissingValues {
38    /// Creates a new builder-style object to manufacture [`FillMissingValues`](crate::types::FillMissingValues).
39    pub fn builder() -> crate::types::builders::FillMissingValuesBuilder {
40        crate::types::builders::FillMissingValuesBuilder::default()
41    }
42}
43
44/// A builder for [`FillMissingValues`](crate::types::FillMissingValues).
45#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
46#[non_exhaustive]
47pub struct FillMissingValuesBuilder {
48    pub(crate) name: ::std::option::Option<::std::string::String>,
49    pub(crate) inputs: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
50    pub(crate) imputed_path: ::std::option::Option<::std::string::String>,
51    pub(crate) filled_path: ::std::option::Option<::std::string::String>,
52}
53impl FillMissingValuesBuilder {
54    /// <p>The name of the transform node.</p>
55    /// This field is required.
56    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
57        self.name = ::std::option::Option::Some(input.into());
58        self
59    }
60    /// <p>The name of the transform node.</p>
61    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
62        self.name = input;
63        self
64    }
65    /// <p>The name of the transform node.</p>
66    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
67        &self.name
68    }
69    /// Appends an item to `inputs`.
70    ///
71    /// To override the contents of this collection use [`set_inputs`](Self::set_inputs).
72    ///
73    /// <p>The data inputs identified by their node names.</p>
74    pub fn inputs(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
75        let mut v = self.inputs.unwrap_or_default();
76        v.push(input.into());
77        self.inputs = ::std::option::Option::Some(v);
78        self
79    }
80    /// <p>The data inputs identified by their node names.</p>
81    pub fn set_inputs(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
82        self.inputs = input;
83        self
84    }
85    /// <p>The data inputs identified by their node names.</p>
86    pub fn get_inputs(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
87        &self.inputs
88    }
89    /// <p>A JSON path to a variable in the data structure for the dataset that is imputed.</p>
90    /// This field is required.
91    pub fn imputed_path(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
92        self.imputed_path = ::std::option::Option::Some(input.into());
93        self
94    }
95    /// <p>A JSON path to a variable in the data structure for the dataset that is imputed.</p>
96    pub fn set_imputed_path(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
97        self.imputed_path = input;
98        self
99    }
100    /// <p>A JSON path to a variable in the data structure for the dataset that is imputed.</p>
101    pub fn get_imputed_path(&self) -> &::std::option::Option<::std::string::String> {
102        &self.imputed_path
103    }
104    /// <p>A JSON path to a variable in the data structure for the dataset that is filled.</p>
105    pub fn filled_path(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
106        self.filled_path = ::std::option::Option::Some(input.into());
107        self
108    }
109    /// <p>A JSON path to a variable in the data structure for the dataset that is filled.</p>
110    pub fn set_filled_path(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
111        self.filled_path = input;
112        self
113    }
114    /// <p>A JSON path to a variable in the data structure for the dataset that is filled.</p>
115    pub fn get_filled_path(&self) -> &::std::option::Option<::std::string::String> {
116        &self.filled_path
117    }
118    /// Consumes the builder and constructs a [`FillMissingValues`](crate::types::FillMissingValues).
119    /// This method will fail if any of the following fields are not set:
120    /// - [`name`](crate::types::builders::FillMissingValuesBuilder::name)
121    /// - [`inputs`](crate::types::builders::FillMissingValuesBuilder::inputs)
122    /// - [`imputed_path`](crate::types::builders::FillMissingValuesBuilder::imputed_path)
123    pub fn build(self) -> ::std::result::Result<crate::types::FillMissingValues, ::aws_smithy_types::error::operation::BuildError> {
124        ::std::result::Result::Ok(crate::types::FillMissingValues {
125            name: self.name.ok_or_else(|| {
126                ::aws_smithy_types::error::operation::BuildError::missing_field(
127                    "name",
128                    "name was not specified but it is required when building FillMissingValues",
129                )
130            })?,
131            inputs: self.inputs.ok_or_else(|| {
132                ::aws_smithy_types::error::operation::BuildError::missing_field(
133                    "inputs",
134                    "inputs was not specified but it is required when building FillMissingValues",
135                )
136            })?,
137            imputed_path: self.imputed_path.ok_or_else(|| {
138                ::aws_smithy_types::error::operation::BuildError::missing_field(
139                    "imputed_path",
140                    "imputed_path was not specified but it is required when building FillMissingValues",
141                )
142            })?,
143            filled_path: self.filled_path,
144        })
145    }
146}