class Aws::Stubbing::Protocols::RestXml

@api private

Public Instance Methods

body_for(api, operation, rules, data) click to toggle source
# File lib/aws-sdk-core/stubbing/protocols/rest_xml.rb, line 9
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
stub_error(error_code) click to toggle source
# File lib/aws-sdk-core/stubbing/protocols/rest_xml.rb, line 21
def stub_error(error_code)
  resp = Seahorse::Client::Http::Response.new
  resp.status_code = 400
  resp.body = XmlError.new(error_code).to_xml
  resp
end
xmlns(api) click to toggle source
# File lib/aws-sdk-core/stubbing/protocols/rest_xml.rb, line 28
def xmlns(api)
  api.metadata['xmlNamespace']
end