aws_sdk_appconfig/operation/get_configuration/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_configuration::_get_configuration_output::GetConfigurationOutputBuilder;
3
4pub use crate::operation::get_configuration::_get_configuration_input::GetConfigurationInputBuilder;
5
6impl crate::operation::get_configuration::builders::GetConfigurationInputBuilder {
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_configuration::GetConfigurationOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::get_configuration::GetConfigurationError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.get_configuration();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `GetConfiguration`.
24///
25/// <p>(Deprecated) Retrieves the latest deployed configuration.</p><important>
26/// <p>Note the following important information.</p>
27/// <ul>
28/// <li>
29/// <p>This API action is deprecated. Calls to receive configuration data should use the <a href="https://docs.aws.amazon.com/appconfig/2019-10-09/APIReference/API_appconfigdata_StartConfigurationSession.html">StartConfigurationSession</a> and <a href="https://docs.aws.amazon.com/appconfig/2019-10-09/APIReference/API_appconfigdata_GetLatestConfiguration.html">GetLatestConfiguration</a> APIs instead.</p></li>
30/// <li>
31/// <p><code>GetConfiguration</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#[deprecated(note = "This API has been deprecated in favor of the GetLatestConfiguration API used in conjunction with StartConfigurationSession.")]
35#[derive(::std::clone::Clone, ::std::fmt::Debug)]
36pub struct GetConfigurationFluentBuilder {
37    handle: ::std::sync::Arc<crate::client::Handle>,
38    inner: crate::operation::get_configuration::builders::GetConfigurationInputBuilder,
39    config_override: ::std::option::Option<crate::config::Builder>,
40}
41impl
42    crate::client::customize::internal::CustomizableSend<
43        crate::operation::get_configuration::GetConfigurationOutput,
44        crate::operation::get_configuration::GetConfigurationError,
45    > for GetConfigurationFluentBuilder
46{
47    fn send(
48        self,
49        config_override: crate::config::Builder,
50    ) -> crate::client::customize::internal::BoxFuture<
51        crate::client::customize::internal::SendResult<
52            crate::operation::get_configuration::GetConfigurationOutput,
53            crate::operation::get_configuration::GetConfigurationError,
54        >,
55    > {
56        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
57    }
58}
59impl GetConfigurationFluentBuilder {
60    /// Creates a new `GetConfigurationFluentBuilder`.
61    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
62        Self {
63            handle,
64            inner: ::std::default::Default::default(),
65            config_override: ::std::option::Option::None,
66        }
67    }
68    /// Access the GetConfiguration as a reference.
69    pub fn as_input(&self) -> &crate::operation::get_configuration::builders::GetConfigurationInputBuilder {
70        &self.inner
71    }
72    /// Sends the request and returns the response.
73    ///
74    /// If an error occurs, an `SdkError` will be returned with additional details that
75    /// can be matched against.
76    ///
77    /// By default, any retryable failures will be retried twice. Retry behavior
78    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
79    /// set when configuring the client.
80    pub async fn send(
81        self,
82    ) -> ::std::result::Result<
83        crate::operation::get_configuration::GetConfigurationOutput,
84        ::aws_smithy_runtime_api::client::result::SdkError<
85            crate::operation::get_configuration::GetConfigurationError,
86            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
87        >,
88    > {
89        let input = self
90            .inner
91            .build()
92            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
93        let runtime_plugins = crate::operation::get_configuration::GetConfiguration::operation_runtime_plugins(
94            self.handle.runtime_plugins.clone(),
95            &self.handle.conf,
96            self.config_override,
97        );
98        crate::operation::get_configuration::GetConfiguration::orchestrate(&runtime_plugins, input).await
99    }
100
101    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
102    pub fn customize(
103        self,
104    ) -> crate::client::customize::CustomizableOperation<
105        crate::operation::get_configuration::GetConfigurationOutput,
106        crate::operation::get_configuration::GetConfigurationError,
107        Self,
108    > {
109        crate::client::customize::CustomizableOperation::new(self)
110    }
111    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
112        self.set_config_override(::std::option::Option::Some(config_override.into()));
113        self
114    }
115
116    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
117        self.config_override = config_override;
118        self
119    }
120    /// <p>The application to get. Specify either the application name or the application ID.</p>
121    pub fn application(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
122        self.inner = self.inner.application(input.into());
123        self
124    }
125    /// <p>The application to get. Specify either the application name or the application ID.</p>
126    pub fn set_application(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
127        self.inner = self.inner.set_application(input);
128        self
129    }
130    /// <p>The application to get. Specify either the application name or the application ID.</p>
131    pub fn get_application(&self) -> &::std::option::Option<::std::string::String> {
132        self.inner.get_application()
133    }
134    /// <p>The environment to get. Specify either the environment name or the environment ID.</p>
135    pub fn environment(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
136        self.inner = self.inner.environment(input.into());
137        self
138    }
139    /// <p>The environment to get. Specify either the environment name or the environment ID.</p>
140    pub fn set_environment(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
141        self.inner = self.inner.set_environment(input);
142        self
143    }
144    /// <p>The environment to get. Specify either the environment name or the environment ID.</p>
145    pub fn get_environment(&self) -> &::std::option::Option<::std::string::String> {
146        self.inner.get_environment()
147    }
148    /// <p>The configuration to get. Specify either the configuration name or the configuration ID.</p>
149    pub fn configuration(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
150        self.inner = self.inner.configuration(input.into());
151        self
152    }
153    /// <p>The configuration to get. Specify either the configuration name or the configuration ID.</p>
154    pub fn set_configuration(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
155        self.inner = self.inner.set_configuration(input);
156        self
157    }
158    /// <p>The configuration to get. Specify either the configuration name or the configuration ID.</p>
159    pub fn get_configuration(&self) -> &::std::option::Option<::std::string::String> {
160        self.inner.get_configuration()
161    }
162    /// <p>The clientId parameter in the following command is a unique, user-specified ID to identify the client for the configuration. This ID enables AppConfig to deploy the configuration in intervals, as defined in the deployment strategy.</p>
163    pub fn client_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
164        self.inner = self.inner.client_id(input.into());
165        self
166    }
167    /// <p>The clientId parameter in the following command is a unique, user-specified ID to identify the client for the configuration. This ID enables AppConfig to deploy the configuration in intervals, as defined in the deployment strategy.</p>
168    pub fn set_client_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
169        self.inner = self.inner.set_client_id(input);
170        self
171    }
172    /// <p>The clientId parameter in the following command is a unique, user-specified ID to identify the client for the configuration. This ID enables AppConfig to deploy the configuration in intervals, as defined in the deployment strategy.</p>
173    pub fn get_client_id(&self) -> &::std::option::Option<::std::string::String> {
174        self.inner.get_client_id()
175    }
176    /// <p>The configuration version returned in the most recent <code>GetConfiguration</code> response.</p><important>
177    /// <p>AppConfig uses the value of the <code>ClientConfigurationVersion</code> parameter to identify the configuration version on your clients. If you don’t send <code>ClientConfigurationVersion</code> with each call to <code>GetConfiguration</code>, your clients receive the current configuration. You are charged each time your clients receive a configuration.</p>
178    /// <p>To avoid excess charges, we recommend you use the <a href="https://docs.aws.amazon.com/appconfig/2019-10-09/APIReference/StartConfigurationSession.html">StartConfigurationSession</a> and <a href="https://docs.aws.amazon.com/appconfig/2019-10-09/APIReference/GetLatestConfiguration.html">GetLatestConfiguration</a> APIs, which track the client configuration version on your behalf. If you choose to continue using <code>GetConfiguration</code>, we recommend that you include the <code>ClientConfigurationVersion</code> value with every call to <code>GetConfiguration</code>. The value to use for <code>ClientConfigurationVersion</code> comes from the <code>ConfigurationVersion</code> attribute returned by <code>GetConfiguration</code> when there is new or updated data, and should be saved for subsequent calls to <code>GetConfiguration</code>.</p>
179    /// </important>
180    /// <p>For more information about working with configurations, see <a href="http://docs.aws.amazon.com/appconfig/latest/userguide/retrieving-feature-flags.html">Retrieving feature flags and configuration data in AppConfig</a> in the <i>AppConfig User Guide</i>.</p>
181    pub fn client_configuration_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
182        self.inner = self.inner.client_configuration_version(input.into());
183        self
184    }
185    /// <p>The configuration version returned in the most recent <code>GetConfiguration</code> response.</p><important>
186    /// <p>AppConfig uses the value of the <code>ClientConfigurationVersion</code> parameter to identify the configuration version on your clients. If you don’t send <code>ClientConfigurationVersion</code> with each call to <code>GetConfiguration</code>, your clients receive the current configuration. You are charged each time your clients receive a configuration.</p>
187    /// <p>To avoid excess charges, we recommend you use the <a href="https://docs.aws.amazon.com/appconfig/2019-10-09/APIReference/StartConfigurationSession.html">StartConfigurationSession</a> and <a href="https://docs.aws.amazon.com/appconfig/2019-10-09/APIReference/GetLatestConfiguration.html">GetLatestConfiguration</a> APIs, which track the client configuration version on your behalf. If you choose to continue using <code>GetConfiguration</code>, we recommend that you include the <code>ClientConfigurationVersion</code> value with every call to <code>GetConfiguration</code>. The value to use for <code>ClientConfigurationVersion</code> comes from the <code>ConfigurationVersion</code> attribute returned by <code>GetConfiguration</code> when there is new or updated data, and should be saved for subsequent calls to <code>GetConfiguration</code>.</p>
188    /// </important>
189    /// <p>For more information about working with configurations, see <a href="http://docs.aws.amazon.com/appconfig/latest/userguide/retrieving-feature-flags.html">Retrieving feature flags and configuration data in AppConfig</a> in the <i>AppConfig User Guide</i>.</p>
190    pub fn set_client_configuration_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
191        self.inner = self.inner.set_client_configuration_version(input);
192        self
193    }
194    /// <p>The configuration version returned in the most recent <code>GetConfiguration</code> response.</p><important>
195    /// <p>AppConfig uses the value of the <code>ClientConfigurationVersion</code> parameter to identify the configuration version on your clients. If you don’t send <code>ClientConfigurationVersion</code> with each call to <code>GetConfiguration</code>, your clients receive the current configuration. You are charged each time your clients receive a configuration.</p>
196    /// <p>To avoid excess charges, we recommend you use the <a href="https://docs.aws.amazon.com/appconfig/2019-10-09/APIReference/StartConfigurationSession.html">StartConfigurationSession</a> and <a href="https://docs.aws.amazon.com/appconfig/2019-10-09/APIReference/GetLatestConfiguration.html">GetLatestConfiguration</a> APIs, which track the client configuration version on your behalf. If you choose to continue using <code>GetConfiguration</code>, we recommend that you include the <code>ClientConfigurationVersion</code> value with every call to <code>GetConfiguration</code>. The value to use for <code>ClientConfigurationVersion</code> comes from the <code>ConfigurationVersion</code> attribute returned by <code>GetConfiguration</code> when there is new or updated data, and should be saved for subsequent calls to <code>GetConfiguration</code>.</p>
197    /// </important>
198    /// <p>For more information about working with configurations, see <a href="http://docs.aws.amazon.com/appconfig/latest/userguide/retrieving-feature-flags.html">Retrieving feature flags and configuration data in AppConfig</a> in the <i>AppConfig User Guide</i>.</p>
199    pub fn get_client_configuration_version(&self) -> &::std::option::Option<::std::string::String> {
200        self.inner.get_client_configuration_version()
201    }
202}