aws_sdk_machinelearning/operation/predict/_predict_output.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct PredictOutput {
6 /// <p>The output from a <code>Predict</code> operation:</p>
7 /// <ul>
8 /// <li>
9 /// <p><code>Details</code> - Contains the following attributes: <code>DetailsAttributes.PREDICTIVE_MODEL_TYPE - REGRESSION | BINARY | MULTICLASS</code> <code>DetailsAttributes.ALGORITHM - SGD</code></p></li>
10 /// <li>
11 /// <p><code>PredictedLabel</code> - Present for either a <code>BINARY</code> or <code>MULTICLASS</code> <code>MLModel</code> request.</p></li>
12 /// <li>
13 /// <p><code>PredictedScores</code> - Contains the raw classification score corresponding to each label.</p></li>
14 /// <li>
15 /// <p><code>PredictedValue</code> - Present for a <code>REGRESSION</code> <code>MLModel</code> request.</p></li>
16 /// </ul>
17 pub prediction: ::std::option::Option<crate::types::Prediction>,
18 _request_id: Option<String>,
19}
20impl PredictOutput {
21 /// <p>The output from a <code>Predict</code> operation:</p>
22 /// <ul>
23 /// <li>
24 /// <p><code>Details</code> - Contains the following attributes: <code>DetailsAttributes.PREDICTIVE_MODEL_TYPE - REGRESSION | BINARY | MULTICLASS</code> <code>DetailsAttributes.ALGORITHM - SGD</code></p></li>
25 /// <li>
26 /// <p><code>PredictedLabel</code> - Present for either a <code>BINARY</code> or <code>MULTICLASS</code> <code>MLModel</code> request.</p></li>
27 /// <li>
28 /// <p><code>PredictedScores</code> - Contains the raw classification score corresponding to each label.</p></li>
29 /// <li>
30 /// <p><code>PredictedValue</code> - Present for a <code>REGRESSION</code> <code>MLModel</code> request.</p></li>
31 /// </ul>
32 pub fn prediction(&self) -> ::std::option::Option<&crate::types::Prediction> {
33 self.prediction.as_ref()
34 }
35}
36impl ::aws_types::request_id::RequestId for PredictOutput {
37 fn request_id(&self) -> Option<&str> {
38 self._request_id.as_deref()
39 }
40}
41impl PredictOutput {
42 /// Creates a new builder-style object to manufacture [`PredictOutput`](crate::operation::predict::PredictOutput).
43 pub fn builder() -> crate::operation::predict::builders::PredictOutputBuilder {
44 crate::operation::predict::builders::PredictOutputBuilder::default()
45 }
46}
47
48/// A builder for [`PredictOutput`](crate::operation::predict::PredictOutput).
49#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
50#[non_exhaustive]
51pub struct PredictOutputBuilder {
52 pub(crate) prediction: ::std::option::Option<crate::types::Prediction>,
53 _request_id: Option<String>,
54}
55impl PredictOutputBuilder {
56 /// <p>The output from a <code>Predict</code> operation:</p>
57 /// <ul>
58 /// <li>
59 /// <p><code>Details</code> - Contains the following attributes: <code>DetailsAttributes.PREDICTIVE_MODEL_TYPE - REGRESSION | BINARY | MULTICLASS</code> <code>DetailsAttributes.ALGORITHM - SGD</code></p></li>
60 /// <li>
61 /// <p><code>PredictedLabel</code> - Present for either a <code>BINARY</code> or <code>MULTICLASS</code> <code>MLModel</code> request.</p></li>
62 /// <li>
63 /// <p><code>PredictedScores</code> - Contains the raw classification score corresponding to each label.</p></li>
64 /// <li>
65 /// <p><code>PredictedValue</code> - Present for a <code>REGRESSION</code> <code>MLModel</code> request.</p></li>
66 /// </ul>
67 pub fn prediction(mut self, input: crate::types::Prediction) -> Self {
68 self.prediction = ::std::option::Option::Some(input);
69 self
70 }
71 /// <p>The output from a <code>Predict</code> operation:</p>
72 /// <ul>
73 /// <li>
74 /// <p><code>Details</code> - Contains the following attributes: <code>DetailsAttributes.PREDICTIVE_MODEL_TYPE - REGRESSION | BINARY | MULTICLASS</code> <code>DetailsAttributes.ALGORITHM - SGD</code></p></li>
75 /// <li>
76 /// <p><code>PredictedLabel</code> - Present for either a <code>BINARY</code> or <code>MULTICLASS</code> <code>MLModel</code> request.</p></li>
77 /// <li>
78 /// <p><code>PredictedScores</code> - Contains the raw classification score corresponding to each label.</p></li>
79 /// <li>
80 /// <p><code>PredictedValue</code> - Present for a <code>REGRESSION</code> <code>MLModel</code> request.</p></li>
81 /// </ul>
82 pub fn set_prediction(mut self, input: ::std::option::Option<crate::types::Prediction>) -> Self {
83 self.prediction = input;
84 self
85 }
86 /// <p>The output from a <code>Predict</code> operation:</p>
87 /// <ul>
88 /// <li>
89 /// <p><code>Details</code> - Contains the following attributes: <code>DetailsAttributes.PREDICTIVE_MODEL_TYPE - REGRESSION | BINARY | MULTICLASS</code> <code>DetailsAttributes.ALGORITHM - SGD</code></p></li>
90 /// <li>
91 /// <p><code>PredictedLabel</code> - Present for either a <code>BINARY</code> or <code>MULTICLASS</code> <code>MLModel</code> request.</p></li>
92 /// <li>
93 /// <p><code>PredictedScores</code> - Contains the raw classification score corresponding to each label.</p></li>
94 /// <li>
95 /// <p><code>PredictedValue</code> - Present for a <code>REGRESSION</code> <code>MLModel</code> request.</p></li>
96 /// </ul>
97 pub fn get_prediction(&self) -> &::std::option::Option<crate::types::Prediction> {
98 &self.prediction
99 }
100 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
101 self._request_id = Some(request_id.into());
102 self
103 }
104
105 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
106 self._request_id = request_id;
107 self
108 }
109 /// Consumes the builder and constructs a [`PredictOutput`](crate::operation::predict::PredictOutput).
110 pub fn build(self) -> crate::operation::predict::PredictOutput {
111 crate::operation::predict::PredictOutput {
112 prediction: self.prediction,
113 _request_id: self._request_id,
114 }
115 }
116}