deleteAnalysis method
Deletes an analysis from Amazon QuickSight. You can optionally include a
recovery window during which you can restore the analysis. If you don't
specify a recovery window value, the operation defaults to 30 days.
QuickSight attaches a DeletionTime
stamp to the response that
specifies the end of the recovery window. At the end of the recovery
window, QuickSight deletes the analysis permanently.
At any time before recovery window ends, you can use the
RestoreAnalysis
API operation to remove the
DeletionTime
stamp and cancel the deletion of the analysis.
The analysis remains visible in the API until it's deleted, so you can
describe it but you can't make a template from it.
An analysis that's scheduled for deletion isn't accessible in the QuickSight console. To access it in the console, restore it. Deleting an analysis doesn't delete the dashboards that you publish from it.
May throw ThrottlingException. May throw InvalidParameterValueException. May throw ConflictException. May throw ResourceNotFoundException. May throw UnsupportedUserEditionException. May throw InternalFailureException.
Parameter analysisId
:
The ID of the analysis that you're deleting.
Parameter awsAccountId
:
The ID of the AWS account where you want to delete an analysis.
Parameter forceDeleteWithoutRecovery
:
This option defaults to the value
NoForceDeleteWithoutRecovery
. To immediately delete the
analysis, add the ForceDeleteWithoutRecovery
option. You
can't restore an analysis after it's deleted.
Parameter recoveryWindowInDays
:
A value that specifies the number of days that QuickSight waits before it
deletes the analysis. You can't use this parameter with the
ForceDeleteWithoutRecovery
option in the same API call. The
default value is 30.
Implementation
Future<DeleteAnalysisResponse> deleteAnalysis({
required String analysisId,
required String awsAccountId,
bool? forceDeleteWithoutRecovery,
int? recoveryWindowInDays,
}) async {
ArgumentError.checkNotNull(analysisId, 'analysisId');
_s.validateStringLength(
'analysisId',
analysisId,
1,
2048,
isRequired: true,
);
ArgumentError.checkNotNull(awsAccountId, 'awsAccountId');
_s.validateStringLength(
'awsAccountId',
awsAccountId,
12,
12,
isRequired: true,
);
_s.validateNumRange(
'recoveryWindowInDays',
recoveryWindowInDays,
7,
30,
);
final $query = <String, List<String>>{
if (forceDeleteWithoutRecovery != null)
'force-delete-without-recovery': [
forceDeleteWithoutRecovery.toString()
],
if (recoveryWindowInDays != null)
'recovery-window-in-days': [recoveryWindowInDays.toString()],
};
final response = await _protocol.send(
payload: null,
method: 'DELETE',
requestUri:
'/accounts/${Uri.encodeComponent(awsAccountId)}/analyses/${Uri.encodeComponent(analysisId)}',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
return DeleteAnalysisResponse.fromJson(response);
}