aws_sdk_b2bi/operation/get_transformer/
_get_transformer_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct GetTransformerOutput {
6    /// <p>Returns the system-assigned unique identifier for the transformer.</p>
7    pub transformer_id: ::std::string::String,
8    /// <p>Returns an Amazon Resource Name (ARN) for a specific Amazon Web Services resource, such as a capability, partnership, profile, or transformer.</p>
9    pub transformer_arn: ::std::string::String,
10    /// <p>Returns the name of the transformer, used to identify it.</p>
11    pub name: ::std::string::String,
12    /// <p>Returns the state of the newly created transformer. The transformer can be either <code>active</code> or <code>inactive</code>. For the transformer to be used in a capability, its status must <code>active</code>.</p>
13    pub status: crate::types::TransformerStatus,
14    /// <p>Returns a timestamp for creation date and time of the transformer.</p>
15    pub created_at: ::aws_smithy_types::DateTime,
16    /// <p>Returns a timestamp for last time the transformer was modified.</p>
17    pub modified_at: ::std::option::Option<::aws_smithy_types::DateTime>,
18    /// <p>Returns that the currently supported file formats for EDI transformations are <code>JSON</code> and <code>XML</code>.</p>
19    #[deprecated(note = "This is a legacy trait. Please use input-conversion or output-conversion.")]
20    pub file_format: crate::types::FileFormat,
21    /// <p>Returns the mapping template for the transformer. This template is used to map the parsed EDI file using JSONata or XSLT.</p>
22    #[deprecated(note = "This is a legacy trait. Please use input-conversion or output-conversion.")]
23    pub mapping_template: ::std::string::String,
24    /// <p>Returns 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>
25    #[deprecated(note = "This is a legacy trait. Please use input-conversion or output-conversion.")]
26    pub edi_type: ::std::option::Option<crate::types::EdiType>,
27    /// <p>Returns a sample EDI document that is used by a transformer as a guide for processing the EDI data.</p>
28    #[deprecated(note = "This is a legacy trait. Please use input-conversion or output-conversion.")]
29    pub sample_document: ::std::option::Option<::std::string::String>,
30    /// <p>Returns the <code>InputConversion</code> object, which contains the format options for the inbound transformation.</p>
31    pub input_conversion: ::std::option::Option<crate::types::InputConversion>,
32    /// <p>Returns the structure that contains the mapping template and its language (either XSLT or JSONATA).</p>
33    pub mapping: ::std::option::Option<crate::types::Mapping>,
34    /// <p>Returns the <code>OutputConversion</code> object, which contains the format options for the outbound transformation.</p>
35    pub output_conversion: ::std::option::Option<crate::types::OutputConversion>,
36    /// <p>Returns 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>
37    pub sample_documents: ::std::option::Option<crate::types::SampleDocuments>,
38    _request_id: Option<String>,
39}
40impl GetTransformerOutput {
41    /// <p>Returns the system-assigned unique identifier for the transformer.</p>
42    pub fn transformer_id(&self) -> &str {
43        use std::ops::Deref;
44        self.transformer_id.deref()
45    }
46    /// <p>Returns an Amazon Resource Name (ARN) for a specific Amazon Web Services resource, such as a capability, partnership, profile, or transformer.</p>
47    pub fn transformer_arn(&self) -> &str {
48        use std::ops::Deref;
49        self.transformer_arn.deref()
50    }
51    /// <p>Returns the name of the transformer, used to identify it.</p>
52    pub fn name(&self) -> &str {
53        use std::ops::Deref;
54        self.name.deref()
55    }
56    /// <p>Returns the state of the newly created transformer. The transformer can be either <code>active</code> or <code>inactive</code>. For the transformer to be used in a capability, its status must <code>active</code>.</p>
57    pub fn status(&self) -> &crate::types::TransformerStatus {
58        &self.status
59    }
60    /// <p>Returns a timestamp for creation date and time of the transformer.</p>
61    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
62        &self.created_at
63    }
64    /// <p>Returns a timestamp for last time the transformer was modified.</p>
65    pub fn modified_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
66        self.modified_at.as_ref()
67    }
68    /// <p>Returns that the currently supported file formats for EDI transformations are <code>JSON</code> and <code>XML</code>.</p>
69    #[deprecated(note = "This is a legacy trait. Please use input-conversion or output-conversion.")]
70    pub fn file_format(&self) -> &crate::types::FileFormat {
71        &self.file_format
72    }
73    /// <p>Returns the mapping template for the transformer. This template is used to map the parsed EDI file using JSONata or XSLT.</p>
74    #[deprecated(note = "This is a legacy trait. Please use input-conversion or output-conversion.")]
75    pub fn mapping_template(&self) -> &str {
76        use std::ops::Deref;
77        self.mapping_template.deref()
78    }
79    /// <p>Returns 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>
80    #[deprecated(note = "This is a legacy trait. Please use input-conversion or output-conversion.")]
81    pub fn edi_type(&self) -> ::std::option::Option<&crate::types::EdiType> {
82        self.edi_type.as_ref()
83    }
84    /// <p>Returns a sample EDI document that is used by a transformer as a guide for processing the EDI data.</p>
85    #[deprecated(note = "This is a legacy trait. Please use input-conversion or output-conversion.")]
86    pub fn sample_document(&self) -> ::std::option::Option<&str> {
87        self.sample_document.as_deref()
88    }
89    /// <p>Returns the <code>InputConversion</code> object, which contains the format options for the inbound transformation.</p>
90    pub fn input_conversion(&self) -> ::std::option::Option<&crate::types::InputConversion> {
91        self.input_conversion.as_ref()
92    }
93    /// <p>Returns the structure that contains the mapping template and its language (either XSLT or JSONATA).</p>
94    pub fn mapping(&self) -> ::std::option::Option<&crate::types::Mapping> {
95        self.mapping.as_ref()
96    }
97    /// <p>Returns the <code>OutputConversion</code> object, which contains the format options for the outbound transformation.</p>
98    pub fn output_conversion(&self) -> ::std::option::Option<&crate::types::OutputConversion> {
99        self.output_conversion.as_ref()
100    }
101    /// <p>Returns 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>
102    pub fn sample_documents(&self) -> ::std::option::Option<&crate::types::SampleDocuments> {
103        self.sample_documents.as_ref()
104    }
105}
106impl ::aws_types::request_id::RequestId for GetTransformerOutput {
107    fn request_id(&self) -> Option<&str> {
108        self._request_id.as_deref()
109    }
110}
111impl GetTransformerOutput {
112    /// Creates a new builder-style object to manufacture [`GetTransformerOutput`](crate::operation::get_transformer::GetTransformerOutput).
113    pub fn builder() -> crate::operation::get_transformer::builders::GetTransformerOutputBuilder {
114        crate::operation::get_transformer::builders::GetTransformerOutputBuilder::default()
115    }
116}
117
118/// A builder for [`GetTransformerOutput`](crate::operation::get_transformer::GetTransformerOutput).
119#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
120#[non_exhaustive]
121pub struct GetTransformerOutputBuilder {
122    pub(crate) transformer_id: ::std::option::Option<::std::string::String>,
123    pub(crate) transformer_arn: ::std::option::Option<::std::string::String>,
124    pub(crate) name: ::std::option::Option<::std::string::String>,
125    pub(crate) status: ::std::option::Option<crate::types::TransformerStatus>,
126    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
127    pub(crate) modified_at: ::std::option::Option<::aws_smithy_types::DateTime>,
128    pub(crate) file_format: ::std::option::Option<crate::types::FileFormat>,
129    pub(crate) mapping_template: ::std::option::Option<::std::string::String>,
130    pub(crate) edi_type: ::std::option::Option<crate::types::EdiType>,
131    pub(crate) sample_document: ::std::option::Option<::std::string::String>,
132    pub(crate) input_conversion: ::std::option::Option<crate::types::InputConversion>,
133    pub(crate) mapping: ::std::option::Option<crate::types::Mapping>,
134    pub(crate) output_conversion: ::std::option::Option<crate::types::OutputConversion>,
135    pub(crate) sample_documents: ::std::option::Option<crate::types::SampleDocuments>,
136    _request_id: Option<String>,
137}
138impl GetTransformerOutputBuilder {
139    /// <p>Returns the system-assigned unique identifier for the transformer.</p>
140    /// This field is required.
141    pub fn transformer_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
142        self.transformer_id = ::std::option::Option::Some(input.into());
143        self
144    }
145    /// <p>Returns the system-assigned unique identifier for the transformer.</p>
146    pub fn set_transformer_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
147        self.transformer_id = input;
148        self
149    }
150    /// <p>Returns the system-assigned unique identifier for the transformer.</p>
151    pub fn get_transformer_id(&self) -> &::std::option::Option<::std::string::String> {
152        &self.transformer_id
153    }
154    /// <p>Returns an Amazon Resource Name (ARN) for a specific Amazon Web Services resource, such as a capability, partnership, profile, or transformer.</p>
155    /// This field is required.
156    pub fn transformer_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
157        self.transformer_arn = ::std::option::Option::Some(input.into());
158        self
159    }
160    /// <p>Returns an Amazon Resource Name (ARN) for a specific Amazon Web Services resource, such as a capability, partnership, profile, or transformer.</p>
161    pub fn set_transformer_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
162        self.transformer_arn = input;
163        self
164    }
165    /// <p>Returns an Amazon Resource Name (ARN) for a specific Amazon Web Services resource, such as a capability, partnership, profile, or transformer.</p>
166    pub fn get_transformer_arn(&self) -> &::std::option::Option<::std::string::String> {
167        &self.transformer_arn
168    }
169    /// <p>Returns the name of the transformer, used to identify it.</p>
170    /// This field is required.
171    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
172        self.name = ::std::option::Option::Some(input.into());
173        self
174    }
175    /// <p>Returns the name of the transformer, used to identify it.</p>
176    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
177        self.name = input;
178        self
179    }
180    /// <p>Returns the name of the transformer, used to identify it.</p>
181    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
182        &self.name
183    }
184    /// <p>Returns the state of the newly created transformer. The transformer can be either <code>active</code> or <code>inactive</code>. For the transformer to be used in a capability, its status must <code>active</code>.</p>
185    /// This field is required.
186    pub fn status(mut self, input: crate::types::TransformerStatus) -> Self {
187        self.status = ::std::option::Option::Some(input);
188        self
189    }
190    /// <p>Returns the state of the newly created transformer. The transformer can be either <code>active</code> or <code>inactive</code>. For the transformer to be used in a capability, its status must <code>active</code>.</p>
191    pub fn set_status(mut self, input: ::std::option::Option<crate::types::TransformerStatus>) -> Self {
192        self.status = input;
193        self
194    }
195    /// <p>Returns the state of the newly created transformer. The transformer can be either <code>active</code> or <code>inactive</code>. For the transformer to be used in a capability, its status must <code>active</code>.</p>
196    pub fn get_status(&self) -> &::std::option::Option<crate::types::TransformerStatus> {
197        &self.status
198    }
199    /// <p>Returns a timestamp for creation date and time of the transformer.</p>
200    /// This field is required.
201    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
202        self.created_at = ::std::option::Option::Some(input);
203        self
204    }
205    /// <p>Returns a timestamp for creation date and time of the transformer.</p>
206    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
207        self.created_at = input;
208        self
209    }
210    /// <p>Returns a timestamp for creation date and time of the transformer.</p>
211    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
212        &self.created_at
213    }
214    /// <p>Returns a timestamp for last time the transformer was modified.</p>
215    pub fn modified_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
216        self.modified_at = ::std::option::Option::Some(input);
217        self
218    }
219    /// <p>Returns a timestamp for last time the transformer was modified.</p>
220    pub fn set_modified_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
221        self.modified_at = input;
222        self
223    }
224    /// <p>Returns a timestamp for last time the transformer was modified.</p>
225    pub fn get_modified_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
226        &self.modified_at
227    }
228    /// <p>Returns that the currently supported file formats for EDI transformations are <code>JSON</code> and <code>XML</code>.</p>
229    #[deprecated(note = "This is a legacy trait. Please use input-conversion or output-conversion.")]
230    pub fn file_format(mut self, input: crate::types::FileFormat) -> Self {
231        self.file_format = ::std::option::Option::Some(input);
232        self
233    }
234    /// <p>Returns that the currently supported file formats for EDI transformations are <code>JSON</code> and <code>XML</code>.</p>
235    #[deprecated(note = "This is a legacy trait. Please use input-conversion or output-conversion.")]
236    pub fn set_file_format(mut self, input: ::std::option::Option<crate::types::FileFormat>) -> Self {
237        self.file_format = input;
238        self
239    }
240    /// <p>Returns that the currently supported file formats for EDI transformations are <code>JSON</code> and <code>XML</code>.</p>
241    #[deprecated(note = "This is a legacy trait. Please use input-conversion or output-conversion.")]
242    pub fn get_file_format(&self) -> &::std::option::Option<crate::types::FileFormat> {
243        &self.file_format
244    }
245    /// <p>Returns the mapping template for the transformer. This template is used to map the parsed EDI file using JSONata or XSLT.</p>
246    #[deprecated(note = "This is a legacy trait. Please use input-conversion or output-conversion.")]
247    pub fn mapping_template(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
248        self.mapping_template = ::std::option::Option::Some(input.into());
249        self
250    }
251    /// <p>Returns the mapping template for the transformer. This template is used to map the parsed EDI file using JSONata or XSLT.</p>
252    #[deprecated(note = "This is a legacy trait. Please use input-conversion or output-conversion.")]
253    pub fn set_mapping_template(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
254        self.mapping_template = input;
255        self
256    }
257    /// <p>Returns the mapping template for the transformer. This template is used to map the parsed EDI file using JSONata or XSLT.</p>
258    #[deprecated(note = "This is a legacy trait. Please use input-conversion or output-conversion.")]
259    pub fn get_mapping_template(&self) -> &::std::option::Option<::std::string::String> {
260        &self.mapping_template
261    }
262    /// <p>Returns 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>
263    #[deprecated(note = "This is a legacy trait. Please use input-conversion or output-conversion.")]
264    pub fn edi_type(mut self, input: crate::types::EdiType) -> Self {
265        self.edi_type = ::std::option::Option::Some(input);
266        self
267    }
268    /// <p>Returns 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>
269    #[deprecated(note = "This is a legacy trait. Please use input-conversion or output-conversion.")]
270    pub fn set_edi_type(mut self, input: ::std::option::Option<crate::types::EdiType>) -> Self {
271        self.edi_type = input;
272        self
273    }
274    /// <p>Returns 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>
275    #[deprecated(note = "This is a legacy trait. Please use input-conversion or output-conversion.")]
276    pub fn get_edi_type(&self) -> &::std::option::Option<crate::types::EdiType> {
277        &self.edi_type
278    }
279    /// <p>Returns a sample EDI document that is used by a transformer as a guide for processing the EDI data.</p>
280    #[deprecated(note = "This is a legacy trait. Please use input-conversion or output-conversion.")]
281    pub fn sample_document(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
282        self.sample_document = ::std::option::Option::Some(input.into());
283        self
284    }
285    /// <p>Returns a sample EDI document that is used by a transformer as a guide for processing the EDI data.</p>
286    #[deprecated(note = "This is a legacy trait. Please use input-conversion or output-conversion.")]
287    pub fn set_sample_document(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
288        self.sample_document = input;
289        self
290    }
291    /// <p>Returns a sample EDI document that is used by a transformer as a guide for processing the EDI data.</p>
292    #[deprecated(note = "This is a legacy trait. Please use input-conversion or output-conversion.")]
293    pub fn get_sample_document(&self) -> &::std::option::Option<::std::string::String> {
294        &self.sample_document
295    }
296    /// <p>Returns the <code>InputConversion</code> object, which contains the format options for the inbound transformation.</p>
297    pub fn input_conversion(mut self, input: crate::types::InputConversion) -> Self {
298        self.input_conversion = ::std::option::Option::Some(input);
299        self
300    }
301    /// <p>Returns the <code>InputConversion</code> object, which contains the format options for the inbound transformation.</p>
302    pub fn set_input_conversion(mut self, input: ::std::option::Option<crate::types::InputConversion>) -> Self {
303        self.input_conversion = input;
304        self
305    }
306    /// <p>Returns the <code>InputConversion</code> object, which contains the format options for the inbound transformation.</p>
307    pub fn get_input_conversion(&self) -> &::std::option::Option<crate::types::InputConversion> {
308        &self.input_conversion
309    }
310    /// <p>Returns the structure that contains the mapping template and its language (either XSLT or JSONATA).</p>
311    pub fn mapping(mut self, input: crate::types::Mapping) -> Self {
312        self.mapping = ::std::option::Option::Some(input);
313        self
314    }
315    /// <p>Returns the structure that contains the mapping template and its language (either XSLT or JSONATA).</p>
316    pub fn set_mapping(mut self, input: ::std::option::Option<crate::types::Mapping>) -> Self {
317        self.mapping = input;
318        self
319    }
320    /// <p>Returns the structure that contains the mapping template and its language (either XSLT or JSONATA).</p>
321    pub fn get_mapping(&self) -> &::std::option::Option<crate::types::Mapping> {
322        &self.mapping
323    }
324    /// <p>Returns the <code>OutputConversion</code> object, which contains the format options for the outbound transformation.</p>
325    pub fn output_conversion(mut self, input: crate::types::OutputConversion) -> Self {
326        self.output_conversion = ::std::option::Option::Some(input);
327        self
328    }
329    /// <p>Returns the <code>OutputConversion</code> object, which contains the format options for the outbound transformation.</p>
330    pub fn set_output_conversion(mut self, input: ::std::option::Option<crate::types::OutputConversion>) -> Self {
331        self.output_conversion = input;
332        self
333    }
334    /// <p>Returns the <code>OutputConversion</code> object, which contains the format options for the outbound transformation.</p>
335    pub fn get_output_conversion(&self) -> &::std::option::Option<crate::types::OutputConversion> {
336        &self.output_conversion
337    }
338    /// <p>Returns 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>
339    pub fn sample_documents(mut self, input: crate::types::SampleDocuments) -> Self {
340        self.sample_documents = ::std::option::Option::Some(input);
341        self
342    }
343    /// <p>Returns 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>
344    pub fn set_sample_documents(mut self, input: ::std::option::Option<crate::types::SampleDocuments>) -> Self {
345        self.sample_documents = input;
346        self
347    }
348    /// <p>Returns 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>
349    pub fn get_sample_documents(&self) -> &::std::option::Option<crate::types::SampleDocuments> {
350        &self.sample_documents
351    }
352    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
353        self._request_id = Some(request_id.into());
354        self
355    }
356
357    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
358        self._request_id = request_id;
359        self
360    }
361    /// Consumes the builder and constructs a [`GetTransformerOutput`](crate::operation::get_transformer::GetTransformerOutput).
362    /// This method will fail if any of the following fields are not set:
363    /// - [`transformer_id`](crate::operation::get_transformer::builders::GetTransformerOutputBuilder::transformer_id)
364    /// - [`transformer_arn`](crate::operation::get_transformer::builders::GetTransformerOutputBuilder::transformer_arn)
365    /// - [`name`](crate::operation::get_transformer::builders::GetTransformerOutputBuilder::name)
366    /// - [`status`](crate::operation::get_transformer::builders::GetTransformerOutputBuilder::status)
367    /// - [`created_at`](crate::operation::get_transformer::builders::GetTransformerOutputBuilder::created_at)
368    pub fn build(
369        self,
370    ) -> ::std::result::Result<crate::operation::get_transformer::GetTransformerOutput, ::aws_smithy_types::error::operation::BuildError> {
371        ::std::result::Result::Ok(crate::operation::get_transformer::GetTransformerOutput {
372            transformer_id: self.transformer_id.ok_or_else(|| {
373                ::aws_smithy_types::error::operation::BuildError::missing_field(
374                    "transformer_id",
375                    "transformer_id was not specified but it is required when building GetTransformerOutput",
376                )
377            })?,
378            transformer_arn: self.transformer_arn.ok_or_else(|| {
379                ::aws_smithy_types::error::operation::BuildError::missing_field(
380                    "transformer_arn",
381                    "transformer_arn was not specified but it is required when building GetTransformerOutput",
382                )
383            })?,
384            name: self.name.ok_or_else(|| {
385                ::aws_smithy_types::error::operation::BuildError::missing_field(
386                    "name",
387                    "name was not specified but it is required when building GetTransformerOutput",
388                )
389            })?,
390            status: self.status.ok_or_else(|| {
391                ::aws_smithy_types::error::operation::BuildError::missing_field(
392                    "status",
393                    "status was not specified but it is required when building GetTransformerOutput",
394                )
395            })?,
396            created_at: self.created_at.ok_or_else(|| {
397                ::aws_smithy_types::error::operation::BuildError::missing_field(
398                    "created_at",
399                    "created_at was not specified but it is required when building GetTransformerOutput",
400                )
401            })?,
402            modified_at: self.modified_at,
403            file_format: self
404                .file_format
405                .unwrap_or("NOT_USED".parse::<crate::types::FileFormat>().expect("static value validated to member")),
406            mapping_template: self.mapping_template.unwrap_or_else(|| "NOT_USED".to_owned()),
407            edi_type: self.edi_type,
408            sample_document: self.sample_document,
409            input_conversion: self.input_conversion,
410            mapping: self.mapping,
411            output_conversion: self.output_conversion,
412            sample_documents: self.sample_documents,
413            _request_id: self._request_id,
414        })
415    }
416}