Class: Roistat::Resources::Events

Inherits:
Base
  • Object
show all
Defined in:
lib/roistat/resources/events.rb,
sig/roistat.rbs

Instance Attribute Summary

Attributes inherited from Base

#client

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Roistat::Resources::Base

Instance Method Details

#add(events) ⇒ Object

POST /project/events/add — body is a JSON array

Parameters:

  • (Array[untyped])

Returns:

  • (Object)


15
16
17
# File 'lib/roistat/resources/events.rb', line 15

def add(events)
  client.post("project/events/add", body: events)
end

#archive(event_id:, events:) ⇒ Object

POST /project/events/meta/eventId/archive — body is a JSON array

Parameters:

  • event_id: (Integer, String)
  • events: (Array[untyped])

Returns:

  • (Object)


29
30
31
# File 'lib/roistat/resources/events.rb', line 29

def archive(event_id:, events:)
  client.post("project/events/meta/#{event_id}/archive", body: events)
end

#bulk_send(events) ⇒ Object

POST /project/events/bulk/send — body is a JSON array

Parameters:

  • (Array[untyped])

Returns:

  • (Object)


10
11
12
# File 'lib/roistat/resources/events.rb', line 10

def bulk_send(events)
  client.post("project/events/bulk/send", body: events)
end

#log(**params) ⇒ Object

GET /project/events/log — filters as query params (docs heading; curl shows POST JSON)

Parameters:

  • (Object)

Returns:

  • (Object)


20
21
22
23
24
25
26
# File 'lib/roistat/resources/events.rb', line 20

def log(**params)
  if params.nil? || params.empty?
    client.get("project/events/log")
  else
    client.get("project/events/log", params: params)
  end
end

#send_event(**body) ⇒ Object

POST /project/events/send

Parameters:

  • (Object)

Returns:

  • (Object)


5
6
7
# File 'lib/roistat/resources/events.rb', line 5

def send_event(**body)
  client.post("project/events/send", body: body)
end