aws_sdk_resourcegroups/operation/group_resources/
_group_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 GroupResourcesOutput {
6    /// <p>A list of Amazon resource names (ARNs) of the resources that this operation successfully added to the group.</p>
7    pub succeeded: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
8    /// <p>A list of Amazon resource names (ARNs) of any resources that this operation failed to add to the group.</p>
9    pub failed: ::std::option::Option<::std::vec::Vec<crate::types::FailedResource>>,
10    /// <p>A list of Amazon resource names (ARNs) of any resources that this operation is still in the process adding to the group. These pending additions continue asynchronously. You can check the status of pending additions by using the <code> <code>ListGroupResources</code> </code> operation, and checking the <code>Resources</code> array in the response and the <code>Status</code> field of each object in that array.</p>
11    pub pending: ::std::option::Option<::std::vec::Vec<crate::types::PendingResource>>,
12    _request_id: Option<String>,
13}
14impl GroupResourcesOutput {
15    /// <p>A list of Amazon resource names (ARNs) of the resources that this operation successfully added to the group.</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 Amazon resource names (ARNs) of any resources that this operation failed to add to the group.</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 Amazon resource names (ARNs) of any resources that this operation is still in the process adding to the group. These pending additions continue asynchronously. You can check the status of pending additions by using the <code> <code>ListGroupResources</code> </code> operation, and checking the <code>Resources</code> array in the response and the <code>Status</code> field of each object in that array.</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 GroupResourcesOutput {
35    fn request_id(&self) -> Option<&str> {
36        self._request_id.as_deref()
37    }
38}
39impl GroupResourcesOutput {
40    /// Creates a new builder-style object to manufacture [`GroupResourcesOutput`](crate::operation::group_resources::GroupResourcesOutput).
41    pub fn builder() -> crate::operation::group_resources::builders::GroupResourcesOutputBuilder {
42        crate::operation::group_resources::builders::GroupResourcesOutputBuilder::default()
43    }
44}
45
46/// A builder for [`GroupResourcesOutput`](crate::operation::group_resources::GroupResourcesOutput).
47#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
48#[non_exhaustive]
49pub struct GroupResourcesOutputBuilder {
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 GroupResourcesOutputBuilder {
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 Amazon resource names (ARNs) of the resources that this operation successfully added to the group.</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 Amazon resource names (ARNs) of the resources that this operation successfully added to the group.</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 Amazon resource names (ARNs) of the resources that this operation successfully added to the group.</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 Amazon resource names (ARNs) of any resources that this operation failed to add to the group.</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 Amazon resource names (ARNs) of any resources that this operation failed to add to the group.</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 Amazon resource names (ARNs) of any resources that this operation failed to add to the group.</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 Amazon resource names (ARNs) of any resources that this operation is still in the process adding to the group. These pending additions continue asynchronously. You can check the status of pending additions by using the <code> <code>ListGroupResources</code> </code> operation, and checking the <code>Resources</code> array in the response and the <code>Status</code> field of each object in that array.</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 Amazon resource names (ARNs) of any resources that this operation is still in the process adding to the group. These pending additions continue asynchronously. You can check the status of pending additions by using the <code> <code>ListGroupResources</code> </code> operation, and checking the <code>Resources</code> array in the response and the <code>Status</code> field of each object in that array.</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 Amazon resource names (ARNs) of any resources that this operation is still in the process adding to the group. These pending additions continue asynchronously. You can check the status of pending additions by using the <code> <code>ListGroupResources</code> </code> operation, and checking the <code>Resources</code> array in the response and the <code>Status</code> field of each object in that array.</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 [`GroupResourcesOutput`](crate::operation::group_resources::GroupResourcesOutput).
126    pub fn build(self) -> crate::operation::group_resources::GroupResourcesOutput {
127        crate::operation::group_resources::GroupResourcesOutput {
128            succeeded: self.succeeded,
129            failed: self.failed,
130            pending: self.pending,
131            _request_id: self._request_id,
132        }
133    }
134}