Class: Inttegro::Resources::Schedules

Inherits:
Object
  • Object
show all
Defined in:
lib/inttegro/resources/schedules.rb

Overview

Client for observing and canceling scheduled Chimes.

Access this resource through Client#schedules.

Instance Method Summary collapse

Constructor Details

#initialize(http) ⇒ Schedules

Returns a new instance of Schedules.

Parameters:



11
12
13
# File 'lib/inttegro/resources/schedules.rb', line 11

def initialize(http)
  @http = T.let(http, Inttegro::HTTPClient)
end

Instance Method Details

#cancel(schedule_id:) ⇒ Inttegro::Schedule::CancelDetail

Request cancellation of a Chime schedule that has not won its execution race.

Parameters:

  • schedule_id (String) —

    unique schedule identifier

Returns:



31
32
33
34
35
36
37
# File 'lib/inttegro/resources/schedules.rb', line 31

def cancel(schedule_id:)
  @http.post_resource(
    "/schedules/cancel",
    Inttegro::Schedule::CancelDetail, :scheduled_chime,
    { schedule_id: schedule_id }
  )
end

#lookup(schedule_id:) ⇒ Inttegro::Schedule::Detail

Retrieve one scheduled Chime.

Parameters:

  • schedule_id (String) —

    unique schedule identifier

Returns:



19
20
21
22
23
24
25
# File 'lib/inttegro/resources/schedules.rb', line 19

def lookup(schedule_id:)
  @http.post_resource(
    "/schedules/lookup",
    Inttegro::Schedule::Detail, :scheduled_chime,
    { schedule_id: schedule_id }
  )
end