aws_sdk_applicationinsights/operation/update_component/
_update_component_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 UpdateComponentInput {
6    /// <p>The name of the resource group.</p>
7    pub resource_group_name: ::std::option::Option<::std::string::String>,
8    /// <p>The name of the component.</p>
9    pub component_name: ::std::option::Option<::std::string::String>,
10    /// <p>The new name of the component.</p>
11    pub new_component_name: ::std::option::Option<::std::string::String>,
12    /// <p>The list of resource ARNs that belong to the component.</p>
13    pub resource_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
14}
15impl UpdateComponentInput {
16    /// <p>The name of the resource group.</p>
17    pub fn resource_group_name(&self) -> ::std::option::Option<&str> {
18        self.resource_group_name.as_deref()
19    }
20    /// <p>The name of the component.</p>
21    pub fn component_name(&self) -> ::std::option::Option<&str> {
22        self.component_name.as_deref()
23    }
24    /// <p>The new name of the component.</p>
25    pub fn new_component_name(&self) -> ::std::option::Option<&str> {
26        self.new_component_name.as_deref()
27    }
28    /// <p>The list of resource ARNs that belong to the component.</p>
29    ///
30    /// 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_list.is_none()`.
31    pub fn resource_list(&self) -> &[::std::string::String] {
32        self.resource_list.as_deref().unwrap_or_default()
33    }
34}
35impl UpdateComponentInput {
36    /// Creates a new builder-style object to manufacture [`UpdateComponentInput`](crate::operation::update_component::UpdateComponentInput).
37    pub fn builder() -> crate::operation::update_component::builders::UpdateComponentInputBuilder {
38        crate::operation::update_component::builders::UpdateComponentInputBuilder::default()
39    }
40}
41
42/// A builder for [`UpdateComponentInput`](crate::operation::update_component::UpdateComponentInput).
43#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
44#[non_exhaustive]
45pub struct UpdateComponentInputBuilder {
46    pub(crate) resource_group_name: ::std::option::Option<::std::string::String>,
47    pub(crate) component_name: ::std::option::Option<::std::string::String>,
48    pub(crate) new_component_name: ::std::option::Option<::std::string::String>,
49    pub(crate) resource_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
50}
51impl UpdateComponentInputBuilder {
52    /// <p>The name of the resource group.</p>
53    /// This field is required.
54    pub fn resource_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
55        self.resource_group_name = ::std::option::Option::Some(input.into());
56        self
57    }
58    /// <p>The name of the resource group.</p>
59    pub fn set_resource_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
60        self.resource_group_name = input;
61        self
62    }
63    /// <p>The name of the resource group.</p>
64    pub fn get_resource_group_name(&self) -> &::std::option::Option<::std::string::String> {
65        &self.resource_group_name
66    }
67    /// <p>The name of the component.</p>
68    /// This field is required.
69    pub fn component_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
70        self.component_name = ::std::option::Option::Some(input.into());
71        self
72    }
73    /// <p>The name of the component.</p>
74    pub fn set_component_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
75        self.component_name = input;
76        self
77    }
78    /// <p>The name of the component.</p>
79    pub fn get_component_name(&self) -> &::std::option::Option<::std::string::String> {
80        &self.component_name
81    }
82    /// <p>The new name of the component.</p>
83    pub fn new_component_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
84        self.new_component_name = ::std::option::Option::Some(input.into());
85        self
86    }
87    /// <p>The new name of the component.</p>
88    pub fn set_new_component_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
89        self.new_component_name = input;
90        self
91    }
92    /// <p>The new name of the component.</p>
93    pub fn get_new_component_name(&self) -> &::std::option::Option<::std::string::String> {
94        &self.new_component_name
95    }
96    /// Appends an item to `resource_list`.
97    ///
98    /// To override the contents of this collection use [`set_resource_list`](Self::set_resource_list).
99    ///
100    /// <p>The list of resource ARNs that belong to the component.</p>
101    pub fn resource_list(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
102        let mut v = self.resource_list.unwrap_or_default();
103        v.push(input.into());
104        self.resource_list = ::std::option::Option::Some(v);
105        self
106    }
107    /// <p>The list of resource ARNs that belong to the component.</p>
108    pub fn set_resource_list(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
109        self.resource_list = input;
110        self
111    }
112    /// <p>The list of resource ARNs that belong to the component.</p>
113    pub fn get_resource_list(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
114        &self.resource_list
115    }
116    /// Consumes the builder and constructs a [`UpdateComponentInput`](crate::operation::update_component::UpdateComponentInput).
117    pub fn build(
118        self,
119    ) -> ::std::result::Result<crate::operation::update_component::UpdateComponentInput, ::aws_smithy_types::error::operation::BuildError> {
120        ::std::result::Result::Ok(crate::operation::update_component::UpdateComponentInput {
121            resource_group_name: self.resource_group_name,
122            component_name: self.component_name,
123            new_component_name: self.new_component_name,
124            resource_list: self.resource_list,
125        })
126    }
127}