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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>The input argument to the <code>TerminationProtection</code> operation.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct SetTerminationProtectionInput {
/// <p>A list of strings that uniquely identify the clusters to protect. This identifier is returned by <code>RunJobFlow</code> and can also be obtained from <code>DescribeJobFlows</code> .</p>
pub job_flow_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
/// <p>A Boolean that indicates whether to protect the cluster and prevent the Amazon EC2 instances in the cluster from shutting down due to API calls, user intervention, or job-flow error.</p>
pub termination_protected: ::std::option::Option<bool>,
}
impl SetTerminationProtectionInput {
/// <p>A list of strings that uniquely identify the clusters to protect. This identifier is returned by <code>RunJobFlow</code> and can also be obtained from <code>DescribeJobFlows</code> .</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 `.job_flow_ids.is_none()`.
pub fn job_flow_ids(&self) -> &[::std::string::String] {
self.job_flow_ids.as_deref().unwrap_or_default()
}
/// <p>A Boolean that indicates whether to protect the cluster and prevent the Amazon EC2 instances in the cluster from shutting down due to API calls, user intervention, or job-flow error.</p>
pub fn termination_protected(&self) -> ::std::option::Option<bool> {
self.termination_protected
}
}
impl SetTerminationProtectionInput {
/// Creates a new builder-style object to manufacture [`SetTerminationProtectionInput`](crate::operation::set_termination_protection::SetTerminationProtectionInput).
pub fn builder() -> crate::operation::set_termination_protection::builders::SetTerminationProtectionInputBuilder {
crate::operation::set_termination_protection::builders::SetTerminationProtectionInputBuilder::default()
}
}
/// A builder for [`SetTerminationProtectionInput`](crate::operation::set_termination_protection::SetTerminationProtectionInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct SetTerminationProtectionInputBuilder {
pub(crate) job_flow_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) termination_protected: ::std::option::Option<bool>,
}
impl SetTerminationProtectionInputBuilder {
/// Appends an item to `job_flow_ids`.
///
/// To override the contents of this collection use [`set_job_flow_ids`](Self::set_job_flow_ids).
///
/// <p>A list of strings that uniquely identify the clusters to protect. This identifier is returned by <code>RunJobFlow</code> and can also be obtained from <code>DescribeJobFlows</code> .</p>
pub fn job_flow_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.job_flow_ids.unwrap_or_default();
v.push(input.into());
self.job_flow_ids = ::std::option::Option::Some(v);
self
}
/// <p>A list of strings that uniquely identify the clusters to protect. This identifier is returned by <code>RunJobFlow</code> and can also be obtained from <code>DescribeJobFlows</code> .</p>
pub fn set_job_flow_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.job_flow_ids = input;
self
}
/// <p>A list of strings that uniquely identify the clusters to protect. This identifier is returned by <code>RunJobFlow</code> and can also be obtained from <code>DescribeJobFlows</code> .</p>
pub fn get_job_flow_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.job_flow_ids
}
/// <p>A Boolean that indicates whether to protect the cluster and prevent the Amazon EC2 instances in the cluster from shutting down due to API calls, user intervention, or job-flow error.</p>
/// This field is required.
pub fn termination_protected(mut self, input: bool) -> Self {
self.termination_protected = ::std::option::Option::Some(input);
self
}
/// <p>A Boolean that indicates whether to protect the cluster and prevent the Amazon EC2 instances in the cluster from shutting down due to API calls, user intervention, or job-flow error.</p>
pub fn set_termination_protected(mut self, input: ::std::option::Option<bool>) -> Self {
self.termination_protected = input;
self
}
/// <p>A Boolean that indicates whether to protect the cluster and prevent the Amazon EC2 instances in the cluster from shutting down due to API calls, user intervention, or job-flow error.</p>
pub fn get_termination_protected(&self) -> &::std::option::Option<bool> {
&self.termination_protected
}
/// Consumes the builder and constructs a [`SetTerminationProtectionInput`](crate::operation::set_termination_protection::SetTerminationProtectionInput).
pub fn build(
self,
) -> ::std::result::Result<
crate::operation::set_termination_protection::SetTerminationProtectionInput,
::aws_smithy_types::error::operation::BuildError,
> {
::std::result::Result::Ok(crate::operation::set_termination_protection::SetTerminationProtectionInput {
job_flow_ids: self.job_flow_ids,
termination_protected: self.termination_protected,
})
}
}