1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Detailed health information about an Amazon EC2 instance in your Elastic Beanstalk environment.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct SingleInstanceHealth {
/// <p>The ID of the Amazon EC2 instance.</p>
pub instance_id: ::std::option::Option<::std::string::String>,
/// <p>Returns the health status of the specified instance. For more information, see <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/health-enhanced-status.html">Health Colors and Statuses</a>.</p>
pub health_status: ::std::option::Option<::std::string::String>,
/// <p>Represents the color indicator that gives you information about the health of the EC2 instance. For more information, see <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/health-enhanced-status.html">Health Colors and Statuses</a>.</p>
pub color: ::std::option::Option<::std::string::String>,
/// <p>Represents the causes, which provide more information about the current health status.</p>
pub causes: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
/// <p>The time at which the EC2 instance was launched.</p>
pub launched_at: ::std::option::Option<::aws_smithy_types::DateTime>,
/// <p>Request metrics from your application.</p>
pub application_metrics: ::std::option::Option<crate::types::ApplicationMetrics>,
/// <p>Operating system metrics from the instance.</p>
pub system: ::std::option::Option<crate::types::SystemStatus>,
/// <p>Information about the most recent deployment to an instance.</p>
pub deployment: ::std::option::Option<crate::types::Deployment>,
/// <p>The availability zone in which the instance runs.</p>
pub availability_zone: ::std::option::Option<::std::string::String>,
/// <p>The instance's type.</p>
pub instance_type: ::std::option::Option<::std::string::String>,
}
impl SingleInstanceHealth {
/// <p>The ID of the Amazon EC2 instance.</p>
pub fn instance_id(&self) -> ::std::option::Option<&str> {
self.instance_id.as_deref()
}
/// <p>Returns the health status of the specified instance. For more information, see <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/health-enhanced-status.html">Health Colors and Statuses</a>.</p>
pub fn health_status(&self) -> ::std::option::Option<&str> {
self.health_status.as_deref()
}
/// <p>Represents the color indicator that gives you information about the health of the EC2 instance. For more information, see <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/health-enhanced-status.html">Health Colors and Statuses</a>.</p>
pub fn color(&self) -> ::std::option::Option<&str> {
self.color.as_deref()
}
/// <p>Represents the causes, which provide more information about the current health status.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.causes.is_none()`.
pub fn causes(&self) -> &[::std::string::String] {
self.causes.as_deref().unwrap_or_default()
}
/// <p>The time at which the EC2 instance was launched.</p>
pub fn launched_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.launched_at.as_ref()
}
/// <p>Request metrics from your application.</p>
pub fn application_metrics(&self) -> ::std::option::Option<&crate::types::ApplicationMetrics> {
self.application_metrics.as_ref()
}
/// <p>Operating system metrics from the instance.</p>
pub fn system(&self) -> ::std::option::Option<&crate::types::SystemStatus> {
self.system.as_ref()
}
/// <p>Information about the most recent deployment to an instance.</p>
pub fn deployment(&self) -> ::std::option::Option<&crate::types::Deployment> {
self.deployment.as_ref()
}
/// <p>The availability zone in which the instance runs.</p>
pub fn availability_zone(&self) -> ::std::option::Option<&str> {
self.availability_zone.as_deref()
}
/// <p>The instance's type.</p>
pub fn instance_type(&self) -> ::std::option::Option<&str> {
self.instance_type.as_deref()
}
}
impl SingleInstanceHealth {
/// Creates a new builder-style object to manufacture [`SingleInstanceHealth`](crate::types::SingleInstanceHealth).
pub fn builder() -> crate::types::builders::SingleInstanceHealthBuilder {
crate::types::builders::SingleInstanceHealthBuilder::default()
}
}
/// A builder for [`SingleInstanceHealth`](crate::types::SingleInstanceHealth).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct SingleInstanceHealthBuilder {
pub(crate) instance_id: ::std::option::Option<::std::string::String>,
pub(crate) health_status: ::std::option::Option<::std::string::String>,
pub(crate) color: ::std::option::Option<::std::string::String>,
pub(crate) causes: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) launched_at: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) application_metrics: ::std::option::Option<crate::types::ApplicationMetrics>,
pub(crate) system: ::std::option::Option<crate::types::SystemStatus>,
pub(crate) deployment: ::std::option::Option<crate::types::Deployment>,
pub(crate) availability_zone: ::std::option::Option<::std::string::String>,
pub(crate) instance_type: ::std::option::Option<::std::string::String>,
}
impl SingleInstanceHealthBuilder {
/// <p>The ID of the Amazon EC2 instance.</p>
pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.instance_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The ID of the Amazon EC2 instance.</p>
pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.instance_id = input;
self
}
/// <p>The ID of the Amazon EC2 instance.</p>
pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
&self.instance_id
}
/// <p>Returns the health status of the specified instance. For more information, see <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/health-enhanced-status.html">Health Colors and Statuses</a>.</p>
pub fn health_status(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.health_status = ::std::option::Option::Some(input.into());
self
}
/// <p>Returns the health status of the specified instance. For more information, see <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/health-enhanced-status.html">Health Colors and Statuses</a>.</p>
pub fn set_health_status(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.health_status = input;
self
}
/// <p>Returns the health status of the specified instance. For more information, see <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/health-enhanced-status.html">Health Colors and Statuses</a>.</p>
pub fn get_health_status(&self) -> &::std::option::Option<::std::string::String> {
&self.health_status
}
/// <p>Represents the color indicator that gives you information about the health of the EC2 instance. For more information, see <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/health-enhanced-status.html">Health Colors and Statuses</a>.</p>
pub fn color(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.color = ::std::option::Option::Some(input.into());
self
}
/// <p>Represents the color indicator that gives you information about the health of the EC2 instance. For more information, see <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/health-enhanced-status.html">Health Colors and Statuses</a>.</p>
pub fn set_color(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.color = input;
self
}
/// <p>Represents the color indicator that gives you information about the health of the EC2 instance. For more information, see <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/health-enhanced-status.html">Health Colors and Statuses</a>.</p>
pub fn get_color(&self) -> &::std::option::Option<::std::string::String> {
&self.color
}
/// Appends an item to `causes`.
///
/// To override the contents of this collection use [`set_causes`](Self::set_causes).
///
/// <p>Represents the causes, which provide more information about the current health status.</p>
pub fn causes(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.causes.unwrap_or_default();
v.push(input.into());
self.causes = ::std::option::Option::Some(v);
self
}
/// <p>Represents the causes, which provide more information about the current health status.</p>
pub fn set_causes(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.causes = input;
self
}
/// <p>Represents the causes, which provide more information about the current health status.</p>
pub fn get_causes(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.causes
}
/// <p>The time at which the EC2 instance was launched.</p>
pub fn launched_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.launched_at = ::std::option::Option::Some(input);
self
}
/// <p>The time at which the EC2 instance was launched.</p>
pub fn set_launched_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.launched_at = input;
self
}
/// <p>The time at which the EC2 instance was launched.</p>
pub fn get_launched_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.launched_at
}
/// <p>Request metrics from your application.</p>
pub fn application_metrics(mut self, input: crate::types::ApplicationMetrics) -> Self {
self.application_metrics = ::std::option::Option::Some(input);
self
}
/// <p>Request metrics from your application.</p>
pub fn set_application_metrics(mut self, input: ::std::option::Option<crate::types::ApplicationMetrics>) -> Self {
self.application_metrics = input;
self
}
/// <p>Request metrics from your application.</p>
pub fn get_application_metrics(&self) -> &::std::option::Option<crate::types::ApplicationMetrics> {
&self.application_metrics
}
/// <p>Operating system metrics from the instance.</p>
pub fn system(mut self, input: crate::types::SystemStatus) -> Self {
self.system = ::std::option::Option::Some(input);
self
}
/// <p>Operating system metrics from the instance.</p>
pub fn set_system(mut self, input: ::std::option::Option<crate::types::SystemStatus>) -> Self {
self.system = input;
self
}
/// <p>Operating system metrics from the instance.</p>
pub fn get_system(&self) -> &::std::option::Option<crate::types::SystemStatus> {
&self.system
}
/// <p>Information about the most recent deployment to an instance.</p>
pub fn deployment(mut self, input: crate::types::Deployment) -> Self {
self.deployment = ::std::option::Option::Some(input);
self
}
/// <p>Information about the most recent deployment to an instance.</p>
pub fn set_deployment(mut self, input: ::std::option::Option<crate::types::Deployment>) -> Self {
self.deployment = input;
self
}
/// <p>Information about the most recent deployment to an instance.</p>
pub fn get_deployment(&self) -> &::std::option::Option<crate::types::Deployment> {
&self.deployment
}
/// <p>The availability zone in which the instance runs.</p>
pub fn availability_zone(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.availability_zone = ::std::option::Option::Some(input.into());
self
}
/// <p>The availability zone in which the instance runs.</p>
pub fn set_availability_zone(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.availability_zone = input;
self
}
/// <p>The availability zone in which the instance runs.</p>
pub fn get_availability_zone(&self) -> &::std::option::Option<::std::string::String> {
&self.availability_zone
}
/// <p>The instance's type.</p>
pub fn instance_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.instance_type = ::std::option::Option::Some(input.into());
self
}
/// <p>The instance's type.</p>
pub fn set_instance_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.instance_type = input;
self
}
/// <p>The instance's type.</p>
pub fn get_instance_type(&self) -> &::std::option::Option<::std::string::String> {
&self.instance_type
}
/// Consumes the builder and constructs a [`SingleInstanceHealth`](crate::types::SingleInstanceHealth).
pub fn build(self) -> crate::types::SingleInstanceHealth {
crate::types::SingleInstanceHealth {
instance_id: self.instance_id,
health_status: self.health_status,
color: self.color,
causes: self.causes,
launched_at: self.launched_at,
application_metrics: self.application_metrics,
system: self.system,
deployment: self.deployment,
availability_zone: self.availability_zone,
instance_type: self.instance_type,
}
}
}