1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::create_workspace::_create_workspace_output::CreateWorkspaceOutputBuilder;
pub use crate::operation::create_workspace::_create_workspace_input::CreateWorkspaceInputBuilder;
/// Fluent builder constructing a request to `CreateWorkspace`.
///
/// <p>Creates a <i>workspace</i>. In a workspace, you can create Grafana dashboards and visualizations to analyze your metrics, logs, and traces. You don't have to build, package, or deploy any hardware to run the Grafana server.</p>
/// <p>Don't use <code>CreateWorkspace</code> to modify an existing workspace. Instead, use <a href="https://docs.aws.amazon.com/grafana/latest/APIReference/API_UpdateWorkspace.html">UpdateWorkspace</a>.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct CreateWorkspaceFluentBuilder {
handle: std::sync::Arc<crate::client::Handle>,
inner: crate::operation::create_workspace::builders::CreateWorkspaceInputBuilder,
}
impl CreateWorkspaceFluentBuilder {
/// Creates a new `CreateWorkspace`.
pub(crate) fn new(handle: std::sync::Arc<crate::client::Handle>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Consume this builder, creating a customizable operation that can be modified before being
/// sent. The operation's inner [http::Request] can be modified as well.
pub async fn customize(
self,
) -> std::result::Result<
crate::client::customize::CustomizableOperation<
crate::operation::create_workspace::CreateWorkspace,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::result::SdkError<crate::operation::create_workspace::CreateWorkspaceError>,
> {
let handle = self.handle.clone();
let operation = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
Ok(crate::client::customize::CustomizableOperation { handle, operation })
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::operation::create_workspace::CreateWorkspaceOutput,
aws_smithy_http::result::SdkError<crate::operation::create_workspace::CreateWorkspaceError>,
> {
let op = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&self.handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
self.handle.client.call(op).await
}
/// <p>Specifies whether the workspace can access Amazon Web Services resources in this Amazon Web Services account only, or whether it can also access Amazon Web Services resources in other accounts in the same organization. If you specify <code>ORGANIZATION</code>, you must specify which organizational units the workspace can access in the <code>workspaceOrganizationalUnits</code> parameter.</p>
pub fn account_access_type(mut self, input: crate::types::AccountAccessType) -> Self {
self.inner = self.inner.account_access_type(input);
self
}
/// <p>Specifies whether the workspace can access Amazon Web Services resources in this Amazon Web Services account only, or whether it can also access Amazon Web Services resources in other accounts in the same organization. If you specify <code>ORGANIZATION</code>, you must specify which organizational units the workspace can access in the <code>workspaceOrganizationalUnits</code> parameter.</p>
pub fn set_account_access_type(
mut self,
input: std::option::Option<crate::types::AccountAccessType>,
) -> Self {
self.inner = self.inner.set_account_access_type(input);
self
}
/// <p>A unique, case-sensitive, user-provided identifier to ensure the idempotency of the request.</p>
pub fn client_token(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.client_token(input.into());
self
}
/// <p>A unique, case-sensitive, user-provided identifier to ensure the idempotency of the request.</p>
pub fn set_client_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_client_token(input);
self
}
/// <p>The name of an IAM role that already exists to use with Organizations to access Amazon Web Services data sources and notification channels in other accounts in an organization.</p>
pub fn organization_role_name(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.organization_role_name(input.into());
self
}
/// <p>The name of an IAM role that already exists to use with Organizations to access Amazon Web Services data sources and notification channels in other accounts in an organization.</p>
pub fn set_organization_role_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_organization_role_name(input);
self
}
/// <p>When creating a workspace through the Amazon Web Services API, CLI or Amazon Web Services CloudFormation, you must manage IAM roles and provision the permissions that the workspace needs to use Amazon Web Services data sources and notification channels.</p>
/// <p>You must also specify a <code>workspaceRoleArn</code> for a role that you will manage for the workspace to use when accessing those datasources and notification channels.</p>
/// <p>The ability for Amazon Managed Grafana to create and update IAM roles on behalf of the user is supported only in the Amazon Managed Grafana console, where this value may be set to <code>SERVICE_MANAGED</code>.</p> <note>
/// <p>Use only the <code>CUSTOMER_MANAGED</code> permission type when creating a workspace with the API, CLI or Amazon Web Services CloudFormation. </p>
/// </note>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/grafana/latest/userguide/AMG-manage-permissions.html">Amazon Managed Grafana permissions and policies for Amazon Web Services data sources and notification channels</a>.</p>
pub fn permission_type(mut self, input: crate::types::PermissionType) -> Self {
self.inner = self.inner.permission_type(input);
self
}
/// <p>When creating a workspace through the Amazon Web Services API, CLI or Amazon Web Services CloudFormation, you must manage IAM roles and provision the permissions that the workspace needs to use Amazon Web Services data sources and notification channels.</p>
/// <p>You must also specify a <code>workspaceRoleArn</code> for a role that you will manage for the workspace to use when accessing those datasources and notification channels.</p>
/// <p>The ability for Amazon Managed Grafana to create and update IAM roles on behalf of the user is supported only in the Amazon Managed Grafana console, where this value may be set to <code>SERVICE_MANAGED</code>.</p> <note>
/// <p>Use only the <code>CUSTOMER_MANAGED</code> permission type when creating a workspace with the API, CLI or Amazon Web Services CloudFormation. </p>
/// </note>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/grafana/latest/userguide/AMG-manage-permissions.html">Amazon Managed Grafana permissions and policies for Amazon Web Services data sources and notification channels</a>.</p>
pub fn set_permission_type(
mut self,
input: std::option::Option<crate::types::PermissionType>,
) -> Self {
self.inner = self.inner.set_permission_type(input);
self
}
/// <p>The name of the CloudFormation stack set to use to generate IAM roles to be used for this workspace.</p>
pub fn stack_set_name(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.stack_set_name(input.into());
self
}
/// <p>The name of the CloudFormation stack set to use to generate IAM roles to be used for this workspace.</p>
pub fn set_stack_set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_stack_set_name(input);
self
}
/// Appends an item to `workspaceDataSources`.
///
/// To override the contents of this collection use [`set_workspace_data_sources`](Self::set_workspace_data_sources).
///
/// <p>This parameter is for internal use only, and should not be used.</p>
pub fn workspace_data_sources(mut self, input: crate::types::DataSourceType) -> Self {
self.inner = self.inner.workspace_data_sources(input);
self
}
/// <p>This parameter is for internal use only, and should not be used.</p>
pub fn set_workspace_data_sources(
mut self,
input: std::option::Option<std::vec::Vec<crate::types::DataSourceType>>,
) -> Self {
self.inner = self.inner.set_workspace_data_sources(input);
self
}
/// <p>A description for the workspace. This is used only to help you identify this workspace.</p>
/// <p>Pattern: <code>^[\\p{L}\\p{Z}\\p{N}\\p{P}]{0,2048}$</code> </p>
pub fn workspace_description(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.workspace_description(input.into());
self
}
/// <p>A description for the workspace. This is used only to help you identify this workspace.</p>
/// <p>Pattern: <code>^[\\p{L}\\p{Z}\\p{N}\\p{P}]{0,2048}$</code> </p>
pub fn set_workspace_description(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_workspace_description(input);
self
}
/// <p>The name for the workspace. It does not have to be unique.</p>
pub fn workspace_name(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.workspace_name(input.into());
self
}
/// <p>The name for the workspace. It does not have to be unique.</p>
pub fn set_workspace_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_workspace_name(input);
self
}
/// Appends an item to `workspaceNotificationDestinations`.
///
/// To override the contents of this collection use [`set_workspace_notification_destinations`](Self::set_workspace_notification_destinations).
///
/// <p>Specify the Amazon Web Services notification channels that you plan to use in this workspace. Specifying these data sources here enables Amazon Managed Grafana to create IAM roles and permissions that allow Amazon Managed Grafana to use these channels.</p>
pub fn workspace_notification_destinations(
mut self,
input: crate::types::NotificationDestinationType,
) -> Self {
self.inner = self.inner.workspace_notification_destinations(input);
self
}
/// <p>Specify the Amazon Web Services notification channels that you plan to use in this workspace. Specifying these data sources here enables Amazon Managed Grafana to create IAM roles and permissions that allow Amazon Managed Grafana to use these channels.</p>
pub fn set_workspace_notification_destinations(
mut self,
input: std::option::Option<std::vec::Vec<crate::types::NotificationDestinationType>>,
) -> Self {
self.inner = self.inner.set_workspace_notification_destinations(input);
self
}
/// Appends an item to `workspaceOrganizationalUnits`.
///
/// To override the contents of this collection use [`set_workspace_organizational_units`](Self::set_workspace_organizational_units).
///
/// <p>Specifies the organizational units that this workspace is allowed to use data sources from, if this workspace is in an account that is part of an organization.</p>
pub fn workspace_organizational_units(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.workspace_organizational_units(input.into());
self
}
/// <p>Specifies the organizational units that this workspace is allowed to use data sources from, if this workspace is in an account that is part of an organization.</p>
pub fn set_workspace_organizational_units(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.inner = self.inner.set_workspace_organizational_units(input);
self
}
/// <p>Specified the IAM role that grants permissions to the Amazon Web Services resources that the workspace will view data from, including both data sources and notification channels. You are responsible for managing the permissions for this role as new data sources or notification channels are added. </p>
pub fn workspace_role_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.workspace_role_arn(input.into());
self
}
/// <p>Specified the IAM role that grants permissions to the Amazon Web Services resources that the workspace will view data from, including both data sources and notification channels. You are responsible for managing the permissions for this role as new data sources or notification channels are added. </p>
pub fn set_workspace_role_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_workspace_role_arn(input);
self
}
/// Appends an item to `authenticationProviders`.
///
/// To override the contents of this collection use [`set_authentication_providers`](Self::set_authentication_providers).
///
/// <p>Specifies whether this workspace uses SAML 2.0, IAM Identity Center (successor to Single Sign-On), or both to authenticate users for using the Grafana console within a workspace. For more information, see <a href="https://docs.aws.amazon.com/grafana/latest/userguide/authentication-in-AMG.html">User authentication in Amazon Managed Grafana</a>.</p>
pub fn authentication_providers(
mut self,
input: crate::types::AuthenticationProviderTypes,
) -> Self {
self.inner = self.inner.authentication_providers(input);
self
}
/// <p>Specifies whether this workspace uses SAML 2.0, IAM Identity Center (successor to Single Sign-On), or both to authenticate users for using the Grafana console within a workspace. For more information, see <a href="https://docs.aws.amazon.com/grafana/latest/userguide/authentication-in-AMG.html">User authentication in Amazon Managed Grafana</a>.</p>
pub fn set_authentication_providers(
mut self,
input: std::option::Option<std::vec::Vec<crate::types::AuthenticationProviderTypes>>,
) -> Self {
self.inner = self.inner.set_authentication_providers(input);
self
}
/// Adds a key-value pair to `tags`.
///
/// To override the contents of this collection use [`set_tags`](Self::set_tags).
///
/// <p>The list of tags associated with the workspace.</p>
pub fn tags(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
self.inner = self.inner.tags(k.into(), v.into());
self
}
/// <p>The list of tags associated with the workspace.</p>
pub fn set_tags(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.inner = self.inner.set_tags(input);
self
}
/// <p>The configuration settings for an Amazon VPC that contains data sources for your Grafana workspace to connect to.</p>
pub fn vpc_configuration(mut self, input: crate::types::VpcConfiguration) -> Self {
self.inner = self.inner.vpc_configuration(input);
self
}
/// <p>The configuration settings for an Amazon VPC that contains data sources for your Grafana workspace to connect to.</p>
pub fn set_vpc_configuration(
mut self,
input: std::option::Option<crate::types::VpcConfiguration>,
) -> Self {
self.inner = self.inner.set_vpc_configuration(input);
self
}
/// <p>The configuration string for the workspace that you create. For more information about the format and configuration options available, see <a href="https://docs.aws.amazon.com/grafana/latest/userguide/AMG-configure-workspace.html">Working in your Grafana workspace</a>.</p>
pub fn configuration(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.configuration(input.into());
self
}
/// <p>The configuration string for the workspace that you create. For more information about the format and configuration options available, see <a href="https://docs.aws.amazon.com/grafana/latest/userguide/AMG-configure-workspace.html">Working in your Grafana workspace</a>.</p>
pub fn set_configuration(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_configuration(input);
self
}
/// <p>Configuration for network access to your workspace.</p>
/// <p>When this is configured, only listed IP addresses and VPC endpoints will be able to access your workspace. Standard Grafana authentication and authorization will still be required.</p>
/// <p>If this is not configured, or is removed, then all IP addresses and VPC endpoints will be allowed. Standard Grafana authentication and authorization will still be required.</p>
pub fn network_access_control(
mut self,
input: crate::types::NetworkAccessConfiguration,
) -> Self {
self.inner = self.inner.network_access_control(input);
self
}
/// <p>Configuration for network access to your workspace.</p>
/// <p>When this is configured, only listed IP addresses and VPC endpoints will be able to access your workspace. Standard Grafana authentication and authorization will still be required.</p>
/// <p>If this is not configured, or is removed, then all IP addresses and VPC endpoints will be allowed. Standard Grafana authentication and authorization will still be required.</p>
pub fn set_network_access_control(
mut self,
input: std::option::Option<crate::types::NetworkAccessConfiguration>,
) -> Self {
self.inner = self.inner.set_network_access_control(input);
self
}
}