Module: Unit::Event

Defined in:
lib/unit/models/event/event.rb,
lib/unit/models/event/list_event_params.rb

Defined Under Namespace

Classes: ListEventParams

Constant Summary collapse

EVENT_LIST_LIMIT =
100
EVENT_LIST_OFFSET =
0

Class Method Summary collapse

Class Method Details

.fire_event(event_id:) ⇒ Object

Fire event

Parameters:

  • event_id (String)

See Also:



32
33
34
# File 'lib/unit/models/event/event.rb', line 32

def fire_event(event_id:)
  Unit::Resource::EventResource.fire(event_id)
end

.get_event(event_id:) ⇒ Object

Get event by id

Parameters:

  • event_id (String)

See Also:



13
14
15
# File 'lib/unit/models/event/event.rb', line 13

def get_event(event_id:)
  Unit::Resource::EventResource.get(event_id)
end

.list_events(limit: EVENT_LIST_LIMIT, offset: EVENT_LIST_OFFSET, type: nil, since: nil, _until: nil) ⇒ Object

List events

Parameters:

  • limit (Integer) (defaults to: EVENT_LIST_LIMIT)
  • offset (Integer) (defaults to: EVENT_LIST_OFFSET)
  • type (Array<String>) (defaults to: nil)
    • optional

  • since (String) (defaults to: nil)
    • optional

  • _until (String) (defaults to: nil)
    • optional

See Also:



24
25
26
27
# File 'lib/unit/models/event/event.rb', line 24

def list_events(limit: EVENT_LIST_LIMIT, offset: EVENT_LIST_OFFSET, type: nil, since: nil, _until: nil)
  params = ListEventParams.new(limit, offset, type, since, _until)
  Unit::Resource::EventResource.list(params)
end