Sha256: f1552b051eaff32c9c55d715dbae152871afa752049d74f87c0b2e34c3f2818d

Contents?: true

Size: 896 Bytes

Versions: 38

Compression:

Stored size: 896 Bytes

Contents

module Seahorse
  module Client
    module Plugins

      # This plugin performs two trivial translations:
      #
      # * The request parameters are serialized as JSON for the request body
      # * The response body is deserialized as JSON for the response data
      #
      # No attempt is made to extract errors from the HTTP response body.
      # Parsing the response only happens for a successful response.
      #
      class JsonSimple < Plugin

        # @api private
        class Handler < Client::Handler

          def call(context)
            context.http_request.body = MultiJson.dump(context.params)
            @handler.call(context).on_success do |response|
              response.error = nil
              response.data = MultiJson.load(context.http_response.body_contents)
            end
          end

        end

        handler(Handler)

      end
    end
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
aws-sdk-core-2.0.28 lib/seahorse/client/plugins/json_simple.rb
aws-sdk-core-2.0.27 lib/seahorse/client/plugins/json_simple.rb
aws-sdk-core-2.0.26 lib/seahorse/client/plugins/json_simple.rb
aws-sdk-core-2.0.25 lib/seahorse/client/plugins/json_simple.rb
aws-sdk-core-2.0.24 lib/seahorse/client/plugins/json_simple.rb
aws-sdk-core-2.0.23 lib/seahorse/client/plugins/json_simple.rb
aws-sdk-core-2.0.22 lib/seahorse/client/plugins/json_simple.rb
aws-sdk-core-2.0.21 lib/seahorse/client/plugins/json_simple.rb
aws-sdk-core-2.0.20 lib/seahorse/client/plugins/json_simple.rb
aws-sdk-core-2.0.19 lib/seahorse/client/plugins/json_simple.rb
aws-sdk-core-2.0.18 lib/seahorse/client/plugins/json_simple.rb
aws-sdk-core-2.0.17 lib/seahorse/client/plugins/json_simple.rb
aws-sdk-core-2.0.16 lib/seahorse/client/plugins/json_simple.rb
aws-sdk-core-2.0.15 lib/seahorse/client/plugins/json_simple.rb
aws-sdk-core-2.0.14 lib/seahorse/client/plugins/json_simple.rb
aws-sdk-core-2.0.13 lib/seahorse/client/plugins/json_simple.rb
aws-sdk-core-2.0.12 lib/seahorse/client/plugins/json_simple.rb
aws-sdk-core-2.0.11 lib/seahorse/client/plugins/json_simple.rb