aws_sdk_b2bi/operation/create_transformer/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_transformer::_create_transformer_output::CreateTransformerOutputBuilder;
3
4pub use crate::operation::create_transformer::_create_transformer_input::CreateTransformerInputBuilder;
5
6impl crate::operation::create_transformer::builders::CreateTransformerInputBuilder {
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::create_transformer::CreateTransformerOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_transformer::CreateTransformerError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_transformer();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateTransformer`.
24///
25/// <p>Creates a transformer. Amazon Web Services B2B Data Interchange currently supports two scenarios:</p>
26/// <ul>
27/// <li>
28/// <p><i>Inbound EDI</i>: the Amazon Web Services customer receives an EDI file from their trading partner. Amazon Web Services B2B Data Interchange converts this EDI file into a JSON or XML file with a service-defined structure. A mapping template provided by the customer, in JSONata or XSLT format, is optionally applied to this file to produce a JSON or XML file with the structure the customer requires.</p></li>
29/// <li>
30/// <p><i>Outbound EDI</i>: the Amazon Web Services customer has a JSON or XML file containing data that they wish to use in an EDI file. A mapping template, provided by the customer (in either JSONata or XSLT format) is applied to this file to generate a JSON or XML file in the service-defined structure. This file is then converted to an EDI file.</p></li>
31/// </ul><note>
32/// <p>The following fields are provided for backwards compatibility only: <code>fileFormat</code>, <code>mappingTemplate</code>, <code>ediType</code>, and <code>sampleDocument</code>.</p>
33/// <ul>
34/// <li>
35/// <p>Use the <code>mapping</code> data type in place of <code>mappingTemplate</code> and <code>fileFormat</code></p></li>
36/// <li>
37/// <p>Use the <code>sampleDocuments</code> data type in place of <code>sampleDocument</code></p></li>
38/// <li>
39/// <p>Use either the <code>inputConversion</code> or <code>outputConversion</code> in place of <code>ediType</code></p></li>
40/// </ul>
41/// </note>
42#[derive(::std::clone::Clone, ::std::fmt::Debug)]
43pub struct CreateTransformerFluentBuilder {
44    handle: ::std::sync::Arc<crate::client::Handle>,
45    inner: crate::operation::create_transformer::builders::CreateTransformerInputBuilder,
46    config_override: ::std::option::Option<crate::config::Builder>,
47}
48impl
49    crate::client::customize::internal::CustomizableSend<
50        crate::operation::create_transformer::CreateTransformerOutput,
51        crate::operation::create_transformer::CreateTransformerError,
52    > for CreateTransformerFluentBuilder
53{
54    fn send(
55        self,
56        config_override: crate::config::Builder,
57    ) -> crate::client::customize::internal::BoxFuture<
58        crate::client::customize::internal::SendResult<
59            crate::operation::create_transformer::CreateTransformerOutput,
60            crate::operation::create_transformer::CreateTransformerError,
61        >,
62    > {
63        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
64    }
65}
66impl CreateTransformerFluentBuilder {
67    /// Creates a new `CreateTransformerFluentBuilder`.
68    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
69        Self {
70            handle,
71            inner: ::std::default::Default::default(),
72            config_override: ::std::option::Option::None,
73        }
74    }
75    /// Access the CreateTransformer as a reference.
76    pub fn as_input(&self) -> &crate::operation::create_transformer::builders::CreateTransformerInputBuilder {
77        &self.inner
78    }
79    /// Sends the request and returns the response.
80    ///
81    /// If an error occurs, an `SdkError` will be returned with additional details that
82    /// can be matched against.
83    ///
84    /// By default, any retryable failures will be retried twice. Retry behavior
85    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
86    /// set when configuring the client.
87    pub async fn send(
88        self,
89    ) -> ::std::result::Result<
90        crate::operation::create_transformer::CreateTransformerOutput,
91        ::aws_smithy_runtime_api::client::result::SdkError<
92            crate::operation::create_transformer::CreateTransformerError,
93            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
94        >,
95    > {
96        let input = self
97            .inner
98            .build()
99            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
100        let runtime_plugins = crate::operation::create_transformer::CreateTransformer::operation_runtime_plugins(
101            self.handle.runtime_plugins.clone(),
102            &self.handle.conf,
103            self.config_override,
104        );
105        crate::operation::create_transformer::CreateTransformer::orchestrate(&runtime_plugins, input).await
106    }
107
108    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
109    pub fn customize(
110        self,
111    ) -> crate::client::customize::CustomizableOperation<
112        crate::operation::create_transformer::CreateTransformerOutput,
113        crate::operation::create_transformer::CreateTransformerError,
114        Self,
115    > {
116        crate::client::customize::CustomizableOperation::new(self)
117    }
118    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
119        self.set_config_override(::std::option::Option::Some(config_override.into()));
120        self
121    }
122
123    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
124        self.config_override = config_override;
125        self
126    }
127    /// <p>Specifies the name of the transformer, used to identify it.</p>
128    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
129        self.inner = self.inner.name(input.into());
130        self
131    }
132    /// <p>Specifies the name of the transformer, used to identify it.</p>
133    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
134        self.inner = self.inner.set_name(input);
135        self
136    }
137    /// <p>Specifies the name of the transformer, used to identify it.</p>
138    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
139        self.inner.get_name()
140    }
141    /// <p>Reserved for future use.</p>
142    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
143        self.inner = self.inner.client_token(input.into());
144        self
145    }
146    /// <p>Reserved for future use.</p>
147    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
148        self.inner = self.inner.set_client_token(input);
149        self
150    }
151    /// <p>Reserved for future use.</p>
152    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
153        self.inner.get_client_token()
154    }
155    ///
156    /// Appends an item to `tags`.
157    ///
158    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
159    ///
160    /// <p>Specifies the key-value pairs assigned to ARNs that you can use to group and search for resources by type. You can attach this metadata to resources (capabilities, partnerships, and so on) for any purpose.</p>
161    pub fn tags(mut self, input: crate::types::Tag) -> Self {
162        self.inner = self.inner.tags(input);
163        self
164    }
165    /// <p>Specifies the key-value pairs assigned to ARNs that you can use to group and search for resources by type. You can attach this metadata to resources (capabilities, partnerships, and so on) for any purpose.</p>
166    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
167        self.inner = self.inner.set_tags(input);
168        self
169    }
170    /// <p>Specifies the key-value pairs assigned to ARNs that you can use to group and search for resources by type. You can attach this metadata to resources (capabilities, partnerships, and so on) for any purpose.</p>
171    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
172        self.inner.get_tags()
173    }
174    /// <p>Specifies that the currently supported file formats for EDI transformations are <code>JSON</code> and <code>XML</code>.</p>
175    #[deprecated(note = "This is a legacy trait. Please use input-conversion or output-conversion.")]
176    pub fn file_format(mut self, input: crate::types::FileFormat) -> Self {
177        self.inner = self.inner.file_format(input);
178        self
179    }
180    /// <p>Specifies that the currently supported file formats for EDI transformations are <code>JSON</code> and <code>XML</code>.</p>
181    #[deprecated(note = "This is a legacy trait. Please use input-conversion or output-conversion.")]
182    pub fn set_file_format(mut self, input: ::std::option::Option<crate::types::FileFormat>) -> Self {
183        self.inner = self.inner.set_file_format(input);
184        self
185    }
186    /// <p>Specifies that the currently supported file formats for EDI transformations are <code>JSON</code> and <code>XML</code>.</p>
187    #[deprecated(note = "This is a legacy trait. Please use input-conversion or output-conversion.")]
188    pub fn get_file_format(&self) -> &::std::option::Option<crate::types::FileFormat> {
189        self.inner.get_file_format()
190    }
191    /// <p>Specifies the mapping template for the transformer. This template is used to map the parsed EDI file using JSONata or XSLT.</p><note>
192    /// <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>
193    /// </note>
194    #[deprecated(note = "This is a legacy trait. Please use input-conversion or output-conversion.")]
195    pub fn mapping_template(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
196        self.inner = self.inner.mapping_template(input.into());
197        self
198    }
199    /// <p>Specifies the mapping template for the transformer. This template is used to map the parsed EDI file using JSONata or XSLT.</p><note>
200    /// <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>
201    /// </note>
202    #[deprecated(note = "This is a legacy trait. Please use input-conversion or output-conversion.")]
203    pub fn set_mapping_template(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
204        self.inner = self.inner.set_mapping_template(input);
205        self
206    }
207    /// <p>Specifies the mapping template for the transformer. This template is used to map the parsed EDI file using JSONata or XSLT.</p><note>
208    /// <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>
209    /// </note>
210    #[deprecated(note = "This is a legacy trait. Please use input-conversion or output-conversion.")]
211    pub fn get_mapping_template(&self) -> &::std::option::Option<::std::string::String> {
212        self.inner.get_mapping_template()
213    }
214    /// <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>
215    #[deprecated(note = "This is a legacy trait. Please use input-conversion or output-conversion.")]
216    pub fn edi_type(mut self, input: crate::types::EdiType) -> Self {
217        self.inner = self.inner.edi_type(input);
218        self
219    }
220    /// <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>
221    #[deprecated(note = "This is a legacy trait. Please use input-conversion or output-conversion.")]
222    pub fn set_edi_type(mut self, input: ::std::option::Option<crate::types::EdiType>) -> Self {
223        self.inner = self.inner.set_edi_type(input);
224        self
225    }
226    /// <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>
227    #[deprecated(note = "This is a legacy trait. Please use input-conversion or output-conversion.")]
228    pub fn get_edi_type(&self) -> &::std::option::Option<crate::types::EdiType> {
229        self.inner.get_edi_type()
230    }
231    /// <p>Specifies a sample EDI document that is used by a transformer as a guide for processing the EDI data.</p>
232    #[deprecated(note = "This is a legacy trait. Please use input-conversion or output-conversion.")]
233    pub fn sample_document(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
234        self.inner = self.inner.sample_document(input.into());
235        self
236    }
237    /// <p>Specifies a sample EDI document that is used by a transformer as a guide for processing the EDI data.</p>
238    #[deprecated(note = "This is a legacy trait. Please use input-conversion or output-conversion.")]
239    pub fn set_sample_document(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
240        self.inner = self.inner.set_sample_document(input);
241        self
242    }
243    /// <p>Specifies a sample EDI document that is used by a transformer as a guide for processing the EDI data.</p>
244    #[deprecated(note = "This is a legacy trait. Please use input-conversion or output-conversion.")]
245    pub fn get_sample_document(&self) -> &::std::option::Option<::std::string::String> {
246        self.inner.get_sample_document()
247    }
248    /// <p>Specify the <code>InputConversion</code> object, which contains the format options for the inbound transformation.</p>
249    pub fn input_conversion(mut self, input: crate::types::InputConversion) -> Self {
250        self.inner = self.inner.input_conversion(input);
251        self
252    }
253    /// <p>Specify the <code>InputConversion</code> object, which contains the format options for the inbound transformation.</p>
254    pub fn set_input_conversion(mut self, input: ::std::option::Option<crate::types::InputConversion>) -> Self {
255        self.inner = self.inner.set_input_conversion(input);
256        self
257    }
258    /// <p>Specify the <code>InputConversion</code> object, which contains the format options for the inbound transformation.</p>
259    pub fn get_input_conversion(&self) -> &::std::option::Option<crate::types::InputConversion> {
260        self.inner.get_input_conversion()
261    }
262    /// <p>Specify the structure that contains the mapping template and its language (either XSLT or JSONATA).</p>
263    pub fn mapping(mut self, input: crate::types::Mapping) -> Self {
264        self.inner = self.inner.mapping(input);
265        self
266    }
267    /// <p>Specify the structure that contains the mapping template and its language (either XSLT or JSONATA).</p>
268    pub fn set_mapping(mut self, input: ::std::option::Option<crate::types::Mapping>) -> Self {
269        self.inner = self.inner.set_mapping(input);
270        self
271    }
272    /// <p>Specify the structure that contains the mapping template and its language (either XSLT or JSONATA).</p>
273    pub fn get_mapping(&self) -> &::std::option::Option<crate::types::Mapping> {
274        self.inner.get_mapping()
275    }
276    /// <p>A structure that contains the <code>OutputConversion</code> object, which contains the format options for the outbound transformation.</p>
277    pub fn output_conversion(mut self, input: crate::types::OutputConversion) -> Self {
278        self.inner = self.inner.output_conversion(input);
279        self
280    }
281    /// <p>A structure that contains the <code>OutputConversion</code> object, which contains the format options for the outbound transformation.</p>
282    pub fn set_output_conversion(mut self, input: ::std::option::Option<crate::types::OutputConversion>) -> Self {
283        self.inner = self.inner.set_output_conversion(input);
284        self
285    }
286    /// <p>A structure that contains the <code>OutputConversion</code> object, which contains the format options for the outbound transformation.</p>
287    pub fn get_output_conversion(&self) -> &::std::option::Option<crate::types::OutputConversion> {
288        self.inner.get_output_conversion()
289    }
290    /// <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>
291    pub fn sample_documents(mut self, input: crate::types::SampleDocuments) -> Self {
292        self.inner = self.inner.sample_documents(input);
293        self
294    }
295    /// <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>
296    pub fn set_sample_documents(mut self, input: ::std::option::Option<crate::types::SampleDocuments>) -> Self {
297        self.inner = self.inner.set_sample_documents(input);
298        self
299    }
300    /// <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>
301    pub fn get_sample_documents(&self) -> &::std::option::Option<crate::types::SampleDocuments> {
302        self.inner.get_sample_documents()
303    }
304}