updateTableReplicaAutoScaling method

Future<UpdateTableReplicaAutoScalingOutput> updateTableReplicaAutoScaling({
  1. required String tableName,
  2. List<GlobalSecondaryIndexAutoScalingUpdate>? globalSecondaryIndexUpdates,
  3. AutoScalingSettingsUpdate? provisionedWriteCapacityAutoScalingUpdate,
  4. List<ReplicaAutoScalingUpdate>? replicaUpdates,
})

Updates auto scaling settings on your global tables at once.

May throw ResourceNotFoundException. May throw ResourceInUseException. May throw LimitExceededException. May throw InternalServerError.

Parameter tableName : The name of the global table to be updated.

Parameter globalSecondaryIndexUpdates : Represents the auto scaling settings of the global secondary indexes of the replica to be updated.

Parameter replicaUpdates : Represents the auto scaling settings of replicas of the table that will be modified.

Implementation

Future<UpdateTableReplicaAutoScalingOutput> updateTableReplicaAutoScaling({
  required String tableName,
  List<GlobalSecondaryIndexAutoScalingUpdate>? globalSecondaryIndexUpdates,
  AutoScalingSettingsUpdate? provisionedWriteCapacityAutoScalingUpdate,
  List<ReplicaAutoScalingUpdate>? replicaUpdates,
}) async {
  ArgumentError.checkNotNull(tableName, 'tableName');
  _s.validateStringLength(
    'tableName',
    tableName,
    3,
    255,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'DynamoDB_20120810.UpdateTableReplicaAutoScaling'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'TableName': tableName,
      if (globalSecondaryIndexUpdates != null)
        'GlobalSecondaryIndexUpdates': globalSecondaryIndexUpdates,
      if (provisionedWriteCapacityAutoScalingUpdate != null)
        'ProvisionedWriteCapacityAutoScalingUpdate':
            provisionedWriteCapacityAutoScalingUpdate,
      if (replicaUpdates != null) 'ReplicaUpdates': replicaUpdates,
    },
  );

  return UpdateTableReplicaAutoScalingOutput.fromJson(jsonResponse.body);
}