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 178 179 180 181 182 183 184 185 186
// 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 ModifyFleetInput {
/// <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>
#[doc(hidden)]
pub dry_run: std::option::Option<bool>,
/// <p>Indicates whether running instances should be terminated if the total target capacity of the EC2 Fleet is decreased below the current size of the EC2 Fleet.</p>
/// <p>Supported only for fleets of type <code>maintain</code>.</p>
#[doc(hidden)]
pub excess_capacity_termination_policy:
std::option::Option<crate::types::FleetExcessCapacityTerminationPolicy>,
/// <p>The launch template and overrides.</p>
#[doc(hidden)]
pub launch_template_configs:
std::option::Option<std::vec::Vec<crate::types::FleetLaunchTemplateConfigRequest>>,
/// <p>The ID of the EC2 Fleet.</p>
#[doc(hidden)]
pub fleet_id: std::option::Option<std::string::String>,
/// <p>The size of the EC2 Fleet.</p>
#[doc(hidden)]
pub target_capacity_specification:
std::option::Option<crate::types::TargetCapacitySpecificationRequest>,
/// <p>Reserved.</p>
#[doc(hidden)]
pub context: std::option::Option<std::string::String>,
}
impl ModifyFleetInput {
/// <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>Indicates whether running instances should be terminated if the total target capacity of the EC2 Fleet is decreased below the current size of the EC2 Fleet.</p>
/// <p>Supported only for fleets of type <code>maintain</code>.</p>
pub fn excess_capacity_termination_policy(
&self,
) -> std::option::Option<&crate::types::FleetExcessCapacityTerminationPolicy> {
self.excess_capacity_termination_policy.as_ref()
}
/// <p>The launch template and overrides.</p>
pub fn launch_template_configs(
&self,
) -> std::option::Option<&[crate::types::FleetLaunchTemplateConfigRequest]> {
self.launch_template_configs.as_deref()
}
/// <p>The ID of the EC2 Fleet.</p>
pub fn fleet_id(&self) -> std::option::Option<&str> {
self.fleet_id.as_deref()
}
/// <p>The size of the EC2 Fleet.</p>
pub fn target_capacity_specification(
&self,
) -> std::option::Option<&crate::types::TargetCapacitySpecificationRequest> {
self.target_capacity_specification.as_ref()
}
/// <p>Reserved.</p>
pub fn context(&self) -> std::option::Option<&str> {
self.context.as_deref()
}
}
impl ModifyFleetInput {
/// Creates a new builder-style object to manufacture [`ModifyFleetInput`](crate::operation::modify_fleet::ModifyFleetInput).
pub fn builder() -> crate::operation::modify_fleet::builders::ModifyFleetInputBuilder {
crate::operation::modify_fleet::builders::ModifyFleetInputBuilder::default()
}
}
/// A builder for [`ModifyFleetInput`](crate::operation::modify_fleet::ModifyFleetInput).
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct ModifyFleetInputBuilder {
pub(crate) dry_run: std::option::Option<bool>,
pub(crate) excess_capacity_termination_policy:
std::option::Option<crate::types::FleetExcessCapacityTerminationPolicy>,
pub(crate) launch_template_configs:
std::option::Option<std::vec::Vec<crate::types::FleetLaunchTemplateConfigRequest>>,
pub(crate) fleet_id: std::option::Option<std::string::String>,
pub(crate) target_capacity_specification:
std::option::Option<crate::types::TargetCapacitySpecificationRequest>,
pub(crate) context: std::option::Option<std::string::String>,
}
impl ModifyFleetInputBuilder {
/// <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 = 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>Indicates whether running instances should be terminated if the total target capacity of the EC2 Fleet is decreased below the current size of the EC2 Fleet.</p>
/// <p>Supported only for fleets of type <code>maintain</code>.</p>
pub fn excess_capacity_termination_policy(
mut self,
input: crate::types::FleetExcessCapacityTerminationPolicy,
) -> Self {
self.excess_capacity_termination_policy = Some(input);
self
}
/// <p>Indicates whether running instances should be terminated if the total target capacity of the EC2 Fleet is decreased below the current size of the EC2 Fleet.</p>
/// <p>Supported only for fleets of type <code>maintain</code>.</p>
pub fn set_excess_capacity_termination_policy(
mut self,
input: std::option::Option<crate::types::FleetExcessCapacityTerminationPolicy>,
) -> Self {
self.excess_capacity_termination_policy = input;
self
}
/// Appends an item to `launch_template_configs`.
///
/// To override the contents of this collection use [`set_launch_template_configs`](Self::set_launch_template_configs).
///
/// <p>The launch template and overrides.</p>
pub fn launch_template_configs(
mut self,
input: crate::types::FleetLaunchTemplateConfigRequest,
) -> Self {
let mut v = self.launch_template_configs.unwrap_or_default();
v.push(input);
self.launch_template_configs = Some(v);
self
}
/// <p>The launch template and overrides.</p>
pub fn set_launch_template_configs(
mut self,
input: std::option::Option<std::vec::Vec<crate::types::FleetLaunchTemplateConfigRequest>>,
) -> Self {
self.launch_template_configs = input;
self
}
/// <p>The ID of the EC2 Fleet.</p>
pub fn fleet_id(mut self, input: impl Into<std::string::String>) -> Self {
self.fleet_id = Some(input.into());
self
}
/// <p>The ID of the EC2 Fleet.</p>
pub fn set_fleet_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.fleet_id = input;
self
}
/// <p>The size of the EC2 Fleet.</p>
pub fn target_capacity_specification(
mut self,
input: crate::types::TargetCapacitySpecificationRequest,
) -> Self {
self.target_capacity_specification = Some(input);
self
}
/// <p>The size of the EC2 Fleet.</p>
pub fn set_target_capacity_specification(
mut self,
input: std::option::Option<crate::types::TargetCapacitySpecificationRequest>,
) -> Self {
self.target_capacity_specification = input;
self
}
/// <p>Reserved.</p>
pub fn context(mut self, input: impl Into<std::string::String>) -> Self {
self.context = Some(input.into());
self
}
/// <p>Reserved.</p>
pub fn set_context(mut self, input: std::option::Option<std::string::String>) -> Self {
self.context = input;
self
}
/// Consumes the builder and constructs a [`ModifyFleetInput`](crate::operation::modify_fleet::ModifyFleetInput).
pub fn build(
self,
) -> Result<
crate::operation::modify_fleet::ModifyFleetInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::operation::modify_fleet::ModifyFleetInput {
dry_run: self.dry_run,
excess_capacity_termination_policy: self.excess_capacity_termination_policy,
launch_template_configs: self.launch_template_configs,
fleet_id: self.fleet_id,
target_capacity_specification: self.target_capacity_specification,
context: self.context,
})
}
}