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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p> A target Amazon EC2 or on-premises instance during a deployment that uses the EC2/On-premises compute platform. </p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct InstanceTarget {
/// <p> The unique ID of a deployment. </p>
#[doc(hidden)]
pub deployment_id: std::option::Option<std::string::String>,
/// <p> The unique ID of a deployment target that has a type of <code>instanceTarget</code>. </p>
#[doc(hidden)]
pub target_id: std::option::Option<std::string::String>,
/// <p> The Amazon Resource Name (ARN) of the target. </p>
#[doc(hidden)]
pub target_arn: std::option::Option<std::string::String>,
/// <p> The status an EC2/On-premises deployment's target instance. </p>
#[doc(hidden)]
pub status: std::option::Option<crate::types::TargetStatus>,
/// <p> The date and time when the target instance was updated by a deployment. </p>
#[doc(hidden)]
pub last_updated_at: std::option::Option<aws_smithy_types::DateTime>,
/// <p> The lifecycle events of the deployment to this target instance. </p>
#[doc(hidden)]
pub lifecycle_events: std::option::Option<std::vec::Vec<crate::types::LifecycleEvent>>,
/// <p> A label that identifies whether the instance is an original target (<code>BLUE</code>) or a replacement target (<code>GREEN</code>). </p>
#[doc(hidden)]
pub instance_label: std::option::Option<crate::types::TargetLabel>,
}
impl InstanceTarget {
/// <p> The unique ID of a deployment. </p>
pub fn deployment_id(&self) -> std::option::Option<&str> {
self.deployment_id.as_deref()
}
/// <p> The unique ID of a deployment target that has a type of <code>instanceTarget</code>. </p>
pub fn target_id(&self) -> std::option::Option<&str> {
self.target_id.as_deref()
}
/// <p> The Amazon Resource Name (ARN) of the target. </p>
pub fn target_arn(&self) -> std::option::Option<&str> {
self.target_arn.as_deref()
}
/// <p> The status an EC2/On-premises deployment's target instance. </p>
pub fn status(&self) -> std::option::Option<&crate::types::TargetStatus> {
self.status.as_ref()
}
/// <p> The date and time when the target instance was updated by a deployment. </p>
pub fn last_updated_at(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.last_updated_at.as_ref()
}
/// <p> The lifecycle events of the deployment to this target instance. </p>
pub fn lifecycle_events(&self) -> std::option::Option<&[crate::types::LifecycleEvent]> {
self.lifecycle_events.as_deref()
}
/// <p> A label that identifies whether the instance is an original target (<code>BLUE</code>) or a replacement target (<code>GREEN</code>). </p>
pub fn instance_label(&self) -> std::option::Option<&crate::types::TargetLabel> {
self.instance_label.as_ref()
}
}
impl InstanceTarget {
/// Creates a new builder-style object to manufacture [`InstanceTarget`](crate::types::InstanceTarget).
pub fn builder() -> crate::types::builders::InstanceTargetBuilder {
crate::types::builders::InstanceTargetBuilder::default()
}
}
/// A builder for [`InstanceTarget`](crate::types::InstanceTarget).
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct InstanceTargetBuilder {
pub(crate) deployment_id: std::option::Option<std::string::String>,
pub(crate) target_id: std::option::Option<std::string::String>,
pub(crate) target_arn: std::option::Option<std::string::String>,
pub(crate) status: std::option::Option<crate::types::TargetStatus>,
pub(crate) last_updated_at: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) lifecycle_events: std::option::Option<std::vec::Vec<crate::types::LifecycleEvent>>,
pub(crate) instance_label: std::option::Option<crate::types::TargetLabel>,
}
impl InstanceTargetBuilder {
/// <p> The unique ID of a deployment. </p>
pub fn deployment_id(mut self, input: impl Into<std::string::String>) -> Self {
self.deployment_id = Some(input.into());
self
}
/// <p> The unique ID of a deployment. </p>
pub fn set_deployment_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.deployment_id = input;
self
}
/// <p> The unique ID of a deployment target that has a type of <code>instanceTarget</code>. </p>
pub fn target_id(mut self, input: impl Into<std::string::String>) -> Self {
self.target_id = Some(input.into());
self
}
/// <p> The unique ID of a deployment target that has a type of <code>instanceTarget</code>. </p>
pub fn set_target_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.target_id = input;
self
}
/// <p> The Amazon Resource Name (ARN) of the target. </p>
pub fn target_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.target_arn = Some(input.into());
self
}
/// <p> The Amazon Resource Name (ARN) of the target. </p>
pub fn set_target_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.target_arn = input;
self
}
/// <p> The status an EC2/On-premises deployment's target instance. </p>
pub fn status(mut self, input: crate::types::TargetStatus) -> Self {
self.status = Some(input);
self
}
/// <p> The status an EC2/On-premises deployment's target instance. </p>
pub fn set_status(mut self, input: std::option::Option<crate::types::TargetStatus>) -> Self {
self.status = input;
self
}
/// <p> The date and time when the target instance was updated by a deployment. </p>
pub fn last_updated_at(mut self, input: aws_smithy_types::DateTime) -> Self {
self.last_updated_at = Some(input);
self
}
/// <p> The date and time when the target instance was updated by a deployment. </p>
pub fn set_last_updated_at(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.last_updated_at = input;
self
}
/// Appends an item to `lifecycle_events`.
///
/// To override the contents of this collection use [`set_lifecycle_events`](Self::set_lifecycle_events).
///
/// <p> The lifecycle events of the deployment to this target instance. </p>
pub fn lifecycle_events(mut self, input: crate::types::LifecycleEvent) -> Self {
let mut v = self.lifecycle_events.unwrap_or_default();
v.push(input);
self.lifecycle_events = Some(v);
self
}
/// <p> The lifecycle events of the deployment to this target instance. </p>
pub fn set_lifecycle_events(
mut self,
input: std::option::Option<std::vec::Vec<crate::types::LifecycleEvent>>,
) -> Self {
self.lifecycle_events = input;
self
}
/// <p> A label that identifies whether the instance is an original target (<code>BLUE</code>) or a replacement target (<code>GREEN</code>). </p>
pub fn instance_label(mut self, input: crate::types::TargetLabel) -> Self {
self.instance_label = Some(input);
self
}
/// <p> A label that identifies whether the instance is an original target (<code>BLUE</code>) or a replacement target (<code>GREEN</code>). </p>
pub fn set_instance_label(
mut self,
input: std::option::Option<crate::types::TargetLabel>,
) -> Self {
self.instance_label = input;
self
}
/// Consumes the builder and constructs a [`InstanceTarget`](crate::types::InstanceTarget).
pub fn build(self) -> crate::types::InstanceTarget {
crate::types::InstanceTarget {
deployment_id: self.deployment_id,
target_id: self.target_id,
target_arn: self.target_arn,
status: self.status,
last_updated_at: self.last_updated_at,
lifecycle_events: self.lifecycle_events,
instance_label: self.instance_label,
}
}
}