aws_sdk_b2bi/operation/test_parsing/
_test_parsing_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 TestParsingOutput {
6    /// <p>Returns the contents of the input file being tested, parsed according to the specified EDI (electronic data interchange) type.</p>
7    pub parsed_file_content: ::std::string::String,
8    /// <p>Returns an array of parsed file contents when the input file is split according to the specified split options. Each element in the array represents a separate split file's parsed content.</p>
9    pub parsed_split_file_contents: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
10    /// <p>Returns an array of validation messages generated during EDI validation. These messages provide detailed information about validation errors, warnings, or confirmations based on the configured X12 validation rules such as element length constraints, code list validations, and element requirement checks. This field is populated when the <code>TestParsing</code> API validates EDI documents.</p>
11    pub validation_messages: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
12    _request_id: Option<String>,
13}
14impl TestParsingOutput {
15    /// <p>Returns the contents of the input file being tested, parsed according to the specified EDI (electronic data interchange) type.</p>
16    pub fn parsed_file_content(&self) -> &str {
17        use std::ops::Deref;
18        self.parsed_file_content.deref()
19    }
20    /// <p>Returns an array of parsed file contents when the input file is split according to the specified split options. Each element in the array represents a separate split file's parsed content.</p>
21    ///
22    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.parsed_split_file_contents.is_none()`.
23    pub fn parsed_split_file_contents(&self) -> &[::std::string::String] {
24        self.parsed_split_file_contents.as_deref().unwrap_or_default()
25    }
26    /// <p>Returns an array of validation messages generated during EDI validation. These messages provide detailed information about validation errors, warnings, or confirmations based on the configured X12 validation rules such as element length constraints, code list validations, and element requirement checks. This field is populated when the <code>TestParsing</code> API validates EDI documents.</p>
27    ///
28    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.validation_messages.is_none()`.
29    pub fn validation_messages(&self) -> &[::std::string::String] {
30        self.validation_messages.as_deref().unwrap_or_default()
31    }
32}
33impl ::aws_types::request_id::RequestId for TestParsingOutput {
34    fn request_id(&self) -> Option<&str> {
35        self._request_id.as_deref()
36    }
37}
38impl TestParsingOutput {
39    /// Creates a new builder-style object to manufacture [`TestParsingOutput`](crate::operation::test_parsing::TestParsingOutput).
40    pub fn builder() -> crate::operation::test_parsing::builders::TestParsingOutputBuilder {
41        crate::operation::test_parsing::builders::TestParsingOutputBuilder::default()
42    }
43}
44
45/// A builder for [`TestParsingOutput`](crate::operation::test_parsing::TestParsingOutput).
46#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
47#[non_exhaustive]
48pub struct TestParsingOutputBuilder {
49    pub(crate) parsed_file_content: ::std::option::Option<::std::string::String>,
50    pub(crate) parsed_split_file_contents: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
51    pub(crate) validation_messages: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
52    _request_id: Option<String>,
53}
54impl TestParsingOutputBuilder {
55    /// <p>Returns the contents of the input file being tested, parsed according to the specified EDI (electronic data interchange) type.</p>
56    /// This field is required.
57    pub fn parsed_file_content(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
58        self.parsed_file_content = ::std::option::Option::Some(input.into());
59        self
60    }
61    /// <p>Returns the contents of the input file being tested, parsed according to the specified EDI (electronic data interchange) type.</p>
62    pub fn set_parsed_file_content(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
63        self.parsed_file_content = input;
64        self
65    }
66    /// <p>Returns the contents of the input file being tested, parsed according to the specified EDI (electronic data interchange) type.</p>
67    pub fn get_parsed_file_content(&self) -> &::std::option::Option<::std::string::String> {
68        &self.parsed_file_content
69    }
70    /// Appends an item to `parsed_split_file_contents`.
71    ///
72    /// To override the contents of this collection use [`set_parsed_split_file_contents`](Self::set_parsed_split_file_contents).
73    ///
74    /// <p>Returns an array of parsed file contents when the input file is split according to the specified split options. Each element in the array represents a separate split file's parsed content.</p>
75    pub fn parsed_split_file_contents(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
76        let mut v = self.parsed_split_file_contents.unwrap_or_default();
77        v.push(input.into());
78        self.parsed_split_file_contents = ::std::option::Option::Some(v);
79        self
80    }
81    /// <p>Returns an array of parsed file contents when the input file is split according to the specified split options. Each element in the array represents a separate split file's parsed content.</p>
82    pub fn set_parsed_split_file_contents(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
83        self.parsed_split_file_contents = input;
84        self
85    }
86    /// <p>Returns an array of parsed file contents when the input file is split according to the specified split options. Each element in the array represents a separate split file's parsed content.</p>
87    pub fn get_parsed_split_file_contents(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
88        &self.parsed_split_file_contents
89    }
90    /// Appends an item to `validation_messages`.
91    ///
92    /// To override the contents of this collection use [`set_validation_messages`](Self::set_validation_messages).
93    ///
94    /// <p>Returns an array of validation messages generated during EDI validation. These messages provide detailed information about validation errors, warnings, or confirmations based on the configured X12 validation rules such as element length constraints, code list validations, and element requirement checks. This field is populated when the <code>TestParsing</code> API validates EDI documents.</p>
95    pub fn validation_messages(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
96        let mut v = self.validation_messages.unwrap_or_default();
97        v.push(input.into());
98        self.validation_messages = ::std::option::Option::Some(v);
99        self
100    }
101    /// <p>Returns an array of validation messages generated during EDI validation. These messages provide detailed information about validation errors, warnings, or confirmations based on the configured X12 validation rules such as element length constraints, code list validations, and element requirement checks. This field is populated when the <code>TestParsing</code> API validates EDI documents.</p>
102    pub fn set_validation_messages(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
103        self.validation_messages = input;
104        self
105    }
106    /// <p>Returns an array of validation messages generated during EDI validation. These messages provide detailed information about validation errors, warnings, or confirmations based on the configured X12 validation rules such as element length constraints, code list validations, and element requirement checks. This field is populated when the <code>TestParsing</code> API validates EDI documents.</p>
107    pub fn get_validation_messages(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
108        &self.validation_messages
109    }
110    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
111        self._request_id = Some(request_id.into());
112        self
113    }
114
115    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
116        self._request_id = request_id;
117        self
118    }
119    /// Consumes the builder and constructs a [`TestParsingOutput`](crate::operation::test_parsing::TestParsingOutput).
120    /// This method will fail if any of the following fields are not set:
121    /// - [`parsed_file_content`](crate::operation::test_parsing::builders::TestParsingOutputBuilder::parsed_file_content)
122    pub fn build(self) -> ::std::result::Result<crate::operation::test_parsing::TestParsingOutput, ::aws_smithy_types::error::operation::BuildError> {
123        ::std::result::Result::Ok(crate::operation::test_parsing::TestParsingOutput {
124            parsed_file_content: self.parsed_file_content.ok_or_else(|| {
125                ::aws_smithy_types::error::operation::BuildError::missing_field(
126                    "parsed_file_content",
127                    "parsed_file_content was not specified but it is required when building TestParsingOutput",
128                )
129            })?,
130            parsed_split_file_contents: self.parsed_split_file_contents,
131            validation_messages: self.validation_messages,
132            _request_id: self._request_id,
133        })
134    }
135}