updateContributorInsights method

Future<UpdateContributorInsightsOutput> updateContributorInsights({
  1. required ContributorInsightsAction contributorInsightsAction,
  2. required String tableName,
  3. String? indexName,
})

Updates the status for contributor insights for a specific table or index.

May throw ResourceNotFoundException. May throw InternalServerError.

Parameter contributorInsightsAction : Represents the contributor insights action.

Parameter tableName : The name of the table.

Parameter indexName : The global secondary index name, if applicable.

Implementation

Future<UpdateContributorInsightsOutput> updateContributorInsights({
  required ContributorInsightsAction contributorInsightsAction,
  required String tableName,
  String? indexName,
}) async {
  ArgumentError.checkNotNull(
      contributorInsightsAction, 'contributorInsightsAction');
  ArgumentError.checkNotNull(tableName, 'tableName');
  _s.validateStringLength(
    'tableName',
    tableName,
    3,
    255,
    isRequired: true,
  );
  _s.validateStringLength(
    'indexName',
    indexName,
    3,
    255,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'DynamoDB_20120810.UpdateContributorInsights'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ContributorInsightsAction': contributorInsightsAction.toValue(),
      'TableName': tableName,
      if (indexName != null) 'IndexName': indexName,
    },
  );

  return UpdateContributorInsightsOutput.fromJson(jsonResponse.body);
}