aws_sdk_iotsitewise/operation/create_portal/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_portal::_create_portal_output::CreatePortalOutputBuilder;
3
4pub use crate::operation::create_portal::_create_portal_input::CreatePortalInputBuilder;
5
6impl crate::operation::create_portal::builders::CreatePortalInputBuilder {
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_portal::CreatePortalOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_portal::CreatePortalError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_portal();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreatePortal`.
24///
25/// <p>Creates a portal, which can contain projects and dashboards. IoT SiteWise Monitor uses IAM Identity Center or IAM to authenticate portal users and manage user permissions.</p><note>
26/// <p>Before you can sign in to a new portal, you must add at least one identity to that portal. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/administer-portals.html#portal-change-admins">Adding or removing portal administrators</a> in the <i>IoT SiteWise User Guide</i>.</p>
27/// </note>
28#[derive(::std::clone::Clone, ::std::fmt::Debug)]
29pub struct CreatePortalFluentBuilder {
30 handle: ::std::sync::Arc<crate::client::Handle>,
31 inner: crate::operation::create_portal::builders::CreatePortalInputBuilder,
32 config_override: ::std::option::Option<crate::config::Builder>,
33}
34impl
35 crate::client::customize::internal::CustomizableSend<
36 crate::operation::create_portal::CreatePortalOutput,
37 crate::operation::create_portal::CreatePortalError,
38 > for CreatePortalFluentBuilder
39{
40 fn send(
41 self,
42 config_override: crate::config::Builder,
43 ) -> crate::client::customize::internal::BoxFuture<
44 crate::client::customize::internal::SendResult<
45 crate::operation::create_portal::CreatePortalOutput,
46 crate::operation::create_portal::CreatePortalError,
47 >,
48 > {
49 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
50 }
51}
52impl CreatePortalFluentBuilder {
53 /// Creates a new `CreatePortalFluentBuilder`.
54 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
55 Self {
56 handle,
57 inner: ::std::default::Default::default(),
58 config_override: ::std::option::Option::None,
59 }
60 }
61 /// Access the CreatePortal as a reference.
62 pub fn as_input(&self) -> &crate::operation::create_portal::builders::CreatePortalInputBuilder {
63 &self.inner
64 }
65 /// Sends the request and returns the response.
66 ///
67 /// If an error occurs, an `SdkError` will be returned with additional details that
68 /// can be matched against.
69 ///
70 /// By default, any retryable failures will be retried twice. Retry behavior
71 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
72 /// set when configuring the client.
73 pub async fn send(
74 self,
75 ) -> ::std::result::Result<
76 crate::operation::create_portal::CreatePortalOutput,
77 ::aws_smithy_runtime_api::client::result::SdkError<
78 crate::operation::create_portal::CreatePortalError,
79 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
80 >,
81 > {
82 let input = self
83 .inner
84 .build()
85 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
86 let runtime_plugins = crate::operation::create_portal::CreatePortal::operation_runtime_plugins(
87 self.handle.runtime_plugins.clone(),
88 &self.handle.conf,
89 self.config_override,
90 );
91 crate::operation::create_portal::CreatePortal::orchestrate(&runtime_plugins, input).await
92 }
93
94 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
95 pub fn customize(
96 self,
97 ) -> crate::client::customize::CustomizableOperation<
98 crate::operation::create_portal::CreatePortalOutput,
99 crate::operation::create_portal::CreatePortalError,
100 Self,
101 > {
102 crate::client::customize::CustomizableOperation::new(self)
103 }
104 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
105 self.set_config_override(::std::option::Option::Some(config_override.into()));
106 self
107 }
108
109 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
110 self.config_override = config_override;
111 self
112 }
113 /// <p>A friendly name for the portal.</p>
114 pub fn portal_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115 self.inner = self.inner.portal_name(input.into());
116 self
117 }
118 /// <p>A friendly name for the portal.</p>
119 pub fn set_portal_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120 self.inner = self.inner.set_portal_name(input);
121 self
122 }
123 /// <p>A friendly name for the portal.</p>
124 pub fn get_portal_name(&self) -> &::std::option::Option<::std::string::String> {
125 self.inner.get_portal_name()
126 }
127 /// <p>A description for the portal.</p>
128 pub fn portal_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
129 self.inner = self.inner.portal_description(input.into());
130 self
131 }
132 /// <p>A description for the portal.</p>
133 pub fn set_portal_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
134 self.inner = self.inner.set_portal_description(input);
135 self
136 }
137 /// <p>A description for the portal.</p>
138 pub fn get_portal_description(&self) -> &::std::option::Option<::std::string::String> {
139 self.inner.get_portal_description()
140 }
141 /// <p>The Amazon Web Services administrator's contact email address.</p>
142 pub fn portal_contact_email(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
143 self.inner = self.inner.portal_contact_email(input.into());
144 self
145 }
146 /// <p>The Amazon Web Services administrator's contact email address.</p>
147 pub fn set_portal_contact_email(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
148 self.inner = self.inner.set_portal_contact_email(input);
149 self
150 }
151 /// <p>The Amazon Web Services administrator's contact email address.</p>
152 pub fn get_portal_contact_email(&self) -> &::std::option::Option<::std::string::String> {
153 self.inner.get_portal_contact_email()
154 }
155 /// <p>A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse this client token if a new idempotent request is required.</p>
156 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
157 self.inner = self.inner.client_token(input.into());
158 self
159 }
160 /// <p>A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse this client token if a new idempotent request is required.</p>
161 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
162 self.inner = self.inner.set_client_token(input);
163 self
164 }
165 /// <p>A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse this client token if a new idempotent request is required.</p>
166 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
167 self.inner.get_client_token()
168 }
169 /// <p>A logo image to display in the portal. Upload a square, high-resolution image. The image is displayed on a dark background.</p>
170 pub fn portal_logo_image_file(mut self, input: crate::types::ImageFile) -> Self {
171 self.inner = self.inner.portal_logo_image_file(input);
172 self
173 }
174 /// <p>A logo image to display in the portal. Upload a square, high-resolution image. The image is displayed on a dark background.</p>
175 pub fn set_portal_logo_image_file(mut self, input: ::std::option::Option<crate::types::ImageFile>) -> Self {
176 self.inner = self.inner.set_portal_logo_image_file(input);
177 self
178 }
179 /// <p>A logo image to display in the portal. Upload a square, high-resolution image. The image is displayed on a dark background.</p>
180 pub fn get_portal_logo_image_file(&self) -> &::std::option::Option<crate::types::ImageFile> {
181 self.inner.get_portal_logo_image_file()
182 }
183 /// <p>The <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">ARN</a> of a service role that allows the portal's users to access your IoT SiteWise resources on your behalf. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/monitor-service-role.html">Using service roles for IoT SiteWise Monitor</a> in the <i>IoT SiteWise User Guide</i>.</p>
184 pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
185 self.inner = self.inner.role_arn(input.into());
186 self
187 }
188 /// <p>The <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">ARN</a> of a service role that allows the portal's users to access your IoT SiteWise resources on your behalf. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/monitor-service-role.html">Using service roles for IoT SiteWise Monitor</a> in the <i>IoT SiteWise User Guide</i>.</p>
189 pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
190 self.inner = self.inner.set_role_arn(input);
191 self
192 }
193 /// <p>The <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">ARN</a> of a service role that allows the portal's users to access your IoT SiteWise resources on your behalf. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/monitor-service-role.html">Using service roles for IoT SiteWise Monitor</a> in the <i>IoT SiteWise User Guide</i>.</p>
194 pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
195 self.inner.get_role_arn()
196 }
197 ///
198 /// Adds a key-value pair to `tags`.
199 ///
200 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
201 ///
202 /// <p>A list of key-value pairs that contain metadata for the portal. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/tag-resources.html">Tagging your IoT SiteWise resources</a> in the <i>IoT SiteWise User Guide</i>.</p>
203 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
204 self.inner = self.inner.tags(k.into(), v.into());
205 self
206 }
207 /// <p>A list of key-value pairs that contain metadata for the portal. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/tag-resources.html">Tagging your IoT SiteWise resources</a> in the <i>IoT SiteWise User Guide</i>.</p>
208 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
209 self.inner = self.inner.set_tags(input);
210 self
211 }
212 /// <p>A list of key-value pairs that contain metadata for the portal. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/tag-resources.html">Tagging your IoT SiteWise resources</a> in the <i>IoT SiteWise User Guide</i>.</p>
213 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
214 self.inner.get_tags()
215 }
216 /// <p>The service to use to authenticate users to the portal. Choose from the following options:</p>
217 /// <ul>
218 /// <li>
219 /// <p><code>SSO</code> – The portal uses IAM Identity Center to authenticate users and manage user permissions. Before you can create a portal that uses IAM Identity Center, you must enable IAM Identity Center. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/monitor-get-started.html#mon-gs-sso">Enabling IAM Identity Center</a> in the <i>IoT SiteWise User Guide</i>. This option is only available in Amazon Web Services Regions other than the China Regions.</p></li>
220 /// <li>
221 /// <p><code>IAM</code> – The portal uses Identity and Access Management to authenticate users and manage user permissions.</p></li>
222 /// </ul>
223 /// <p>You can't change this value after you create a portal.</p>
224 /// <p>Default: <code>SSO</code></p>
225 pub fn portal_auth_mode(mut self, input: crate::types::AuthMode) -> Self {
226 self.inner = self.inner.portal_auth_mode(input);
227 self
228 }
229 /// <p>The service to use to authenticate users to the portal. Choose from the following options:</p>
230 /// <ul>
231 /// <li>
232 /// <p><code>SSO</code> – The portal uses IAM Identity Center to authenticate users and manage user permissions. Before you can create a portal that uses IAM Identity Center, you must enable IAM Identity Center. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/monitor-get-started.html#mon-gs-sso">Enabling IAM Identity Center</a> in the <i>IoT SiteWise User Guide</i>. This option is only available in Amazon Web Services Regions other than the China Regions.</p></li>
233 /// <li>
234 /// <p><code>IAM</code> – The portal uses Identity and Access Management to authenticate users and manage user permissions.</p></li>
235 /// </ul>
236 /// <p>You can't change this value after you create a portal.</p>
237 /// <p>Default: <code>SSO</code></p>
238 pub fn set_portal_auth_mode(mut self, input: ::std::option::Option<crate::types::AuthMode>) -> Self {
239 self.inner = self.inner.set_portal_auth_mode(input);
240 self
241 }
242 /// <p>The service to use to authenticate users to the portal. Choose from the following options:</p>
243 /// <ul>
244 /// <li>
245 /// <p><code>SSO</code> – The portal uses IAM Identity Center to authenticate users and manage user permissions. Before you can create a portal that uses IAM Identity Center, you must enable IAM Identity Center. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/monitor-get-started.html#mon-gs-sso">Enabling IAM Identity Center</a> in the <i>IoT SiteWise User Guide</i>. This option is only available in Amazon Web Services Regions other than the China Regions.</p></li>
246 /// <li>
247 /// <p><code>IAM</code> – The portal uses Identity and Access Management to authenticate users and manage user permissions.</p></li>
248 /// </ul>
249 /// <p>You can't change this value after you create a portal.</p>
250 /// <p>Default: <code>SSO</code></p>
251 pub fn get_portal_auth_mode(&self) -> &::std::option::Option<crate::types::AuthMode> {
252 self.inner.get_portal_auth_mode()
253 }
254 /// <p>The email address that sends alarm notifications.</p><important>
255 /// <p>If you use the <a href="https://docs.aws.amazon.com/iotevents/latest/developerguide/lambda-support.html">IoT Events managed Lambda function</a> to manage your emails, you must <a href="https://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-email-addresses.html">verify the sender email address in Amazon SES</a>.</p>
256 /// </important>
257 pub fn notification_sender_email(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
258 self.inner = self.inner.notification_sender_email(input.into());
259 self
260 }
261 /// <p>The email address that sends alarm notifications.</p><important>
262 /// <p>If you use the <a href="https://docs.aws.amazon.com/iotevents/latest/developerguide/lambda-support.html">IoT Events managed Lambda function</a> to manage your emails, you must <a href="https://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-email-addresses.html">verify the sender email address in Amazon SES</a>.</p>
263 /// </important>
264 pub fn set_notification_sender_email(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
265 self.inner = self.inner.set_notification_sender_email(input);
266 self
267 }
268 /// <p>The email address that sends alarm notifications.</p><important>
269 /// <p>If you use the <a href="https://docs.aws.amazon.com/iotevents/latest/developerguide/lambda-support.html">IoT Events managed Lambda function</a> to manage your emails, you must <a href="https://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-email-addresses.html">verify the sender email address in Amazon SES</a>.</p>
270 /// </important>
271 pub fn get_notification_sender_email(&self) -> &::std::option::Option<::std::string::String> {
272 self.inner.get_notification_sender_email()
273 }
274 /// <p>Contains the configuration information of an alarm created in an IoT SiteWise Monitor portal. You can use the alarm to monitor an asset property and get notified when the asset property value is outside a specified range. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/appguide/monitor-alarms.html">Monitoring with alarms</a> in the <i>IoT SiteWise Application Guide</i>.</p>
275 pub fn alarms(mut self, input: crate::types::Alarms) -> Self {
276 self.inner = self.inner.alarms(input);
277 self
278 }
279 /// <p>Contains the configuration information of an alarm created in an IoT SiteWise Monitor portal. You can use the alarm to monitor an asset property and get notified when the asset property value is outside a specified range. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/appguide/monitor-alarms.html">Monitoring with alarms</a> in the <i>IoT SiteWise Application Guide</i>.</p>
280 pub fn set_alarms(mut self, input: ::std::option::Option<crate::types::Alarms>) -> Self {
281 self.inner = self.inner.set_alarms(input);
282 self
283 }
284 /// <p>Contains the configuration information of an alarm created in an IoT SiteWise Monitor portal. You can use the alarm to monitor an asset property and get notified when the asset property value is outside a specified range. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/appguide/monitor-alarms.html">Monitoring with alarms</a> in the <i>IoT SiteWise Application Guide</i>.</p>
285 pub fn get_alarms(&self) -> &::std::option::Option<crate::types::Alarms> {
286 self.inner.get_alarms()
287 }
288 /// <p>Define the type of portal. The value for IoT SiteWise Monitor (Classic) is <code>SITEWISE_PORTAL_V1</code>. The value for IoT SiteWise Monitor (AI-aware) is <code>SITEWISE_PORTAL_V2</code>.</p>
289 pub fn portal_type(mut self, input: crate::types::PortalType) -> Self {
290 self.inner = self.inner.portal_type(input);
291 self
292 }
293 /// <p>Define the type of portal. The value for IoT SiteWise Monitor (Classic) is <code>SITEWISE_PORTAL_V1</code>. The value for IoT SiteWise Monitor (AI-aware) is <code>SITEWISE_PORTAL_V2</code>.</p>
294 pub fn set_portal_type(mut self, input: ::std::option::Option<crate::types::PortalType>) -> Self {
295 self.inner = self.inner.set_portal_type(input);
296 self
297 }
298 /// <p>Define the type of portal. The value for IoT SiteWise Monitor (Classic) is <code>SITEWISE_PORTAL_V1</code>. The value for IoT SiteWise Monitor (AI-aware) is <code>SITEWISE_PORTAL_V2</code>.</p>
299 pub fn get_portal_type(&self) -> &::std::option::Option<crate::types::PortalType> {
300 self.inner.get_portal_type()
301 }
302 ///
303 /// Adds a key-value pair to `portalTypeConfiguration`.
304 ///
305 /// To override the contents of this collection use [`set_portal_type_configuration`](Self::set_portal_type_configuration).
306 ///
307 /// <p>The configuration entry associated with the specific portal type. The value for IoT SiteWise Monitor (Classic) is <code>SITEWISE_PORTAL_V1</code>. The value for IoT SiteWise Monitor (AI-aware) is <code>SITEWISE_PORTAL_V2</code>.</p>
308 pub fn portal_type_configuration(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::PortalTypeEntry) -> Self {
309 self.inner = self.inner.portal_type_configuration(k.into(), v);
310 self
311 }
312 /// <p>The configuration entry associated with the specific portal type. The value for IoT SiteWise Monitor (Classic) is <code>SITEWISE_PORTAL_V1</code>. The value for IoT SiteWise Monitor (AI-aware) is <code>SITEWISE_PORTAL_V2</code>.</p>
313 pub fn set_portal_type_configuration(
314 mut self,
315 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::PortalTypeEntry>>,
316 ) -> Self {
317 self.inner = self.inner.set_portal_type_configuration(input);
318 self
319 }
320 /// <p>The configuration entry associated with the specific portal type. The value for IoT SiteWise Monitor (Classic) is <code>SITEWISE_PORTAL_V1</code>. The value for IoT SiteWise Monitor (AI-aware) is <code>SITEWISE_PORTAL_V2</code>.</p>
321 pub fn get_portal_type_configuration(
322 &self,
323 ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::PortalTypeEntry>> {
324 self.inner.get_portal_type_configuration()
325 }
326}