Sha256: dc33c8e807ec7204e29629f40d87a28198ef42d343e2eba6b6b1a9ac2bd4e05a

Contents?: true

Size: 874 Bytes

Versions: 6

Compression:

Stored size: 874 Bytes

Contents

module Aws
  module Stubbing
    module Protocols
      class RestXml < Rest

        include Seahorse::Model::Shapes

        def body_for(api, operation, rules, data)
          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

        def stub_error(error_code)
          http_resp = Seahorse::Client::Http::Response.new
          http_resp.status_code = 400
          http_resp.body = <<-XML.strip
<ErrorResponse>
  <Error>
    <Code>#{error_code}</Code>
    <Message>stubbed-response-error-message</Message>
  </Error>
</ErrorResponse>
          XML
          http_resp
        end

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

      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
aws-sdk-core-2.1.7 lib/aws-sdk-core/stubbing/protocols/rest_xml.rb
aws-sdk-core-2.1.5 lib/aws-sdk-core/stubbing/protocols/rest_xml.rb
aws-sdk-core-2.1.4 lib/aws-sdk-core/stubbing/protocols/rest_xml.rb
aws-sdk-core-2.1.3 lib/aws-sdk-core/stubbing/protocols/rest_xml.rb
aws-sdk-core-2.1.2 lib/aws-sdk-core/stubbing/protocols/rest_xml.rb
aws-sdk-core-2.1.1 lib/aws-sdk-core/stubbing/protocols/rest_xml.rb