1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
23/// <p>The <code>TestRoleResponse</code> structure.</p>
4#[deprecated]
5#[non_exhaustive]
6#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
7pub struct TestRoleOutput {
8/// <p>If the operation is successful, this value is <code>true</code>; otherwise, the value is <code>false</code>.</p>
9pub success: ::std::option::Option<::std::string::String>,
10/// <p>If the <code>Success</code> element contains <code>false</code>, this value is an array of one or more error messages that were generated during the test process.</p>
11pub messages: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
12 _request_id: Option<String>,
13}
14impl TestRoleOutput {
15/// <p>If the operation is successful, this value is <code>true</code>; otherwise, the value is <code>false</code>.</p>
16pub fn success(&self) -> ::std::option::Option<&str> {
17self.success.as_deref()
18 }
19/// <p>If the <code>Success</code> element contains <code>false</code>, this value is an array of one or more error messages that were generated during the test process.</p>
20 ///
21 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.messages.is_none()`.
22pub fn messages(&self) -> &[::std::string::String] {
23self.messages.as_deref().unwrap_or_default()
24 }
25}
26impl ::aws_types::request_id::RequestId for TestRoleOutput {
27fn request_id(&self) -> Option<&str> {
28self._request_id.as_deref()
29 }
30}
31impl TestRoleOutput {
32/// Creates a new builder-style object to manufacture [`TestRoleOutput`](crate::operation::test_role::TestRoleOutput).
33pub fn builder() -> crate::operation::test_role::builders::TestRoleOutputBuilder {
34crate::operation::test_role::builders::TestRoleOutputBuilder::default()
35 }
36}
3738/// A builder for [`TestRoleOutput`](crate::operation::test_role::TestRoleOutput).
39#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
40#[non_exhaustive]
41pub struct TestRoleOutputBuilder {
42pub(crate) success: ::std::option::Option<::std::string::String>,
43pub(crate) messages: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
44 _request_id: Option<String>,
45}
46impl TestRoleOutputBuilder {
47/// <p>If the operation is successful, this value is <code>true</code>; otherwise, the value is <code>false</code>.</p>
48pub fn success(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
49self.success = ::std::option::Option::Some(input.into());
50self
51}
52/// <p>If the operation is successful, this value is <code>true</code>; otherwise, the value is <code>false</code>.</p>
53pub fn set_success(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
54self.success = input;
55self
56}
57/// <p>If the operation is successful, this value is <code>true</code>; otherwise, the value is <code>false</code>.</p>
58pub fn get_success(&self) -> &::std::option::Option<::std::string::String> {
59&self.success
60 }
61/// Appends an item to `messages`.
62 ///
63 /// To override the contents of this collection use [`set_messages`](Self::set_messages).
64 ///
65 /// <p>If the <code>Success</code> element contains <code>false</code>, this value is an array of one or more error messages that were generated during the test process.</p>
66pub fn messages(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67let mut v = self.messages.unwrap_or_default();
68 v.push(input.into());
69self.messages = ::std::option::Option::Some(v);
70self
71}
72/// <p>If the <code>Success</code> element contains <code>false</code>, this value is an array of one or more error messages that were generated during the test process.</p>
73pub fn set_messages(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
74self.messages = input;
75self
76}
77/// <p>If the <code>Success</code> element contains <code>false</code>, this value is an array of one or more error messages that were generated during the test process.</p>
78pub fn get_messages(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
79&self.messages
80 }
81pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
82self._request_id = Some(request_id.into());
83self
84}
8586pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
87self._request_id = request_id;
88self
89}
90/// Consumes the builder and constructs a [`TestRoleOutput`](crate::operation::test_role::TestRoleOutput).
91pub fn build(self) -> crate::operation::test_role::TestRoleOutput {
92crate::operation::test_role::TestRoleOutput {
93 success: self.success,
94 messages: self.messages,
95 _request_id: self._request_id,
96 }
97 }
98}