Class: Io::Flow::V0::Models::WebhookSettings
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::WebhookSettings
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Sets organization level settings to determine things like how many retries on delivery, how long we wait, etc. By default, we will attempt delivery up to 6 times, using exponential backoff with a see of 1 minute (60k ms) - which means that we will retry over the course of approximately an hour before giving up.
Instance Attribute Summary collapse
-
#retry_max_attempts ⇒ Object
readonly
Returns the value of attribute retry_max_attempts.
-
#retry_sleep_ms ⇒ Object
readonly
Returns the value of attribute retry_sleep_ms.
-
#secret ⇒ Object
readonly
Returns the value of attribute secret.
-
#sleep_ms ⇒ Object
readonly
Returns the value of attribute sleep_ms.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ WebhookSettings
constructor
A new instance of WebhookSettings.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ WebhookSettings
Returns a new instance of WebhookSettings.
32920 32921 32922 32923 32924 32925 32926 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32920 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) @secret = (x = opts.delete(:secret); x.nil? ? nil : HttpClient::Preconditions.assert_class('secret', x, String)) @retry_max_attempts = HttpClient::Preconditions.assert_class('retry_max_attempts', (x = opts.delete(:retry_max_attempts); x.nil? ? 6 : x), Integer) @retry_sleep_ms = HttpClient::Preconditions.assert_class('retry_sleep_ms', (x = opts.delete(:retry_sleep_ms); x.nil? ? 60000 : x), Integer) @sleep_ms = HttpClient::Preconditions.assert_class('sleep_ms', (x = opts.delete(:sleep_ms); x.nil? ? 0 : x), Integer) end |
Instance Attribute Details
#retry_max_attempts ⇒ Object (readonly)
Returns the value of attribute retry_max_attempts.
32918 32919 32920 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32918 def retry_max_attempts @retry_max_attempts end |
#retry_sleep_ms ⇒ Object (readonly)
Returns the value of attribute retry_sleep_ms.
32918 32919 32920 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32918 def retry_sleep_ms @retry_sleep_ms end |
#secret ⇒ Object (readonly)
Returns the value of attribute secret.
32918 32919 32920 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32918 def secret @secret end |
#sleep_ms ⇒ Object (readonly)
Returns the value of attribute sleep_ms.
32918 32919 32920 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32918 def sleep_ms @sleep_ms end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
32932 32933 32934 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32932 def copy(incoming={}) WebhookSettings.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
32936 32937 32938 32939 32940 32941 32942 32943 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32936 def to_hash { :secret => secret, :retry_max_attempts => retry_max_attempts, :retry_sleep_ms => retry_sleep_ms, :sleep_ms => sleep_ms } end |
#to_json ⇒ Object
32928 32929 32930 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32928 def to_json JSON.dump(to_hash) end |