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

Version Path
aws-sdk-core-3.131.2 lib/aws-sdk-core/plugins/jsonvalue_converter.rb
aws-sdk-core-3.131.1 lib/aws-sdk-core/plugins/jsonvalue_converter.rb
aws-sdk-core-3.131.0 lib/aws-sdk-core/plugins/jsonvalue_converter.rb
aws-sdk-core-3.130.2 lib/aws-sdk-core/plugins/jsonvalue_converter.rb
aws-sdk-core-3.130.1 lib/aws-sdk-core/plugins/jsonvalue_converter.rb
aws-sdk-core-3.130.0 lib/aws-sdk-core/plugins/jsonvalue_converter.rb
aws-sdk-core-3.129.1 lib/aws-sdk-core/plugins/jsonvalue_converter.rb
aws-sdk-core-3.129.0 lib/aws-sdk-core/plugins/jsonvalue_converter.rb
aws-sdk-core-3.128.1 lib/aws-sdk-core/plugins/jsonvalue_converter.rb
aws-sdk-core-3.128.0 lib/aws-sdk-core/plugins/jsonvalue_converter.rb
aws-sdk-core-3.127.0 lib/aws-sdk-core/plugins/jsonvalue_converter.rb
aws-sdk-core-3.126.2 lib/aws-sdk-core/plugins/jsonvalue_converter.rb
aws-sdk-core-3.126.1 lib/aws-sdk-core/plugins/jsonvalue_converter.rb
aws-sdk-core-3.126.0 lib/aws-sdk-core/plugins/jsonvalue_converter.rb
aws-sdk-core-3.125.6 lib/aws-sdk-core/plugins/jsonvalue_converter.rb
aws-sdk-core-3.125.5 lib/aws-sdk-core/plugins/jsonvalue_converter.rb
aws-sdk-core-3.125.4 lib/aws-sdk-core/plugins/jsonvalue_converter.rb
aws-sdk-core-3.125.3 lib/aws-sdk-core/plugins/jsonvalue_converter.rb
aws-sdk-core-3.125.2 lib/aws-sdk-core/plugins/jsonvalue_converter.rb
aws-sdk-core-3.125.1 lib/aws-sdk-core/plugins/jsonvalue_converter.rb