aws_sdk_resourcegroups/operation/ungroup_resources/
_ungroup_resources_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 UngroupResourcesOutput {
6    /// <p>A list of resources that were successfully removed from the group by this operation.</p>
7    pub succeeded: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
8    /// <p>A list of any resources that failed to be removed from the group by this operation.</p>
9    pub failed: ::std::option::Option<::std::vec::Vec<crate::types::FailedResource>>,
10    /// <p>A list of any resources that are still in the process of being removed from the group by this operation. These pending removals continue asynchronously. You can check the status of pending removals by using the <code> <code>ListGroupResources</code> </code> operation. After the resource is successfully removed, it no longer appears in the response.</p>
11    pub pending: ::std::option::Option<::std::vec::Vec<crate::types::PendingResource>>,
12    _request_id: Option<String>,
13}
14impl UngroupResourcesOutput {
15    /// <p>A list of resources that were successfully removed from the group by this operation.</p>
16    ///
17    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.succeeded.is_none()`.
18    pub fn succeeded(&self) -> &[::std::string::String] {
19        self.succeeded.as_deref().unwrap_or_default()
20    }
21    /// <p>A list of any resources that failed to be removed from the group by this operation.</p>
22    ///
23    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.failed.is_none()`.
24    pub fn failed(&self) -> &[crate::types::FailedResource] {
25        self.failed.as_deref().unwrap_or_default()
26    }
27    /// <p>A list of any resources that are still in the process of being removed from the group by this operation. These pending removals continue asynchronously. You can check the status of pending removals by using the <code> <code>ListGroupResources</code> </code> operation. After the resource is successfully removed, it no longer appears in the response.</p>
28    ///
29    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.pending.is_none()`.
30    pub fn pending(&self) -> &[crate::types::PendingResource] {
31        self.pending.as_deref().unwrap_or_default()
32    }
33}
34impl ::aws_types::request_id::RequestId for UngroupResourcesOutput {
35    fn request_id(&self) -> Option<&str> {
36        self._request_id.as_deref()
37    }
38}
39impl UngroupResourcesOutput {
40    /// Creates a new builder-style object to manufacture [`UngroupResourcesOutput`](crate::operation::ungroup_resources::UngroupResourcesOutput).
41    pub fn builder() -> crate::operation::ungroup_resources::builders::UngroupResourcesOutputBuilder {
42        crate::operation::ungroup_resources::builders::UngroupResourcesOutputBuilder::default()
43    }
44}
45
46/// A builder for [`UngroupResourcesOutput`](crate::operation::ungroup_resources::UngroupResourcesOutput).
47#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
48#[non_exhaustive]
49pub struct UngroupResourcesOutputBuilder {
50    pub(crate) succeeded: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
51    pub(crate) failed: ::std::option::Option<::std::vec::Vec<crate::types::FailedResource>>,
52    pub(crate) pending: ::std::option::Option<::std::vec::Vec<crate::types::PendingResource>>,
53    _request_id: Option<String>,
54}
55impl UngroupResourcesOutputBuilder {
56    /// Appends an item to `succeeded`.
57    ///
58    /// To override the contents of this collection use [`set_succeeded`](Self::set_succeeded).
59    ///
60    /// <p>A list of resources that were successfully removed from the group by this operation.</p>
61    pub fn succeeded(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62        let mut v = self.succeeded.unwrap_or_default();
63        v.push(input.into());
64        self.succeeded = ::std::option::Option::Some(v);
65        self
66    }
67    /// <p>A list of resources that were successfully removed from the group by this operation.</p>
68    pub fn set_succeeded(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
69        self.succeeded = input;
70        self
71    }
72    /// <p>A list of resources that were successfully removed from the group by this operation.</p>
73    pub fn get_succeeded(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
74        &self.succeeded
75    }
76    /// Appends an item to `failed`.
77    ///
78    /// To override the contents of this collection use [`set_failed`](Self::set_failed).
79    ///
80    /// <p>A list of any resources that failed to be removed from the group by this operation.</p>
81    pub fn failed(mut self, input: crate::types::FailedResource) -> Self {
82        let mut v = self.failed.unwrap_or_default();
83        v.push(input);
84        self.failed = ::std::option::Option::Some(v);
85        self
86    }
87    /// <p>A list of any resources that failed to be removed from the group by this operation.</p>
88    pub fn set_failed(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::FailedResource>>) -> Self {
89        self.failed = input;
90        self
91    }
92    /// <p>A list of any resources that failed to be removed from the group by this operation.</p>
93    pub fn get_failed(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::FailedResource>> {
94        &self.failed
95    }
96    /// Appends an item to `pending`.
97    ///
98    /// To override the contents of this collection use [`set_pending`](Self::set_pending).
99    ///
100    /// <p>A list of any resources that are still in the process of being removed from the group by this operation. These pending removals continue asynchronously. You can check the status of pending removals by using the <code> <code>ListGroupResources</code> </code> operation. After the resource is successfully removed, it no longer appears in the response.</p>
101    pub fn pending(mut self, input: crate::types::PendingResource) -> Self {
102        let mut v = self.pending.unwrap_or_default();
103        v.push(input);
104        self.pending = ::std::option::Option::Some(v);
105        self
106    }
107    /// <p>A list of any resources that are still in the process of being removed from the group by this operation. These pending removals continue asynchronously. You can check the status of pending removals by using the <code> <code>ListGroupResources</code> </code> operation. After the resource is successfully removed, it no longer appears in the response.</p>
108    pub fn set_pending(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PendingResource>>) -> Self {
109        self.pending = input;
110        self
111    }
112    /// <p>A list of any resources that are still in the process of being removed from the group by this operation. These pending removals continue asynchronously. You can check the status of pending removals by using the <code> <code>ListGroupResources</code> </code> operation. After the resource is successfully removed, it no longer appears in the response.</p>
113    pub fn get_pending(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PendingResource>> {
114        &self.pending
115    }
116    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
117        self._request_id = Some(request_id.into());
118        self
119    }
120
121    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
122        self._request_id = request_id;
123        self
124    }
125    /// Consumes the builder and constructs a [`UngroupResourcesOutput`](crate::operation::ungroup_resources::UngroupResourcesOutput).
126    pub fn build(self) -> crate::operation::ungroup_resources::UngroupResourcesOutput {
127        crate::operation::ungroup_resources::UngroupResourcesOutput {
128            succeeded: self.succeeded,
129            failed: self.failed,
130            pending: self.pending,
131            _request_id: self._request_id,
132        }
133    }
134}