aws_sdk_rekognition/operation/list_project_policies/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::list_project_policies::_list_project_policies_output::ListProjectPoliciesOutputBuilder;
3
4pub use crate::operation::list_project_policies::_list_project_policies_input::ListProjectPoliciesInputBuilder;
5
6impl crate::operation::list_project_policies::builders::ListProjectPoliciesInputBuilder {
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_project_policies::ListProjectPoliciesOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::list_project_policies::ListProjectPoliciesError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.list_project_policies();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `ListProjectPolicies`.
24///
25/// <note>
26/// <p>This operation applies only to Amazon Rekognition Custom Labels.</p>
27/// </note>
28/// <p>Gets a list of the project policies attached to a project.</p>
29/// <p>To attach a project policy to a project, call <code>PutProjectPolicy</code>. To remove a project policy from a project, call <code>DeleteProjectPolicy</code>.</p>
30/// <p>This operation requires permissions to perform the <code>rekognition:ListProjectPolicies</code> action.</p>
31#[derive(::std::clone::Clone, ::std::fmt::Debug)]
32pub struct ListProjectPoliciesFluentBuilder {
33    handle: ::std::sync::Arc<crate::client::Handle>,
34    inner: crate::operation::list_project_policies::builders::ListProjectPoliciesInputBuilder,
35    config_override: ::std::option::Option<crate::config::Builder>,
36}
37impl
38    crate::client::customize::internal::CustomizableSend<
39        crate::operation::list_project_policies::ListProjectPoliciesOutput,
40        crate::operation::list_project_policies::ListProjectPoliciesError,
41    > for ListProjectPoliciesFluentBuilder
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::list_project_policies::ListProjectPoliciesOutput,
49            crate::operation::list_project_policies::ListProjectPoliciesError,
50        >,
51    > {
52        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
53    }
54}
55impl ListProjectPoliciesFluentBuilder {
56    /// Creates a new `ListProjectPoliciesFluentBuilder`.
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 ListProjectPolicies as a reference.
65    pub fn as_input(&self) -> &crate::operation::list_project_policies::builders::ListProjectPoliciesInputBuilder {
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::list_project_policies::ListProjectPoliciesOutput,
80        ::aws_smithy_runtime_api::client::result::SdkError<
81            crate::operation::list_project_policies::ListProjectPoliciesError,
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::list_project_policies::ListProjectPolicies::operation_runtime_plugins(
90            self.handle.runtime_plugins.clone(),
91            &self.handle.conf,
92            self.config_override,
93        );
94        crate::operation::list_project_policies::ListProjectPolicies::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::list_project_policies::ListProjectPoliciesOutput,
102        crate::operation::list_project_policies::ListProjectPoliciesError,
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    /// Create a paginator for this request
117    ///
118    /// Paginators are used by calling [`send().await`](crate::operation::list_project_policies::paginator::ListProjectPoliciesPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
119    pub fn into_paginator(self) -> crate::operation::list_project_policies::paginator::ListProjectPoliciesPaginator {
120        crate::operation::list_project_policies::paginator::ListProjectPoliciesPaginator::new(self.handle, self.inner)
121    }
122    /// <p>The ARN of the project for which you want to list the project policies.</p>
123    pub fn project_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
124        self.inner = self.inner.project_arn(input.into());
125        self
126    }
127    /// <p>The ARN of the project for which you want to list the project policies.</p>
128    pub fn set_project_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
129        self.inner = self.inner.set_project_arn(input);
130        self
131    }
132    /// <p>The ARN of the project for which you want to list the project policies.</p>
133    pub fn get_project_arn(&self) -> &::std::option::Option<::std::string::String> {
134        self.inner.get_project_arn()
135    }
136    /// <p>If the previous response was incomplete (because there is more results to retrieve), Amazon Rekognition Custom Labels returns a pagination token in the response. You can use this pagination token to retrieve the next set of results.</p>
137    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
138        self.inner = self.inner.next_token(input.into());
139        self
140    }
141    /// <p>If the previous response was incomplete (because there is more results to retrieve), Amazon Rekognition Custom Labels returns a pagination token in the response. You can use this pagination token to retrieve the next set of results.</p>
142    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
143        self.inner = self.inner.set_next_token(input);
144        self
145    }
146    /// <p>If the previous response was incomplete (because there is more results to retrieve), Amazon Rekognition Custom Labels returns a pagination token in the response. You can use this pagination token to retrieve the next set of results.</p>
147    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
148        self.inner.get_next_token()
149    }
150    /// <p>The maximum number of results to return per paginated call. The largest value you can specify is 5. If you specify a value greater than 5, a ValidationException error occurs. The default value is 5.</p>
151    pub fn max_results(mut self, input: i32) -> Self {
152        self.inner = self.inner.max_results(input);
153        self
154    }
155    /// <p>The maximum number of results to return per paginated call. The largest value you can specify is 5. If you specify a value greater than 5, a ValidationException error occurs. The default value is 5.</p>
156    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
157        self.inner = self.inner.set_max_results(input);
158        self
159    }
160    /// <p>The maximum number of results to return per paginated call. The largest value you can specify is 5. If you specify a value greater than 5, a ValidationException error occurs. The default value is 5.</p>
161    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
162        self.inner.get_max_results()
163    }
164}