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
// 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 instance</a> in the <i>Amazon EC2 User Guide</i>.</p>
/// <p> Default: <code>false</code> </p>
pub hibernate: ::std::option::Option<bool>,
/// <p>Checks whether you have the required permissions for the action, 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 instances to stop. The instances do not have an opportunity to flush file system caches or file system metadata. If you use this option, you must perform file system check and repair procedures. This option is not recommended for Windows instances.</p>
/// <p>Default: <code>false</code> </p>
pub force: ::std::option::Option<bool>,
}
impl StopInstancesInput {
/// <p>The IDs of the instances.</p>
pub fn instance_ids(&self) -> ::std::option::Option<&[::std::string::String]> {
self.instance_ids.as_deref()
}
/// <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 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>Checks whether you have the required permissions for the action, 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 instances to stop. The instances do not have an opportunity to flush file system caches or file system metadata. If you use this option, you must perform file system check and repair procedures. This option is not recommended for Windows instances.</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).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
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) 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 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 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 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>Checks whether you have the required permissions for the action, 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 action, 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 action, 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 instances to stop. The instances do not have an opportunity to flush file system caches or file system metadata. If you use this option, you must perform file system check and repair procedures. This option is not recommended for Windows instances.</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 instances to stop. The instances do not have an opportunity to flush file system caches or file system metadata. If you use this option, you must perform file system check and repair procedures. This option is not recommended for Windows instances.</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 instances to stop. The instances do not have an opportunity to flush file system caches or file system metadata. If you use this option, you must perform file system check and repair procedures. This option is not recommended for Windows instances.</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_http::operation::error::BuildError> {
::std::result::Result::Ok(crate::operation::stop_instances::StopInstancesInput {
instance_ids: self.instance_ids,
hibernate: self.hibernate,
dry_run: self.dry_run,
force: self.force,
})
}
}