aws_sdk_applicationinsights/operation/describe_component/
_describe_component_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 DescribeComponentOutput {
6    /// <p>Describes a standalone resource or similarly grouped resources that the application is made up of.</p>
7    pub application_component: ::std::option::Option<crate::types::ApplicationComponent>,
8    /// <p>The list of resource ARNs that belong to the component.</p>
9    pub resource_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
10    _request_id: Option<String>,
11}
12impl DescribeComponentOutput {
13    /// <p>Describes a standalone resource or similarly grouped resources that the application is made up of.</p>
14    pub fn application_component(&self) -> ::std::option::Option<&crate::types::ApplicationComponent> {
15        self.application_component.as_ref()
16    }
17    /// <p>The list of resource ARNs that belong to the component.</p>
18    ///
19    /// 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()`.
20    pub fn resource_list(&self) -> &[::std::string::String] {
21        self.resource_list.as_deref().unwrap_or_default()
22    }
23}
24impl ::aws_types::request_id::RequestId for DescribeComponentOutput {
25    fn request_id(&self) -> Option<&str> {
26        self._request_id.as_deref()
27    }
28}
29impl DescribeComponentOutput {
30    /// Creates a new builder-style object to manufacture [`DescribeComponentOutput`](crate::operation::describe_component::DescribeComponentOutput).
31    pub fn builder() -> crate::operation::describe_component::builders::DescribeComponentOutputBuilder {
32        crate::operation::describe_component::builders::DescribeComponentOutputBuilder::default()
33    }
34}
35
36/// A builder for [`DescribeComponentOutput`](crate::operation::describe_component::DescribeComponentOutput).
37#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
38#[non_exhaustive]
39pub struct DescribeComponentOutputBuilder {
40    pub(crate) application_component: ::std::option::Option<crate::types::ApplicationComponent>,
41    pub(crate) resource_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
42    _request_id: Option<String>,
43}
44impl DescribeComponentOutputBuilder {
45    /// <p>Describes a standalone resource or similarly grouped resources that the application is made up of.</p>
46    pub fn application_component(mut self, input: crate::types::ApplicationComponent) -> Self {
47        self.application_component = ::std::option::Option::Some(input);
48        self
49    }
50    /// <p>Describes a standalone resource or similarly grouped resources that the application is made up of.</p>
51    pub fn set_application_component(mut self, input: ::std::option::Option<crate::types::ApplicationComponent>) -> Self {
52        self.application_component = input;
53        self
54    }
55    /// <p>Describes a standalone resource or similarly grouped resources that the application is made up of.</p>
56    pub fn get_application_component(&self) -> &::std::option::Option<crate::types::ApplicationComponent> {
57        &self.application_component
58    }
59    /// Appends an item to `resource_list`.
60    ///
61    /// To override the contents of this collection use [`set_resource_list`](Self::set_resource_list).
62    ///
63    /// <p>The list of resource ARNs that belong to the component.</p>
64    pub fn resource_list(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
65        let mut v = self.resource_list.unwrap_or_default();
66        v.push(input.into());
67        self.resource_list = ::std::option::Option::Some(v);
68        self
69    }
70    /// <p>The list of resource ARNs that belong to the component.</p>
71    pub fn set_resource_list(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
72        self.resource_list = input;
73        self
74    }
75    /// <p>The list of resource ARNs that belong to the component.</p>
76    pub fn get_resource_list(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
77        &self.resource_list
78    }
79    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
80        self._request_id = Some(request_id.into());
81        self
82    }
83
84    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
85        self._request_id = request_id;
86        self
87    }
88    /// Consumes the builder and constructs a [`DescribeComponentOutput`](crate::operation::describe_component::DescribeComponentOutput).
89    pub fn build(self) -> crate::operation::describe_component::DescribeComponentOutput {
90        crate::operation::describe_component::DescribeComponentOutput {
91            application_component: self.application_component,
92            resource_list: self.resource_list,
93            _request_id: self._request_id,
94        }
95    }
96}