aws_sdk_ec2/operation/describe_reserved_instances/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::describe_reserved_instances::_describe_reserved_instances_output::DescribeReservedInstancesOutputBuilder;
3
4pub use crate::operation::describe_reserved_instances::_describe_reserved_instances_input::DescribeReservedInstancesInputBuilder;
5
6impl crate::operation::describe_reserved_instances::builders::DescribeReservedInstancesInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::describe_reserved_instances::DescribeReservedInstancesOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::describe_reserved_instances::DescribeReservedInstancesError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.describe_reserved_instances();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `DescribeReservedInstances`.
24///
25/// <p>Describes one or more of the Reserved Instances that you purchased.</p>
26/// <p>For more information about Reserved Instances, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts-on-demand-reserved-instances.html">Reserved Instances</a> in the <i>Amazon EC2 User Guide</i>.</p><note>
27/// <p>The order of the elements in the response, including those within nested structures, might vary. Applications should not assume the elements appear in a particular order.</p>
28/// </note>
29#[derive(::std::clone::Clone, ::std::fmt::Debug)]
30pub struct DescribeReservedInstancesFluentBuilder {
31    handle: ::std::sync::Arc<crate::client::Handle>,
32    inner: crate::operation::describe_reserved_instances::builders::DescribeReservedInstancesInputBuilder,
33    config_override: ::std::option::Option<crate::config::Builder>,
34}
35impl
36    crate::client::customize::internal::CustomizableSend<
37        crate::operation::describe_reserved_instances::DescribeReservedInstancesOutput,
38        crate::operation::describe_reserved_instances::DescribeReservedInstancesError,
39    > for DescribeReservedInstancesFluentBuilder
40{
41    fn send(
42        self,
43        config_override: crate::config::Builder,
44    ) -> crate::client::customize::internal::BoxFuture<
45        crate::client::customize::internal::SendResult<
46            crate::operation::describe_reserved_instances::DescribeReservedInstancesOutput,
47            crate::operation::describe_reserved_instances::DescribeReservedInstancesError,
48        >,
49    > {
50        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
51    }
52}
53impl DescribeReservedInstancesFluentBuilder {
54    /// Creates a new `DescribeReservedInstancesFluentBuilder`.
55    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
56        Self {
57            handle,
58            inner: ::std::default::Default::default(),
59            config_override: ::std::option::Option::None,
60        }
61    }
62    /// Access the DescribeReservedInstances as a reference.
63    pub fn as_input(&self) -> &crate::operation::describe_reserved_instances::builders::DescribeReservedInstancesInputBuilder {
64        &self.inner
65    }
66    /// Sends the request and returns the response.
67    ///
68    /// If an error occurs, an `SdkError` will be returned with additional details that
69    /// can be matched against.
70    ///
71    /// By default, any retryable failures will be retried twice. Retry behavior
72    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
73    /// set when configuring the client.
74    pub async fn send(
75        self,
76    ) -> ::std::result::Result<
77        crate::operation::describe_reserved_instances::DescribeReservedInstancesOutput,
78        ::aws_smithy_runtime_api::client::result::SdkError<
79            crate::operation::describe_reserved_instances::DescribeReservedInstancesError,
80            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
81        >,
82    > {
83        let input = self
84            .inner
85            .build()
86            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
87        let runtime_plugins = crate::operation::describe_reserved_instances::DescribeReservedInstances::operation_runtime_plugins(
88            self.handle.runtime_plugins.clone(),
89            &self.handle.conf,
90            self.config_override,
91        );
92        crate::operation::describe_reserved_instances::DescribeReservedInstances::orchestrate(&runtime_plugins, input).await
93    }
94
95    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
96    pub fn customize(
97        self,
98    ) -> crate::client::customize::CustomizableOperation<
99        crate::operation::describe_reserved_instances::DescribeReservedInstancesOutput,
100        crate::operation::describe_reserved_instances::DescribeReservedInstancesError,
101        Self,
102    > {
103        crate::client::customize::CustomizableOperation::new(self)
104    }
105    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
106        self.set_config_override(::std::option::Option::Some(config_override.into()));
107        self
108    }
109
110    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
111        self.config_override = config_override;
112        self
113    }
114    /// <p>Describes whether the Reserved Instance is Standard or Convertible.</p>
115    pub fn offering_class(mut self, input: crate::types::OfferingClassType) -> Self {
116        self.inner = self.inner.offering_class(input);
117        self
118    }
119    /// <p>Describes whether the Reserved Instance is Standard or Convertible.</p>
120    pub fn set_offering_class(mut self, input: ::std::option::Option<crate::types::OfferingClassType>) -> Self {
121        self.inner = self.inner.set_offering_class(input);
122        self
123    }
124    /// <p>Describes whether the Reserved Instance is Standard or Convertible.</p>
125    pub fn get_offering_class(&self) -> &::std::option::Option<crate::types::OfferingClassType> {
126        self.inner.get_offering_class()
127    }
128    ///
129    /// Appends an item to `ReservedInstancesIds`.
130    ///
131    /// To override the contents of this collection use [`set_reserved_instances_ids`](Self::set_reserved_instances_ids).
132    ///
133    /// <p>One or more Reserved Instance IDs.</p>
134    /// <p>Default: Describes all your Reserved Instances, or only those otherwise specified.</p>
135    pub fn reserved_instances_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
136        self.inner = self.inner.reserved_instances_ids(input.into());
137        self
138    }
139    /// <p>One or more Reserved Instance IDs.</p>
140    /// <p>Default: Describes all your Reserved Instances, or only those otherwise specified.</p>
141    pub fn set_reserved_instances_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
142        self.inner = self.inner.set_reserved_instances_ids(input);
143        self
144    }
145    /// <p>One or more Reserved Instance IDs.</p>
146    /// <p>Default: Describes all your Reserved Instances, or only those otherwise specified.</p>
147    pub fn get_reserved_instances_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
148        self.inner.get_reserved_instances_ids()
149    }
150    /// <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>
151    pub fn dry_run(mut self, input: bool) -> Self {
152        self.inner = self.inner.dry_run(input);
153        self
154    }
155    /// <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>
156    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
157        self.inner = self.inner.set_dry_run(input);
158        self
159    }
160    /// <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>
161    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
162        self.inner.get_dry_run()
163    }
164    ///
165    /// Appends an item to `Filters`.
166    ///
167    /// To override the contents of this collection use [`set_filters`](Self::set_filters).
168    ///
169    /// <p>One or more filters.</p>
170    /// <ul>
171    /// <li>
172    /// <p><code>availability-zone</code> - The Availability Zone where the Reserved Instance can be used.</p></li>
173    /// <li>
174    /// <p><code>availability-zone-id</code> - The ID of the Availability Zone where the Reserved Instance can be used.</p></li>
175    /// <li>
176    /// <p><code>duration</code> - The duration of the Reserved Instance (one year or three years), in seconds (<code>31536000</code> | <code>94608000</code>).</p></li>
177    /// <li>
178    /// <p><code>end</code> - The time when the Reserved Instance expires (for example, 2015-08-07T11:54:42.000Z).</p></li>
179    /// <li>
180    /// <p><code>fixed-price</code> - The purchase price of the Reserved Instance (for example, 9800.0).</p></li>
181    /// <li>
182    /// <p><code>instance-type</code> - The instance type that is covered by the reservation.</p></li>
183    /// <li>
184    /// <p><code>scope</code> - The scope of the Reserved Instance (<code>Region</code> or <code>Availability Zone</code>).</p></li>
185    /// <li>
186    /// <p><code>product-description</code> - The Reserved Instance product platform description (<code>Linux/UNIX</code> | <code>Linux with SQL Server Standard</code> | <code>Linux with SQL Server Web</code> | <code>Linux with SQL Server Enterprise</code> | <code>SUSE Linux</code> | <code>Red Hat Enterprise Linux</code> | <code>Red Hat Enterprise Linux with HA</code> | <code>Windows</code> | <code>Windows with SQL Server Standard</code> | <code>Windows with SQL Server Web</code> | <code>Windows with SQL Server Enterprise</code>).</p></li>
187    /// <li>
188    /// <p><code>reserved-instances-id</code> - The ID of the Reserved Instance.</p></li>
189    /// <li>
190    /// <p><code>start</code> - The time at which the Reserved Instance purchase request was placed (for example, 2014-08-07T11:54:42.000Z).</p></li>
191    /// <li>
192    /// <p><code>state</code> - The state of the Reserved Instance (<code>payment-pending</code> | <code>active</code> | <code>payment-failed</code> | <code>retired</code>).</p></li>
193    /// <li>
194    /// <p><code>tag:<key></key></code> - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key <code>Owner</code> and the value <code>TeamA</code>, specify <code>tag:Owner</code> for the filter name and <code>TeamA</code> for the filter value.</p></li>
195    /// <li>
196    /// <p><code>tag-key</code> - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.</p></li>
197    /// <li>
198    /// <p><code>usage-price</code> - The usage price of the Reserved Instance, per hour (for example, 0.84).</p></li>
199    /// </ul>
200    pub fn filters(mut self, input: crate::types::Filter) -> Self {
201        self.inner = self.inner.filters(input);
202        self
203    }
204    /// <p>One or more filters.</p>
205    /// <ul>
206    /// <li>
207    /// <p><code>availability-zone</code> - The Availability Zone where the Reserved Instance can be used.</p></li>
208    /// <li>
209    /// <p><code>availability-zone-id</code> - The ID of the Availability Zone where the Reserved Instance can be used.</p></li>
210    /// <li>
211    /// <p><code>duration</code> - The duration of the Reserved Instance (one year or three years), in seconds (<code>31536000</code> | <code>94608000</code>).</p></li>
212    /// <li>
213    /// <p><code>end</code> - The time when the Reserved Instance expires (for example, 2015-08-07T11:54:42.000Z).</p></li>
214    /// <li>
215    /// <p><code>fixed-price</code> - The purchase price of the Reserved Instance (for example, 9800.0).</p></li>
216    /// <li>
217    /// <p><code>instance-type</code> - The instance type that is covered by the reservation.</p></li>
218    /// <li>
219    /// <p><code>scope</code> - The scope of the Reserved Instance (<code>Region</code> or <code>Availability Zone</code>).</p></li>
220    /// <li>
221    /// <p><code>product-description</code> - The Reserved Instance product platform description (<code>Linux/UNIX</code> | <code>Linux with SQL Server Standard</code> | <code>Linux with SQL Server Web</code> | <code>Linux with SQL Server Enterprise</code> | <code>SUSE Linux</code> | <code>Red Hat Enterprise Linux</code> | <code>Red Hat Enterprise Linux with HA</code> | <code>Windows</code> | <code>Windows with SQL Server Standard</code> | <code>Windows with SQL Server Web</code> | <code>Windows with SQL Server Enterprise</code>).</p></li>
222    /// <li>
223    /// <p><code>reserved-instances-id</code> - The ID of the Reserved Instance.</p></li>
224    /// <li>
225    /// <p><code>start</code> - The time at which the Reserved Instance purchase request was placed (for example, 2014-08-07T11:54:42.000Z).</p></li>
226    /// <li>
227    /// <p><code>state</code> - The state of the Reserved Instance (<code>payment-pending</code> | <code>active</code> | <code>payment-failed</code> | <code>retired</code>).</p></li>
228    /// <li>
229    /// <p><code>tag:<key></key></code> - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key <code>Owner</code> and the value <code>TeamA</code>, specify <code>tag:Owner</code> for the filter name and <code>TeamA</code> for the filter value.</p></li>
230    /// <li>
231    /// <p><code>tag-key</code> - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.</p></li>
232    /// <li>
233    /// <p><code>usage-price</code> - The usage price of the Reserved Instance, per hour (for example, 0.84).</p></li>
234    /// </ul>
235    pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>) -> Self {
236        self.inner = self.inner.set_filters(input);
237        self
238    }
239    /// <p>One or more filters.</p>
240    /// <ul>
241    /// <li>
242    /// <p><code>availability-zone</code> - The Availability Zone where the Reserved Instance can be used.</p></li>
243    /// <li>
244    /// <p><code>availability-zone-id</code> - The ID of the Availability Zone where the Reserved Instance can be used.</p></li>
245    /// <li>
246    /// <p><code>duration</code> - The duration of the Reserved Instance (one year or three years), in seconds (<code>31536000</code> | <code>94608000</code>).</p></li>
247    /// <li>
248    /// <p><code>end</code> - The time when the Reserved Instance expires (for example, 2015-08-07T11:54:42.000Z).</p></li>
249    /// <li>
250    /// <p><code>fixed-price</code> - The purchase price of the Reserved Instance (for example, 9800.0).</p></li>
251    /// <li>
252    /// <p><code>instance-type</code> - The instance type that is covered by the reservation.</p></li>
253    /// <li>
254    /// <p><code>scope</code> - The scope of the Reserved Instance (<code>Region</code> or <code>Availability Zone</code>).</p></li>
255    /// <li>
256    /// <p><code>product-description</code> - The Reserved Instance product platform description (<code>Linux/UNIX</code> | <code>Linux with SQL Server Standard</code> | <code>Linux with SQL Server Web</code> | <code>Linux with SQL Server Enterprise</code> | <code>SUSE Linux</code> | <code>Red Hat Enterprise Linux</code> | <code>Red Hat Enterprise Linux with HA</code> | <code>Windows</code> | <code>Windows with SQL Server Standard</code> | <code>Windows with SQL Server Web</code> | <code>Windows with SQL Server Enterprise</code>).</p></li>
257    /// <li>
258    /// <p><code>reserved-instances-id</code> - The ID of the Reserved Instance.</p></li>
259    /// <li>
260    /// <p><code>start</code> - The time at which the Reserved Instance purchase request was placed (for example, 2014-08-07T11:54:42.000Z).</p></li>
261    /// <li>
262    /// <p><code>state</code> - The state of the Reserved Instance (<code>payment-pending</code> | <code>active</code> | <code>payment-failed</code> | <code>retired</code>).</p></li>
263    /// <li>
264    /// <p><code>tag:<key></key></code> - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key <code>Owner</code> and the value <code>TeamA</code>, specify <code>tag:Owner</code> for the filter name and <code>TeamA</code> for the filter value.</p></li>
265    /// <li>
266    /// <p><code>tag-key</code> - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.</p></li>
267    /// <li>
268    /// <p><code>usage-price</code> - The usage price of the Reserved Instance, per hour (for example, 0.84).</p></li>
269    /// </ul>
270    pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Filter>> {
271        self.inner.get_filters()
272    }
273    /// <p>The Reserved Instance offering type. If you are using tools that predate the 2011-11-01 API version, you only have access to the <code>Medium Utilization</code> Reserved Instance offering type.</p>
274    pub fn offering_type(mut self, input: crate::types::OfferingTypeValues) -> Self {
275        self.inner = self.inner.offering_type(input);
276        self
277    }
278    /// <p>The Reserved Instance offering type. If you are using tools that predate the 2011-11-01 API version, you only have access to the <code>Medium Utilization</code> Reserved Instance offering type.</p>
279    pub fn set_offering_type(mut self, input: ::std::option::Option<crate::types::OfferingTypeValues>) -> Self {
280        self.inner = self.inner.set_offering_type(input);
281        self
282    }
283    /// <p>The Reserved Instance offering type. If you are using tools that predate the 2011-11-01 API version, you only have access to the <code>Medium Utilization</code> Reserved Instance offering type.</p>
284    pub fn get_offering_type(&self) -> &::std::option::Option<crate::types::OfferingTypeValues> {
285        self.inner.get_offering_type()
286    }
287}