aws_sdk_applicationinsights/types/
_application_component.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Describes a standalone resource or similarly grouped resources that the application is made up of.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct ApplicationComponent {
7    /// <p>The name of the component.</p>
8    pub component_name: ::std::option::Option<::std::string::String>,
9    /// <p>If logging is supported for the resource type, indicates whether the component has configured logs to be monitored.</p>
10    pub component_remarks: ::std::option::Option<::std::string::String>,
11    /// <p>The resource type. Supported resource types include EC2 instances, Auto Scaling group, Classic ELB, Application ELB, and SQS Queue.</p>
12    pub resource_type: ::std::option::Option<::std::string::String>,
13    /// <p>The operating system of the component.</p>
14    pub os_type: ::std::option::Option<crate::types::OsType>,
15    /// <p>The stack tier of the application component.</p>
16    pub tier: ::std::option::Option<crate::types::Tier>,
17    /// <p>Indicates whether the application component is monitored.</p>
18    pub monitor: ::std::option::Option<bool>,
19    /// <p>Workloads detected in the application component.</p>
20    pub detected_workload: ::std::option::Option<
21        ::std::collections::HashMap<crate::types::Tier, ::std::collections::HashMap<::std::string::String, ::std::string::String>>,
22    >,
23}
24impl ApplicationComponent {
25    /// <p>The name of the component.</p>
26    pub fn component_name(&self) -> ::std::option::Option<&str> {
27        self.component_name.as_deref()
28    }
29    /// <p>If logging is supported for the resource type, indicates whether the component has configured logs to be monitored.</p>
30    pub fn component_remarks(&self) -> ::std::option::Option<&str> {
31        self.component_remarks.as_deref()
32    }
33    /// <p>The resource type. Supported resource types include EC2 instances, Auto Scaling group, Classic ELB, Application ELB, and SQS Queue.</p>
34    pub fn resource_type(&self) -> ::std::option::Option<&str> {
35        self.resource_type.as_deref()
36    }
37    /// <p>The operating system of the component.</p>
38    pub fn os_type(&self) -> ::std::option::Option<&crate::types::OsType> {
39        self.os_type.as_ref()
40    }
41    /// <p>The stack tier of the application component.</p>
42    pub fn tier(&self) -> ::std::option::Option<&crate::types::Tier> {
43        self.tier.as_ref()
44    }
45    /// <p>Indicates whether the application component is monitored.</p>
46    pub fn monitor(&self) -> ::std::option::Option<bool> {
47        self.monitor
48    }
49    /// <p>Workloads detected in the application component.</p>
50    pub fn detected_workload(
51        &self,
52    ) -> ::std::option::Option<
53        &::std::collections::HashMap<crate::types::Tier, ::std::collections::HashMap<::std::string::String, ::std::string::String>>,
54    > {
55        self.detected_workload.as_ref()
56    }
57}
58impl ApplicationComponent {
59    /// Creates a new builder-style object to manufacture [`ApplicationComponent`](crate::types::ApplicationComponent).
60    pub fn builder() -> crate::types::builders::ApplicationComponentBuilder {
61        crate::types::builders::ApplicationComponentBuilder::default()
62    }
63}
64
65/// A builder for [`ApplicationComponent`](crate::types::ApplicationComponent).
66#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
67#[non_exhaustive]
68pub struct ApplicationComponentBuilder {
69    pub(crate) component_name: ::std::option::Option<::std::string::String>,
70    pub(crate) component_remarks: ::std::option::Option<::std::string::String>,
71    pub(crate) resource_type: ::std::option::Option<::std::string::String>,
72    pub(crate) os_type: ::std::option::Option<crate::types::OsType>,
73    pub(crate) tier: ::std::option::Option<crate::types::Tier>,
74    pub(crate) monitor: ::std::option::Option<bool>,
75    pub(crate) detected_workload: ::std::option::Option<
76        ::std::collections::HashMap<crate::types::Tier, ::std::collections::HashMap<::std::string::String, ::std::string::String>>,
77    >,
78}
79impl ApplicationComponentBuilder {
80    /// <p>The name of the component.</p>
81    pub fn component_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
82        self.component_name = ::std::option::Option::Some(input.into());
83        self
84    }
85    /// <p>The name of the component.</p>
86    pub fn set_component_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
87        self.component_name = input;
88        self
89    }
90    /// <p>The name of the component.</p>
91    pub fn get_component_name(&self) -> &::std::option::Option<::std::string::String> {
92        &self.component_name
93    }
94    /// <p>If logging is supported for the resource type, indicates whether the component has configured logs to be monitored.</p>
95    pub fn component_remarks(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
96        self.component_remarks = ::std::option::Option::Some(input.into());
97        self
98    }
99    /// <p>If logging is supported for the resource type, indicates whether the component has configured logs to be monitored.</p>
100    pub fn set_component_remarks(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
101        self.component_remarks = input;
102        self
103    }
104    /// <p>If logging is supported for the resource type, indicates whether the component has configured logs to be monitored.</p>
105    pub fn get_component_remarks(&self) -> &::std::option::Option<::std::string::String> {
106        &self.component_remarks
107    }
108    /// <p>The resource type. Supported resource types include EC2 instances, Auto Scaling group, Classic ELB, Application ELB, and SQS Queue.</p>
109    pub fn resource_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
110        self.resource_type = ::std::option::Option::Some(input.into());
111        self
112    }
113    /// <p>The resource type. Supported resource types include EC2 instances, Auto Scaling group, Classic ELB, Application ELB, and SQS Queue.</p>
114    pub fn set_resource_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
115        self.resource_type = input;
116        self
117    }
118    /// <p>The resource type. Supported resource types include EC2 instances, Auto Scaling group, Classic ELB, Application ELB, and SQS Queue.</p>
119    pub fn get_resource_type(&self) -> &::std::option::Option<::std::string::String> {
120        &self.resource_type
121    }
122    /// <p>The operating system of the component.</p>
123    pub fn os_type(mut self, input: crate::types::OsType) -> Self {
124        self.os_type = ::std::option::Option::Some(input);
125        self
126    }
127    /// <p>The operating system of the component.</p>
128    pub fn set_os_type(mut self, input: ::std::option::Option<crate::types::OsType>) -> Self {
129        self.os_type = input;
130        self
131    }
132    /// <p>The operating system of the component.</p>
133    pub fn get_os_type(&self) -> &::std::option::Option<crate::types::OsType> {
134        &self.os_type
135    }
136    /// <p>The stack tier of the application component.</p>
137    pub fn tier(mut self, input: crate::types::Tier) -> Self {
138        self.tier = ::std::option::Option::Some(input);
139        self
140    }
141    /// <p>The stack tier of the application component.</p>
142    pub fn set_tier(mut self, input: ::std::option::Option<crate::types::Tier>) -> Self {
143        self.tier = input;
144        self
145    }
146    /// <p>The stack tier of the application component.</p>
147    pub fn get_tier(&self) -> &::std::option::Option<crate::types::Tier> {
148        &self.tier
149    }
150    /// <p>Indicates whether the application component is monitored.</p>
151    pub fn monitor(mut self, input: bool) -> Self {
152        self.monitor = ::std::option::Option::Some(input);
153        self
154    }
155    /// <p>Indicates whether the application component is monitored.</p>
156    pub fn set_monitor(mut self, input: ::std::option::Option<bool>) -> Self {
157        self.monitor = input;
158        self
159    }
160    /// <p>Indicates whether the application component is monitored.</p>
161    pub fn get_monitor(&self) -> &::std::option::Option<bool> {
162        &self.monitor
163    }
164    /// Adds a key-value pair to `detected_workload`.
165    ///
166    /// To override the contents of this collection use [`set_detected_workload`](Self::set_detected_workload).
167    ///
168    /// <p>Workloads detected in the application component.</p>
169    pub fn detected_workload(mut self, k: crate::types::Tier, v: ::std::collections::HashMap<::std::string::String, ::std::string::String>) -> Self {
170        let mut hash_map = self.detected_workload.unwrap_or_default();
171        hash_map.insert(k, v);
172        self.detected_workload = ::std::option::Option::Some(hash_map);
173        self
174    }
175    /// <p>Workloads detected in the application component.</p>
176    pub fn set_detected_workload(
177        mut self,
178        input: ::std::option::Option<
179            ::std::collections::HashMap<crate::types::Tier, ::std::collections::HashMap<::std::string::String, ::std::string::String>>,
180        >,
181    ) -> Self {
182        self.detected_workload = input;
183        self
184    }
185    /// <p>Workloads detected in the application component.</p>
186    pub fn get_detected_workload(
187        &self,
188    ) -> &::std::option::Option<
189        ::std::collections::HashMap<crate::types::Tier, ::std::collections::HashMap<::std::string::String, ::std::string::String>>,
190    > {
191        &self.detected_workload
192    }
193    /// Consumes the builder and constructs a [`ApplicationComponent`](crate::types::ApplicationComponent).
194    pub fn build(self) -> crate::types::ApplicationComponent {
195        crate::types::ApplicationComponent {
196            component_name: self.component_name,
197            component_remarks: self.component_remarks,
198            resource_type: self.resource_type,
199            os_type: self.os_type,
200            tier: self.tier,
201            monitor: self.monitor,
202            detected_workload: self.detected_workload,
203        }
204    }
205}