aws_sdk_codedeploy/operation/stop_deployment/
_stop_deployment_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Represents the input of a <code>StopDeployment</code> operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct StopDeploymentInput {
7    /// <p>The unique ID of a deployment.</p>
8    pub deployment_id: ::std::option::Option<::std::string::String>,
9    /// <p>Indicates, when a deployment is stopped, whether instances that have been updated should be rolled back to the previous version of the application revision.</p>
10    pub auto_rollback_enabled: ::std::option::Option<bool>,
11}
12impl StopDeploymentInput {
13    /// <p>The unique ID of a deployment.</p>
14    pub fn deployment_id(&self) -> ::std::option::Option<&str> {
15        self.deployment_id.as_deref()
16    }
17    /// <p>Indicates, when a deployment is stopped, whether instances that have been updated should be rolled back to the previous version of the application revision.</p>
18    pub fn auto_rollback_enabled(&self) -> ::std::option::Option<bool> {
19        self.auto_rollback_enabled
20    }
21}
22impl StopDeploymentInput {
23    /// Creates a new builder-style object to manufacture [`StopDeploymentInput`](crate::operation::stop_deployment::StopDeploymentInput).
24    pub fn builder() -> crate::operation::stop_deployment::builders::StopDeploymentInputBuilder {
25        crate::operation::stop_deployment::builders::StopDeploymentInputBuilder::default()
26    }
27}
28
29/// A builder for [`StopDeploymentInput`](crate::operation::stop_deployment::StopDeploymentInput).
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct StopDeploymentInputBuilder {
33    pub(crate) deployment_id: ::std::option::Option<::std::string::String>,
34    pub(crate) auto_rollback_enabled: ::std::option::Option<bool>,
35}
36impl StopDeploymentInputBuilder {
37    /// <p>The unique ID of a deployment.</p>
38    /// This field is required.
39    pub fn deployment_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
40        self.deployment_id = ::std::option::Option::Some(input.into());
41        self
42    }
43    /// <p>The unique ID of a deployment.</p>
44    pub fn set_deployment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
45        self.deployment_id = input;
46        self
47    }
48    /// <p>The unique ID of a deployment.</p>
49    pub fn get_deployment_id(&self) -> &::std::option::Option<::std::string::String> {
50        &self.deployment_id
51    }
52    /// <p>Indicates, when a deployment is stopped, whether instances that have been updated should be rolled back to the previous version of the application revision.</p>
53    pub fn auto_rollback_enabled(mut self, input: bool) -> Self {
54        self.auto_rollback_enabled = ::std::option::Option::Some(input);
55        self
56    }
57    /// <p>Indicates, when a deployment is stopped, whether instances that have been updated should be rolled back to the previous version of the application revision.</p>
58    pub fn set_auto_rollback_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
59        self.auto_rollback_enabled = input;
60        self
61    }
62    /// <p>Indicates, when a deployment is stopped, whether instances that have been updated should be rolled back to the previous version of the application revision.</p>
63    pub fn get_auto_rollback_enabled(&self) -> &::std::option::Option<bool> {
64        &self.auto_rollback_enabled
65    }
66    /// Consumes the builder and constructs a [`StopDeploymentInput`](crate::operation::stop_deployment::StopDeploymentInput).
67    pub fn build(
68        self,
69    ) -> ::std::result::Result<crate::operation::stop_deployment::StopDeploymentInput, ::aws_smithy_types::error::operation::BuildError> {
70        ::std::result::Result::Ok(crate::operation::stop_deployment::StopDeploymentInput {
71            deployment_id: self.deployment_id,
72            auto_rollback_enabled: self.auto_rollback_enabled,
73        })
74    }
75}