aws_sdk_resourcegroups/operation/group_resources/
_group_resources_input.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 GroupResourcesInput {
6    /// <p>The name or the Amazon resource name (ARN) of the resource group to add resources to.</p>
7    pub group: ::std::option::Option<::std::string::String>,
8    /// <p>The list of Amazon resource names (ARNs) of the resources to be added to the group.</p>
9    pub resource_arns: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
10}
11impl GroupResourcesInput {
12    /// <p>The name or the Amazon resource name (ARN) of the resource group to add resources to.</p>
13    pub fn group(&self) -> ::std::option::Option<&str> {
14        self.group.as_deref()
15    }
16    /// <p>The list of Amazon resource names (ARNs) of the resources to be added to the group.</p>
17    ///
18    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.resource_arns.is_none()`.
19    pub fn resource_arns(&self) -> &[::std::string::String] {
20        self.resource_arns.as_deref().unwrap_or_default()
21    }
22}
23impl GroupResourcesInput {
24    /// Creates a new builder-style object to manufacture [`GroupResourcesInput`](crate::operation::group_resources::GroupResourcesInput).
25    pub fn builder() -> crate::operation::group_resources::builders::GroupResourcesInputBuilder {
26        crate::operation::group_resources::builders::GroupResourcesInputBuilder::default()
27    }
28}
29
30/// A builder for [`GroupResourcesInput`](crate::operation::group_resources::GroupResourcesInput).
31#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
32#[non_exhaustive]
33pub struct GroupResourcesInputBuilder {
34    pub(crate) group: ::std::option::Option<::std::string::String>,
35    pub(crate) resource_arns: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
36}
37impl GroupResourcesInputBuilder {
38    /// <p>The name or the Amazon resource name (ARN) of the resource group to add resources to.</p>
39    /// This field is required.
40    pub fn group(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
41        self.group = ::std::option::Option::Some(input.into());
42        self
43    }
44    /// <p>The name or the Amazon resource name (ARN) of the resource group to add resources to.</p>
45    pub fn set_group(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
46        self.group = input;
47        self
48    }
49    /// <p>The name or the Amazon resource name (ARN) of the resource group to add resources to.</p>
50    pub fn get_group(&self) -> &::std::option::Option<::std::string::String> {
51        &self.group
52    }
53    /// Appends an item to `resource_arns`.
54    ///
55    /// To override the contents of this collection use [`set_resource_arns`](Self::set_resource_arns).
56    ///
57    /// <p>The list of Amazon resource names (ARNs) of the resources to be added to the group.</p>
58    pub fn resource_arns(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
59        let mut v = self.resource_arns.unwrap_or_default();
60        v.push(input.into());
61        self.resource_arns = ::std::option::Option::Some(v);
62        self
63    }
64    /// <p>The list of Amazon resource names (ARNs) of the resources to be added to the group.</p>
65    pub fn set_resource_arns(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
66        self.resource_arns = input;
67        self
68    }
69    /// <p>The list of Amazon resource names (ARNs) of the resources to be added to the group.</p>
70    pub fn get_resource_arns(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
71        &self.resource_arns
72    }
73    /// Consumes the builder and constructs a [`GroupResourcesInput`](crate::operation::group_resources::GroupResourcesInput).
74    pub fn build(
75        self,
76    ) -> ::std::result::Result<crate::operation::group_resources::GroupResourcesInput, ::aws_smithy_types::error::operation::BuildError> {
77        ::std::result::Result::Ok(crate::operation::group_resources::GroupResourcesInput {
78            group: self.group,
79            resource_arns: self.resource_arns,
80        })
81    }
82}