updateGlobalTableSettings method

Future<UpdateGlobalTableSettingsOutput> updateGlobalTableSettings({
  1. required String globalTableName,
  2. BillingMode? globalTableBillingMode,
  3. List<GlobalTableGlobalSecondaryIndexSettingsUpdate>? globalTableGlobalSecondaryIndexSettingsUpdate,
  4. AutoScalingSettingsUpdate? globalTableProvisionedWriteCapacityAutoScalingSettingsUpdate,
  5. int? globalTableProvisionedWriteCapacityUnits,
  6. List<ReplicaSettingsUpdate>? replicaSettingsUpdate,
})

Updates settings for a global table.

May throw GlobalTableNotFoundException. May throw ReplicaNotFoundException. May throw IndexNotFoundException. May throw LimitExceededException. May throw ResourceInUseException. May throw InternalServerError.

Parameter globalTableName : The name of the global table

Parameter globalTableBillingMode : The billing mode of the global table. If GlobalTableBillingMode is not specified, the global table defaults to PROVISIONED capacity billing mode.

  • PROVISIONED - We recommend using PROVISIONED for predictable workloads. PROVISIONED sets the billing mode to Provisioned Mode.
  • PAY_PER_REQUEST - We recommend using PAY_PER_REQUEST for unpredictable workloads. PAY_PER_REQUEST sets the billing mode to On-Demand Mode.

Parameter globalTableGlobalSecondaryIndexSettingsUpdate : Represents the settings of a global secondary index for a global table that will be modified.

Parameter globalTableProvisionedWriteCapacityAutoScalingSettingsUpdate : Auto scaling settings for managing provisioned write capacity for the global table.

Parameter globalTableProvisionedWriteCapacityUnits : The maximum number of writes consumed per second before DynamoDB returns a ThrottlingException.

Parameter replicaSettingsUpdate : Represents the settings for a global table in a Region that will be modified.

Implementation

Future<UpdateGlobalTableSettingsOutput> updateGlobalTableSettings({
  required String globalTableName,
  BillingMode? globalTableBillingMode,
  List<GlobalTableGlobalSecondaryIndexSettingsUpdate>?
      globalTableGlobalSecondaryIndexSettingsUpdate,
  AutoScalingSettingsUpdate?
      globalTableProvisionedWriteCapacityAutoScalingSettingsUpdate,
  int? globalTableProvisionedWriteCapacityUnits,
  List<ReplicaSettingsUpdate>? replicaSettingsUpdate,
}) async {
  ArgumentError.checkNotNull(globalTableName, 'globalTableName');
  _s.validateStringLength(
    'globalTableName',
    globalTableName,
    3,
    255,
    isRequired: true,
  );
  _s.validateNumRange(
    'globalTableProvisionedWriteCapacityUnits',
    globalTableProvisionedWriteCapacityUnits,
    1,
    1152921504606846976,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'DynamoDB_20120810.UpdateGlobalTableSettings'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'GlobalTableName': globalTableName,
      if (globalTableBillingMode != null)
        'GlobalTableBillingMode': globalTableBillingMode.toValue(),
      if (globalTableGlobalSecondaryIndexSettingsUpdate != null)
        'GlobalTableGlobalSecondaryIndexSettingsUpdate':
            globalTableGlobalSecondaryIndexSettingsUpdate,
      if (globalTableProvisionedWriteCapacityAutoScalingSettingsUpdate !=
          null)
        'GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate':
            globalTableProvisionedWriteCapacityAutoScalingSettingsUpdate,
      if (globalTableProvisionedWriteCapacityUnits != null)
        'GlobalTableProvisionedWriteCapacityUnits':
            globalTableProvisionedWriteCapacityUnits,
      if (replicaSettingsUpdate != null)
        'ReplicaSettingsUpdate': replicaSettingsUpdate,
    },
  );

  return UpdateGlobalTableSettingsOutput.fromJson(jsonResponse.body);
}