aws_sdk_forecast/operation/describe_predictor/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::describe_predictor::_describe_predictor_output::DescribePredictorOutputBuilder;
3
4pub use crate::operation::describe_predictor::_describe_predictor_input::DescribePredictorInputBuilder;
5
6impl crate::operation::describe_predictor::builders::DescribePredictorInputBuilder {
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_predictor::DescribePredictorOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::describe_predictor::DescribePredictorError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.describe_predictor();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `DescribePredictor`.
24///
25/// <note>
26/// <p>This operation is only valid for legacy predictors created with CreatePredictor. If you are not using a legacy predictor, use <code>DescribeAutoPredictor</code>.</p>
27/// </note>
28/// <p>Describes a predictor created using the <code>CreatePredictor</code> operation.</p>
29/// <p>In addition to listing the properties provided in the <code>CreatePredictor</code> request, this operation lists the following properties:</p>
30/// <ul>
31/// <li>
32/// <p><code>DatasetImportJobArns</code> - The dataset import jobs used to import training data.</p></li>
33/// <li>
34/// <p><code>AutoMLAlgorithmArns</code> - If AutoML is performed, the algorithms that were evaluated.</p></li>
35/// <li>
36/// <p><code>CreationTime</code></p></li>
37/// <li>
38/// <p><code>LastModificationTime</code></p></li>
39/// <li>
40/// <p><code>Status</code></p></li>
41/// <li>
42/// <p><code>Message</code> - If an error occurred, information about the error.</p></li>
43/// </ul>
44#[derive(::std::clone::Clone, ::std::fmt::Debug)]
45pub struct DescribePredictorFluentBuilder {
46    handle: ::std::sync::Arc<crate::client::Handle>,
47    inner: crate::operation::describe_predictor::builders::DescribePredictorInputBuilder,
48    config_override: ::std::option::Option<crate::config::Builder>,
49}
50impl
51    crate::client::customize::internal::CustomizableSend<
52        crate::operation::describe_predictor::DescribePredictorOutput,
53        crate::operation::describe_predictor::DescribePredictorError,
54    > for DescribePredictorFluentBuilder
55{
56    fn send(
57        self,
58        config_override: crate::config::Builder,
59    ) -> crate::client::customize::internal::BoxFuture<
60        crate::client::customize::internal::SendResult<
61            crate::operation::describe_predictor::DescribePredictorOutput,
62            crate::operation::describe_predictor::DescribePredictorError,
63        >,
64    > {
65        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
66    }
67}
68impl DescribePredictorFluentBuilder {
69    /// Creates a new `DescribePredictorFluentBuilder`.
70    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
71        Self {
72            handle,
73            inner: ::std::default::Default::default(),
74            config_override: ::std::option::Option::None,
75        }
76    }
77    /// Access the DescribePredictor as a reference.
78    pub fn as_input(&self) -> &crate::operation::describe_predictor::builders::DescribePredictorInputBuilder {
79        &self.inner
80    }
81    /// Sends the request and returns the response.
82    ///
83    /// If an error occurs, an `SdkError` will be returned with additional details that
84    /// can be matched against.
85    ///
86    /// By default, any retryable failures will be retried twice. Retry behavior
87    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
88    /// set when configuring the client.
89    pub async fn send(
90        self,
91    ) -> ::std::result::Result<
92        crate::operation::describe_predictor::DescribePredictorOutput,
93        ::aws_smithy_runtime_api::client::result::SdkError<
94            crate::operation::describe_predictor::DescribePredictorError,
95            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
96        >,
97    > {
98        let input = self
99            .inner
100            .build()
101            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
102        let runtime_plugins = crate::operation::describe_predictor::DescribePredictor::operation_runtime_plugins(
103            self.handle.runtime_plugins.clone(),
104            &self.handle.conf,
105            self.config_override,
106        );
107        crate::operation::describe_predictor::DescribePredictor::orchestrate(&runtime_plugins, input).await
108    }
109
110    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
111    pub fn customize(
112        self,
113    ) -> crate::client::customize::CustomizableOperation<
114        crate::operation::describe_predictor::DescribePredictorOutput,
115        crate::operation::describe_predictor::DescribePredictorError,
116        Self,
117    > {
118        crate::client::customize::CustomizableOperation::new(self)
119    }
120    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
121        self.set_config_override(::std::option::Option::Some(config_override.into()));
122        self
123    }
124
125    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
126        self.config_override = config_override;
127        self
128    }
129    /// <p>The Amazon Resource Name (ARN) of the predictor that you want information about.</p>
130    pub fn predictor_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
131        self.inner = self.inner.predictor_arn(input.into());
132        self
133    }
134    /// <p>The Amazon Resource Name (ARN) of the predictor that you want information about.</p>
135    pub fn set_predictor_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136        self.inner = self.inner.set_predictor_arn(input);
137        self
138    }
139    /// <p>The Amazon Resource Name (ARN) of the predictor that you want information about.</p>
140    pub fn get_predictor_arn(&self) -> &::std::option::Option<::std::string::String> {
141        self.inner.get_predictor_arn()
142    }
143}