Class: Aws::Stubbing::Protocols::RestXml Private

Inherits:
Rest
  • Object
show all
Includes:
Seahorse::Model::Shapes
Defined in:
lib/aws-sdk-core/stubbing/protocols/rest_xml.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Methods inherited from Rest

#stub_data

Instance Method Details

#body_for(api, operation, rules, data) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


8
9
10
11
12
13
14
# 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.['xmlNamespace'] }
  Xml::Builder.new(rules, target:xml).to_xml(data)
  xml.join
end

#stub_error(error_code) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


16
17
18
19
20
21
# 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) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


23
24
25
# File 'lib/aws-sdk-core/stubbing/protocols/rest_xml.rb', line 23

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