Skip to main content

aws_sdk_ec2/operation/describe_scheduled_instance_availability/
_describe_scheduled_instance_availability_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Contains the parameters for DescribeScheduledInstanceAvailability.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct DescribeScheduledInstanceAvailabilityInput {
7    /// <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>
8    pub dry_run: ::std::option::Option<bool>,
9    /// <p>The filters.</p>
10    /// <ul>
11    /// <li>
12    /// <p><code>availability-zone</code> - The Availability Zone (for example, <code>us-west-2a</code>).</p></li>
13    /// <li>
14    /// <p><code>instance-type</code> - The instance type (for example, <code>c4.large</code>).</p></li>
15    /// <li>
16    /// <p><code>platform</code> - The platform (<code>Linux/UNIX</code> or <code>Windows</code>).</p></li>
17    /// </ul>
18    pub filters: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>,
19    /// <p>The time period for the first schedule to start.</p>
20    pub first_slot_start_time_range: ::std::option::Option<crate::types::SlotDateTimeRangeRequest>,
21    /// <p>The maximum number of results to return in a single call. This value can be between 5 and 300. The default value is 300. To retrieve the remaining results, make another call with the returned <code>NextToken</code> value.</p>
22    pub max_results: ::std::option::Option<i32>,
23    /// <p>The maximum available duration, in hours. This value must be greater than <code>MinSlotDurationInHours</code> and less than 1,720.</p>
24    pub max_slot_duration_in_hours: ::std::option::Option<i32>,
25    /// <p>The minimum available duration, in hours. The minimum required duration is 1,200 hours per year. For example, the minimum daily schedule is 4 hours, the minimum weekly schedule is 24 hours, and the minimum monthly schedule is 100 hours.</p>
26    pub min_slot_duration_in_hours: ::std::option::Option<i32>,
27    /// <p>The token for the next set of results.</p>
28    pub next_token: ::std::option::Option<::std::string::String>,
29    /// <p>The schedule recurrence.</p>
30    pub recurrence: ::std::option::Option<crate::types::ScheduledInstanceRecurrenceRequest>,
31}
32impl DescribeScheduledInstanceAvailabilityInput {
33    /// <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>
34    pub fn dry_run(&self) -> ::std::option::Option<bool> {
35        self.dry_run
36    }
37    /// <p>The filters.</p>
38    /// <ul>
39    /// <li>
40    /// <p><code>availability-zone</code> - The Availability Zone (for example, <code>us-west-2a</code>).</p></li>
41    /// <li>
42    /// <p><code>instance-type</code> - The instance type (for example, <code>c4.large</code>).</p></li>
43    /// <li>
44    /// <p><code>platform</code> - The platform (<code>Linux/UNIX</code> or <code>Windows</code>).</p></li>
45    /// </ul>
46    ///
47    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.filters.is_none()`.
48    pub fn filters(&self) -> &[crate::types::Filter] {
49        self.filters.as_deref().unwrap_or_default()
50    }
51    /// <p>The time period for the first schedule to start.</p>
52    pub fn first_slot_start_time_range(&self) -> ::std::option::Option<&crate::types::SlotDateTimeRangeRequest> {
53        self.first_slot_start_time_range.as_ref()
54    }
55    /// <p>The maximum number of results to return in a single call. This value can be between 5 and 300. The default value is 300. To retrieve the remaining results, make another call with the returned <code>NextToken</code> value.</p>
56    pub fn max_results(&self) -> ::std::option::Option<i32> {
57        self.max_results
58    }
59    /// <p>The maximum available duration, in hours. This value must be greater than <code>MinSlotDurationInHours</code> and less than 1,720.</p>
60    pub fn max_slot_duration_in_hours(&self) -> ::std::option::Option<i32> {
61        self.max_slot_duration_in_hours
62    }
63    /// <p>The minimum available duration, in hours. The minimum required duration is 1,200 hours per year. For example, the minimum daily schedule is 4 hours, the minimum weekly schedule is 24 hours, and the minimum monthly schedule is 100 hours.</p>
64    pub fn min_slot_duration_in_hours(&self) -> ::std::option::Option<i32> {
65        self.min_slot_duration_in_hours
66    }
67    /// <p>The token for the next set of results.</p>
68    pub fn next_token(&self) -> ::std::option::Option<&str> {
69        self.next_token.as_deref()
70    }
71    /// <p>The schedule recurrence.</p>
72    pub fn recurrence(&self) -> ::std::option::Option<&crate::types::ScheduledInstanceRecurrenceRequest> {
73        self.recurrence.as_ref()
74    }
75}
76impl DescribeScheduledInstanceAvailabilityInput {
77    /// Creates a new builder-style object to manufacture [`DescribeScheduledInstanceAvailabilityInput`](crate::operation::describe_scheduled_instance_availability::DescribeScheduledInstanceAvailabilityInput).
78    pub fn builder() -> crate::operation::describe_scheduled_instance_availability::builders::DescribeScheduledInstanceAvailabilityInputBuilder {
79        crate::operation::describe_scheduled_instance_availability::builders::DescribeScheduledInstanceAvailabilityInputBuilder::default()
80    }
81}
82
83/// A builder for [`DescribeScheduledInstanceAvailabilityInput`](crate::operation::describe_scheduled_instance_availability::DescribeScheduledInstanceAvailabilityInput).
84#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
85#[non_exhaustive]
86pub struct DescribeScheduledInstanceAvailabilityInputBuilder {
87    pub(crate) dry_run: ::std::option::Option<bool>,
88    pub(crate) filters: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>,
89    pub(crate) first_slot_start_time_range: ::std::option::Option<crate::types::SlotDateTimeRangeRequest>,
90    pub(crate) max_results: ::std::option::Option<i32>,
91    pub(crate) max_slot_duration_in_hours: ::std::option::Option<i32>,
92    pub(crate) min_slot_duration_in_hours: ::std::option::Option<i32>,
93    pub(crate) next_token: ::std::option::Option<::std::string::String>,
94    pub(crate) recurrence: ::std::option::Option<crate::types::ScheduledInstanceRecurrenceRequest>,
95}
96impl DescribeScheduledInstanceAvailabilityInputBuilder {
97    /// <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>
98    pub fn dry_run(mut self, input: bool) -> Self {
99        self.dry_run = ::std::option::Option::Some(input);
100        self
101    }
102    /// <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>
103    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
104        self.dry_run = input;
105        self
106    }
107    /// <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>
108    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
109        &self.dry_run
110    }
111    /// Appends an item to `filters`.
112    ///
113    /// To override the contents of this collection use [`set_filters`](Self::set_filters).
114    ///
115    /// <p>The filters.</p>
116    /// <ul>
117    /// <li>
118    /// <p><code>availability-zone</code> - The Availability Zone (for example, <code>us-west-2a</code>).</p></li>
119    /// <li>
120    /// <p><code>instance-type</code> - The instance type (for example, <code>c4.large</code>).</p></li>
121    /// <li>
122    /// <p><code>platform</code> - The platform (<code>Linux/UNIX</code> or <code>Windows</code>).</p></li>
123    /// </ul>
124    pub fn filters(mut self, input: crate::types::Filter) -> Self {
125        let mut v = self.filters.unwrap_or_default();
126        v.push(input);
127        self.filters = ::std::option::Option::Some(v);
128        self
129    }
130    /// <p>The filters.</p>
131    /// <ul>
132    /// <li>
133    /// <p><code>availability-zone</code> - The Availability Zone (for example, <code>us-west-2a</code>).</p></li>
134    /// <li>
135    /// <p><code>instance-type</code> - The instance type (for example, <code>c4.large</code>).</p></li>
136    /// <li>
137    /// <p><code>platform</code> - The platform (<code>Linux/UNIX</code> or <code>Windows</code>).</p></li>
138    /// </ul>
139    pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>) -> Self {
140        self.filters = input;
141        self
142    }
143    /// <p>The filters.</p>
144    /// <ul>
145    /// <li>
146    /// <p><code>availability-zone</code> - The Availability Zone (for example, <code>us-west-2a</code>).</p></li>
147    /// <li>
148    /// <p><code>instance-type</code> - The instance type (for example, <code>c4.large</code>).</p></li>
149    /// <li>
150    /// <p><code>platform</code> - The platform (<code>Linux/UNIX</code> or <code>Windows</code>).</p></li>
151    /// </ul>
152    pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Filter>> {
153        &self.filters
154    }
155    /// <p>The time period for the first schedule to start.</p>
156    /// This field is required.
157    pub fn first_slot_start_time_range(mut self, input: crate::types::SlotDateTimeRangeRequest) -> Self {
158        self.first_slot_start_time_range = ::std::option::Option::Some(input);
159        self
160    }
161    /// <p>The time period for the first schedule to start.</p>
162    pub fn set_first_slot_start_time_range(mut self, input: ::std::option::Option<crate::types::SlotDateTimeRangeRequest>) -> Self {
163        self.first_slot_start_time_range = input;
164        self
165    }
166    /// <p>The time period for the first schedule to start.</p>
167    pub fn get_first_slot_start_time_range(&self) -> &::std::option::Option<crate::types::SlotDateTimeRangeRequest> {
168        &self.first_slot_start_time_range
169    }
170    /// <p>The maximum number of results to return in a single call. This value can be between 5 and 300. The default value is 300. To retrieve the remaining results, make another call with the returned <code>NextToken</code> value.</p>
171    pub fn max_results(mut self, input: i32) -> Self {
172        self.max_results = ::std::option::Option::Some(input);
173        self
174    }
175    /// <p>The maximum number of results to return in a single call. This value can be between 5 and 300. The default value is 300. To retrieve the remaining results, make another call with the returned <code>NextToken</code> value.</p>
176    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
177        self.max_results = input;
178        self
179    }
180    /// <p>The maximum number of results to return in a single call. This value can be between 5 and 300. The default value is 300. To retrieve the remaining results, make another call with the returned <code>NextToken</code> value.</p>
181    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
182        &self.max_results
183    }
184    /// <p>The maximum available duration, in hours. This value must be greater than <code>MinSlotDurationInHours</code> and less than 1,720.</p>
185    pub fn max_slot_duration_in_hours(mut self, input: i32) -> Self {
186        self.max_slot_duration_in_hours = ::std::option::Option::Some(input);
187        self
188    }
189    /// <p>The maximum available duration, in hours. This value must be greater than <code>MinSlotDurationInHours</code> and less than 1,720.</p>
190    pub fn set_max_slot_duration_in_hours(mut self, input: ::std::option::Option<i32>) -> Self {
191        self.max_slot_duration_in_hours = input;
192        self
193    }
194    /// <p>The maximum available duration, in hours. This value must be greater than <code>MinSlotDurationInHours</code> and less than 1,720.</p>
195    pub fn get_max_slot_duration_in_hours(&self) -> &::std::option::Option<i32> {
196        &self.max_slot_duration_in_hours
197    }
198    /// <p>The minimum available duration, in hours. The minimum required duration is 1,200 hours per year. For example, the minimum daily schedule is 4 hours, the minimum weekly schedule is 24 hours, and the minimum monthly schedule is 100 hours.</p>
199    pub fn min_slot_duration_in_hours(mut self, input: i32) -> Self {
200        self.min_slot_duration_in_hours = ::std::option::Option::Some(input);
201        self
202    }
203    /// <p>The minimum available duration, in hours. The minimum required duration is 1,200 hours per year. For example, the minimum daily schedule is 4 hours, the minimum weekly schedule is 24 hours, and the minimum monthly schedule is 100 hours.</p>
204    pub fn set_min_slot_duration_in_hours(mut self, input: ::std::option::Option<i32>) -> Self {
205        self.min_slot_duration_in_hours = input;
206        self
207    }
208    /// <p>The minimum available duration, in hours. The minimum required duration is 1,200 hours per year. For example, the minimum daily schedule is 4 hours, the minimum weekly schedule is 24 hours, and the minimum monthly schedule is 100 hours.</p>
209    pub fn get_min_slot_duration_in_hours(&self) -> &::std::option::Option<i32> {
210        &self.min_slot_duration_in_hours
211    }
212    /// <p>The token for the next set of results.</p>
213    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
214        self.next_token = ::std::option::Option::Some(input.into());
215        self
216    }
217    /// <p>The token for the next set of results.</p>
218    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
219        self.next_token = input;
220        self
221    }
222    /// <p>The token for the next set of results.</p>
223    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
224        &self.next_token
225    }
226    /// <p>The schedule recurrence.</p>
227    /// This field is required.
228    pub fn recurrence(mut self, input: crate::types::ScheduledInstanceRecurrenceRequest) -> Self {
229        self.recurrence = ::std::option::Option::Some(input);
230        self
231    }
232    /// <p>The schedule recurrence.</p>
233    pub fn set_recurrence(mut self, input: ::std::option::Option<crate::types::ScheduledInstanceRecurrenceRequest>) -> Self {
234        self.recurrence = input;
235        self
236    }
237    /// <p>The schedule recurrence.</p>
238    pub fn get_recurrence(&self) -> &::std::option::Option<crate::types::ScheduledInstanceRecurrenceRequest> {
239        &self.recurrence
240    }
241    /// Consumes the builder and constructs a [`DescribeScheduledInstanceAvailabilityInput`](crate::operation::describe_scheduled_instance_availability::DescribeScheduledInstanceAvailabilityInput).
242    pub fn build(
243        self,
244    ) -> ::std::result::Result<
245        crate::operation::describe_scheduled_instance_availability::DescribeScheduledInstanceAvailabilityInput,
246        ::aws_smithy_types::error::operation::BuildError,
247    > {
248        ::std::result::Result::Ok(
249            crate::operation::describe_scheduled_instance_availability::DescribeScheduledInstanceAvailabilityInput {
250                dry_run: self.dry_run,
251                filters: self.filters,
252                first_slot_start_time_range: self.first_slot_start_time_range,
253                max_results: self.max_results,
254                max_slot_duration_in_hours: self.max_slot_duration_in_hours,
255                min_slot_duration_in_hours: self.min_slot_duration_in_hours,
256                next_token: self.next_token,
257                recurrence: self.recurrence,
258            },
259        )
260    }
261}