aws_sdk_elasticbeanstalk/operation/retrieve_environment_info/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::retrieve_environment_info::_retrieve_environment_info_output::RetrieveEnvironmentInfoOutputBuilder;
3
4pub use crate::operation::retrieve_environment_info::_retrieve_environment_info_input::RetrieveEnvironmentInfoInputBuilder;
5
6impl crate::operation::retrieve_environment_info::builders::RetrieveEnvironmentInfoInputBuilder {
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::retrieve_environment_info::RetrieveEnvironmentInfoOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::retrieve_environment_info::RetrieveEnvironmentInfoError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.retrieve_environment_info();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `RetrieveEnvironmentInfo`.
24///
25/// <p>Retrieves the compiled information from a <code>RequestEnvironmentInfo</code> request.</p>
26/// <p>Related Topics</p>
27/// <ul>
28/// <li>
29/// <p><code>RequestEnvironmentInfo</code></p></li>
30/// </ul>
31#[derive(::std::clone::Clone, ::std::fmt::Debug)]
32pub struct RetrieveEnvironmentInfoFluentBuilder {
33    handle: ::std::sync::Arc<crate::client::Handle>,
34    inner: crate::operation::retrieve_environment_info::builders::RetrieveEnvironmentInfoInputBuilder,
35    config_override: ::std::option::Option<crate::config::Builder>,
36}
37impl
38    crate::client::customize::internal::CustomizableSend<
39        crate::operation::retrieve_environment_info::RetrieveEnvironmentInfoOutput,
40        crate::operation::retrieve_environment_info::RetrieveEnvironmentInfoError,
41    > for RetrieveEnvironmentInfoFluentBuilder
42{
43    fn send(
44        self,
45        config_override: crate::config::Builder,
46    ) -> crate::client::customize::internal::BoxFuture<
47        crate::client::customize::internal::SendResult<
48            crate::operation::retrieve_environment_info::RetrieveEnvironmentInfoOutput,
49            crate::operation::retrieve_environment_info::RetrieveEnvironmentInfoError,
50        >,
51    > {
52        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
53    }
54}
55impl RetrieveEnvironmentInfoFluentBuilder {
56    /// Creates a new `RetrieveEnvironmentInfoFluentBuilder`.
57    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
58        Self {
59            handle,
60            inner: ::std::default::Default::default(),
61            config_override: ::std::option::Option::None,
62        }
63    }
64    /// Access the RetrieveEnvironmentInfo as a reference.
65    pub fn as_input(&self) -> &crate::operation::retrieve_environment_info::builders::RetrieveEnvironmentInfoInputBuilder {
66        &self.inner
67    }
68    /// Sends the request and returns the response.
69    ///
70    /// If an error occurs, an `SdkError` will be returned with additional details that
71    /// can be matched against.
72    ///
73    /// By default, any retryable failures will be retried twice. Retry behavior
74    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
75    /// set when configuring the client.
76    pub async fn send(
77        self,
78    ) -> ::std::result::Result<
79        crate::operation::retrieve_environment_info::RetrieveEnvironmentInfoOutput,
80        ::aws_smithy_runtime_api::client::result::SdkError<
81            crate::operation::retrieve_environment_info::RetrieveEnvironmentInfoError,
82            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
83        >,
84    > {
85        let input = self
86            .inner
87            .build()
88            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
89        let runtime_plugins = crate::operation::retrieve_environment_info::RetrieveEnvironmentInfo::operation_runtime_plugins(
90            self.handle.runtime_plugins.clone(),
91            &self.handle.conf,
92            self.config_override,
93        );
94        crate::operation::retrieve_environment_info::RetrieveEnvironmentInfo::orchestrate(&runtime_plugins, input).await
95    }
96
97    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
98    pub fn customize(
99        self,
100    ) -> crate::client::customize::CustomizableOperation<
101        crate::operation::retrieve_environment_info::RetrieveEnvironmentInfoOutput,
102        crate::operation::retrieve_environment_info::RetrieveEnvironmentInfoError,
103        Self,
104    > {
105        crate::client::customize::CustomizableOperation::new(self)
106    }
107    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
108        self.set_config_override(::std::option::Option::Some(config_override.into()));
109        self
110    }
111
112    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
113        self.config_override = config_override;
114        self
115    }
116    /// <p>The ID of the data's environment.</p>
117    /// <p>If no such environment is found, returns an <code>InvalidParameterValue</code> error.</p>
118    /// <p>Condition: You must specify either this or an EnvironmentName, or both. If you do not specify either, AWS Elastic Beanstalk returns <code>MissingRequiredParameter</code> error.</p>
119    pub fn environment_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
120        self.inner = self.inner.environment_id(input.into());
121        self
122    }
123    /// <p>The ID of the data's environment.</p>
124    /// <p>If no such environment is found, returns an <code>InvalidParameterValue</code> error.</p>
125    /// <p>Condition: You must specify either this or an EnvironmentName, or both. If you do not specify either, AWS Elastic Beanstalk returns <code>MissingRequiredParameter</code> error.</p>
126    pub fn set_environment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
127        self.inner = self.inner.set_environment_id(input);
128        self
129    }
130    /// <p>The ID of the data's environment.</p>
131    /// <p>If no such environment is found, returns an <code>InvalidParameterValue</code> error.</p>
132    /// <p>Condition: You must specify either this or an EnvironmentName, or both. If you do not specify either, AWS Elastic Beanstalk returns <code>MissingRequiredParameter</code> error.</p>
133    pub fn get_environment_id(&self) -> &::std::option::Option<::std::string::String> {
134        self.inner.get_environment_id()
135    }
136    /// <p>The name of the data's environment.</p>
137    /// <p>If no such environment is found, returns an <code>InvalidParameterValue</code> error.</p>
138    /// <p>Condition: You must specify either this or an EnvironmentId, or both. If you do not specify either, AWS Elastic Beanstalk returns <code>MissingRequiredParameter</code> error.</p>
139    pub fn environment_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
140        self.inner = self.inner.environment_name(input.into());
141        self
142    }
143    /// <p>The name of the data's environment.</p>
144    /// <p>If no such environment is found, returns an <code>InvalidParameterValue</code> error.</p>
145    /// <p>Condition: You must specify either this or an EnvironmentId, or both. If you do not specify either, AWS Elastic Beanstalk returns <code>MissingRequiredParameter</code> error.</p>
146    pub fn set_environment_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
147        self.inner = self.inner.set_environment_name(input);
148        self
149    }
150    /// <p>The name of the data's environment.</p>
151    /// <p>If no such environment is found, returns an <code>InvalidParameterValue</code> error.</p>
152    /// <p>Condition: You must specify either this or an EnvironmentId, or both. If you do not specify either, AWS Elastic Beanstalk returns <code>MissingRequiredParameter</code> error.</p>
153    pub fn get_environment_name(&self) -> &::std::option::Option<::std::string::String> {
154        self.inner.get_environment_name()
155    }
156    /// <p>The type of information to retrieve.</p>
157    pub fn info_type(mut self, input: crate::types::EnvironmentInfoType) -> Self {
158        self.inner = self.inner.info_type(input);
159        self
160    }
161    /// <p>The type of information to retrieve.</p>
162    pub fn set_info_type(mut self, input: ::std::option::Option<crate::types::EnvironmentInfoType>) -> Self {
163        self.inner = self.inner.set_info_type(input);
164        self
165    }
166    /// <p>The type of information to retrieve.</p>
167    pub fn get_info_type(&self) -> &::std::option::Option<crate::types::EnvironmentInfoType> {
168        self.inner.get_info_type()
169    }
170}