Sha256: 8f348f2a697161f07bc8c94b0ccf5446a60ae38a6eac5acc1d56e54a247bd1c5

Contents?: true

Size: 869 Bytes

Versions: 172

Compression:

Stored size: 869 Bytes

Contents

# frozen_string_literal: true

module Aws
  module Stubbing
    module Protocols
      class RestXml < Rest

        def body_for(api, operation, rules, data)
          if eventstream?(rules)
            encode_eventstream_response(rules, data, Xml::Builder)
          else
            xml = []
            rules.location_name = operation.name + 'Result'
            rules['xmlNamespace'] = { 'uri' => api.metadata['xmlNamespace'] }
            Xml::Builder.new(rules, target:xml).to_xml(data)
            xml.join
          end
        end

        def stub_error(error_code)
          http_resp = Seahorse::Client::Http::Response.new
          http_resp.status_code = 400
          http_resp.body = XmlError.new(error_code).to_xml
          http_resp
        end

        def xmlns(api)
          api.metadata['xmlNamespace']
        end

      end
    end
  end
end

Version data entries

172 entries across 172 versions & 1 rubygems

Version Path
aws-sdk-core-3.210.0 lib/aws-sdk-core/stubbing/protocols/rest_xml.rb
aws-sdk-core-3.209.1 lib/aws-sdk-core/stubbing/protocols/rest_xml.rb
aws-sdk-core-3.209.0 lib/aws-sdk-core/stubbing/protocols/rest_xml.rb
aws-sdk-core-3.208.0 lib/aws-sdk-core/stubbing/protocols/rest_xml.rb
aws-sdk-core-3.207.0 lib/aws-sdk-core/stubbing/protocols/rest_xml.rb
aws-sdk-core-3.206.0 lib/aws-sdk-core/stubbing/protocols/rest_xml.rb
aws-sdk-core-3.205.0 lib/aws-sdk-core/stubbing/protocols/rest_xml.rb
aws-sdk-core-3.204.0 lib/aws-sdk-core/stubbing/protocols/rest_xml.rb
aws-sdk-core-3.203.0 lib/aws-sdk-core/stubbing/protocols/rest_xml.rb
aws-sdk-core-3.202.2 lib/aws-sdk-core/stubbing/protocols/rest_xml.rb
aws-sdk-core-3.202.1 lib/aws-sdk-core/stubbing/protocols/rest_xml.rb
aws-sdk-core-3.202.0 lib/aws-sdk-core/stubbing/protocols/rest_xml.rb
aws-sdk-core-3.201.5 lib/aws-sdk-core/stubbing/protocols/rest_xml.rb
aws-sdk-core-3.201.4 lib/aws-sdk-core/stubbing/protocols/rest_xml.rb
aws-sdk-core-3.201.3 lib/aws-sdk-core/stubbing/protocols/rest_xml.rb
aws-sdk-core-3.201.2 lib/aws-sdk-core/stubbing/protocols/rest_xml.rb
aws-sdk-core-3.201.1 lib/aws-sdk-core/stubbing/protocols/rest_xml.rb
aws-sdk-core-3.201.0 lib/aws-sdk-core/stubbing/protocols/rest_xml.rb
aws-sdk-core-3.200.0 lib/aws-sdk-core/stubbing/protocols/rest_xml.rb
aws-sdk-core-3.199.0 lib/aws-sdk-core/stubbing/protocols/rest_xml.rb