deleteWorkspace method

Future<DeleteWorkspaceResponse> deleteWorkspace({
  1. required String workspaceName,
  2. String? clientToken,
})

Deletes a workspace. Before you delete a workspace, you must delete all resources contained in or associated with the workspace, such as datasets, time series, pipelines, and tasks.

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 delete.

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.

Implementation

Future<DeleteWorkspaceResponse> deleteWorkspace({
  required String workspaceName,
  String? clientToken,
}) async {
  final $query = <String, List<String>>{
    if (clientToken != null) 'clientToken': [clientToken],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'DELETE',
    requestUri: '/workspaces/${Uri.encodeComponent(workspaceName)}',
    queryParams: $query,
    hostPrefix: 'api.',
    exceptionFnMap: _exceptionFns,
  );
  return DeleteWorkspaceResponse.fromJson(response);
}