aws_sdk_personalize/operation/describe_recommender/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::describe_recommender::_describe_recommender_output::DescribeRecommenderOutputBuilder;
3
4pub use crate::operation::describe_recommender::_describe_recommender_input::DescribeRecommenderInputBuilder;
5
6impl crate::operation::describe_recommender::builders::DescribeRecommenderInputBuilder {
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_recommender::DescribeRecommenderOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::describe_recommender::DescribeRecommenderError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.describe_recommender();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `DescribeRecommender`.
24///
25/// <p>Describes the given recommender, including its status.</p>
26/// <p>A recommender can be in one of the following states:</p>
27/// <ul>
28/// <li>
29/// <p>CREATE PENDING &gt; CREATE IN_PROGRESS &gt; ACTIVE -or- CREATE FAILED</p></li>
30/// <li>
31/// <p>STOP PENDING &gt; STOP IN_PROGRESS &gt; INACTIVE &gt; START PENDING &gt; START IN_PROGRESS &gt; ACTIVE</p></li>
32/// <li>
33/// <p>DELETE PENDING &gt; DELETE IN_PROGRESS</p></li>
34/// </ul>
35/// <p>When the <code>status</code> is <code>CREATE FAILED</code>, the response includes the <code>failureReason</code> key, which describes why.</p>
36/// <p>The <code>modelMetrics</code> key is null when the recommender is being created or deleted.</p>
37/// <p>For more information on recommenders, see <a href="https://docs.aws.amazon.com/personalize/latest/dg/API_CreateRecommender.html">CreateRecommender</a>.</p>
38#[derive(::std::clone::Clone, ::std::fmt::Debug)]
39pub struct DescribeRecommenderFluentBuilder {
40    handle: ::std::sync::Arc<crate::client::Handle>,
41    inner: crate::operation::describe_recommender::builders::DescribeRecommenderInputBuilder,
42    config_override: ::std::option::Option<crate::config::Builder>,
43}
44impl
45    crate::client::customize::internal::CustomizableSend<
46        crate::operation::describe_recommender::DescribeRecommenderOutput,
47        crate::operation::describe_recommender::DescribeRecommenderError,
48    > for DescribeRecommenderFluentBuilder
49{
50    fn send(
51        self,
52        config_override: crate::config::Builder,
53    ) -> crate::client::customize::internal::BoxFuture<
54        crate::client::customize::internal::SendResult<
55            crate::operation::describe_recommender::DescribeRecommenderOutput,
56            crate::operation::describe_recommender::DescribeRecommenderError,
57        >,
58    > {
59        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
60    }
61}
62impl DescribeRecommenderFluentBuilder {
63    /// Creates a new `DescribeRecommenderFluentBuilder`.
64    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
65        Self {
66            handle,
67            inner: ::std::default::Default::default(),
68            config_override: ::std::option::Option::None,
69        }
70    }
71    /// Access the DescribeRecommender as a reference.
72    pub fn as_input(&self) -> &crate::operation::describe_recommender::builders::DescribeRecommenderInputBuilder {
73        &self.inner
74    }
75    /// Sends the request and returns the response.
76    ///
77    /// If an error occurs, an `SdkError` will be returned with additional details that
78    /// can be matched against.
79    ///
80    /// By default, any retryable failures will be retried twice. Retry behavior
81    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
82    /// set when configuring the client.
83    pub async fn send(
84        self,
85    ) -> ::std::result::Result<
86        crate::operation::describe_recommender::DescribeRecommenderOutput,
87        ::aws_smithy_runtime_api::client::result::SdkError<
88            crate::operation::describe_recommender::DescribeRecommenderError,
89            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
90        >,
91    > {
92        let input = self
93            .inner
94            .build()
95            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
96        let runtime_plugins = crate::operation::describe_recommender::DescribeRecommender::operation_runtime_plugins(
97            self.handle.runtime_plugins.clone(),
98            &self.handle.conf,
99            self.config_override,
100        );
101        crate::operation::describe_recommender::DescribeRecommender::orchestrate(&runtime_plugins, input).await
102    }
103
104    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
105    pub fn customize(
106        self,
107    ) -> crate::client::customize::CustomizableOperation<
108        crate::operation::describe_recommender::DescribeRecommenderOutput,
109        crate::operation::describe_recommender::DescribeRecommenderError,
110        Self,
111    > {
112        crate::client::customize::CustomizableOperation::new(self)
113    }
114    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
115        self.set_config_override(::std::option::Option::Some(config_override.into()));
116        self
117    }
118
119    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
120        self.config_override = config_override;
121        self
122    }
123    /// <p>The Amazon Resource Name (ARN) of the recommender to describe.</p>
124    pub fn recommender_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
125        self.inner = self.inner.recommender_arn(input.into());
126        self
127    }
128    /// <p>The Amazon Resource Name (ARN) of the recommender to describe.</p>
129    pub fn set_recommender_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
130        self.inner = self.inner.set_recommender_arn(input);
131        self
132    }
133    /// <p>The Amazon Resource Name (ARN) of the recommender to describe.</p>
134    pub fn get_recommender_arn(&self) -> &::std::option::Option<::std::string::String> {
135        self.inner.get_recommender_arn()
136    }
137}