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