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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct StopInstancesInput {
/// <p>The IDs of the instances.</p>
pub instance_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
/// <p>Hibernates the instance if the instance was enabled for hibernation at launch. If the instance cannot hibernate successfully, a normal shutdown occurs. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html">Hibernate your Amazon EC2 instance</a> in the <i>Amazon EC2 User Guide</i>.</p>
/// <p>Default: <code>false</code></p>
pub hibernate: ::std::option::Option<bool>,
/// <p>Specifies whether to bypass the graceful OS shutdown process when the instance is stopped.</p><important>
/// <p>Bypassing the graceful OS shutdown might result in data loss or corruption (for example, memory contents not flushed to disk or loss of in-flight IOs) or skipped shutdown scripts.</p>
/// </important>
/// <p>Default: <code>false</code></p>
pub skip_os_shutdown: ::std::option::Option<bool>,
/// <p>Checks whether you have the required permissions for the operation, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
pub dry_run: ::std::option::Option<bool>,
/// <p>Forces the instance to stop. The instance will first attempt a graceful shutdown, which includes flushing file system caches and metadata. If the graceful shutdown fails to complete within the timeout period, the instance shuts down forcibly without flushing the file system caches and metadata.</p>
/// <p>After using this option, you must perform file system check and repair procedures. This option is not recommended for Windows instances. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesStopping.html">Troubleshoot Amazon EC2 instance stop issues</a> in the <i>Amazon EC2 User Guide</i>.</p>
/// <p>Default: <code>false</code></p>
pub force: ::std::option::Option<bool>,
}
impl StopInstancesInput {
/// <p>The IDs of the 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()
}
/// <p>Hibernates the instance if the instance was enabled for hibernation at launch. If the instance cannot hibernate successfully, a normal shutdown occurs. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html">Hibernate your Amazon EC2 instance</a> in the <i>Amazon EC2 User Guide</i>.</p>
/// <p>Default: <code>false</code></p>
pub fn hibernate(&self) -> ::std::option::Option<bool> {
self.hibernate
}
/// <p>Specifies whether to bypass the graceful OS shutdown process when the instance is stopped.</p><important>
/// <p>Bypassing the graceful OS shutdown might result in data loss or corruption (for example, memory contents not flushed to disk or loss of in-flight IOs) or skipped shutdown scripts.</p>
/// </important>
/// <p>Default: <code>false</code></p>
pub fn skip_os_shutdown(&self) -> ::std::option::Option<bool> {
self.skip_os_shutdown
}
/// <p>Checks whether you have the required permissions for the operation, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
pub fn dry_run(&self) -> ::std::option::Option<bool> {
self.dry_run
}
/// <p>Forces the instance to stop. The instance will first attempt a graceful shutdown, which includes flushing file system caches and metadata. If the graceful shutdown fails to complete within the timeout period, the instance shuts down forcibly without flushing the file system caches and metadata.</p>
/// <p>After using this option, you must perform file system check and repair procedures. This option is not recommended for Windows instances. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesStopping.html">Troubleshoot Amazon EC2 instance stop issues</a> in the <i>Amazon EC2 User Guide</i>.</p>
/// <p>Default: <code>false</code></p>
pub fn force(&self) -> ::std::option::Option<bool> {
self.force
}
}
impl StopInstancesInput {
/// Creates a new builder-style object to manufacture [`StopInstancesInput`](crate::operation::stop_instances::StopInstancesInput).
pub fn builder() -> crate::operation::stop_instances::builders::StopInstancesInputBuilder {
crate::operation::stop_instances::builders::StopInstancesInputBuilder::default()
}
}
/// A builder for [`StopInstancesInput`](crate::operation::stop_instances::StopInstancesInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct StopInstancesInputBuilder {
pub(crate) instance_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) hibernate: ::std::option::Option<bool>,
pub(crate) skip_os_shutdown: ::std::option::Option<bool>,
pub(crate) dry_run: ::std::option::Option<bool>,
pub(crate) force: ::std::option::Option<bool>,
}
impl StopInstancesInputBuilder {
/// 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 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 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 instances.</p>
pub fn get_instance_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.instance_ids
}
/// <p>Hibernates the instance if the instance was enabled for hibernation at launch. If the instance cannot hibernate successfully, a normal shutdown occurs. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html">Hibernate your Amazon EC2 instance</a> in the <i>Amazon EC2 User Guide</i>.</p>
/// <p>Default: <code>false</code></p>
pub fn hibernate(mut self, input: bool) -> Self {
self.hibernate = ::std::option::Option::Some(input);
self
}
/// <p>Hibernates the instance if the instance was enabled for hibernation at launch. If the instance cannot hibernate successfully, a normal shutdown occurs. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html">Hibernate your Amazon EC2 instance</a> in the <i>Amazon EC2 User Guide</i>.</p>
/// <p>Default: <code>false</code></p>
pub fn set_hibernate(mut self, input: ::std::option::Option<bool>) -> Self {
self.hibernate = input;
self
}
/// <p>Hibernates the instance if the instance was enabled for hibernation at launch. If the instance cannot hibernate successfully, a normal shutdown occurs. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html">Hibernate your Amazon EC2 instance</a> in the <i>Amazon EC2 User Guide</i>.</p>
/// <p>Default: <code>false</code></p>
pub fn get_hibernate(&self) -> &::std::option::Option<bool> {
&self.hibernate
}
/// <p>Specifies whether to bypass the graceful OS shutdown process when the instance is stopped.</p><important>
/// <p>Bypassing the graceful OS shutdown might result in data loss or corruption (for example, memory contents not flushed to disk or loss of in-flight IOs) or skipped shutdown scripts.</p>
/// </important>
/// <p>Default: <code>false</code></p>
pub fn skip_os_shutdown(mut self, input: bool) -> Self {
self.skip_os_shutdown = ::std::option::Option::Some(input);
self
}
/// <p>Specifies whether to bypass the graceful OS shutdown process when the instance is stopped.</p><important>
/// <p>Bypassing the graceful OS shutdown might result in data loss or corruption (for example, memory contents not flushed to disk or loss of in-flight IOs) or skipped shutdown scripts.</p>
/// </important>
/// <p>Default: <code>false</code></p>
pub fn set_skip_os_shutdown(mut self, input: ::std::option::Option<bool>) -> Self {
self.skip_os_shutdown = input;
self
}
/// <p>Specifies whether to bypass the graceful OS shutdown process when the instance is stopped.</p><important>
/// <p>Bypassing the graceful OS shutdown might result in data loss or corruption (for example, memory contents not flushed to disk or loss of in-flight IOs) or skipped shutdown scripts.</p>
/// </important>
/// <p>Default: <code>false</code></p>
pub fn get_skip_os_shutdown(&self) -> &::std::option::Option<bool> {
&self.skip_os_shutdown
}
/// <p>Checks whether you have the required permissions for the operation, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
pub fn dry_run(mut self, input: bool) -> Self {
self.dry_run = ::std::option::Option::Some(input);
self
}
/// <p>Checks whether you have the required permissions for the operation, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
self.dry_run = input;
self
}
/// <p>Checks whether you have the required permissions for the operation, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
&self.dry_run
}
/// <p>Forces the instance to stop. The instance will first attempt a graceful shutdown, which includes flushing file system caches and metadata. If the graceful shutdown fails to complete within the timeout period, the instance shuts down forcibly without flushing the file system caches and metadata.</p>
/// <p>After using this option, you must perform file system check and repair procedures. This option is not recommended for Windows instances. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesStopping.html">Troubleshoot Amazon EC2 instance stop issues</a> in the <i>Amazon EC2 User Guide</i>.</p>
/// <p>Default: <code>false</code></p>
pub fn force(mut self, input: bool) -> Self {
self.force = ::std::option::Option::Some(input);
self
}
/// <p>Forces the instance to stop. The instance will first attempt a graceful shutdown, which includes flushing file system caches and metadata. If the graceful shutdown fails to complete within the timeout period, the instance shuts down forcibly without flushing the file system caches and metadata.</p>
/// <p>After using this option, you must perform file system check and repair procedures. This option is not recommended for Windows instances. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesStopping.html">Troubleshoot Amazon EC2 instance stop issues</a> in the <i>Amazon EC2 User Guide</i>.</p>
/// <p>Default: <code>false</code></p>
pub fn set_force(mut self, input: ::std::option::Option<bool>) -> Self {
self.force = input;
self
}
/// <p>Forces the instance to stop. The instance will first attempt a graceful shutdown, which includes flushing file system caches and metadata. If the graceful shutdown fails to complete within the timeout period, the instance shuts down forcibly without flushing the file system caches and metadata.</p>
/// <p>After using this option, you must perform file system check and repair procedures. This option is not recommended for Windows instances. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesStopping.html">Troubleshoot Amazon EC2 instance stop issues</a> in the <i>Amazon EC2 User Guide</i>.</p>
/// <p>Default: <code>false</code></p>
pub fn get_force(&self) -> &::std::option::Option<bool> {
&self.force
}
/// Consumes the builder and constructs a [`StopInstancesInput`](crate::operation::stop_instances::StopInstancesInput).
pub fn build(
self,
) -> ::std::result::Result<crate::operation::stop_instances::StopInstancesInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::stop_instances::StopInstancesInput {
instance_ids: self.instance_ids,
hibernate: self.hibernate,
skip_os_shutdown: self.skip_os_shutdown,
dry_run: self.dry_run,
force: self.force,
})
}
}