aws_sdk_ssoadmin/operation/create_instance/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_instance::_create_instance_output::CreateInstanceOutputBuilder;
3
4pub use crate::operation::create_instance::_create_instance_input::CreateInstanceInputBuilder;
5
6impl crate::operation::create_instance::builders::CreateInstanceInputBuilder {
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::create_instance::CreateInstanceOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_instance::CreateInstanceError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_instance();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateInstance`.
24///
25/// <p>Creates an instance of IAM Identity Center for a standalone Amazon Web Services account that is not managed by Organizations or a member Amazon Web Services account in an organization. You can create only one instance per account and across all Amazon Web Services Regions.</p>
26/// <p>The CreateInstance request is rejected if the following apply:</p>
27/// <ul>
28/// <li>
29/// <p>The instance is created within the organization management account.</p></li>
30/// <li>
31/// <p>An instance already exists in the same account.</p></li>
32/// </ul>
33#[derive(::std::clone::Clone, ::std::fmt::Debug)]
34pub struct CreateInstanceFluentBuilder {
35 handle: ::std::sync::Arc<crate::client::Handle>,
36 inner: crate::operation::create_instance::builders::CreateInstanceInputBuilder,
37 config_override: ::std::option::Option<crate::config::Builder>,
38}
39impl
40 crate::client::customize::internal::CustomizableSend<
41 crate::operation::create_instance::CreateInstanceOutput,
42 crate::operation::create_instance::CreateInstanceError,
43 > for CreateInstanceFluentBuilder
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::create_instance::CreateInstanceOutput,
51 crate::operation::create_instance::CreateInstanceError,
52 >,
53 > {
54 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
55 }
56}
57impl CreateInstanceFluentBuilder {
58 /// Creates a new `CreateInstanceFluentBuilder`.
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 CreateInstance as a reference.
67 pub fn as_input(&self) -> &crate::operation::create_instance::builders::CreateInstanceInputBuilder {
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::create_instance::CreateInstanceOutput,
82 ::aws_smithy_runtime_api::client::result::SdkError<
83 crate::operation::create_instance::CreateInstanceError,
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::create_instance::CreateInstance::operation_runtime_plugins(
92 self.handle.runtime_plugins.clone(),
93 &self.handle.conf,
94 self.config_override,
95 );
96 crate::operation::create_instance::CreateInstance::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::create_instance::CreateInstanceOutput,
104 crate::operation::create_instance::CreateInstanceError,
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 /// <p>The name of the instance of IAM Identity Center.</p>
119 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
120 self.inner = self.inner.name(input.into());
121 self
122 }
123 /// <p>The name of the instance of IAM Identity Center.</p>
124 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
125 self.inner = self.inner.set_name(input);
126 self
127 }
128 /// <p>The name of the instance of IAM Identity Center.</p>
129 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
130 self.inner.get_name()
131 }
132 /// <p>Specifies a unique, case-sensitive ID that you provide to ensure the idempotency of the request. This lets you safely retry the request without accidentally performing the same operation a second time. Passing the same value to a later call to an operation requires that you also pass the same value for all other parameters. We recommend that you use a <a href="https://wikipedia.org/wiki/Universally_unique_identifier">UUID type of value</a>.</p>
133 /// <p>If you don't provide this value, then Amazon Web Services generates a random one for you.</p>
134 /// <p>If you retry the operation with the same <code>ClientToken</code>, but with different parameters, the retry fails with an <code>IdempotentParameterMismatch</code> error.</p>
135 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
136 self.inner = self.inner.client_token(input.into());
137 self
138 }
139 /// <p>Specifies a unique, case-sensitive ID that you provide to ensure the idempotency of the request. This lets you safely retry the request without accidentally performing the same operation a second time. Passing the same value to a later call to an operation requires that you also pass the same value for all other parameters. We recommend that you use a <a href="https://wikipedia.org/wiki/Universally_unique_identifier">UUID type of value</a>.</p>
140 /// <p>If you don't provide this value, then Amazon Web Services generates a random one for you.</p>
141 /// <p>If you retry the operation with the same <code>ClientToken</code>, but with different parameters, the retry fails with an <code>IdempotentParameterMismatch</code> error.</p>
142 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
143 self.inner = self.inner.set_client_token(input);
144 self
145 }
146 /// <p>Specifies a unique, case-sensitive ID that you provide to ensure the idempotency of the request. This lets you safely retry the request without accidentally performing the same operation a second time. Passing the same value to a later call to an operation requires that you also pass the same value for all other parameters. We recommend that you use a <a href="https://wikipedia.org/wiki/Universally_unique_identifier">UUID type of value</a>.</p>
147 /// <p>If you don't provide this value, then Amazon Web Services generates a random one for you.</p>
148 /// <p>If you retry the operation with the same <code>ClientToken</code>, but with different parameters, the retry fails with an <code>IdempotentParameterMismatch</code> error.</p>
149 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
150 self.inner.get_client_token()
151 }
152 ///
153 /// Appends an item to `Tags`.
154 ///
155 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
156 ///
157 /// <p>Specifies tags to be attached to the instance of IAM Identity Center.</p>
158 pub fn tags(mut self, input: crate::types::Tag) -> Self {
159 self.inner = self.inner.tags(input);
160 self
161 }
162 /// <p>Specifies tags to be attached to the instance of IAM Identity Center.</p>
163 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
164 self.inner = self.inner.set_tags(input);
165 self
166 }
167 /// <p>Specifies tags to be attached to the instance of IAM Identity Center.</p>
168 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
169 self.inner.get_tags()
170 }
171}