aws_sdk_ec2/operation/cancel_capacity_reservation_fleets/_cancel_capacity_reservation_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 CancelCapacityReservationFleetsInput {
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 Capacity Reservation Fleets to cancel.</p>
9 pub capacity_reservation_fleet_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
10}
11impl CancelCapacityReservationFleetsInput {
12 /// <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>
13 pub fn dry_run(&self) -> ::std::option::Option<bool> {
14 self.dry_run
15 }
16 /// <p>The IDs of the Capacity Reservation Fleets to cancel.</p>
17 ///
18 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.capacity_reservation_fleet_ids.is_none()`.
19 pub fn capacity_reservation_fleet_ids(&self) -> &[::std::string::String] {
20 self.capacity_reservation_fleet_ids.as_deref().unwrap_or_default()
21 }
22}
23impl CancelCapacityReservationFleetsInput {
24 /// Creates a new builder-style object to manufacture [`CancelCapacityReservationFleetsInput`](crate::operation::cancel_capacity_reservation_fleets::CancelCapacityReservationFleetsInput).
25 pub fn builder() -> crate::operation::cancel_capacity_reservation_fleets::builders::CancelCapacityReservationFleetsInputBuilder {
26 crate::operation::cancel_capacity_reservation_fleets::builders::CancelCapacityReservationFleetsInputBuilder::default()
27 }
28}
29
30/// A builder for [`CancelCapacityReservationFleetsInput`](crate::operation::cancel_capacity_reservation_fleets::CancelCapacityReservationFleetsInput).
31#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
32#[non_exhaustive]
33pub struct CancelCapacityReservationFleetsInputBuilder {
34 pub(crate) dry_run: ::std::option::Option<bool>,
35 pub(crate) capacity_reservation_fleet_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
36}
37impl CancelCapacityReservationFleetsInputBuilder {
38 /// <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>
39 pub fn dry_run(mut self, input: bool) -> Self {
40 self.dry_run = ::std::option::Option::Some(input);
41 self
42 }
43 /// <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>
44 pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
45 self.dry_run = input;
46 self
47 }
48 /// <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>
49 pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
50 &self.dry_run
51 }
52 /// Appends an item to `capacity_reservation_fleet_ids`.
53 ///
54 /// To override the contents of this collection use [`set_capacity_reservation_fleet_ids`](Self::set_capacity_reservation_fleet_ids).
55 ///
56 /// <p>The IDs of the Capacity Reservation Fleets to cancel.</p>
57 pub fn capacity_reservation_fleet_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
58 let mut v = self.capacity_reservation_fleet_ids.unwrap_or_default();
59 v.push(input.into());
60 self.capacity_reservation_fleet_ids = ::std::option::Option::Some(v);
61 self
62 }
63 /// <p>The IDs of the Capacity Reservation Fleets to cancel.</p>
64 pub fn set_capacity_reservation_fleet_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
65 self.capacity_reservation_fleet_ids = input;
66 self
67 }
68 /// <p>The IDs of the Capacity Reservation Fleets to cancel.</p>
69 pub fn get_capacity_reservation_fleet_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
70 &self.capacity_reservation_fleet_ids
71 }
72 /// Consumes the builder and constructs a [`CancelCapacityReservationFleetsInput`](crate::operation::cancel_capacity_reservation_fleets::CancelCapacityReservationFleetsInput).
73 pub fn build(
74 self,
75 ) -> ::std::result::Result<
76 crate::operation::cancel_capacity_reservation_fleets::CancelCapacityReservationFleetsInput,
77 ::aws_smithy_types::error::operation::BuildError,
78 > {
79 ::std::result::Result::Ok(
80 crate::operation::cancel_capacity_reservation_fleets::CancelCapacityReservationFleetsInput {
81 dry_run: self.dry_run,
82 capacity_reservation_fleet_ids: self.capacity_reservation_fleet_ids,
83 },
84 )
85 }
86}