Class: Svix::MessageAttempt
- Inherits:
-
Object
- Object
- Svix::MessageAttempt
- Defined in:
- lib/svix/api/message_attempt.rb
Instance Method Summary collapse
- #expunge_content(app_id, msg_id, attempt_id) ⇒ Object
- #get(app_id, msg_id, attempt_id) ⇒ Object
-
#initialize(client) ⇒ MessageAttempt
constructor
A new instance of MessageAttempt.
- #list_attempted_destinations(app_id, msg_id, options = {}) ⇒ Object
- #list_attempted_messages(app_id, endpoint_id, options = {}) ⇒ Object
- #list_by_endpoint(app_id, endpoint_id, options = {}) ⇒ Object
- #list_by_msg(app_id, msg_id, options = {}) ⇒ Object
- #resend(app_id, msg_id, endpoint_id, options = {}) ⇒ Object
Constructor Details
#initialize(client) ⇒ MessageAttempt
Returns a new instance of MessageAttempt.
8 9 10 |
# File 'lib/svix/api/message_attempt.rb', line 8 def initialize(client) @client = client end |
Instance Method Details
#expunge_content(app_id, msg_id, attempt_id) ⇒ Object
84 85 86 87 88 89 |
# File 'lib/svix/api/message_attempt.rb', line 84 def expunge_content(app_id, msg_id, attempt_id) @client.execute_request( "DELETE", "/api/v1/app/#{app_id}/msg/#{msg_id}/attempt/#{attempt_id}/content" ) end |
#get(app_id, msg_id, attempt_id) ⇒ Object
76 77 78 79 80 81 82 |
# File 'lib/svix/api/message_attempt.rb', line 76 def get(app_id, msg_id, attempt_id) res = @client.execute_request( "GET", "/api/v1/app/#{app_id}/msg/#{msg_id}/attempt/#{attempt_id}" ) MessageAttemptOut.deserialize(res) end |
#list_attempted_destinations(app_id, msg_id, options = {}) ⇒ Object
91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'lib/svix/api/message_attempt.rb', line 91 def list_attempted_destinations(app_id, msg_id, = {}) = .transform_keys(&:to_s) res = @client.execute_request( "GET", "/api/v1/app/#{app_id}/msg/#{msg_id}/endpoint", query_params: { "limit" => ["limit"], "iterator" => ["iterator"] } ) ListResponseMessageEndpointOut.deserialize(res) end |
#list_attempted_messages(app_id, endpoint_id, options = {}) ⇒ Object
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/svix/api/message_attempt.rb', line 56 def (app_id, endpoint_id, = {}) = .transform_keys(&:to_s) res = @client.execute_request( "GET", "/api/v1/app/#{app_id}/endpoint/#{endpoint_id}/msg", query_params: { "limit" => ["limit"], "iterator" => ["iterator"], "channel" => ["channel"], "tag" => ["tag"], "status" => ["status"], "before" => ["before"], "after" => ["after"], "with_content" => ["with_content"], "event_types" => ["event_types"] } ) ListResponseEndpointMessageOut.deserialize(res) end |
#list_by_endpoint(app_id, endpoint_id, options = {}) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/svix/api/message_attempt.rb', line 12 def list_by_endpoint(app_id, endpoint_id, = {}) = .transform_keys(&:to_s) res = @client.execute_request( "GET", "/api/v1/app/#{app_id}/attempt/endpoint/#{endpoint_id}", query_params: { "limit" => ["limit"], "iterator" => ["iterator"], "status" => ["status"], "status_code_class" => ["status_code_class"], "channel" => ["channel"], "tag" => ["tag"], "before" => ["before"], "after" => ["after"], "with_content" => ["with_content"], "with_msg" => ["with_msg"], "event_types" => ["event_types"] } ) ListResponseMessageAttemptOut.deserialize(res) end |
#list_by_msg(app_id, msg_id, options = {}) ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/svix/api/message_attempt.rb', line 34 def list_by_msg(app_id, msg_id, = {}) = .transform_keys(&:to_s) res = @client.execute_request( "GET", "/api/v1/app/#{app_id}/attempt/msg/#{msg_id}", query_params: { "limit" => ["limit"], "iterator" => ["iterator"], "status" => ["status"], "status_code_class" => ["status_code_class"], "channel" => ["channel"], "tag" => ["tag"], "endpoint_id" => ["endpoint_id"], "before" => ["before"], "after" => ["after"], "with_content" => ["with_content"], "event_types" => ["event_types"] } ) ListResponseMessageAttemptOut.deserialize(res) end |
#resend(app_id, msg_id, endpoint_id, options = {}) ⇒ Object
104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/svix/api/message_attempt.rb', line 104 def resend(app_id, msg_id, endpoint_id, = {}) = .transform_keys(&:to_s) res = @client.execute_request( "POST", "/api/v1/app/#{app_id}/msg/#{msg_id}/endpoint/#{endpoint_id}/resend", headers: { "idempotency-key" => ["idempotency-key"] } ) EmptyResponse.deserialize(res) end |