class Aws::Stubbing::Protocols::RestXml

Public Instance Methods

body_for(api, operation, rules, data) click to toggle source
# File lib/aws-sdk-core/stubbing/protocols/rest_xml.rb, line 8
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
stub_error(error_code) click to toggle source
# File lib/aws-sdk-core/stubbing/protocols/rest_xml.rb, line 16
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
xmlns(api) click to toggle source
# File lib/aws-sdk-core/stubbing/protocols/rest_xml.rb, line 23
def xmlns(api)
  api.metadata['xmlNamespace']
end