class Io::Flow::V0::Models::WebhookResponse
Attributes
body[R]
body_url[R]
headers[R]
id[R]
request[R]
status[R]
Public Class Methods
new(incoming={})
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 72929 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:id, :request, :headers, :body, :status], 'WebhookResponse') @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) @request = (x = opts.delete(:request); x.is_a?(::Io::Flow::V0::Models::WebhookRequestReference) ? x : ::Io::Flow::V0::Models::WebhookRequestReference.new(x)) @headers = HttpClient::Preconditions.assert_class('headers', opts.delete(:headers), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::Header) ? x : ::Io::Flow::V0::Models::Header.new(x)) } @body = HttpClient::Preconditions.assert_class('body', opts.delete(:body), String) @body_url = (x = opts.delete(:body_url); x.nil? ? nil : HttpClient::Preconditions.assert_class('body_url', x, String)) @status = HttpClient::Preconditions.assert_class('status', opts.delete(:status), Integer) end
Public Instance Methods
copy(incoming={})
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 72944 def copy(incoming={}) WebhookResponse.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end
to_hash()
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 72948 def to_hash { :id => id, :request => request.to_hash, :headers => headers.map { |o| o.to_hash }, :body => body, :body_url => body_url, :status => status } end
to_json()
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 72940 def to_json JSON.dump(to_hash) end