in lib/aws-record/record/table_config.rb [387:416]
def _update_throughput_opts(resp)
if @billing_mode == "PROVISIONED"
opts = {
table_name: @model_class.table_name,
provisioned_throughput: {
read_capacity_units: @read_capacity_units,
write_capacity_units: @write_capacity_units
}
}
if !resp.table.billing_mode_summary.nil? &&
resp.table.billing_mode_summary.billing_mode == "PAY_PER_REQUEST"
opts[:billing_mode] = @billing_mode
if resp.table.global_secondary_indexes
resp_gsis = resp.table.global_secondary_indexes
_add_global_secondary_index_throughput(opts, resp_gsis)
end
end
opts
elsif @billing_mode == "PAY_PER_REQUEST"
{
table_name: @model_class.table_name,
billing_mode: "PAY_PER_REQUEST"
}
else
raise ArgumentError, "Unsupported billing mode #{@billing_mode}"
end
end