updateWorkspace method
Updates a workspace. You can update only workspaces in the
ACTIVE or FAILED state. Fields that you omit
from the request are left unchanged. To recover a workspace in the
FAILED state, call this operation and supply its encryption
configuration again.
May throw AccessDeniedException.
May throw ConflictingOperationException.
May throw InternalFailureException.
May throw InvalidRequestException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
Parameter workspaceName :
The name of the workspace to update.
Parameter clientToken :
A unique, case-sensitive identifier that you provide to ensure that the
request is idempotent. If you retry a request that completed successfully
using the same client token, the retry succeeds without performing any
further actions.
Parameter encryptionConfiguration :
The encryption configuration for the workspace. Omit this field to leave
encryption unchanged. After a customer managed key configuration becomes
active, the key can't be changed; supplying the same key is accepted.
Parameter workspaceDescription :
A new description for the workspace.
Implementation
Future<UpdateWorkspaceResponse> updateWorkspace({
required String workspaceName,
String? clientToken,
WorkspaceEncryptionConfiguration? encryptionConfiguration,
String? workspaceDescription,
}) async {
final $payload = <String, dynamic>{
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
if (encryptionConfiguration != null)
'encryptionConfiguration': encryptionConfiguration,
if (workspaceDescription != null)
'workspaceDescription': workspaceDescription,
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri: '/workspaces/${Uri.encodeComponent(workspaceName)}',
hostPrefix: 'api.',
exceptionFnMap: _exceptionFns,
);
return UpdateWorkspaceResponse.fromJson(response);
}