aws_sdk_eks/operation/list_insights/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::list_insights::_list_insights_output::ListInsightsOutputBuilder;
3
4pub use crate::operation::list_insights::_list_insights_input::ListInsightsInputBuilder;
5
6impl crate::operation::list_insights::builders::ListInsightsInputBuilder {
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::list_insights::ListInsightsOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::list_insights::ListInsightsError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.list_insights();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `ListInsights`.
24///
25/// <p>Returns a list of all insights checked for against the specified cluster. You can filter which insights are returned by category, associated Kubernetes version, and status. The default filter lists all categories and every status.</p>
26/// <p>The following lists the available categories:</p>
27/// <ul>
28/// <li>
29/// <p><code>UPGRADE_READINESS</code>: Amazon EKS identifies issues that could impact your ability to upgrade to new versions of Kubernetes. These are called upgrade insights.</p></li>
30/// <li>
31/// <p><code>MISCONFIGURATION</code>: Amazon EKS identifies misconfiguration in your EKS Hybrid Nodes setup that could impair functionality of your cluster or workloads. These are called configuration insights.</p></li>
32/// </ul>
33#[derive(::std::clone::Clone, ::std::fmt::Debug)]
34pub struct ListInsightsFluentBuilder {
35    handle: ::std::sync::Arc<crate::client::Handle>,
36    inner: crate::operation::list_insights::builders::ListInsightsInputBuilder,
37    config_override: ::std::option::Option<crate::config::Builder>,
38}
39impl
40    crate::client::customize::internal::CustomizableSend<
41        crate::operation::list_insights::ListInsightsOutput,
42        crate::operation::list_insights::ListInsightsError,
43    > for ListInsightsFluentBuilder
44{
45    fn send(
46        self,
47        config_override: crate::config::Builder,
48    ) -> crate::client::customize::internal::BoxFuture<
49        crate::client::customize::internal::SendResult<
50            crate::operation::list_insights::ListInsightsOutput,
51            crate::operation::list_insights::ListInsightsError,
52        >,
53    > {
54        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
55    }
56}
57impl ListInsightsFluentBuilder {
58    /// Creates a new `ListInsightsFluentBuilder`.
59    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
60        Self {
61            handle,
62            inner: ::std::default::Default::default(),
63            config_override: ::std::option::Option::None,
64        }
65    }
66    /// Access the ListInsights as a reference.
67    pub fn as_input(&self) -> &crate::operation::list_insights::builders::ListInsightsInputBuilder {
68        &self.inner
69    }
70    /// Sends the request and returns the response.
71    ///
72    /// If an error occurs, an `SdkError` will be returned with additional details that
73    /// can be matched against.
74    ///
75    /// By default, any retryable failures will be retried twice. Retry behavior
76    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
77    /// set when configuring the client.
78    pub async fn send(
79        self,
80    ) -> ::std::result::Result<
81        crate::operation::list_insights::ListInsightsOutput,
82        ::aws_smithy_runtime_api::client::result::SdkError<
83            crate::operation::list_insights::ListInsightsError,
84            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
85        >,
86    > {
87        let input = self
88            .inner
89            .build()
90            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
91        let runtime_plugins = crate::operation::list_insights::ListInsights::operation_runtime_plugins(
92            self.handle.runtime_plugins.clone(),
93            &self.handle.conf,
94            self.config_override,
95        );
96        crate::operation::list_insights::ListInsights::orchestrate(&runtime_plugins, input).await
97    }
98
99    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
100    pub fn customize(
101        self,
102    ) -> crate::client::customize::CustomizableOperation<
103        crate::operation::list_insights::ListInsightsOutput,
104        crate::operation::list_insights::ListInsightsError,
105        Self,
106    > {
107        crate::client::customize::CustomizableOperation::new(self)
108    }
109    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
110        self.set_config_override(::std::option::Option::Some(config_override.into()));
111        self
112    }
113
114    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
115        self.config_override = config_override;
116        self
117    }
118    /// Create a paginator for this request
119    ///
120    /// Paginators are used by calling [`send().await`](crate::operation::list_insights::paginator::ListInsightsPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
121    pub fn into_paginator(self) -> crate::operation::list_insights::paginator::ListInsightsPaginator {
122        crate::operation::list_insights::paginator::ListInsightsPaginator::new(self.handle, self.inner)
123    }
124    /// <p>The name of the Amazon EKS cluster associated with the insights.</p>
125    pub fn cluster_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
126        self.inner = self.inner.cluster_name(input.into());
127        self
128    }
129    /// <p>The name of the Amazon EKS cluster associated with the insights.</p>
130    pub fn set_cluster_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
131        self.inner = self.inner.set_cluster_name(input);
132        self
133    }
134    /// <p>The name of the Amazon EKS cluster associated with the insights.</p>
135    pub fn get_cluster_name(&self) -> &::std::option::Option<::std::string::String> {
136        self.inner.get_cluster_name()
137    }
138    /// <p>The criteria to filter your list of insights for your cluster. You can filter which insights are returned by category, associated Kubernetes version, and status.</p>
139    pub fn filter(mut self, input: crate::types::InsightsFilter) -> Self {
140        self.inner = self.inner.filter(input);
141        self
142    }
143    /// <p>The criteria to filter your list of insights for your cluster. You can filter which insights are returned by category, associated Kubernetes version, and status.</p>
144    pub fn set_filter(mut self, input: ::std::option::Option<crate::types::InsightsFilter>) -> Self {
145        self.inner = self.inner.set_filter(input);
146        self
147    }
148    /// <p>The criteria to filter your list of insights for your cluster. You can filter which insights are returned by category, associated Kubernetes version, and status.</p>
149    pub fn get_filter(&self) -> &::std::option::Option<crate::types::InsightsFilter> {
150        self.inner.get_filter()
151    }
152    /// <p>The maximum number of identity provider configurations returned by <code>ListInsights</code> in paginated output. When you use this parameter, <code>ListInsights</code> returns only <code>maxResults</code> results in a single page along with a <code>nextToken</code> response element. You can see the remaining results of the initial request by sending another <code>ListInsights</code> request with the returned <code>nextToken</code> value. This value can be between 1 and 100. If you don't use this parameter, <code>ListInsights</code> returns up to 100 results and a <code>nextToken</code> value, if applicable.</p>
153    pub fn max_results(mut self, input: i32) -> Self {
154        self.inner = self.inner.max_results(input);
155        self
156    }
157    /// <p>The maximum number of identity provider configurations returned by <code>ListInsights</code> in paginated output. When you use this parameter, <code>ListInsights</code> returns only <code>maxResults</code> results in a single page along with a <code>nextToken</code> response element. You can see the remaining results of the initial request by sending another <code>ListInsights</code> request with the returned <code>nextToken</code> value. This value can be between 1 and 100. If you don't use this parameter, <code>ListInsights</code> returns up to 100 results and a <code>nextToken</code> value, if applicable.</p>
158    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
159        self.inner = self.inner.set_max_results(input);
160        self
161    }
162    /// <p>The maximum number of identity provider configurations returned by <code>ListInsights</code> in paginated output. When you use this parameter, <code>ListInsights</code> returns only <code>maxResults</code> results in a single page along with a <code>nextToken</code> response element. You can see the remaining results of the initial request by sending another <code>ListInsights</code> request with the returned <code>nextToken</code> value. This value can be between 1 and 100. If you don't use this parameter, <code>ListInsights</code> returns up to 100 results and a <code>nextToken</code> value, if applicable.</p>
163    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
164        self.inner.get_max_results()
165    }
166    /// <p>The <code>nextToken</code> value returned from a previous paginated <code>ListInsights</code> request. When the results of a <code>ListInsights</code> request exceed <code>maxResults</code>, you can use this value to retrieve the next page of results. This value is <code>null</code> when there are no more results to return.</p>
167    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
168        self.inner = self.inner.next_token(input.into());
169        self
170    }
171    /// <p>The <code>nextToken</code> value returned from a previous paginated <code>ListInsights</code> request. When the results of a <code>ListInsights</code> request exceed <code>maxResults</code>, you can use this value to retrieve the next page of results. This value is <code>null</code> when there are no more results to return.</p>
172    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
173        self.inner = self.inner.set_next_token(input);
174        self
175    }
176    /// <p>The <code>nextToken</code> value returned from a previous paginated <code>ListInsights</code> request. When the results of a <code>ListInsights</code> request exceed <code>maxResults</code>, you can use this value to retrieve the next page of results. This value is <code>null</code> when there are no more results to return.</p>
177    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
178        self.inner.get_next_token()
179    }
180}