aws_sdk_b2bi/operation/update_transformer/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_transformer::_update_transformer_output::UpdateTransformerOutputBuilder;
3
4pub use crate::operation::update_transformer::_update_transformer_input::UpdateTransformerInputBuilder;
5
6impl crate::operation::update_transformer::builders::UpdateTransformerInputBuilder {
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::update_transformer::UpdateTransformerOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_transformer::UpdateTransformerError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_transformer();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateTransformer`.
24///
25/// <p>Updates the specified parameters for a transformer. A transformer can take an EDI file as input and transform it into a JSON-or XML-formatted document. Alternatively, a transformer can take a JSON-or XML-formatted document as input and transform it into an EDI file.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct UpdateTransformerFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::update_transformer::builders::UpdateTransformerInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::update_transformer::UpdateTransformerOutput,
35        crate::operation::update_transformer::UpdateTransformerError,
36    > for UpdateTransformerFluentBuilder
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::update_transformer::UpdateTransformerOutput,
44            crate::operation::update_transformer::UpdateTransformerError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl UpdateTransformerFluentBuilder {
51    /// Creates a new `UpdateTransformerFluentBuilder`.
52    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    /// Access the UpdateTransformer as a reference.
60    pub fn as_input(&self) -> &crate::operation::update_transformer::builders::UpdateTransformerInputBuilder {
61        &self.inner
62    }
63    /// Sends the request and returns the response.
64    ///
65    /// If an error occurs, an `SdkError` will be returned with additional details that
66    /// can be matched against.
67    ///
68    /// By default, any retryable failures will be retried twice. Retry behavior
69    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70    /// set when configuring the client.
71    pub async fn send(
72        self,
73    ) -> ::std::result::Result<
74        crate::operation::update_transformer::UpdateTransformerOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::update_transformer::UpdateTransformerError,
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::update_transformer::UpdateTransformer::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::update_transformer::UpdateTransformer::orchestrate(&runtime_plugins, input).await
90    }
91
92    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93    pub fn customize(
94        self,
95    ) -> crate::client::customize::CustomizableOperation<
96        crate::operation::update_transformer::UpdateTransformerOutput,
97        crate::operation::update_transformer::UpdateTransformerError,
98        Self,
99    > {
100        crate::client::customize::CustomizableOperation::new(self)
101    }
102    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103        self.set_config_override(::std::option::Option::Some(config_override.into()));
104        self
105    }
106
107    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108        self.config_override = config_override;
109        self
110    }
111    /// <p>Specifies the system-assigned unique identifier for the transformer.</p>
112    pub fn transformer_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.transformer_id(input.into());
114        self
115    }
116    /// <p>Specifies the system-assigned unique identifier for the transformer.</p>
117    pub fn set_transformer_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_transformer_id(input);
119        self
120    }
121    /// <p>Specifies the system-assigned unique identifier for the transformer.</p>
122    pub fn get_transformer_id(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_transformer_id()
124    }
125    /// <p>Specify a new name for the transformer, if you want to update it.</p>
126    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.name(input.into());
128        self
129    }
130    /// <p>Specify a new name for the transformer, if you want to update it.</p>
131    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_name(input);
133        self
134    }
135    /// <p>Specify a new name for the transformer, if you want to update it.</p>
136    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_name()
138    }
139    /// <p>Specifies the transformer's status. You can update the state of the transformer from <code>inactive</code> to <code>active</code>.</p>
140    pub fn status(mut self, input: crate::types::TransformerStatus) -> Self {
141        self.inner = self.inner.status(input);
142        self
143    }
144    /// <p>Specifies the transformer's status. You can update the state of the transformer from <code>inactive</code> to <code>active</code>.</p>
145    pub fn set_status(mut self, input: ::std::option::Option<crate::types::TransformerStatus>) -> Self {
146        self.inner = self.inner.set_status(input);
147        self
148    }
149    /// <p>Specifies the transformer's status. You can update the state of the transformer from <code>inactive</code> to <code>active</code>.</p>
150    pub fn get_status(&self) -> &::std::option::Option<crate::types::TransformerStatus> {
151        self.inner.get_status()
152    }
153    /// <p>Specifies that the currently supported file formats for EDI transformations are <code>JSON</code> and <code>XML</code>.</p>
154    #[deprecated(note = "This is a legacy trait. Please use input-conversion or output-conversion.")]
155    pub fn file_format(mut self, input: crate::types::FileFormat) -> Self {
156        self.inner = self.inner.file_format(input);
157        self
158    }
159    /// <p>Specifies that the currently supported file formats for EDI transformations are <code>JSON</code> and <code>XML</code>.</p>
160    #[deprecated(note = "This is a legacy trait. Please use input-conversion or output-conversion.")]
161    pub fn set_file_format(mut self, input: ::std::option::Option<crate::types::FileFormat>) -> Self {
162        self.inner = self.inner.set_file_format(input);
163        self
164    }
165    /// <p>Specifies that the currently supported file formats for EDI transformations are <code>JSON</code> and <code>XML</code>.</p>
166    #[deprecated(note = "This is a legacy trait. Please use input-conversion or output-conversion.")]
167    pub fn get_file_format(&self) -> &::std::option::Option<crate::types::FileFormat> {
168        self.inner.get_file_format()
169    }
170    /// <p>Specifies the mapping template for the transformer. This template is used to map the parsed EDI file using JSONata or XSLT.</p><note>
171    /// <p>This parameter is available for backwards compatibility. Use the <a href="https://docs.aws.amazon.com/b2bi/latest/APIReference/API_Mapping.html">Mapping</a> data type instead.</p>
172    /// </note>
173    #[deprecated(note = "This is a legacy trait. Please use input-conversion or output-conversion.")]
174    pub fn mapping_template(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
175        self.inner = self.inner.mapping_template(input.into());
176        self
177    }
178    /// <p>Specifies the mapping template for the transformer. This template is used to map the parsed EDI file using JSONata or XSLT.</p><note>
179    /// <p>This parameter is available for backwards compatibility. Use the <a href="https://docs.aws.amazon.com/b2bi/latest/APIReference/API_Mapping.html">Mapping</a> data type instead.</p>
180    /// </note>
181    #[deprecated(note = "This is a legacy trait. Please use input-conversion or output-conversion.")]
182    pub fn set_mapping_template(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
183        self.inner = self.inner.set_mapping_template(input);
184        self
185    }
186    /// <p>Specifies the mapping template for the transformer. This template is used to map the parsed EDI file using JSONata or XSLT.</p><note>
187    /// <p>This parameter is available for backwards compatibility. Use the <a href="https://docs.aws.amazon.com/b2bi/latest/APIReference/API_Mapping.html">Mapping</a> data type instead.</p>
188    /// </note>
189    #[deprecated(note = "This is a legacy trait. Please use input-conversion or output-conversion.")]
190    pub fn get_mapping_template(&self) -> &::std::option::Option<::std::string::String> {
191        self.inner.get_mapping_template()
192    }
193    /// <p>Specifies the details for the EDI standard that is being used for the transformer. Currently, only X12 is supported. X12 is a set of standards and corresponding messages that define specific business documents.</p>
194    #[deprecated(note = "This is a legacy trait. Please use input-conversion or output-conversion.")]
195    pub fn edi_type(mut self, input: crate::types::EdiType) -> Self {
196        self.inner = self.inner.edi_type(input);
197        self
198    }
199    /// <p>Specifies the details for the EDI standard that is being used for the transformer. Currently, only X12 is supported. X12 is a set of standards and corresponding messages that define specific business documents.</p>
200    #[deprecated(note = "This is a legacy trait. Please use input-conversion or output-conversion.")]
201    pub fn set_edi_type(mut self, input: ::std::option::Option<crate::types::EdiType>) -> Self {
202        self.inner = self.inner.set_edi_type(input);
203        self
204    }
205    /// <p>Specifies the details for the EDI standard that is being used for the transformer. Currently, only X12 is supported. X12 is a set of standards and corresponding messages that define specific business documents.</p>
206    #[deprecated(note = "This is a legacy trait. Please use input-conversion or output-conversion.")]
207    pub fn get_edi_type(&self) -> &::std::option::Option<crate::types::EdiType> {
208        self.inner.get_edi_type()
209    }
210    /// <p>Specifies a sample EDI document that is used by a transformer as a guide for processing the EDI data.</p>
211    #[deprecated(note = "This is a legacy trait. Please use input-conversion or output-conversion.")]
212    pub fn sample_document(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
213        self.inner = self.inner.sample_document(input.into());
214        self
215    }
216    /// <p>Specifies a sample EDI document that is used by a transformer as a guide for processing the EDI data.</p>
217    #[deprecated(note = "This is a legacy trait. Please use input-conversion or output-conversion.")]
218    pub fn set_sample_document(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
219        self.inner = self.inner.set_sample_document(input);
220        self
221    }
222    /// <p>Specifies a sample EDI document that is used by a transformer as a guide for processing the EDI data.</p>
223    #[deprecated(note = "This is a legacy trait. Please use input-conversion or output-conversion.")]
224    pub fn get_sample_document(&self) -> &::std::option::Option<::std::string::String> {
225        self.inner.get_sample_document()
226    }
227    /// <p>To update, specify the <code>InputConversion</code> object, which contains the format options for the inbound transformation.</p>
228    pub fn input_conversion(mut self, input: crate::types::InputConversion) -> Self {
229        self.inner = self.inner.input_conversion(input);
230        self
231    }
232    /// <p>To update, specify the <code>InputConversion</code> object, which contains the format options for the inbound transformation.</p>
233    pub fn set_input_conversion(mut self, input: ::std::option::Option<crate::types::InputConversion>) -> Self {
234        self.inner = self.inner.set_input_conversion(input);
235        self
236    }
237    /// <p>To update, specify the <code>InputConversion</code> object, which contains the format options for the inbound transformation.</p>
238    pub fn get_input_conversion(&self) -> &::std::option::Option<crate::types::InputConversion> {
239        self.inner.get_input_conversion()
240    }
241    /// <p>Specify the structure that contains the mapping template and its language (either XSLT or JSONATA).</p>
242    pub fn mapping(mut self, input: crate::types::Mapping) -> Self {
243        self.inner = self.inner.mapping(input);
244        self
245    }
246    /// <p>Specify the structure that contains the mapping template and its language (either XSLT or JSONATA).</p>
247    pub fn set_mapping(mut self, input: ::std::option::Option<crate::types::Mapping>) -> Self {
248        self.inner = self.inner.set_mapping(input);
249        self
250    }
251    /// <p>Specify the structure that contains the mapping template and its language (either XSLT or JSONATA).</p>
252    pub fn get_mapping(&self) -> &::std::option::Option<crate::types::Mapping> {
253        self.inner.get_mapping()
254    }
255    /// <p>To update, specify the <code>OutputConversion</code> object, which contains the format options for the outbound transformation.</p>
256    pub fn output_conversion(mut self, input: crate::types::OutputConversion) -> Self {
257        self.inner = self.inner.output_conversion(input);
258        self
259    }
260    /// <p>To update, specify the <code>OutputConversion</code> object, which contains the format options for the outbound transformation.</p>
261    pub fn set_output_conversion(mut self, input: ::std::option::Option<crate::types::OutputConversion>) -> Self {
262        self.inner = self.inner.set_output_conversion(input);
263        self
264    }
265    /// <p>To update, specify the <code>OutputConversion</code> object, which contains the format options for the outbound transformation.</p>
266    pub fn get_output_conversion(&self) -> &::std::option::Option<crate::types::OutputConversion> {
267        self.inner.get_output_conversion()
268    }
269    /// <p>Specify a structure that contains the Amazon S3 bucket and an array of the corresponding keys used to identify the location for your sample documents.</p>
270    pub fn sample_documents(mut self, input: crate::types::SampleDocuments) -> Self {
271        self.inner = self.inner.sample_documents(input);
272        self
273    }
274    /// <p>Specify a structure that contains the Amazon S3 bucket and an array of the corresponding keys used to identify the location for your sample documents.</p>
275    pub fn set_sample_documents(mut self, input: ::std::option::Option<crate::types::SampleDocuments>) -> Self {
276        self.inner = self.inner.set_sample_documents(input);
277        self
278    }
279    /// <p>Specify a structure that contains the Amazon S3 bucket and an array of the corresponding keys used to identify the location for your sample documents.</p>
280    pub fn get_sample_documents(&self) -> &::std::option::Option<crate::types::SampleDocuments> {
281        self.inner.get_sample_documents()
282    }
283}