Class: Inttegro::Resources::Chimes
- Inherits:
-
Object
- Object
- Inttegro::Resources::Chimes
- Defined in:
- lib/inttegro/resources/chimes.rb
Overview
Client for immediate, scheduled, and broadcast SMS or email notifications.
Access this resource through Client#chimes.
Instance Method Summary collapse
-
#broadcast(payload) ⇒ Inttegro::Broadcast::CreationDetail
Start an asynchronous Chime broadcast.
-
#initialize(http) ⇒ Chimes
constructor
A new instance of Chimes.
-
#lookup(chime_id:) ⇒ Inttegro::Chime
Retrieve a sent Chime.
-
#page(payload = {}) ⇒ Inttegro::Chime::Page
Retrieve a filtered page of Chimes.
-
#schedule(payload) ⇒ Inttegro::Schedule::CreationDetail
Schedule one or more Chimes for future delivery.
-
#send(payload) ⇒ Inttegro::Chime
Send one Chime immediately.
Constructor Details
#initialize(http) ⇒ Chimes
Returns a new instance of Chimes.
11 12 13 |
# File 'lib/inttegro/resources/chimes.rb', line 11 def initialize(http) @http = T.let(http, Inttegro::HTTPClient) end |
Instance Method Details
#broadcast(payload) ⇒ Inttegro::Broadcast::CreationDetail
Start an asynchronous Chime broadcast.
51 52 53 |
# File 'lib/inttegro/resources/chimes.rb', line 51 def broadcast(payload) @http.post_resource("/chimes/broadcast", Inttegro::Broadcast::CreationDetail, :broadcast, payload) end |
#lookup(chime_id:) ⇒ Inttegro::Chime
Retrieve a sent Chime.
27 28 29 |
# File 'lib/inttegro/resources/chimes.rb', line 27 def lookup(chime_id:) @http.post_resource("/chimes/lookup", Inttegro::Chime, :chime, { chime_id: chime_id }) end |
#page(payload = {}) ⇒ Inttegro::Chime::Page
Retrieve a filtered page of Chimes.
35 36 37 |
# File 'lib/inttegro/resources/chimes.rb', line 35 def page(payload = {}) @http.post_resource("/chimes/page", Inttegro::Chime::Page, :page, payload || {}) end |
#schedule(payload) ⇒ Inttegro::Schedule::CreationDetail
Schedule one or more Chimes for future delivery.
43 44 45 |
# File 'lib/inttegro/resources/chimes.rb', line 43 def schedule(payload) @http.post_resource("/chimes/schedule", Inttegro::Schedule::CreationDetail, :scheduled_chime, payload) end |
#send(payload) ⇒ Inttegro::Chime
Send one Chime immediately.
19 20 21 |
# File 'lib/inttegro/resources/chimes.rb', line 19 def send(payload) @http.post_resource("/chimes/send", Inttegro::Chime, :chime, payload) end |