Class: HookSniff::MessageAttempt
- Inherits:
-
Object
- Object
- HookSniff::MessageAttempt
- Defined in:
- lib/hooksniff/api/message_attempt.rb
Instance Method Summary collapse
- #get(attempt_id) ⇒ Object
-
#initialize(client) ⇒ MessageAttempt
constructor
A new instance of MessageAttempt.
- #list_by_msg(message_id, options = {}) ⇒ Object
- #resend(message_id, endpoint_id) ⇒ Object
Constructor Details
#initialize(client) ⇒ MessageAttempt
Returns a new instance of MessageAttempt.
7 8 9 |
# File 'lib/hooksniff/api/message_attempt.rb', line 7 def initialize(client) @client = client end |
Instance Method Details
#get(attempt_id) ⇒ Object
25 26 27 28 |
# File 'lib/hooksniff/api/message_attempt.rb', line 25 def get(attempt_id) res = @client.execute_request("GET", "/v1/webhooks/attempts/#{attempt_id}") MessageAttemptOut.deserialize(res) end |
#list_by_msg(message_id, options = {}) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/hooksniff/api/message_attempt.rb', line 11 def list_by_msg(, = {}) = .transform_keys(&:to_s) res = @client.execute_request( "GET", "/v1/webhooks/#{}/attempts", query_params: { "limit" => ["limit"], "offset" => ["offset"], "status" => ["status"] } ) ListResponseMessageAttemptOut.deserialize(res) end |
#resend(message_id, endpoint_id) ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/hooksniff/api/message_attempt.rb', line 30 def resend(, endpoint_id) res = @client.execute_request( "POST", "/v1/webhooks/#{}/attempts/#{endpoint_id}/resend" ) nil end |