aws_sdk_b2bi/operation/test_mapping/
_test_mapping_input.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 TestMappingInput {
6    /// <p>Specify the contents of the EDI (electronic data interchange) XML or JSON file that is used as input for the transform.</p>
7    pub input_file_content: ::std::option::Option<::std::string::String>,
8    /// <p>Specifies the mapping template for the transformer. This template is used to map the parsed EDI file using JSONata or XSLT.</p><note>
9    /// <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>
10    /// </note>
11    pub mapping_template: ::std::option::Option<::std::string::String>,
12    /// <p>Specifies that the currently supported file formats for EDI transformations are <code>JSON</code> and <code>XML</code>.</p>
13    pub file_format: ::std::option::Option<crate::types::FileFormat>,
14}
15impl TestMappingInput {
16    /// <p>Specify the contents of the EDI (electronic data interchange) XML or JSON file that is used as input for the transform.</p>
17    pub fn input_file_content(&self) -> ::std::option::Option<&str> {
18        self.input_file_content.as_deref()
19    }
20    /// <p>Specifies the mapping template for the transformer. This template is used to map the parsed EDI file using JSONata or XSLT.</p><note>
21    /// <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>
22    /// </note>
23    pub fn mapping_template(&self) -> ::std::option::Option<&str> {
24        self.mapping_template.as_deref()
25    }
26    /// <p>Specifies that the currently supported file formats for EDI transformations are <code>JSON</code> and <code>XML</code>.</p>
27    pub fn file_format(&self) -> ::std::option::Option<&crate::types::FileFormat> {
28        self.file_format.as_ref()
29    }
30}
31impl TestMappingInput {
32    /// Creates a new builder-style object to manufacture [`TestMappingInput`](crate::operation::test_mapping::TestMappingInput).
33    pub fn builder() -> crate::operation::test_mapping::builders::TestMappingInputBuilder {
34        crate::operation::test_mapping::builders::TestMappingInputBuilder::default()
35    }
36}
37
38/// A builder for [`TestMappingInput`](crate::operation::test_mapping::TestMappingInput).
39#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
40#[non_exhaustive]
41pub struct TestMappingInputBuilder {
42    pub(crate) input_file_content: ::std::option::Option<::std::string::String>,
43    pub(crate) mapping_template: ::std::option::Option<::std::string::String>,
44    pub(crate) file_format: ::std::option::Option<crate::types::FileFormat>,
45}
46impl TestMappingInputBuilder {
47    /// <p>Specify the contents of the EDI (electronic data interchange) XML or JSON file that is used as input for the transform.</p>
48    /// This field is required.
49    pub fn input_file_content(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
50        self.input_file_content = ::std::option::Option::Some(input.into());
51        self
52    }
53    /// <p>Specify the contents of the EDI (electronic data interchange) XML or JSON file that is used as input for the transform.</p>
54    pub fn set_input_file_content(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
55        self.input_file_content = input;
56        self
57    }
58    /// <p>Specify the contents of the EDI (electronic data interchange) XML or JSON file that is used as input for the transform.</p>
59    pub fn get_input_file_content(&self) -> &::std::option::Option<::std::string::String> {
60        &self.input_file_content
61    }
62    /// <p>Specifies the mapping template for the transformer. This template is used to map the parsed EDI file using JSONata or XSLT.</p><note>
63    /// <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>
64    /// </note>
65    /// This field is required.
66    pub fn mapping_template(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67        self.mapping_template = ::std::option::Option::Some(input.into());
68        self
69    }
70    /// <p>Specifies the mapping template for the transformer. This template is used to map the parsed EDI file using JSONata or XSLT.</p><note>
71    /// <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>
72    /// </note>
73    pub fn set_mapping_template(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
74        self.mapping_template = input;
75        self
76    }
77    /// <p>Specifies the mapping template for the transformer. This template is used to map the parsed EDI file using JSONata or XSLT.</p><note>
78    /// <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>
79    /// </note>
80    pub fn get_mapping_template(&self) -> &::std::option::Option<::std::string::String> {
81        &self.mapping_template
82    }
83    /// <p>Specifies that the currently supported file formats for EDI transformations are <code>JSON</code> and <code>XML</code>.</p>
84    /// This field is required.
85    pub fn file_format(mut self, input: crate::types::FileFormat) -> Self {
86        self.file_format = ::std::option::Option::Some(input);
87        self
88    }
89    /// <p>Specifies that the currently supported file formats for EDI transformations are <code>JSON</code> and <code>XML</code>.</p>
90    pub fn set_file_format(mut self, input: ::std::option::Option<crate::types::FileFormat>) -> Self {
91        self.file_format = input;
92        self
93    }
94    /// <p>Specifies that the currently supported file formats for EDI transformations are <code>JSON</code> and <code>XML</code>.</p>
95    pub fn get_file_format(&self) -> &::std::option::Option<crate::types::FileFormat> {
96        &self.file_format
97    }
98    /// Consumes the builder and constructs a [`TestMappingInput`](crate::operation::test_mapping::TestMappingInput).
99    pub fn build(self) -> ::std::result::Result<crate::operation::test_mapping::TestMappingInput, ::aws_smithy_types::error::operation::BuildError> {
100        ::std::result::Result::Ok(crate::operation::test_mapping::TestMappingInput {
101            input_file_content: self.input_file_content,
102            mapping_template: self.mapping_template,
103            file_format: self.file_format,
104        })
105    }
106}