aws_sdk_ssooidc/operation/start_device_authorization/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::start_device_authorization::_start_device_authorization_output::StartDeviceAuthorizationOutputBuilder;
3
4pub use crate::operation::start_device_authorization::_start_device_authorization_input::StartDeviceAuthorizationInputBuilder;
5
6impl crate::operation::start_device_authorization::builders::StartDeviceAuthorizationInputBuilder {
7                    /// Sends a request with this input using the given client.
8                    pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result<
9                        crate::operation::start_device_authorization::StartDeviceAuthorizationOutput,
10                        ::aws_smithy_runtime_api::client::result::SdkError<
11                            crate::operation::start_device_authorization::StartDeviceAuthorizationError,
12                            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse
13                        >
14                    > {
15                        let mut fluent_builder = client.start_device_authorization();
16                        fluent_builder.inner = self;
17                        fluent_builder.send().await
18                    }
19                }
20/// Fluent builder constructing a request to `StartDeviceAuthorization`.
21/// 
22/// <p>Initiates device authorization by requesting a pair of verification codes from the authorization service.</p>
23#[derive(::std::clone::Clone, ::std::fmt::Debug)]
24pub struct StartDeviceAuthorizationFluentBuilder {
25                handle: ::std::sync::Arc<crate::client::Handle>,
26                inner: crate::operation::start_device_authorization::builders::StartDeviceAuthorizationInputBuilder,
27config_override: ::std::option::Option<crate::config::Builder>,
28            }
29impl
30                crate::client::customize::internal::CustomizableSend<
31                    crate::operation::start_device_authorization::StartDeviceAuthorizationOutput,
32                    crate::operation::start_device_authorization::StartDeviceAuthorizationError,
33                > for StartDeviceAuthorizationFluentBuilder
34            {
35                fn send(
36                    self,
37                    config_override: crate::config::Builder,
38                ) -> crate::client::customize::internal::BoxFuture<
39                    crate::client::customize::internal::SendResult<
40                        crate::operation::start_device_authorization::StartDeviceAuthorizationOutput,
41                        crate::operation::start_device_authorization::StartDeviceAuthorizationError,
42                    >,
43                > {
44                    ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
45                }
46            }
47impl StartDeviceAuthorizationFluentBuilder {
48    /// Creates a new `StartDeviceAuthorizationFluentBuilder`.
49                    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
50                        Self {
51                            handle,
52                            inner: ::std::default::Default::default(),
53    config_override: ::std::option::Option::None,
54                        }
55                    }
56    /// Access the StartDeviceAuthorization as a reference.
57                    pub fn as_input(&self) -> &crate::operation::start_device_authorization::builders::StartDeviceAuthorizationInputBuilder {
58                        &self.inner
59                    }
60    /// Sends the request and returns the response.
61                    ///
62                    /// If an error occurs, an `SdkError` will be returned with additional details that
63                    /// can be matched against.
64                    ///
65                    /// By default, any retryable failures will be retried twice. Retry behavior
66                    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
67                    /// set when configuring the client.
68                    pub async fn send(self) -> ::std::result::Result<crate::operation::start_device_authorization::StartDeviceAuthorizationOutput, ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::start_device_authorization::StartDeviceAuthorizationError, ::aws_smithy_runtime_api::client::orchestrator::HttpResponse>> {
69                        let input = self.inner.build().map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
70                        let runtime_plugins = crate::operation::start_device_authorization::StartDeviceAuthorization::operation_runtime_plugins(
71                            self.handle.runtime_plugins.clone(),
72                            &self.handle.conf,
73                            self.config_override,
74                        );
75                        crate::operation::start_device_authorization::StartDeviceAuthorization::orchestrate(&runtime_plugins, input).await
76                    }
77    
78                    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
79                    pub fn customize(
80                        self,
81                    ) -> crate::client::customize::CustomizableOperation<crate::operation::start_device_authorization::StartDeviceAuthorizationOutput, crate::operation::start_device_authorization::StartDeviceAuthorizationError, Self> {
82                        crate::client::customize::CustomizableOperation::new(self)
83                    }
84    pub(crate) fn config_override(
85                            mut self,
86                            config_override: impl ::std::convert::Into<crate::config::Builder>,
87                        ) -> Self {
88                            self.set_config_override(::std::option::Option::Some(config_override.into()));
89                            self
90                        }
91    
92                        pub(crate) fn set_config_override(
93                            &mut self,
94                            config_override: ::std::option::Option<crate::config::Builder>,
95                        ) -> &mut Self {
96                            self.config_override = config_override;
97                            self
98                        }
99    /// <p>The unique identifier string for the client that is registered with IAM Identity Center. This value should come from the persisted result of the <code>RegisterClient</code> API operation.</p>
100    pub fn client_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
101                    self.inner = self.inner.client_id(input.into());
102                    self
103                }
104    /// <p>The unique identifier string for the client that is registered with IAM Identity Center. This value should come from the persisted result of the <code>RegisterClient</code> API operation.</p>
105    pub fn set_client_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
106                    self.inner = self.inner.set_client_id(input);
107                    self
108                }
109    /// <p>The unique identifier string for the client that is registered with IAM Identity Center. This value should come from the persisted result of the <code>RegisterClient</code> API operation.</p>
110    pub fn get_client_id(&self) -> &::std::option::Option<::std::string::String> {
111                    self.inner.get_client_id()
112                }
113    /// <p>A secret string that is generated for the client. This value should come from the persisted result of the <code>RegisterClient</code> API operation.</p>
114    pub fn client_secret(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115                    self.inner = self.inner.client_secret(input.into());
116                    self
117                }
118    /// <p>A secret string that is generated for the client. This value should come from the persisted result of the <code>RegisterClient</code> API operation.</p>
119    pub fn set_client_secret(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120                    self.inner = self.inner.set_client_secret(input);
121                    self
122                }
123    /// <p>A secret string that is generated for the client. This value should come from the persisted result of the <code>RegisterClient</code> API operation.</p>
124    pub fn get_client_secret(&self) -> &::std::option::Option<::std::string::String> {
125                    self.inner.get_client_secret()
126                }
127    /// <p>The URL for the Amazon Web Services access portal. For more information, see <a href="https://docs.aws.amazon.com/singlesignon/latest/userguide/using-the-portal.html">Using the Amazon Web Services access portal</a> in the <i>IAM Identity Center User Guide</i>.</p>
128    pub fn start_url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
129                    self.inner = self.inner.start_url(input.into());
130                    self
131                }
132    /// <p>The URL for the Amazon Web Services access portal. For more information, see <a href="https://docs.aws.amazon.com/singlesignon/latest/userguide/using-the-portal.html">Using the Amazon Web Services access portal</a> in the <i>IAM Identity Center User Guide</i>.</p>
133    pub fn set_start_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
134                    self.inner = self.inner.set_start_url(input);
135                    self
136                }
137    /// <p>The URL for the Amazon Web Services access portal. For more information, see <a href="https://docs.aws.amazon.com/singlesignon/latest/userguide/using-the-portal.html">Using the Amazon Web Services access portal</a> in the <i>IAM Identity Center User Guide</i>.</p>
138    pub fn get_start_url(&self) -> &::std::option::Option<::std::string::String> {
139                    self.inner.get_start_url()
140                }
141}
142