aws_sdk_redshift/operation/get_reserved_node_exchange_configuration_options/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_reserved_node_exchange_configuration_options::_get_reserved_node_exchange_configuration_options_output::GetReservedNodeExchangeConfigurationOptionsOutputBuilder;
3
4pub use crate::operation::get_reserved_node_exchange_configuration_options::_get_reserved_node_exchange_configuration_options_input::GetReservedNodeExchangeConfigurationOptionsInputBuilder;
5
6impl crate::operation::get_reserved_node_exchange_configuration_options::builders::GetReservedNodeExchangeConfigurationOptionsInputBuilder {
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::get_reserved_node_exchange_configuration_options::GetReservedNodeExchangeConfigurationOptionsOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::get_reserved_node_exchange_configuration_options::GetReservedNodeExchangeConfigurationOptionsError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.get_reserved_node_exchange_configuration_options();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `GetReservedNodeExchangeConfigurationOptions`.
24///
25/// <p>Gets the configuration options for the reserved-node exchange. These options include information about the source reserved node and target reserved node offering. Details include the node type, the price, the node count, and the offering type.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct GetReservedNodeExchangeConfigurationOptionsFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::get_reserved_node_exchange_configuration_options::builders::GetReservedNodeExchangeConfigurationOptionsInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::get_reserved_node_exchange_configuration_options::GetReservedNodeExchangeConfigurationOptionsOutput,
35        crate::operation::get_reserved_node_exchange_configuration_options::GetReservedNodeExchangeConfigurationOptionsError,
36    > for GetReservedNodeExchangeConfigurationOptionsFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<
43            crate::operation::get_reserved_node_exchange_configuration_options::GetReservedNodeExchangeConfigurationOptionsOutput,
44            crate::operation::get_reserved_node_exchange_configuration_options::GetReservedNodeExchangeConfigurationOptionsError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl GetReservedNodeExchangeConfigurationOptionsFluentBuilder {
51    /// Creates a new `GetReservedNodeExchangeConfigurationOptionsFluentBuilder`.
52    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53        Self {
54            handle,
55            inner: ::std::default::Default::default(),
56            config_override: ::std::option::Option::None,
57        }
58    }
59    /// Access the GetReservedNodeExchangeConfigurationOptions as a reference.
60    pub fn as_input(
61        &self,
62    ) -> &crate::operation::get_reserved_node_exchange_configuration_options::builders::GetReservedNodeExchangeConfigurationOptionsInputBuilder {
63        &self.inner
64    }
65    /// Sends the request and returns the response.
66    ///
67    /// If an error occurs, an `SdkError` will be returned with additional details that
68    /// can be matched against.
69    ///
70    /// By default, any retryable failures will be retried twice. Retry behavior
71    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
72    /// set when configuring the client.
73    pub async fn send(
74        self,
75    ) -> ::std::result::Result<
76        crate::operation::get_reserved_node_exchange_configuration_options::GetReservedNodeExchangeConfigurationOptionsOutput,
77        ::aws_smithy_runtime_api::client::result::SdkError<
78            crate::operation::get_reserved_node_exchange_configuration_options::GetReservedNodeExchangeConfigurationOptionsError,
79            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
80        >,
81    > {
82        let input = self
83            .inner
84            .build()
85            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
86        let runtime_plugins = crate::operation::get_reserved_node_exchange_configuration_options::GetReservedNodeExchangeConfigurationOptions::operation_runtime_plugins(
87                            self.handle.runtime_plugins.clone(),
88                            &self.handle.conf,
89                            self.config_override,
90                        );
91        crate::operation::get_reserved_node_exchange_configuration_options::GetReservedNodeExchangeConfigurationOptions::orchestrate(
92            &runtime_plugins,
93            input,
94        )
95        .await
96    }
97
98    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
99    pub fn customize(
100        self,
101    ) -> crate::client::customize::CustomizableOperation<
102        crate::operation::get_reserved_node_exchange_configuration_options::GetReservedNodeExchangeConfigurationOptionsOutput,
103        crate::operation::get_reserved_node_exchange_configuration_options::GetReservedNodeExchangeConfigurationOptionsError,
104        Self,
105    > {
106        crate::client::customize::CustomizableOperation::new(self)
107    }
108    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
109        self.set_config_override(::std::option::Option::Some(config_override.into()));
110        self
111    }
112
113    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
114        self.config_override = config_override;
115        self
116    }
117    /// Create a paginator for this request
118    ///
119    /// Paginators are used by calling [`send().await`](crate::operation::get_reserved_node_exchange_configuration_options::paginator::GetReservedNodeExchangeConfigurationOptionsPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
120    pub fn into_paginator(
121        self,
122    ) -> crate::operation::get_reserved_node_exchange_configuration_options::paginator::GetReservedNodeExchangeConfigurationOptionsPaginator {
123        crate::operation::get_reserved_node_exchange_configuration_options::paginator::GetReservedNodeExchangeConfigurationOptionsPaginator::new(
124            self.handle,
125            self.inner,
126        )
127    }
128    /// <p>The action type of the reserved-node configuration. The action type can be an exchange initiated from either a snapshot or a resize.</p>
129    pub fn action_type(mut self, input: crate::types::ReservedNodeExchangeActionType) -> Self {
130        self.inner = self.inner.action_type(input);
131        self
132    }
133    /// <p>The action type of the reserved-node configuration. The action type can be an exchange initiated from either a snapshot or a resize.</p>
134    pub fn set_action_type(mut self, input: ::std::option::Option<crate::types::ReservedNodeExchangeActionType>) -> Self {
135        self.inner = self.inner.set_action_type(input);
136        self
137    }
138    /// <p>The action type of the reserved-node configuration. The action type can be an exchange initiated from either a snapshot or a resize.</p>
139    pub fn get_action_type(&self) -> &::std::option::Option<crate::types::ReservedNodeExchangeActionType> {
140        self.inner.get_action_type()
141    }
142    /// <p>The identifier for the cluster that is the source for a reserved-node exchange.</p>
143    pub fn cluster_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
144        self.inner = self.inner.cluster_identifier(input.into());
145        self
146    }
147    /// <p>The identifier for the cluster that is the source for a reserved-node exchange.</p>
148    pub fn set_cluster_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
149        self.inner = self.inner.set_cluster_identifier(input);
150        self
151    }
152    /// <p>The identifier for the cluster that is the source for a reserved-node exchange.</p>
153    pub fn get_cluster_identifier(&self) -> &::std::option::Option<::std::string::String> {
154        self.inner.get_cluster_identifier()
155    }
156    /// <p>The identifier for the snapshot that is the source for the reserved-node exchange.</p>
157    pub fn snapshot_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
158        self.inner = self.inner.snapshot_identifier(input.into());
159        self
160    }
161    /// <p>The identifier for the snapshot that is the source for the reserved-node exchange.</p>
162    pub fn set_snapshot_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
163        self.inner = self.inner.set_snapshot_identifier(input);
164        self
165    }
166    /// <p>The identifier for the snapshot that is the source for the reserved-node exchange.</p>
167    pub fn get_snapshot_identifier(&self) -> &::std::option::Option<::std::string::String> {
168        self.inner.get_snapshot_identifier()
169    }
170    /// <p>The maximum number of response records to return in each call. If the number of remaining response records exceeds the specified <code>MaxRecords</code> value, a value is returned in a <code>Marker</code> field of the response. You can retrieve the next set of records by retrying the command with the returned marker value.</p>
171    pub fn max_records(mut self, input: i32) -> Self {
172        self.inner = self.inner.max_records(input);
173        self
174    }
175    /// <p>The maximum number of response records to return in each call. If the number of remaining response records exceeds the specified <code>MaxRecords</code> value, a value is returned in a <code>Marker</code> field of the response. You can retrieve the next set of records by retrying the command with the returned marker value.</p>
176    pub fn set_max_records(mut self, input: ::std::option::Option<i32>) -> Self {
177        self.inner = self.inner.set_max_records(input);
178        self
179    }
180    /// <p>The maximum number of response records to return in each call. If the number of remaining response records exceeds the specified <code>MaxRecords</code> value, a value is returned in a <code>Marker</code> field of the response. You can retrieve the next set of records by retrying the command with the returned marker value.</p>
181    pub fn get_max_records(&self) -> &::std::option::Option<i32> {
182        self.inner.get_max_records()
183    }
184    /// <p>An optional pagination token provided by a previous <code>GetReservedNodeExchangeConfigurationOptions</code> request. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by the <code>MaxRecords</code> parameter. You can retrieve the next set of response records by providing the returned marker value in the <code>Marker</code> parameter and retrying the request.</p>
185    pub fn marker(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
186        self.inner = self.inner.marker(input.into());
187        self
188    }
189    /// <p>An optional pagination token provided by a previous <code>GetReservedNodeExchangeConfigurationOptions</code> request. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by the <code>MaxRecords</code> parameter. You can retrieve the next set of response records by providing the returned marker value in the <code>Marker</code> parameter and retrying the request.</p>
190    pub fn set_marker(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
191        self.inner = self.inner.set_marker(input);
192        self
193    }
194    /// <p>An optional pagination token provided by a previous <code>GetReservedNodeExchangeConfigurationOptions</code> request. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by the <code>MaxRecords</code> parameter. You can retrieve the next set of response records by providing the returned marker value in the <code>Marker</code> parameter and retrying the request.</p>
195    pub fn get_marker(&self) -> &::std::option::Option<::std::string::String> {
196        self.inner.get_marker()
197    }
198}