Module: EventMachine::Smsified::SubscriptionsModule
- Included in:
- OneAPI, Subscriptions
- Defined in:
- lib/em-smsified/subscriptions.rb
Instance Method Summary collapse
-
#create_inbound_subscription(destination_address, options, &blk) ⇒ Object
Creates an inbound subscription.
-
#create_outbound_subscription(sender_address, options, &blk) ⇒ Object
Creates an outbound subscription.
-
#delete_inbound_subscription(subscription_id, &blk) ⇒ Object
Deletes an inbound subscription.
-
#delete_outbound_subscription(subscription_id, &blk) ⇒ Object
Deletes an outbound subscription.
-
#inbound_subscriptions(destination_address, &blk) ⇒ Object
Fetches the inbound subscriptions.
-
#outbound_subscriptions(sender_address, &blk) ⇒ Object
Fetches the outbound subscriptions.
-
#update_inbound_subscription(subscription_id, options, &blk) ⇒ Object
Updates an inbound subscription.
-
#update_outbound_subscription(sender_address, options, &blk) ⇒ Object
Updates an outbound subscription.
Instance Method Details
#create_inbound_subscription(destination_address, options, &blk) ⇒ Object
Creates an inbound subscription
17 18 19 20 21 22 23 24 25 |
# File 'lib/em-smsified/subscriptions.rb', line 17 def create_inbound_subscription(destination_address, , &blk) query = .merge({ :destination_address => destination_address }) post("/smsmessaging/inbound/subscriptions", camelcase_keys(query), SMSIFIED_HTTP_HEADERS, &blk ) end |
#create_outbound_subscription(sender_address, options, &blk) ⇒ Object
Creates an outbound subscription
37 38 39 40 41 42 |
# File 'lib/em-smsified/subscriptions.rb', line 37 def create_outbound_subscription(sender_address, , &blk) post("/smsmessaging/outbound/#{sender_address}/subscriptions", build_query_string(), SMSIFIED_HTTP_HEADERS, &blk ) end |
#delete_inbound_subscription(subscription_id, &blk) ⇒ Object
Deletes an inbound subscription
51 52 53 |
# File 'lib/em-smsified/subscriptions.rb', line 51 def delete_inbound_subscription(subscription_id, &blk) delete("/smsmessaging/inbound/subscriptions/#{subscription_id}", SMSIFIED_HTTP_HEADERS, &blk) end |
#delete_outbound_subscription(subscription_id, &blk) ⇒ Object
Deletes an outbound subscription
62 63 64 |
# File 'lib/em-smsified/subscriptions.rb', line 62 def delete_outbound_subscription(subscription_id, &blk) delete("/smsmessaging/outbound/subscriptions/#{subscription_id}", SMSIFIED_HTTP_HEADERS, &blk) end |
#inbound_subscriptions(destination_address, &blk) ⇒ Object
Fetches the inbound subscriptions
73 74 75 |
# File 'lib/em-smsified/subscriptions.rb', line 73 def inbound_subscriptions(destination_address, &blk) get("/smsmessaging/inbound/subscriptions?destinationAddress=#{destination_address}", SMSIFIED_HTTP_HEADERS, &blk) end |
#outbound_subscriptions(sender_address, &blk) ⇒ Object
Fetches the outbound subscriptions
84 85 86 |
# File 'lib/em-smsified/subscriptions.rb', line 84 def outbound_subscriptions(sender_address, &blk) get("/smsmessaging/outbound/subscriptions?senderAddress=#{sender_address}", SMSIFIED_HTTP_HEADERS, &blk) end |
#update_inbound_subscription(subscription_id, options, &blk) ⇒ Object
Updates an inbound subscription
99 100 101 102 103 104 |
# File 'lib/em-smsified/subscriptions.rb', line 99 def update_inbound_subscription(subscription_id, , &blk) post("/smsmessaging/inbound/subscriptions/#{subscription_id}", build_query_string(), SMSIFIED_HTTP_HEADERS, &blk ) end |
#update_outbound_subscription(sender_address, options, &blk) ⇒ Object
Updates an outbound subscription
117 118 119 120 121 |
# File 'lib/em-smsified/subscriptions.rb', line 117 def update_outbound_subscription(sender_address, , &blk) post("/smsmessaging/outbound/#{sender_address}/subscriptions", build_query_string(), SMSIFIED_HTTP_HEADERS, &blk ) end |