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, options = {}) ⇒ 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
91 92 93 94 95 96 |
# File 'lib/svix/api/message_attempt.rb', line 91 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, options = {}) ⇒ Object
79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/svix/api/message_attempt.rb', line 79 def get(app_id, msg_id, attempt_id, = {}) = .transform_keys(&:to_s) res = @client.execute_request( "GET", "/api/v1/app/#{app_id}/msg/#{msg_id}/attempt/#{attempt_id}", query_params: { "expanded_statuses" => ["expanded_statuses"] } ) MessageAttemptOut.deserialize(res) end |
#list_attempted_destinations(app_id, msg_id, options = {}) ⇒ Object
98 99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/svix/api/message_attempt.rb', line 98 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
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/svix/api/message_attempt.rb', line 58 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"], "expanded_statuses" => ["expanded_statuses"], "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 33 |
# 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"], "expanded_statuses" => ["expanded_statuses"], "event_types" => ["event_types"] } ) ListResponseMessageAttemptOut.deserialize(res) end |
#list_by_msg(app_id, msg_id, options = {}) ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/svix/api/message_attempt.rb', line 35 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"], "expanded_statuses" => ["expanded_statuses"], "event_types" => ["event_types"] } ) ListResponseMessageAttemptOut.deserialize(res) end |
#resend(app_id, msg_id, endpoint_id, options = {}) ⇒ Object
111 112 113 114 115 116 117 118 119 120 121 |
# File 'lib/svix/api/message_attempt.rb', line 111 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 |