aws_sdk_cognitoidentityprovider/operation/update_resource_server/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_resource_server::_update_resource_server_output::UpdateResourceServerOutputBuilder;
3
4pub use crate::operation::update_resource_server::_update_resource_server_input::UpdateResourceServerInputBuilder;
5
6impl crate::operation::update_resource_server::builders::UpdateResourceServerInputBuilder {
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::update_resource_server::UpdateResourceServerOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_resource_server::UpdateResourceServerError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_resource_server();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateResourceServer`.
24///
25/// <p>Updates the name and scopes of a resource server. All other fields are read-only. For more information about resource servers, see <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-define-resource-servers.html">Access control with resource servers</a>.</p><important>
26/// <p>If you don't provide a value for an attribute, it is set to the default value.</p>
27/// </important> <note>
28/// <p>Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.</p>
29/// <p class="title"><b>Learn more</b></p>
30/// <ul>
31/// <li>
32/// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_aws-signing.html">Signing Amazon Web Services API Requests</a></p></li>
33/// <li>
34/// <p><a href="https://docs.aws.amazon.com/cognito/latest/developerguide/user-pools-API-operations.html">Using the Amazon Cognito user pools API and user pool endpoints</a></p></li>
35/// </ul>
36/// </note>
37#[derive(::std::clone::Clone, ::std::fmt::Debug)]
38pub struct UpdateResourceServerFluentBuilder {
39    handle: ::std::sync::Arc<crate::client::Handle>,
40    inner: crate::operation::update_resource_server::builders::UpdateResourceServerInputBuilder,
41    config_override: ::std::option::Option<crate::config::Builder>,
42}
43impl
44    crate::client::customize::internal::CustomizableSend<
45        crate::operation::update_resource_server::UpdateResourceServerOutput,
46        crate::operation::update_resource_server::UpdateResourceServerError,
47    > for UpdateResourceServerFluentBuilder
48{
49    fn send(
50        self,
51        config_override: crate::config::Builder,
52    ) -> crate::client::customize::internal::BoxFuture<
53        crate::client::customize::internal::SendResult<
54            crate::operation::update_resource_server::UpdateResourceServerOutput,
55            crate::operation::update_resource_server::UpdateResourceServerError,
56        >,
57    > {
58        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
59    }
60}
61impl UpdateResourceServerFluentBuilder {
62    /// Creates a new `UpdateResourceServerFluentBuilder`.
63    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
64        Self {
65            handle,
66            inner: ::std::default::Default::default(),
67            config_override: ::std::option::Option::None,
68        }
69    }
70    /// Access the UpdateResourceServer as a reference.
71    pub fn as_input(&self) -> &crate::operation::update_resource_server::builders::UpdateResourceServerInputBuilder {
72        &self.inner
73    }
74    /// Sends the request and returns the response.
75    ///
76    /// If an error occurs, an `SdkError` will be returned with additional details that
77    /// can be matched against.
78    ///
79    /// By default, any retryable failures will be retried twice. Retry behavior
80    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
81    /// set when configuring the client.
82    pub async fn send(
83        self,
84    ) -> ::std::result::Result<
85        crate::operation::update_resource_server::UpdateResourceServerOutput,
86        ::aws_smithy_runtime_api::client::result::SdkError<
87            crate::operation::update_resource_server::UpdateResourceServerError,
88            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
89        >,
90    > {
91        let input = self
92            .inner
93            .build()
94            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
95        let runtime_plugins = crate::operation::update_resource_server::UpdateResourceServer::operation_runtime_plugins(
96            self.handle.runtime_plugins.clone(),
97            &self.handle.conf,
98            self.config_override,
99        );
100        crate::operation::update_resource_server::UpdateResourceServer::orchestrate(&runtime_plugins, input).await
101    }
102
103    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
104    pub fn customize(
105        self,
106    ) -> crate::client::customize::CustomizableOperation<
107        crate::operation::update_resource_server::UpdateResourceServerOutput,
108        crate::operation::update_resource_server::UpdateResourceServerError,
109        Self,
110    > {
111        crate::client::customize::CustomizableOperation::new(self)
112    }
113    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
114        self.set_config_override(::std::option::Option::Some(config_override.into()));
115        self
116    }
117
118    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
119        self.config_override = config_override;
120        self
121    }
122    /// <p>The ID of the user pool that contains the resource server that you want to update.</p>
123    pub fn user_pool_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
124        self.inner = self.inner.user_pool_id(input.into());
125        self
126    }
127    /// <p>The ID of the user pool that contains the resource server that you want to update.</p>
128    pub fn set_user_pool_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
129        self.inner = self.inner.set_user_pool_id(input);
130        self
131    }
132    /// <p>The ID of the user pool that contains the resource server that you want to update.</p>
133    pub fn get_user_pool_id(&self) -> &::std::option::Option<::std::string::String> {
134        self.inner.get_user_pool_id()
135    }
136    /// <p>A unique resource server identifier for the resource server. The identifier can be an API friendly name like <code>solar-system-data</code>. You can also set an API URL like <code>https://solar-system-data-api.example.com</code> as your identifier.</p>
137    /// <p>Amazon Cognito represents scopes in the access token in the format <code>$resource-server-identifier/$scope</code>. Longer scope-identifier strings increase the size of your access tokens.</p>
138    pub fn identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
139        self.inner = self.inner.identifier(input.into());
140        self
141    }
142    /// <p>A unique resource server identifier for the resource server. The identifier can be an API friendly name like <code>solar-system-data</code>. You can also set an API URL like <code>https://solar-system-data-api.example.com</code> as your identifier.</p>
143    /// <p>Amazon Cognito represents scopes in the access token in the format <code>$resource-server-identifier/$scope</code>. Longer scope-identifier strings increase the size of your access tokens.</p>
144    pub fn set_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
145        self.inner = self.inner.set_identifier(input);
146        self
147    }
148    /// <p>A unique resource server identifier for the resource server. The identifier can be an API friendly name like <code>solar-system-data</code>. You can also set an API URL like <code>https://solar-system-data-api.example.com</code> as your identifier.</p>
149    /// <p>Amazon Cognito represents scopes in the access token in the format <code>$resource-server-identifier/$scope</code>. Longer scope-identifier strings increase the size of your access tokens.</p>
150    pub fn get_identifier(&self) -> &::std::option::Option<::std::string::String> {
151        self.inner.get_identifier()
152    }
153    /// <p>The updated name of the resource server.</p>
154    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
155        self.inner = self.inner.name(input.into());
156        self
157    }
158    /// <p>The updated name of the resource server.</p>
159    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
160        self.inner = self.inner.set_name(input);
161        self
162    }
163    /// <p>The updated name of the resource server.</p>
164    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
165        self.inner.get_name()
166    }
167    ///
168    /// Appends an item to `Scopes`.
169    ///
170    /// To override the contents of this collection use [`set_scopes`](Self::set_scopes).
171    ///
172    /// <p>An array of updated custom scope names and descriptions that you want to associate with your resource server.</p>
173    pub fn scopes(mut self, input: crate::types::ResourceServerScopeType) -> Self {
174        self.inner = self.inner.scopes(input);
175        self
176    }
177    /// <p>An array of updated custom scope names and descriptions that you want to associate with your resource server.</p>
178    pub fn set_scopes(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ResourceServerScopeType>>) -> Self {
179        self.inner = self.inner.set_scopes(input);
180        self
181    }
182    /// <p>An array of updated custom scope names and descriptions that you want to associate with your resource server.</p>
183    pub fn get_scopes(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ResourceServerScopeType>> {
184        self.inner.get_scopes()
185    }
186}