aws_sdk_b2bi/operation/generate_mapping/
_generate_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 GenerateMappingInput {
6    /// <p>Provide the contents of a sample X12 EDI file, either in JSON or XML format, to use as a starting point for the mapping.</p>
7    pub input_file_content: ::std::option::Option<::std::string::String>,
8    /// <p>Provide the contents of a sample X12 EDI file, either in JSON or XML format, to use as a target for the mapping.</p>
9    pub output_file_content: ::std::option::Option<::std::string::String>,
10    /// <p>Specify the mapping type: either <code>JSONATA</code> or <code>XSLT.</code></p>
11    pub mapping_type: ::std::option::Option<crate::types::MappingType>,
12}
13impl GenerateMappingInput {
14    /// <p>Provide the contents of a sample X12 EDI file, either in JSON or XML format, to use as a starting point for the mapping.</p>
15    pub fn input_file_content(&self) -> ::std::option::Option<&str> {
16        self.input_file_content.as_deref()
17    }
18    /// <p>Provide the contents of a sample X12 EDI file, either in JSON or XML format, to use as a target for the mapping.</p>
19    pub fn output_file_content(&self) -> ::std::option::Option<&str> {
20        self.output_file_content.as_deref()
21    }
22    /// <p>Specify the mapping type: either <code>JSONATA</code> or <code>XSLT.</code></p>
23    pub fn mapping_type(&self) -> ::std::option::Option<&crate::types::MappingType> {
24        self.mapping_type.as_ref()
25    }
26}
27impl GenerateMappingInput {
28    /// Creates a new builder-style object to manufacture [`GenerateMappingInput`](crate::operation::generate_mapping::GenerateMappingInput).
29    pub fn builder() -> crate::operation::generate_mapping::builders::GenerateMappingInputBuilder {
30        crate::operation::generate_mapping::builders::GenerateMappingInputBuilder::default()
31    }
32}
33
34/// A builder for [`GenerateMappingInput`](crate::operation::generate_mapping::GenerateMappingInput).
35#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
36#[non_exhaustive]
37pub struct GenerateMappingInputBuilder {
38    pub(crate) input_file_content: ::std::option::Option<::std::string::String>,
39    pub(crate) output_file_content: ::std::option::Option<::std::string::String>,
40    pub(crate) mapping_type: ::std::option::Option<crate::types::MappingType>,
41}
42impl GenerateMappingInputBuilder {
43    /// <p>Provide the contents of a sample X12 EDI file, either in JSON or XML format, to use as a starting point for the mapping.</p>
44    /// This field is required.
45    pub fn input_file_content(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
46        self.input_file_content = ::std::option::Option::Some(input.into());
47        self
48    }
49    /// <p>Provide the contents of a sample X12 EDI file, either in JSON or XML format, to use as a starting point for the mapping.</p>
50    pub fn set_input_file_content(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
51        self.input_file_content = input;
52        self
53    }
54    /// <p>Provide the contents of a sample X12 EDI file, either in JSON or XML format, to use as a starting point for the mapping.</p>
55    pub fn get_input_file_content(&self) -> &::std::option::Option<::std::string::String> {
56        &self.input_file_content
57    }
58    /// <p>Provide the contents of a sample X12 EDI file, either in JSON or XML format, to use as a target for the mapping.</p>
59    /// This field is required.
60    pub fn output_file_content(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
61        self.output_file_content = ::std::option::Option::Some(input.into());
62        self
63    }
64    /// <p>Provide the contents of a sample X12 EDI file, either in JSON or XML format, to use as a target for the mapping.</p>
65    pub fn set_output_file_content(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
66        self.output_file_content = input;
67        self
68    }
69    /// <p>Provide the contents of a sample X12 EDI file, either in JSON or XML format, to use as a target for the mapping.</p>
70    pub fn get_output_file_content(&self) -> &::std::option::Option<::std::string::String> {
71        &self.output_file_content
72    }
73    /// <p>Specify the mapping type: either <code>JSONATA</code> or <code>XSLT.</code></p>
74    /// This field is required.
75    pub fn mapping_type(mut self, input: crate::types::MappingType) -> Self {
76        self.mapping_type = ::std::option::Option::Some(input);
77        self
78    }
79    /// <p>Specify the mapping type: either <code>JSONATA</code> or <code>XSLT.</code></p>
80    pub fn set_mapping_type(mut self, input: ::std::option::Option<crate::types::MappingType>) -> Self {
81        self.mapping_type = input;
82        self
83    }
84    /// <p>Specify the mapping type: either <code>JSONATA</code> or <code>XSLT.</code></p>
85    pub fn get_mapping_type(&self) -> &::std::option::Option<crate::types::MappingType> {
86        &self.mapping_type
87    }
88    /// Consumes the builder and constructs a [`GenerateMappingInput`](crate::operation::generate_mapping::GenerateMappingInput).
89    pub fn build(
90        self,
91    ) -> ::std::result::Result<crate::operation::generate_mapping::GenerateMappingInput, ::aws_smithy_types::error::operation::BuildError> {
92        ::std::result::Result::Ok(crate::operation::generate_mapping::GenerateMappingInput {
93            input_file_content: self.input_file_content,
94            output_file_content: self.output_file_content,
95            mapping_type: self.mapping_type,
96        })
97    }
98}