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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::update_workspace::_update_workspace_output::UpdateWorkspaceOutputBuilder;
pub use crate::operation::update_workspace::_update_workspace_input::UpdateWorkspaceInputBuilder;
/// Fluent builder constructing a request to `UpdateWorkspace`.
///
/// <p>Modifies an existing Amazon Managed Grafana workspace. If you use this operation and omit any optional parameters, the existing values of those parameters are not changed.</p>
/// <p>To modify the user authentication methods that the workspace uses, such as SAML or IAM Identity Center, use <a href="https://docs.aws.amazon.com/grafana/latest/APIReference/API_UpdateWorkspaceAuthentication.html">UpdateWorkspaceAuthentication</a>.</p>
/// <p>To modify which users in the workspace have the <code>Admin</code> and <code>Editor</code> Grafana roles, use <a href="https://docs.aws.amazon.com/grafana/latest/APIReference/API_UpdatePermissions.html">UpdatePermissions</a>.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct UpdateWorkspaceFluentBuilder {
handle: std::sync::Arc<crate::client::Handle>,
inner: crate::operation::update_workspace::builders::UpdateWorkspaceInputBuilder,
}
impl UpdateWorkspaceFluentBuilder {
/// Creates a new `UpdateWorkspace`.
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::update_workspace::UpdateWorkspace,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::result::SdkError<crate::operation::update_workspace::UpdateWorkspaceError>,
> {
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::update_workspace::UpdateWorkspaceOutput,
aws_smithy_http::result::SdkError<crate::operation::update_workspace::UpdateWorkspaceError>,
> {
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>The name of an IAM role that already exists to use to access resources through Organizations. This can only be used with a workspace that has the <code>permissionType</code> set to <code>CUSTOMER_MANAGED</code>.</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 to access resources through Organizations. This can only be used with a workspace that has the <code>permissionType</code> set to <code>CUSTOMER_MANAGED</code>.</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>Use this parameter if you want to change a workspace from <code>SERVICE_MANAGED</code> to <code>CUSTOMER_MANAGED</code>. This allows you to manage the permissions that the workspace uses to access datasources and notification channels. If the workspace is in a member Amazon Web Services account of an organization, and that account is not a delegated administrator account, and you want the workspace to access data sources in other Amazon Web Services accounts in the organization, you must choose <code>CUSTOMER_MANAGED</code>.</p>
/// <p>If you specify this as <code>CUSTOMER_MANAGED</code>, you must also specify a <code>workspaceRoleArn</code> that the workspace will use for accessing Amazon Web Services resources.</p>
/// <p>For more information on the role and permissions needed, 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> <note>
/// <p>Do not use this to convert a <code>CUSTOMER_MANAGED</code> workspace to <code>SERVICE_MANAGED</code>. Do not include this parameter if you want to leave the workspace as <code>SERVICE_MANAGED</code>.</p>
/// <p>You can convert a <code>CUSTOMER_MANAGED</code> workspace to <code>SERVICE_MANAGED</code> using the Amazon Managed Grafana console. For more information, see <a href="https://docs.aws.amazon.com/grafana/latest/userguide/AMG-datasource-and-notification.html">Managing permissions for data sources and notification channels</a>.</p>
/// </note>
pub fn permission_type(mut self, input: crate::types::PermissionType) -> Self {
self.inner = self.inner.permission_type(input);
self
}
/// <p>Use this parameter if you want to change a workspace from <code>SERVICE_MANAGED</code> to <code>CUSTOMER_MANAGED</code>. This allows you to manage the permissions that the workspace uses to access datasources and notification channels. If the workspace is in a member Amazon Web Services account of an organization, and that account is not a delegated administrator account, and you want the workspace to access data sources in other Amazon Web Services accounts in the organization, you must choose <code>CUSTOMER_MANAGED</code>.</p>
/// <p>If you specify this as <code>CUSTOMER_MANAGED</code>, you must also specify a <code>workspaceRoleArn</code> that the workspace will use for accessing Amazon Web Services resources.</p>
/// <p>For more information on the role and permissions needed, 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> <note>
/// <p>Do not use this to convert a <code>CUSTOMER_MANAGED</code> workspace to <code>SERVICE_MANAGED</code>. Do not include this parameter if you want to leave the workspace as <code>SERVICE_MANAGED</code>.</p>
/// <p>You can convert a <code>CUSTOMER_MANAGED</code> workspace to <code>SERVICE_MANAGED</code> using the Amazon Managed Grafana console. For more information, see <a href="https://docs.aws.amazon.com/grafana/latest/userguide/AMG-datasource-and-notification.html">Managing permissions for data sources and notification channels</a>.</p>
/// </note>
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>
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>
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 ID of the workspace to update.</p>
pub fn workspace_id(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.workspace_id(input.into());
self
}
/// <p>The ID of the workspace to update.</p>
pub fn set_workspace_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_workspace_id(input);
self
}
/// <p>A new name for the workspace to update.</p>
pub fn workspace_name(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.workspace_name(input.into());
self
}
/// <p>A new name for the workspace to update.</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>Specifies an IAM role that grants permissions to Amazon Web Services resources that the workspace accesses, such as data sources and notification channels. If this workspace has <code>permissionType</code> <code>CUSTOMER_MANAGED</code>, then this role is required.</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>Specifies an IAM role that grants permissions to Amazon Web Services resources that the workspace accesses, such as data sources and notification channels. If this workspace has <code>permissionType</code> <code>CUSTOMER_MANAGED</code>, then this role is required.</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
}
/// <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>Whether to remove the VPC configuration from the workspace.</p>
/// <p>Setting this to <code>true</code> and providing a <code>vpcConfiguration</code> to set will return an error.</p>
pub fn remove_vpc_configuration(mut self, input: bool) -> Self {
self.inner = self.inner.remove_vpc_configuration(input);
self
}
/// <p>Whether to remove the VPC configuration from the workspace.</p>
/// <p>Setting this to <code>true</code> and providing a <code>vpcConfiguration</code> to set will return an error.</p>
pub fn set_remove_vpc_configuration(mut self, input: std::option::Option<bool>) -> Self {
self.inner = self.inner.set_remove_vpc_configuration(input);
self
}
/// <p>The configuration settings 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>The configuration settings 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
}
/// <p>Whether to remove the network access configuration from the workspace.</p>
/// <p>Setting this to <code>true</code> and providing a <code>networkAccessControl</code> to set will return an error.</p>
/// <p>If you remove this configuration by setting this to <code>true</code>, then all IP addresses and VPC endpoints will be allowed. Standard Grafana authentication and authorization will still be required.</p>
pub fn remove_network_access_configuration(mut self, input: bool) -> Self {
self.inner = self.inner.remove_network_access_configuration(input);
self
}
/// <p>Whether to remove the network access configuration from the workspace.</p>
/// <p>Setting this to <code>true</code> and providing a <code>networkAccessControl</code> to set will return an error.</p>
/// <p>If you remove this configuration by setting this to <code>true</code>, then all IP addresses and VPC endpoints will be allowed. Standard Grafana authentication and authorization will still be required.</p>
pub fn set_remove_network_access_configuration(
mut self,
input: std::option::Option<bool>,
) -> Self {
self.inner = self.inner.set_remove_network_access_configuration(input);
self
}
}