aws_sdk_bedrockagentruntime/operation/invoke_flow/
builders.rs1pub use crate::operation::invoke_flow::_invoke_flow_output::InvokeFlowOutputBuilder;
3
4pub use crate::operation::invoke_flow::_invoke_flow_input::InvokeFlowInputBuilder;
5
6impl crate::operation::invoke_flow::builders::InvokeFlowInputBuilder {
7 pub async fn send_with(
9 self,
10 client: &crate::Client,
11 ) -> ::std::result::Result<
12 crate::operation::invoke_flow::InvokeFlowOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::invoke_flow::InvokeFlowError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.invoke_flow();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23#[derive(::std::clone::Clone, ::std::fmt::Debug)]
29pub struct InvokeFlowFluentBuilder {
30 handle: ::std::sync::Arc<crate::client::Handle>,
31 inner: crate::operation::invoke_flow::builders::InvokeFlowInputBuilder,
32 config_override: ::std::option::Option<crate::config::Builder>,
33}
34impl
35 crate::client::customize::internal::CustomizableSend<
36 crate::operation::invoke_flow::InvokeFlowOutput,
37 crate::operation::invoke_flow::InvokeFlowError,
38 > for InvokeFlowFluentBuilder
39{
40 fn send(
41 self,
42 config_override: crate::config::Builder,
43 ) -> crate::client::customize::internal::BoxFuture<
44 crate::client::customize::internal::SendResult<
45 crate::operation::invoke_flow::InvokeFlowOutput,
46 crate::operation::invoke_flow::InvokeFlowError,
47 >,
48 > {
49 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
50 }
51}
52impl InvokeFlowFluentBuilder {
53 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
55 Self {
56 handle,
57 inner: ::std::default::Default::default(),
58 config_override: ::std::option::Option::None,
59 }
60 }
61 pub fn as_input(&self) -> &crate::operation::invoke_flow::builders::InvokeFlowInputBuilder {
63 &self.inner
64 }
65 pub async fn send(
74 self,
75 ) -> ::std::result::Result<
76 crate::operation::invoke_flow::InvokeFlowOutput,
77 ::aws_smithy_runtime_api::client::result::SdkError<
78 crate::operation::invoke_flow::InvokeFlowError,
79 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
80 >,
81 > {
82 let input = self
83 .inner
84 .build()
85 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
86 let runtime_plugins = crate::operation::invoke_flow::InvokeFlow::operation_runtime_plugins(
87 self.handle.runtime_plugins.clone(),
88 &self.handle.conf,
89 self.config_override,
90 );
91 let mut output = crate::operation::invoke_flow::InvokeFlow::orchestrate(&runtime_plugins, input).await?;
92
93 fn response_error(
102 err: impl ::std::convert::Into<::aws_smithy_runtime_api::box_error::BoxError>,
103 ) -> ::aws_smithy_runtime_api::client::result::SdkError<
104 crate::operation::invoke_flow::InvokeFlowError,
105 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
106 > {
107 ::aws_smithy_runtime_api::client::result::SdkError::response_error(
108 err,
109 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse::new(
110 ::aws_smithy_runtime_api::http::StatusCode::try_from(200).expect("valid successful code"),
111 ::aws_smithy_types::body::SdkBody::empty(),
112 ),
113 )
114 }
115
116 let message = output.response_stream.try_recv_initial_response().await.map_err(response_error)?;
117
118 match message {
119 ::std::option::Option::Some(_message) => ::std::result::Result::Ok(output),
120 ::std::option::Option::None => ::std::result::Result::Ok(output),
121 }
122 }
123
124 pub fn customize(
126 self,
127 ) -> crate::client::customize::CustomizableOperation<
128 crate::operation::invoke_flow::InvokeFlowOutput,
129 crate::operation::invoke_flow::InvokeFlowError,
130 Self,
131 > {
132 crate::client::customize::CustomizableOperation::new(self)
133 }
134 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
135 self.set_config_override(::std::option::Option::Some(config_override.into()));
136 self
137 }
138
139 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
140 self.config_override = config_override;
141 self
142 }
143 pub fn flow_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
145 self.inner = self.inner.flow_identifier(input.into());
146 self
147 }
148 pub fn set_flow_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
150 self.inner = self.inner.set_flow_identifier(input);
151 self
152 }
153 pub fn get_flow_identifier(&self) -> &::std::option::Option<::std::string::String> {
155 self.inner.get_flow_identifier()
156 }
157 pub fn flow_alias_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
159 self.inner = self.inner.flow_alias_identifier(input.into());
160 self
161 }
162 pub fn set_flow_alias_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
164 self.inner = self.inner.set_flow_alias_identifier(input);
165 self
166 }
167 pub fn get_flow_alias_identifier(&self) -> &::std::option::Option<::std::string::String> {
169 self.inner.get_flow_alias_identifier()
170 }
171 pub fn inputs(mut self, input: crate::types::FlowInput) -> Self {
178 self.inner = self.inner.inputs(input);
179 self
180 }
181 pub fn set_inputs(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::FlowInput>>) -> Self {
183 self.inner = self.inner.set_inputs(input);
184 self
185 }
186 pub fn get_inputs(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::FlowInput>> {
188 self.inner.get_inputs()
189 }
190 pub fn enable_trace(mut self, input: bool) -> Self {
192 self.inner = self.inner.enable_trace(input);
193 self
194 }
195 pub fn set_enable_trace(mut self, input: ::std::option::Option<bool>) -> Self {
197 self.inner = self.inner.set_enable_trace(input);
198 self
199 }
200 pub fn get_enable_trace(&self) -> &::std::option::Option<bool> {
202 self.inner.get_enable_trace()
203 }
204 pub fn model_performance_configuration(mut self, input: crate::types::ModelPerformanceConfiguration) -> Self {
206 self.inner = self.inner.model_performance_configuration(input);
207 self
208 }
209 pub fn set_model_performance_configuration(mut self, input: ::std::option::Option<crate::types::ModelPerformanceConfiguration>) -> Self {
211 self.inner = self.inner.set_model_performance_configuration(input);
212 self
213 }
214 pub fn get_model_performance_configuration(&self) -> &::std::option::Option<crate::types::ModelPerformanceConfiguration> {
216 self.inner.get_model_performance_configuration()
217 }
218 pub fn execution_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
220 self.inner = self.inner.execution_id(input.into());
221 self
222 }
223 pub fn set_execution_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
225 self.inner = self.inner.set_execution_id(input);
226 self
227 }
228 pub fn get_execution_id(&self) -> &::std::option::Option<::std::string::String> {
230 self.inner.get_execution_id()
231 }
232}