Sha256: 20215c15a6c04899aca7d754e30e7243b0c45a924f30c086c49301674ab4aa92
Contents?: true
Size: 1007 Bytes
Versions: 8
Compression:
Stored size: 1007 Bytes
Contents
# frozen_string_literal: true module Aws module Stubbing module Protocols # @api private class RpcV2 def stub_data(_api, operation, data) resp = Seahorse::Client::Http::Response.new resp.status_code = 200 resp.headers['Smithy-Protocol'] = 'rpc-v2-cbor' resp.headers['Content-Type'] = 'application/cbor' resp.headers['x-amzn-RequestId'] = 'stubbed-request-id' resp.body = build_body(operation, data) resp end def stub_error(error_code) resp = Seahorse::Client::Http::Response.new resp.status_code = 400 resp.body = Aws::RpcV2.encode( { 'code' => error_code, 'message' => 'stubbed-response-error-message' } ) resp end private def build_body(operation, data) Aws::RpcV2::Builder.new(operation.output).serialize(data) end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems