aws_sdk_computeoptimizerautomation/operation/disassociate_accounts/
_disassociate_accounts_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 DisassociateAccountsOutput {
6    /// <p>The IDs of the member accounts that were successfully disassociated.</p>
7    pub account_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
8    /// <p>Any errors that occurred during the disassociation process.</p>
9    pub errors: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
10    _request_id: Option<String>,
11}
12impl DisassociateAccountsOutput {
13    /// <p>The IDs of the member accounts that were successfully disassociated.</p>
14    ///
15    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.account_ids.is_none()`.
16    pub fn account_ids(&self) -> &[::std::string::String] {
17        self.account_ids.as_deref().unwrap_or_default()
18    }
19    /// <p>Any errors that occurred during the disassociation 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 `.errors.is_none()`.
22    pub fn errors(&self) -> &[::std::string::String] {
23        self.errors.as_deref().unwrap_or_default()
24    }
25}
26impl ::aws_types::request_id::RequestId for DisassociateAccountsOutput {
27    fn request_id(&self) -> Option<&str> {
28        self._request_id.as_deref()
29    }
30}
31impl DisassociateAccountsOutput {
32    /// Creates a new builder-style object to manufacture [`DisassociateAccountsOutput`](crate::operation::disassociate_accounts::DisassociateAccountsOutput).
33    pub fn builder() -> crate::operation::disassociate_accounts::builders::DisassociateAccountsOutputBuilder {
34        crate::operation::disassociate_accounts::builders::DisassociateAccountsOutputBuilder::default()
35    }
36}
37
38/// A builder for [`DisassociateAccountsOutput`](crate::operation::disassociate_accounts::DisassociateAccountsOutput).
39#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
40#[non_exhaustive]
41pub struct DisassociateAccountsOutputBuilder {
42    pub(crate) account_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
43    pub(crate) errors: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
44    _request_id: Option<String>,
45}
46impl DisassociateAccountsOutputBuilder {
47    /// Appends an item to `account_ids`.
48    ///
49    /// To override the contents of this collection use [`set_account_ids`](Self::set_account_ids).
50    ///
51    /// <p>The IDs of the member accounts that were successfully disassociated.</p>
52    pub fn account_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53        let mut v = self.account_ids.unwrap_or_default();
54        v.push(input.into());
55        self.account_ids = ::std::option::Option::Some(v);
56        self
57    }
58    /// <p>The IDs of the member accounts that were successfully disassociated.</p>
59    pub fn set_account_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
60        self.account_ids = input;
61        self
62    }
63    /// <p>The IDs of the member accounts that were successfully disassociated.</p>
64    pub fn get_account_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
65        &self.account_ids
66    }
67    /// Appends an item to `errors`.
68    ///
69    /// To override the contents of this collection use [`set_errors`](Self::set_errors).
70    ///
71    /// <p>Any errors that occurred during the disassociation process.</p>
72    pub fn errors(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
73        let mut v = self.errors.unwrap_or_default();
74        v.push(input.into());
75        self.errors = ::std::option::Option::Some(v);
76        self
77    }
78    /// <p>Any errors that occurred during the disassociation process.</p>
79    pub fn set_errors(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
80        self.errors = input;
81        self
82    }
83    /// <p>Any errors that occurred during the disassociation process.</p>
84    pub fn get_errors(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
85        &self.errors
86    }
87    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
88        self._request_id = Some(request_id.into());
89        self
90    }
91
92    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
93        self._request_id = request_id;
94        self
95    }
96    /// Consumes the builder and constructs a [`DisassociateAccountsOutput`](crate::operation::disassociate_accounts::DisassociateAccountsOutput).
97    pub fn build(self) -> crate::operation::disassociate_accounts::DisassociateAccountsOutput {
98        crate::operation::disassociate_accounts::DisassociateAccountsOutput {
99            account_ids: self.account_ids,
100            errors: self.errors,
101            _request_id: self._request_id,
102        }
103    }
104}