_validate_billing

in lib/aws-record/record/table_migration.rb [143:159]


      def _validate_billing(opts)
        valid_modes = %w[PAY_PER_REQUEST PROVISIONED]
        if opts.key?(:billing_mode) && !valid_modes.include?(opts[:billing_mode])
          raise ArgumentError, ":billing_mode option must be one of #{valid_modes.join(', ')} " \
                               "current value is: #{opts[:billing_mode]}"
        end
        if opts.key?(:provisioned_throughput)
          if opts[:billing_mode] == 'PAY_PER_REQUEST'
            raise ArgumentError, 'when :provisioned_throughput option is specified, :billing_mode ' \
                                 "must either be unspecified or have a value of 'PROVISIONED'"
          end
        elsif opts[:billing_mode] != 'PAY_PER_REQUEST'
          raise ArgumentError, 'when :provisioned_throughput option is not specified, ' \
                               ":billing_mode must be set to 'PAY_PER_REQUEST'"
        end
      end