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 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Describes a deployment of a stack or app.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Deployment {
/// <p>The deployment ID.</p>
pub deployment_id: ::std::option::Option<::std::string::String>,
/// <p>The stack ID.</p>
pub stack_id: ::std::option::Option<::std::string::String>,
/// <p>The app ID.</p>
pub app_id: ::std::option::Option<::std::string::String>,
/// <p>Date when the deployment was created.</p>
pub created_at: ::std::option::Option<::std::string::String>,
/// <p>Date when the deployment completed.</p>
pub completed_at: ::std::option::Option<::std::string::String>,
/// <p>The deployment duration.</p>
pub duration: ::std::option::Option<i32>,
/// <p>The user's IAM ARN.</p>
pub iam_user_arn: ::std::option::Option<::std::string::String>,
/// <p>A user-defined comment.</p>
pub comment: ::std::option::Option<::std::string::String>,
/// <p>Used to specify a stack or deployment command.</p>
pub command: ::std::option::Option<crate::types::DeploymentCommand>,
/// <p>The deployment status:</p>
/// <ul>
/// <li>
/// <p>running</p></li>
/// <li>
/// <p>successful</p></li>
/// <li>
/// <p>failed</p></li>
/// </ul>
pub status: ::std::option::Option<::std::string::String>,
/// <p>A string that contains user-defined custom JSON. It can be used to override the corresponding default stack configuration attribute values for stack or to pass data to recipes. The string should be in the following format:</p>
/// <p><code>"{\"key1\": \"value1\", \"key2\": \"value2\",...}"</code></p>
/// <p>For more information on custom JSON, see <a href="https://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-json.html">Use Custom JSON to Modify the Stack Configuration Attributes</a>.</p>
pub custom_json: ::std::option::Option<::std::string::String>,
/// <p>The IDs of the target instances.</p>
pub instance_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl Deployment {
/// <p>The deployment ID.</p>
pub fn deployment_id(&self) -> ::std::option::Option<&str> {
self.deployment_id.as_deref()
}
/// <p>The stack ID.</p>
pub fn stack_id(&self) -> ::std::option::Option<&str> {
self.stack_id.as_deref()
}
/// <p>The app ID.</p>
pub fn app_id(&self) -> ::std::option::Option<&str> {
self.app_id.as_deref()
}
/// <p>Date when the deployment was created.</p>
pub fn created_at(&self) -> ::std::option::Option<&str> {
self.created_at.as_deref()
}
/// <p>Date when the deployment completed.</p>
pub fn completed_at(&self) -> ::std::option::Option<&str> {
self.completed_at.as_deref()
}
/// <p>The deployment duration.</p>
pub fn duration(&self) -> ::std::option::Option<i32> {
self.duration
}
/// <p>The user's IAM ARN.</p>
pub fn iam_user_arn(&self) -> ::std::option::Option<&str> {
self.iam_user_arn.as_deref()
}
/// <p>A user-defined comment.</p>
pub fn comment(&self) -> ::std::option::Option<&str> {
self.comment.as_deref()
}
/// <p>Used to specify a stack or deployment command.</p>
pub fn command(&self) -> ::std::option::Option<&crate::types::DeploymentCommand> {
self.command.as_ref()
}
/// <p>The deployment status:</p>
/// <ul>
/// <li>
/// <p>running</p></li>
/// <li>
/// <p>successful</p></li>
/// <li>
/// <p>failed</p></li>
/// </ul>
pub fn status(&self) -> ::std::option::Option<&str> {
self.status.as_deref()
}
/// <p>A string that contains user-defined custom JSON. It can be used to override the corresponding default stack configuration attribute values for stack or to pass data to recipes. The string should be in the following format:</p>
/// <p><code>"{\"key1\": \"value1\", \"key2\": \"value2\",...}"</code></p>
/// <p>For more information on custom JSON, see <a href="https://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-json.html">Use Custom JSON to Modify the Stack Configuration Attributes</a>.</p>
pub fn custom_json(&self) -> ::std::option::Option<&str> {
self.custom_json.as_deref()
}
/// <p>The IDs of the target instances.</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 `.instance_ids.is_none()`.
pub fn instance_ids(&self) -> &[::std::string::String] {
self.instance_ids.as_deref().unwrap_or_default()
}
}
impl Deployment {
/// Creates a new builder-style object to manufacture [`Deployment`](crate::types::Deployment).
pub fn builder() -> crate::types::builders::DeploymentBuilder {
crate::types::builders::DeploymentBuilder::default()
}
}
/// A builder for [`Deployment`](crate::types::Deployment).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct DeploymentBuilder {
pub(crate) deployment_id: ::std::option::Option<::std::string::String>,
pub(crate) stack_id: ::std::option::Option<::std::string::String>,
pub(crate) app_id: ::std::option::Option<::std::string::String>,
pub(crate) created_at: ::std::option::Option<::std::string::String>,
pub(crate) completed_at: ::std::option::Option<::std::string::String>,
pub(crate) duration: ::std::option::Option<i32>,
pub(crate) iam_user_arn: ::std::option::Option<::std::string::String>,
pub(crate) comment: ::std::option::Option<::std::string::String>,
pub(crate) command: ::std::option::Option<crate::types::DeploymentCommand>,
pub(crate) status: ::std::option::Option<::std::string::String>,
pub(crate) custom_json: ::std::option::Option<::std::string::String>,
pub(crate) instance_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl DeploymentBuilder {
/// <p>The deployment ID.</p>
pub fn deployment_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.deployment_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The deployment ID.</p>
pub fn set_deployment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.deployment_id = input;
self
}
/// <p>The deployment ID.</p>
pub fn get_deployment_id(&self) -> &::std::option::Option<::std::string::String> {
&self.deployment_id
}
/// <p>The stack ID.</p>
pub fn stack_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.stack_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The stack ID.</p>
pub fn set_stack_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.stack_id = input;
self
}
/// <p>The stack ID.</p>
pub fn get_stack_id(&self) -> &::std::option::Option<::std::string::String> {
&self.stack_id
}
/// <p>The app ID.</p>
pub fn app_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.app_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The app ID.</p>
pub fn set_app_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.app_id = input;
self
}
/// <p>The app ID.</p>
pub fn get_app_id(&self) -> &::std::option::Option<::std::string::String> {
&self.app_id
}
/// <p>Date when the deployment was created.</p>
pub fn created_at(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.created_at = ::std::option::Option::Some(input.into());
self
}
/// <p>Date when the deployment was created.</p>
pub fn set_created_at(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.created_at = input;
self
}
/// <p>Date when the deployment was created.</p>
pub fn get_created_at(&self) -> &::std::option::Option<::std::string::String> {
&self.created_at
}
/// <p>Date when the deployment completed.</p>
pub fn completed_at(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.completed_at = ::std::option::Option::Some(input.into());
self
}
/// <p>Date when the deployment completed.</p>
pub fn set_completed_at(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.completed_at = input;
self
}
/// <p>Date when the deployment completed.</p>
pub fn get_completed_at(&self) -> &::std::option::Option<::std::string::String> {
&self.completed_at
}
/// <p>The deployment duration.</p>
pub fn duration(mut self, input: i32) -> Self {
self.duration = ::std::option::Option::Some(input);
self
}
/// <p>The deployment duration.</p>
pub fn set_duration(mut self, input: ::std::option::Option<i32>) -> Self {
self.duration = input;
self
}
/// <p>The deployment duration.</p>
pub fn get_duration(&self) -> &::std::option::Option<i32> {
&self.duration
}
/// <p>The user's IAM ARN.</p>
pub fn iam_user_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.iam_user_arn = ::std::option::Option::Some(input.into());
self
}
/// <p>The user's IAM ARN.</p>
pub fn set_iam_user_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.iam_user_arn = input;
self
}
/// <p>The user's IAM ARN.</p>
pub fn get_iam_user_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.iam_user_arn
}
/// <p>A user-defined comment.</p>
pub fn comment(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.comment = ::std::option::Option::Some(input.into());
self
}
/// <p>A user-defined comment.</p>
pub fn set_comment(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.comment = input;
self
}
/// <p>A user-defined comment.</p>
pub fn get_comment(&self) -> &::std::option::Option<::std::string::String> {
&self.comment
}
/// <p>Used to specify a stack or deployment command.</p>
pub fn command(mut self, input: crate::types::DeploymentCommand) -> Self {
self.command = ::std::option::Option::Some(input);
self
}
/// <p>Used to specify a stack or deployment command.</p>
pub fn set_command(mut self, input: ::std::option::Option<crate::types::DeploymentCommand>) -> Self {
self.command = input;
self
}
/// <p>Used to specify a stack or deployment command.</p>
pub fn get_command(&self) -> &::std::option::Option<crate::types::DeploymentCommand> {
&self.command
}
/// <p>The deployment status:</p>
/// <ul>
/// <li>
/// <p>running</p></li>
/// <li>
/// <p>successful</p></li>
/// <li>
/// <p>failed</p></li>
/// </ul>
pub fn status(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.status = ::std::option::Option::Some(input.into());
self
}
/// <p>The deployment status:</p>
/// <ul>
/// <li>
/// <p>running</p></li>
/// <li>
/// <p>successful</p></li>
/// <li>
/// <p>failed</p></li>
/// </ul>
pub fn set_status(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.status = input;
self
}
/// <p>The deployment status:</p>
/// <ul>
/// <li>
/// <p>running</p></li>
/// <li>
/// <p>successful</p></li>
/// <li>
/// <p>failed</p></li>
/// </ul>
pub fn get_status(&self) -> &::std::option::Option<::std::string::String> {
&self.status
}
/// <p>A string that contains user-defined custom JSON. It can be used to override the corresponding default stack configuration attribute values for stack or to pass data to recipes. The string should be in the following format:</p>
/// <p><code>"{\"key1\": \"value1\", \"key2\": \"value2\",...}"</code></p>
/// <p>For more information on custom JSON, see <a href="https://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-json.html">Use Custom JSON to Modify the Stack Configuration Attributes</a>.</p>
pub fn custom_json(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.custom_json = ::std::option::Option::Some(input.into());
self
}
/// <p>A string that contains user-defined custom JSON. It can be used to override the corresponding default stack configuration attribute values for stack or to pass data to recipes. The string should be in the following format:</p>
/// <p><code>"{\"key1\": \"value1\", \"key2\": \"value2\",...}"</code></p>
/// <p>For more information on custom JSON, see <a href="https://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-json.html">Use Custom JSON to Modify the Stack Configuration Attributes</a>.</p>
pub fn set_custom_json(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.custom_json = input;
self
}
/// <p>A string that contains user-defined custom JSON. It can be used to override the corresponding default stack configuration attribute values for stack or to pass data to recipes. The string should be in the following format:</p>
/// <p><code>"{\"key1\": \"value1\", \"key2\": \"value2\",...}"</code></p>
/// <p>For more information on custom JSON, see <a href="https://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-json.html">Use Custom JSON to Modify the Stack Configuration Attributes</a>.</p>
pub fn get_custom_json(&self) -> &::std::option::Option<::std::string::String> {
&self.custom_json
}
/// Appends an item to `instance_ids`.
///
/// To override the contents of this collection use [`set_instance_ids`](Self::set_instance_ids).
///
/// <p>The IDs of the target instances.</p>
pub fn instance_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.instance_ids.unwrap_or_default();
v.push(input.into());
self.instance_ids = ::std::option::Option::Some(v);
self
}
/// <p>The IDs of the target instances.</p>
pub fn set_instance_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.instance_ids = input;
self
}
/// <p>The IDs of the target instances.</p>
pub fn get_instance_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.instance_ids
}
/// Consumes the builder and constructs a [`Deployment`](crate::types::Deployment).
pub fn build(self) -> crate::types::Deployment {
crate::types::Deployment {
deployment_id: self.deployment_id,
stack_id: self.stack_id,
app_id: self.app_id,
created_at: self.created_at,
completed_at: self.completed_at,
duration: self.duration,
iam_user_arn: self.iam_user_arn,
comment: self.comment,
command: self.command,
status: self.status,
custom_json: self.custom_json,
instance_ids: self.instance_ids,
}
}
}