aws_sdk_datapipeline/operation/evaluate_expression/
_evaluate_expression_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Contains the output of EvaluateExpression.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct EvaluateExpressionOutput {
7    /// <p>The evaluated expression.</p>
8    pub evaluated_expression: ::std::string::String,
9    _request_id: Option<String>,
10}
11impl EvaluateExpressionOutput {
12    /// <p>The evaluated expression.</p>
13    pub fn evaluated_expression(&self) -> &str {
14        use std::ops::Deref;
15        self.evaluated_expression.deref()
16    }
17}
18impl ::aws_types::request_id::RequestId for EvaluateExpressionOutput {
19    fn request_id(&self) -> Option<&str> {
20        self._request_id.as_deref()
21    }
22}
23impl EvaluateExpressionOutput {
24    /// Creates a new builder-style object to manufacture [`EvaluateExpressionOutput`](crate::operation::evaluate_expression::EvaluateExpressionOutput).
25    pub fn builder() -> crate::operation::evaluate_expression::builders::EvaluateExpressionOutputBuilder {
26        crate::operation::evaluate_expression::builders::EvaluateExpressionOutputBuilder::default()
27    }
28}
29
30/// A builder for [`EvaluateExpressionOutput`](crate::operation::evaluate_expression::EvaluateExpressionOutput).
31#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
32#[non_exhaustive]
33pub struct EvaluateExpressionOutputBuilder {
34    pub(crate) evaluated_expression: ::std::option::Option<::std::string::String>,
35    _request_id: Option<String>,
36}
37impl EvaluateExpressionOutputBuilder {
38    /// <p>The evaluated expression.</p>
39    /// This field is required.
40    pub fn evaluated_expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
41        self.evaluated_expression = ::std::option::Option::Some(input.into());
42        self
43    }
44    /// <p>The evaluated expression.</p>
45    pub fn set_evaluated_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
46        self.evaluated_expression = input;
47        self
48    }
49    /// <p>The evaluated expression.</p>
50    pub fn get_evaluated_expression(&self) -> &::std::option::Option<::std::string::String> {
51        &self.evaluated_expression
52    }
53    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
54        self._request_id = Some(request_id.into());
55        self
56    }
57
58    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
59        self._request_id = request_id;
60        self
61    }
62    /// Consumes the builder and constructs a [`EvaluateExpressionOutput`](crate::operation::evaluate_expression::EvaluateExpressionOutput).
63    /// This method will fail if any of the following fields are not set:
64    /// - [`evaluated_expression`](crate::operation::evaluate_expression::builders::EvaluateExpressionOutputBuilder::evaluated_expression)
65    pub fn build(
66        self,
67    ) -> ::std::result::Result<crate::operation::evaluate_expression::EvaluateExpressionOutput, ::aws_smithy_types::error::operation::BuildError>
68    {
69        ::std::result::Result::Ok(crate::operation::evaluate_expression::EvaluateExpressionOutput {
70            evaluated_expression: self.evaluated_expression.ok_or_else(|| {
71                ::aws_smithy_types::error::operation::BuildError::missing_field(
72                    "evaluated_expression",
73                    "evaluated_expression was not specified but it is required when building EvaluateExpressionOutput",
74                )
75            })?,
76            _request_id: self._request_id,
77        })
78    }
79}