aws_sdk_datapipeline/operation/evaluate_expression/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::evaluate_expression::_evaluate_expression_output::EvaluateExpressionOutputBuilder;
3
4pub use crate::operation::evaluate_expression::_evaluate_expression_input::EvaluateExpressionInputBuilder;
5
6impl crate::operation::evaluate_expression::builders::EvaluateExpressionInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::evaluate_expression::EvaluateExpressionOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::evaluate_expression::EvaluateExpressionError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.evaluate_expression();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `EvaluateExpression`.
24///
25/// <p>Task runners call <code>EvaluateExpression</code> to evaluate a string in the context of the specified object. For example, a task runner can evaluate SQL queries stored in Amazon S3.</p><examples>
26/// <request>
27/// POST / HTTP/1.1 Content-Type: application/x-amz-json-1.1 X-Amz-Target: DataPipeline.DescribePipelines Content-Length: 164 Host: datapipeline.us-east-1.amazonaws.com X-Amz-Date: Mon, 12 Nov 2012 17:49:52 GMT Authorization: AuthParams {"pipelineId": "df-08785951KAKJEXAMPLE", "objectId": "Schedule", "expression": "Transform started at #{startDateTime} and finished at #{endDateTime}"}
28/// </request>
29/// <response>
30/// x-amzn-RequestId: 02870eb7-0736-11e2-af6f-6bc7a6be60d9 Content-Type: application/x-amz-json-1.1 Content-Length: 103 Date: Mon, 12 Nov 2012 17:50:53 GMT {"evaluatedExpression": "Transform started at 2012-12-12T00:00:00 and finished at 2012-12-21T18:00:00"}
31/// </response>
32/// </examples>
33#[derive(::std::clone::Clone, ::std::fmt::Debug)]
34pub struct EvaluateExpressionFluentBuilder {
35    handle: ::std::sync::Arc<crate::client::Handle>,
36    inner: crate::operation::evaluate_expression::builders::EvaluateExpressionInputBuilder,
37    config_override: ::std::option::Option<crate::config::Builder>,
38}
39impl
40    crate::client::customize::internal::CustomizableSend<
41        crate::operation::evaluate_expression::EvaluateExpressionOutput,
42        crate::operation::evaluate_expression::EvaluateExpressionError,
43    > for EvaluateExpressionFluentBuilder
44{
45    fn send(
46        self,
47        config_override: crate::config::Builder,
48    ) -> crate::client::customize::internal::BoxFuture<
49        crate::client::customize::internal::SendResult<
50            crate::operation::evaluate_expression::EvaluateExpressionOutput,
51            crate::operation::evaluate_expression::EvaluateExpressionError,
52        >,
53    > {
54        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
55    }
56}
57impl EvaluateExpressionFluentBuilder {
58    /// Creates a new `EvaluateExpressionFluentBuilder`.
59    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
60        Self {
61            handle,
62            inner: ::std::default::Default::default(),
63            config_override: ::std::option::Option::None,
64        }
65    }
66    /// Access the EvaluateExpression as a reference.
67    pub fn as_input(&self) -> &crate::operation::evaluate_expression::builders::EvaluateExpressionInputBuilder {
68        &self.inner
69    }
70    /// Sends the request and returns the response.
71    ///
72    /// If an error occurs, an `SdkError` will be returned with additional details that
73    /// can be matched against.
74    ///
75    /// By default, any retryable failures will be retried twice. Retry behavior
76    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
77    /// set when configuring the client.
78    pub async fn send(
79        self,
80    ) -> ::std::result::Result<
81        crate::operation::evaluate_expression::EvaluateExpressionOutput,
82        ::aws_smithy_runtime_api::client::result::SdkError<
83            crate::operation::evaluate_expression::EvaluateExpressionError,
84            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
85        >,
86    > {
87        let input = self
88            .inner
89            .build()
90            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
91        let runtime_plugins = crate::operation::evaluate_expression::EvaluateExpression::operation_runtime_plugins(
92            self.handle.runtime_plugins.clone(),
93            &self.handle.conf,
94            self.config_override,
95        );
96        crate::operation::evaluate_expression::EvaluateExpression::orchestrate(&runtime_plugins, input).await
97    }
98
99    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
100    pub fn customize(
101        self,
102    ) -> crate::client::customize::CustomizableOperation<
103        crate::operation::evaluate_expression::EvaluateExpressionOutput,
104        crate::operation::evaluate_expression::EvaluateExpressionError,
105        Self,
106    > {
107        crate::client::customize::CustomizableOperation::new(self)
108    }
109    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
110        self.set_config_override(::std::option::Option::Some(config_override.into()));
111        self
112    }
113
114    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
115        self.config_override = config_override;
116        self
117    }
118    /// <p>The ID of the pipeline.</p>
119    pub fn pipeline_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
120        self.inner = self.inner.pipeline_id(input.into());
121        self
122    }
123    /// <p>The ID of the pipeline.</p>
124    pub fn set_pipeline_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
125        self.inner = self.inner.set_pipeline_id(input);
126        self
127    }
128    /// <p>The ID of the pipeline.</p>
129    pub fn get_pipeline_id(&self) -> &::std::option::Option<::std::string::String> {
130        self.inner.get_pipeline_id()
131    }
132    /// <p>The ID of the object.</p>
133    pub fn object_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
134        self.inner = self.inner.object_id(input.into());
135        self
136    }
137    /// <p>The ID of the object.</p>
138    pub fn set_object_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
139        self.inner = self.inner.set_object_id(input);
140        self
141    }
142    /// <p>The ID of the object.</p>
143    pub fn get_object_id(&self) -> &::std::option::Option<::std::string::String> {
144        self.inner.get_object_id()
145    }
146    /// <p>The expression to evaluate.</p>
147    pub fn expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
148        self.inner = self.inner.expression(input.into());
149        self
150    }
151    /// <p>The expression to evaluate.</p>
152    pub fn set_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
153        self.inner = self.inner.set_expression(input);
154        self
155    }
156    /// <p>The expression to evaluate.</p>
157    pub fn get_expression(&self) -> &::std::option::Option<::std::string::String> {
158        self.inner.get_expression()
159    }
160}