Sha256: d07f8974bf4a29a284ba01acf09bdb5887f5fbd68d026a6db52d92ff70dcf5a9
Contents?: true
Size: 797 Bytes
Versions: 66
Compression:
Stored size: 797 Bytes
Contents
# frozen_string_literal: true module Aws module Plugins # Converts input value to JSON Syntax for members with jsonvalue trait class JsonvalueConverter < Seahorse::Client::Plugin # @api private class Handler < Seahorse::Client::Handler def call(context) context.operation.input.shape.members.each do |m, ref| if ref['jsonvalue'] param_value = context.params[m] unless param_value.respond_to?(:to_json) raise ArgumentError, "The value of params[#{m}] is not JSON serializable." end context.params[m] = param_value.to_json end end @handler.call(context) end end handler(Handler, step: :initialize) end end end
Version data entries
66 entries across 66 versions & 1 rubygems