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
22
23
24
25
26
27
28
# 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 = <<-XML.strip
<ErrorResponse>
  <Error>
    <Code>#{error_code}</Code>
    <Message>stubbed-response-error-message</Message>
  </Error>
</ErrorResponse>
  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.



30
31
32
# File 'lib/aws-sdk-core/stubbing/protocols/rest_xml.rb', line 30

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