aws_sdk_appconfigdata/operation/get_latest_configuration/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_latest_configuration::_get_latest_configuration_output::GetLatestConfigurationOutputBuilder;
3
4pub use crate::operation::get_latest_configuration::_get_latest_configuration_input::GetLatestConfigurationInputBuilder;
5
6impl crate::operation::get_latest_configuration::builders::GetLatestConfigurationInputBuilder {
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_latest_configuration::GetLatestConfigurationOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::get_latest_configuration::GetLatestConfigurationError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.get_latest_configuration();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `GetLatestConfiguration`.
24///
25/// <p>Retrieves the latest deployed configuration. This API may return empty configuration data if the client already has the latest version. For more information about this API action and to view example CLI commands that show how to use it with the <code>StartConfigurationSession</code> API action, see <a href="http://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-retrieving-the-configuration">Retrieving the configuration</a> in the <i>AppConfig User Guide</i>.</p><important>
26/// <p>Note the following important information.</p>
27/// <ul>
28/// <li>
29/// <p>Each configuration token is only valid for one call to <code>GetLatestConfiguration</code>. The <code>GetLatestConfiguration</code> response includes a <code>NextPollConfigurationToken</code> that should always replace the token used for the just-completed call in preparation for the next one.</p></li>
30/// <li>
31/// <p><code>GetLatestConfiguration</code> is a priced call. For more information, see <a href="https://aws.amazon.com/systems-manager/pricing/">Pricing</a>.</p></li>
32/// </ul>
33/// </important>
34#[derive(::std::clone::Clone, ::std::fmt::Debug)]
35pub struct GetLatestConfigurationFluentBuilder {
36    handle: ::std::sync::Arc<crate::client::Handle>,
37    inner: crate::operation::get_latest_configuration::builders::GetLatestConfigurationInputBuilder,
38    config_override: ::std::option::Option<crate::config::Builder>,
39}
40impl
41    crate::client::customize::internal::CustomizableSend<
42        crate::operation::get_latest_configuration::GetLatestConfigurationOutput,
43        crate::operation::get_latest_configuration::GetLatestConfigurationError,
44    > for GetLatestConfigurationFluentBuilder
45{
46    fn send(
47        self,
48        config_override: crate::config::Builder,
49    ) -> crate::client::customize::internal::BoxFuture<
50        crate::client::customize::internal::SendResult<
51            crate::operation::get_latest_configuration::GetLatestConfigurationOutput,
52            crate::operation::get_latest_configuration::GetLatestConfigurationError,
53        >,
54    > {
55        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
56    }
57}
58impl GetLatestConfigurationFluentBuilder {
59    /// Creates a new `GetLatestConfigurationFluentBuilder`.
60    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
61        Self {
62            handle,
63            inner: ::std::default::Default::default(),
64            config_override: ::std::option::Option::None,
65        }
66    }
67    /// Access the GetLatestConfiguration as a reference.
68    pub fn as_input(&self) -> &crate::operation::get_latest_configuration::builders::GetLatestConfigurationInputBuilder {
69        &self.inner
70    }
71    /// Sends the request and returns the response.
72    ///
73    /// If an error occurs, an `SdkError` will be returned with additional details that
74    /// can be matched against.
75    ///
76    /// By default, any retryable failures will be retried twice. Retry behavior
77    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
78    /// set when configuring the client.
79    pub async fn send(
80        self,
81    ) -> ::std::result::Result<
82        crate::operation::get_latest_configuration::GetLatestConfigurationOutput,
83        ::aws_smithy_runtime_api::client::result::SdkError<
84            crate::operation::get_latest_configuration::GetLatestConfigurationError,
85            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
86        >,
87    > {
88        let input = self
89            .inner
90            .build()
91            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
92        let runtime_plugins = crate::operation::get_latest_configuration::GetLatestConfiguration::operation_runtime_plugins(
93            self.handle.runtime_plugins.clone(),
94            &self.handle.conf,
95            self.config_override,
96        );
97        crate::operation::get_latest_configuration::GetLatestConfiguration::orchestrate(&runtime_plugins, input).await
98    }
99
100    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
101    pub fn customize(
102        self,
103    ) -> crate::client::customize::CustomizableOperation<
104        crate::operation::get_latest_configuration::GetLatestConfigurationOutput,
105        crate::operation::get_latest_configuration::GetLatestConfigurationError,
106        Self,
107    > {
108        crate::client::customize::CustomizableOperation::new(self)
109    }
110    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
111        self.set_config_override(::std::option::Option::Some(config_override.into()));
112        self
113    }
114
115    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
116        self.config_override = config_override;
117        self
118    }
119    /// <p>Token describing the current state of the configuration session. To obtain a token, first call the <code>StartConfigurationSession</code> API. Note that every call to <code>GetLatestConfiguration</code> will return a new <code>ConfigurationToken</code> (<code>NextPollConfigurationToken</code> in the response) and <i>must</i> be provided to subsequent <code>GetLatestConfiguration</code> API calls.</p><important>
120    /// <p>This token should only be used once. To support long poll use cases, the token is valid for up to 24 hours. If a <code>GetLatestConfiguration</code> call uses an expired token, the system returns <code>BadRequestException</code>.</p>
121    /// </important>
122    pub fn configuration_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
123        self.inner = self.inner.configuration_token(input.into());
124        self
125    }
126    /// <p>Token describing the current state of the configuration session. To obtain a token, first call the <code>StartConfigurationSession</code> API. Note that every call to <code>GetLatestConfiguration</code> will return a new <code>ConfigurationToken</code> (<code>NextPollConfigurationToken</code> in the response) and <i>must</i> be provided to subsequent <code>GetLatestConfiguration</code> API calls.</p><important>
127    /// <p>This token should only be used once. To support long poll use cases, the token is valid for up to 24 hours. If a <code>GetLatestConfiguration</code> call uses an expired token, the system returns <code>BadRequestException</code>.</p>
128    /// </important>
129    pub fn set_configuration_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
130        self.inner = self.inner.set_configuration_token(input);
131        self
132    }
133    /// <p>Token describing the current state of the configuration session. To obtain a token, first call the <code>StartConfigurationSession</code> API. Note that every call to <code>GetLatestConfiguration</code> will return a new <code>ConfigurationToken</code> (<code>NextPollConfigurationToken</code> in the response) and <i>must</i> be provided to subsequent <code>GetLatestConfiguration</code> API calls.</p><important>
134    /// <p>This token should only be used once. To support long poll use cases, the token is valid for up to 24 hours. If a <code>GetLatestConfiguration</code> call uses an expired token, the system returns <code>BadRequestException</code>.</p>
135    /// </important>
136    pub fn get_configuration_token(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_configuration_token()
138    }
139}