Class: Aws::Stubbing::Protocols::RestJson Private
- Defined in:
- lib/aws-sdk-core/stubbing/protocols/rest_json.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.
Direct Known Subclasses
Instance Method Summary collapse
Methods inherited from Rest
Instance Method Details
#body_for(_a, _b, 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_json.rb', line 8 def body_for(_a, _b, rules, data) if eventstream?(rules) encode_eventstream_response(rules, data, Aws::Json::Builder) else Aws::Json::Builder.new(rules).serialize(data) end 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 |
# File 'lib/aws-sdk-core/stubbing/protocols/rest_json.rb', line 16 def stub_error(error_code) http_resp = Seahorse::Client::Http::Response.new http_resp.status_code = 400 http_resp.body = <<-JSON.strip { "code": #{error_code.inspect}, "message": "stubbed-response-error-message" } JSON http_resp end |