aws_sdk_elastictranscoder/operation/test_role/
_test_role_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <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>
9    pub 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>
11    pub 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>
16    pub fn success(&self) -> ::std::option::Option<&str> {
17        self.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()`.
22    pub fn messages(&self) -> &[::std::string::String] {
23        self.messages.as_deref().unwrap_or_default()
24    }
25}
26impl ::aws_types::request_id::RequestId for TestRoleOutput {
27    fn request_id(&self) -> Option<&str> {
28        self._request_id.as_deref()
29    }
30}
31impl TestRoleOutput {
32    /// Creates a new builder-style object to manufacture [`TestRoleOutput`](crate::operation::test_role::TestRoleOutput).
33    pub fn builder() -> crate::operation::test_role::builders::TestRoleOutputBuilder {
34        crate::operation::test_role::builders::TestRoleOutputBuilder::default()
35    }
36}
37
38/// 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 {
42    pub(crate) success: ::std::option::Option<::std::string::String>,
43    pub(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>
48    pub fn success(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
49        self.success = ::std::option::Option::Some(input.into());
50        self
51    }
52    /// <p>If the operation is successful, this value is <code>true</code>; otherwise, the value is <code>false</code>.</p>
53    pub fn set_success(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
54        self.success = input;
55        self
56    }
57    /// <p>If the operation is successful, this value is <code>true</code>; otherwise, the value is <code>false</code>.</p>
58    pub 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>
66    pub fn messages(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67        let mut v = self.messages.unwrap_or_default();
68        v.push(input.into());
69        self.messages = ::std::option::Option::Some(v);
70        self
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>
73    pub fn set_messages(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
74        self.messages = input;
75        self
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>
78    pub fn get_messages(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
79        &self.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 [`TestRoleOutput`](crate::operation::test_role::TestRoleOutput).
91    pub fn build(self) -> crate::operation::test_role::TestRoleOutput {
92        crate::operation::test_role::TestRoleOutput {
93            success: self.success,
94            messages: self.messages,
95            _request_id: self._request_id,
96        }
97    }
98}