aws_sdk_machinelearning/operation/predict/
_predict_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct PredictInput {
6 pub ml_model_id: ::std::option::Option<::std::string::String>,
8 pub record: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
10 #[allow(missing_docs)] pub predict_endpoint: ::std::option::Option<::std::string::String>,
12}
13impl PredictInput {
14 pub fn ml_model_id(&self) -> ::std::option::Option<&str> {
16 self.ml_model_id.as_deref()
17 }
18 pub fn record(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
20 self.record.as_ref()
21 }
22 #[allow(missing_docs)] pub fn predict_endpoint(&self) -> ::std::option::Option<&str> {
24 self.predict_endpoint.as_deref()
25 }
26}
27impl PredictInput {
28 pub fn builder() -> crate::operation::predict::builders::PredictInputBuilder {
30 crate::operation::predict::builders::PredictInputBuilder::default()
31 }
32}
33
34#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
36#[non_exhaustive]
37pub struct PredictInputBuilder {
38 pub(crate) ml_model_id: ::std::option::Option<::std::string::String>,
39 pub(crate) record: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
40 pub(crate) predict_endpoint: ::std::option::Option<::std::string::String>,
41}
42impl PredictInputBuilder {
43 pub fn ml_model_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
46 self.ml_model_id = ::std::option::Option::Some(input.into());
47 self
48 }
49 pub fn set_ml_model_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
51 self.ml_model_id = input;
52 self
53 }
54 pub fn get_ml_model_id(&self) -> &::std::option::Option<::std::string::String> {
56 &self.ml_model_id
57 }
58 pub fn record(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
64 let mut hash_map = self.record.unwrap_or_default();
65 hash_map.insert(k.into(), v.into());
66 self.record = ::std::option::Option::Some(hash_map);
67 self
68 }
69 pub fn set_record(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
71 self.record = input;
72 self
73 }
74 pub fn get_record(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
76 &self.record
77 }
78 #[allow(missing_docs)] pub fn predict_endpoint(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
81 self.predict_endpoint = ::std::option::Option::Some(input.into());
82 self
83 }
84 #[allow(missing_docs)] pub fn set_predict_endpoint(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
86 self.predict_endpoint = input;
87 self
88 }
89 #[allow(missing_docs)] pub fn get_predict_endpoint(&self) -> &::std::option::Option<::std::string::String> {
91 &self.predict_endpoint
92 }
93 pub fn build(self) -> ::std::result::Result<crate::operation::predict::PredictInput, ::aws_smithy_types::error::operation::BuildError> {
95 ::std::result::Result::Ok(crate::operation::predict::PredictInput {
96 ml_model_id: self.ml_model_id,
97 record: self.record,
98 predict_endpoint: self.predict_endpoint,
99 })
100 }
101}