aws_sdk_b2bi/operation/test_conversion/_test_conversion_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 TestConversionOutput {
6 /// <p>Returns the converted file content.</p>
7 pub converted_file_content: ::std::string::String,
8 /// <p>Returns an array of validation messages that Amazon Web Services B2B Data Interchange generates during the conversion process. These messages include both standard EDI validation results and custom validation messages when custom validation rules are configured. Custom validation messages provide detailed feedback on element length constraints, code list validations, and element requirement checks applied during the outbound EDI generation process.</p>
9 pub validation_messages: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
10 _request_id: Option<String>,
11}
12impl TestConversionOutput {
13 /// <p>Returns the converted file content.</p>
14 pub fn converted_file_content(&self) -> &str {
15 use std::ops::Deref;
16 self.converted_file_content.deref()
17 }
18 /// <p>Returns an array of validation messages that Amazon Web Services B2B Data Interchange generates during the conversion process. These messages include both standard EDI validation results and custom validation messages when custom validation rules are configured. Custom validation messages provide detailed feedback on element length constraints, code list validations, and element requirement checks applied during the outbound EDI generation process.</p>
19 ///
20 /// 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()`.
21 pub fn validation_messages(&self) -> &[::std::string::String] {
22 self.validation_messages.as_deref().unwrap_or_default()
23 }
24}
25impl ::aws_types::request_id::RequestId for TestConversionOutput {
26 fn request_id(&self) -> Option<&str> {
27 self._request_id.as_deref()
28 }
29}
30impl TestConversionOutput {
31 /// Creates a new builder-style object to manufacture [`TestConversionOutput`](crate::operation::test_conversion::TestConversionOutput).
32 pub fn builder() -> crate::operation::test_conversion::builders::TestConversionOutputBuilder {
33 crate::operation::test_conversion::builders::TestConversionOutputBuilder::default()
34 }
35}
36
37/// A builder for [`TestConversionOutput`](crate::operation::test_conversion::TestConversionOutput).
38#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
39#[non_exhaustive]
40pub struct TestConversionOutputBuilder {
41 pub(crate) converted_file_content: ::std::option::Option<::std::string::String>,
42 pub(crate) validation_messages: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
43 _request_id: Option<String>,
44}
45impl TestConversionOutputBuilder {
46 /// <p>Returns the converted file content.</p>
47 /// This field is required.
48 pub fn converted_file_content(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
49 self.converted_file_content = ::std::option::Option::Some(input.into());
50 self
51 }
52 /// <p>Returns the converted file content.</p>
53 pub fn set_converted_file_content(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
54 self.converted_file_content = input;
55 self
56 }
57 /// <p>Returns the converted file content.</p>
58 pub fn get_converted_file_content(&self) -> &::std::option::Option<::std::string::String> {
59 &self.converted_file_content
60 }
61 /// Appends an item to `validation_messages`.
62 ///
63 /// To override the contents of this collection use [`set_validation_messages`](Self::set_validation_messages).
64 ///
65 /// <p>Returns an array of validation messages that Amazon Web Services B2B Data Interchange generates during the conversion process. These messages include both standard EDI validation results and custom validation messages when custom validation rules are configured. Custom validation messages provide detailed feedback on element length constraints, code list validations, and element requirement checks applied during the outbound EDI generation process.</p>
66 pub fn validation_messages(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67 let mut v = self.validation_messages.unwrap_or_default();
68 v.push(input.into());
69 self.validation_messages = ::std::option::Option::Some(v);
70 self
71 }
72 /// <p>Returns an array of validation messages that Amazon Web Services B2B Data Interchange generates during the conversion process. These messages include both standard EDI validation results and custom validation messages when custom validation rules are configured. Custom validation messages provide detailed feedback on element length constraints, code list validations, and element requirement checks applied during the outbound EDI generation process.</p>
73 pub fn set_validation_messages(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
74 self.validation_messages = input;
75 self
76 }
77 /// <p>Returns an array of validation messages that Amazon Web Services B2B Data Interchange generates during the conversion process. These messages include both standard EDI validation results and custom validation messages when custom validation rules are configured. Custom validation messages provide detailed feedback on element length constraints, code list validations, and element requirement checks applied during the outbound EDI generation process.</p>
78 pub fn get_validation_messages(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
79 &self.validation_messages
80 }
81 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
82 self._request_id = Some(request_id.into());
83 self
84 }
85
86 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
87 self._request_id = request_id;
88 self
89 }
90 /// Consumes the builder and constructs a [`TestConversionOutput`](crate::operation::test_conversion::TestConversionOutput).
91 /// This method will fail if any of the following fields are not set:
92 /// - [`converted_file_content`](crate::operation::test_conversion::builders::TestConversionOutputBuilder::converted_file_content)
93 pub fn build(
94 self,
95 ) -> ::std::result::Result<crate::operation::test_conversion::TestConversionOutput, ::aws_smithy_types::error::operation::BuildError> {
96 ::std::result::Result::Ok(crate::operation::test_conversion::TestConversionOutput {
97 converted_file_content: self.converted_file_content.ok_or_else(|| {
98 ::aws_smithy_types::error::operation::BuildError::missing_field(
99 "converted_file_content",
100 "converted_file_content was not specified but it is required when building TestConversionOutput",
101 )
102 })?,
103 validation_messages: self.validation_messages,
104 _request_id: self._request_id,
105 })
106 }
107}