aws_sdk_devopsagent/operation/send_message/
builders.rs1pub use crate::operation::send_message::_send_message_input::SendMessageInputBuilder;
3
4pub use crate::operation::send_message::_send_message_output::SendMessageOutputBuilder;
5
6impl crate::operation::send_message::builders::SendMessageInputBuilder {
7 pub async fn send_with(
9 self,
10 client: &crate::Client,
11 ) -> ::std::result::Result<
12 crate::operation::send_message::SendMessageOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::send_message::SendMessageError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.send_message();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct SendMessageFluentBuilder {
28 handle: ::std::sync::Arc<crate::client::Handle>,
29 inner: crate::operation::send_message::builders::SendMessageInputBuilder,
30 config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33 crate::client::customize::internal::CustomizableSend<
34 crate::operation::send_message::SendMessageOutput,
35 crate::operation::send_message::SendMessageError,
36 > for SendMessageFluentBuilder
37{
38 fn send(
39 self,
40 config_override: crate::config::Builder,
41 ) -> crate::client::customize::internal::BoxFuture<
42 crate::client::customize::internal::SendResult<
43 crate::operation::send_message::SendMessageOutput,
44 crate::operation::send_message::SendMessageError,
45 >,
46 > {
47 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48 }
49}
50impl SendMessageFluentBuilder {
51 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53 Self {
54 handle,
55 inner: ::std::default::Default::default(),
56 config_override: ::std::option::Option::None,
57 }
58 }
59 pub fn as_input(&self) -> &crate::operation::send_message::builders::SendMessageInputBuilder {
61 &self.inner
62 }
63 pub async fn send(
72 self,
73 ) -> ::std::result::Result<
74 crate::operation::send_message::SendMessageOutput,
75 ::aws_smithy_runtime_api::client::result::SdkError<
76 crate::operation::send_message::SendMessageError,
77 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78 >,
79 > {
80 let input = self
81 .inner
82 .build()
83 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84 let runtime_plugins = crate::operation::send_message::SendMessage::operation_runtime_plugins(
85 self.handle.runtime_plugins.clone(),
86 &self.handle.conf,
87 self.config_override,
88 );
89 let mut output = crate::operation::send_message::SendMessage::orchestrate(&runtime_plugins, input).await?;
90
91 fn response_error(
100 err: impl ::std::convert::Into<::aws_smithy_runtime_api::box_error::BoxError>,
101 ) -> ::aws_smithy_runtime_api::client::result::SdkError<
102 crate::operation::send_message::SendMessageError,
103 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
104 > {
105 ::aws_smithy_runtime_api::client::result::SdkError::response_error(
106 err,
107 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse::new(
108 ::aws_smithy_runtime_api::http::StatusCode::try_from(200).expect("valid successful code"),
109 ::aws_smithy_types::body::SdkBody::empty(),
110 ),
111 )
112 }
113
114 let message = output.events.try_recv_initial_response().await.map_err(response_error)?;
115
116 match message {
117 ::std::option::Option::Some(_message) => ::std::result::Result::Ok(output),
118 ::std::option::Option::None => ::std::result::Result::Ok(output),
119 }
120 }
121
122 pub fn customize(
124 self,
125 ) -> crate::client::customize::CustomizableOperation<
126 crate::operation::send_message::SendMessageOutput,
127 crate::operation::send_message::SendMessageError,
128 Self,
129 > {
130 crate::client::customize::CustomizableOperation::new(self)
131 }
132 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
133 self.set_config_override(::std::option::Option::Some(config_override.into()));
134 self
135 }
136
137 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
138 self.config_override = config_override;
139 self
140 }
141 pub fn agent_space_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
143 self.inner = self.inner.agent_space_id(input.into());
144 self
145 }
146 pub fn set_agent_space_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
148 self.inner = self.inner.set_agent_space_id(input);
149 self
150 }
151 pub fn get_agent_space_id(&self) -> &::std::option::Option<::std::string::String> {
153 self.inner.get_agent_space_id()
154 }
155 pub fn execution_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
157 self.inner = self.inner.execution_id(input.into());
158 self
159 }
160 pub fn set_execution_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
162 self.inner = self.inner.set_execution_id(input);
163 self
164 }
165 pub fn get_execution_id(&self) -> &::std::option::Option<::std::string::String> {
167 self.inner.get_execution_id()
168 }
169 pub fn content(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
171 self.inner = self.inner.content(input.into());
172 self
173 }
174 pub fn set_content(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
176 self.inner = self.inner.set_content(input);
177 self
178 }
179 pub fn get_content(&self) -> &::std::option::Option<::std::string::String> {
181 self.inner.get_content()
182 }
183 pub fn context(mut self, input: crate::types::SendMessageContext) -> Self {
185 self.inner = self.inner.context(input);
186 self
187 }
188 pub fn set_context(mut self, input: ::std::option::Option<crate::types::SendMessageContext>) -> Self {
190 self.inner = self.inner.set_context(input);
191 self
192 }
193 pub fn get_context(&self) -> &::std::option::Option<crate::types::SendMessageContext> {
195 self.inner.get_context()
196 }
197 pub fn user_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
199 self.inner = self.inner.user_id(input.into());
200 self
201 }
202 pub fn set_user_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
204 self.inner = self.inner.set_user_id(input);
205 self
206 }
207 pub fn get_user_id(&self) -> &::std::option::Option<::std::string::String> {
209 self.inner.get_user_id()
210 }
211}