aws_sdk_ec2/operation/delete_fleets/_delete_fleets_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct DeleteFleetsInput {
6 /// <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>
7 pub dry_run: ::std::option::Option<bool>,
8 /// <p>The IDs of the EC2 Fleets.</p>
9 /// <p>Constraints: In a single request, you can specify up to 25 <code>instant</code> fleet IDs and up to 100 <code>maintain</code> or <code>request</code> fleet IDs.</p>
10 pub fleet_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
11 /// <p>Indicates whether to terminate the associated instances when the EC2 Fleet is deleted. The default is to terminate the instances.</p>
12 /// <p>To let the instances continue to run after the EC2 Fleet is deleted, specify <code>no-terminate-instances</code>. Supported only for fleets of type <code>maintain</code> and <code>request</code>.</p>
13 /// <p>For <code>instant</code> fleets, you cannot specify <code>NoTerminateInstances</code>. A deleted <code>instant</code> fleet with running instances is not supported.</p>
14 pub terminate_instances: ::std::option::Option<bool>,
15}
16impl DeleteFleetsInput {
17 /// <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>
18 pub fn dry_run(&self) -> ::std::option::Option<bool> {
19 self.dry_run
20 }
21 /// <p>The IDs of the EC2 Fleets.</p>
22 /// <p>Constraints: In a single request, you can specify up to 25 <code>instant</code> fleet IDs and up to 100 <code>maintain</code> or <code>request</code> fleet IDs.</p>
23 ///
24 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.fleet_ids.is_none()`.
25 pub fn fleet_ids(&self) -> &[::std::string::String] {
26 self.fleet_ids.as_deref().unwrap_or_default()
27 }
28 /// <p>Indicates whether to terminate the associated instances when the EC2 Fleet is deleted. The default is to terminate the instances.</p>
29 /// <p>To let the instances continue to run after the EC2 Fleet is deleted, specify <code>no-terminate-instances</code>. Supported only for fleets of type <code>maintain</code> and <code>request</code>.</p>
30 /// <p>For <code>instant</code> fleets, you cannot specify <code>NoTerminateInstances</code>. A deleted <code>instant</code> fleet with running instances is not supported.</p>
31 pub fn terminate_instances(&self) -> ::std::option::Option<bool> {
32 self.terminate_instances
33 }
34}
35impl DeleteFleetsInput {
36 /// Creates a new builder-style object to manufacture [`DeleteFleetsInput`](crate::operation::delete_fleets::DeleteFleetsInput).
37 pub fn builder() -> crate::operation::delete_fleets::builders::DeleteFleetsInputBuilder {
38 crate::operation::delete_fleets::builders::DeleteFleetsInputBuilder::default()
39 }
40}
41
42/// A builder for [`DeleteFleetsInput`](crate::operation::delete_fleets::DeleteFleetsInput).
43#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
44#[non_exhaustive]
45pub struct DeleteFleetsInputBuilder {
46 pub(crate) dry_run: ::std::option::Option<bool>,
47 pub(crate) fleet_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
48 pub(crate) terminate_instances: ::std::option::Option<bool>,
49}
50impl DeleteFleetsInputBuilder {
51 /// <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>
52 pub fn dry_run(mut self, input: bool) -> Self {
53 self.dry_run = ::std::option::Option::Some(input);
54 self
55 }
56 /// <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>
57 pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
58 self.dry_run = input;
59 self
60 }
61 /// <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>
62 pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
63 &self.dry_run
64 }
65 /// Appends an item to `fleet_ids`.
66 ///
67 /// To override the contents of this collection use [`set_fleet_ids`](Self::set_fleet_ids).
68 ///
69 /// <p>The IDs of the EC2 Fleets.</p>
70 /// <p>Constraints: In a single request, you can specify up to 25 <code>instant</code> fleet IDs and up to 100 <code>maintain</code> or <code>request</code> fleet IDs.</p>
71 pub fn fleet_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
72 let mut v = self.fleet_ids.unwrap_or_default();
73 v.push(input.into());
74 self.fleet_ids = ::std::option::Option::Some(v);
75 self
76 }
77 /// <p>The IDs of the EC2 Fleets.</p>
78 /// <p>Constraints: In a single request, you can specify up to 25 <code>instant</code> fleet IDs and up to 100 <code>maintain</code> or <code>request</code> fleet IDs.</p>
79 pub fn set_fleet_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
80 self.fleet_ids = input;
81 self
82 }
83 /// <p>The IDs of the EC2 Fleets.</p>
84 /// <p>Constraints: In a single request, you can specify up to 25 <code>instant</code> fleet IDs and up to 100 <code>maintain</code> or <code>request</code> fleet IDs.</p>
85 pub fn get_fleet_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
86 &self.fleet_ids
87 }
88 /// <p>Indicates whether to terminate the associated instances when the EC2 Fleet is deleted. The default is to terminate the instances.</p>
89 /// <p>To let the instances continue to run after the EC2 Fleet is deleted, specify <code>no-terminate-instances</code>. Supported only for fleets of type <code>maintain</code> and <code>request</code>.</p>
90 /// <p>For <code>instant</code> fleets, you cannot specify <code>NoTerminateInstances</code>. A deleted <code>instant</code> fleet with running instances is not supported.</p>
91 /// This field is required.
92 pub fn terminate_instances(mut self, input: bool) -> Self {
93 self.terminate_instances = ::std::option::Option::Some(input);
94 self
95 }
96 /// <p>Indicates whether to terminate the associated instances when the EC2 Fleet is deleted. The default is to terminate the instances.</p>
97 /// <p>To let the instances continue to run after the EC2 Fleet is deleted, specify <code>no-terminate-instances</code>. Supported only for fleets of type <code>maintain</code> and <code>request</code>.</p>
98 /// <p>For <code>instant</code> fleets, you cannot specify <code>NoTerminateInstances</code>. A deleted <code>instant</code> fleet with running instances is not supported.</p>
99 pub fn set_terminate_instances(mut self, input: ::std::option::Option<bool>) -> Self {
100 self.terminate_instances = input;
101 self
102 }
103 /// <p>Indicates whether to terminate the associated instances when the EC2 Fleet is deleted. The default is to terminate the instances.</p>
104 /// <p>To let the instances continue to run after the EC2 Fleet is deleted, specify <code>no-terminate-instances</code>. Supported only for fleets of type <code>maintain</code> and <code>request</code>.</p>
105 /// <p>For <code>instant</code> fleets, you cannot specify <code>NoTerminateInstances</code>. A deleted <code>instant</code> fleet with running instances is not supported.</p>
106 pub fn get_terminate_instances(&self) -> &::std::option::Option<bool> {
107 &self.terminate_instances
108 }
109 /// Consumes the builder and constructs a [`DeleteFleetsInput`](crate::operation::delete_fleets::DeleteFleetsInput).
110 pub fn build(
111 self,
112 ) -> ::std::result::Result<crate::operation::delete_fleets::DeleteFleetsInput, ::aws_smithy_types::error::operation::BuildError> {
113 ::std::result::Result::Ok(crate::operation::delete_fleets::DeleteFleetsInput {
114 dry_run: self.dry_run,
115 fleet_ids: self.fleet_ids,
116 terminate_instances: self.terminate_instances,
117 })
118 }
119}