updateAnalysis method

Future<UpdateAnalysisResponse> updateAnalysis({
  1. required String analysisId,
  2. required String awsAccountId,
  3. required String name,
  4. required AnalysisSourceEntity sourceEntity,
  5. Parameters? parameters,
  6. String? themeArn,
})

Updates an analysis in Amazon QuickSight

May throw ResourceNotFoundException. May throw InvalidParameterValueException. May throw ThrottlingException. May throw ResourceExistsException. May throw ConflictException. May throw UnsupportedUserEditionException. May throw InternalFailureException.

Parameter analysisId : The ID for the analysis that you're updating. This ID displays in the URL of the analysis.

Parameter awsAccountId : The ID of the AWS account that contains the analysis that you're updating.

Parameter name : A descriptive name for the analysis that you're updating. This name displays for the analysis in the QuickSight console.

Parameter sourceEntity : A source entity to use for the analysis that you're updating. This metadata structure contains details that describe a source template and one or more datasets.

Parameter parameters : The parameter names and override values that you want to use. An analysis can have any parameter type, and some parameters might accept multiple values.

Parameter themeArn : The Amazon Resource Name (ARN) for the theme to apply to the analysis that you're creating. To see the theme in the QuickSight console, make sure that you have access to it.

Implementation

Future<UpdateAnalysisResponse> updateAnalysis({
  required String analysisId,
  required String awsAccountId,
  required String name,
  required AnalysisSourceEntity sourceEntity,
  Parameters? parameters,
  String? themeArn,
}) 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,
  );
  ArgumentError.checkNotNull(name, 'name');
  _s.validateStringLength(
    'name',
    name,
    1,
    2048,
    isRequired: true,
  );
  ArgumentError.checkNotNull(sourceEntity, 'sourceEntity');
  final $payload = <String, dynamic>{
    'Name': name,
    'SourceEntity': sourceEntity,
    if (parameters != null) 'Parameters': parameters,
    if (themeArn != null) 'ThemeArn': themeArn,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri:
        '/accounts/${Uri.encodeComponent(awsAccountId)}/analyses/${Uri.encodeComponent(analysisId)}',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateAnalysisResponse.fromJson(response);
}