Module: BWAPI::Client::CommandCenter::Displays::Events

Included in:
BWAPI::Client::CommandCenter::Displays
Defined in:
lib/bwapi/client/command_center/displays/events.rb

Overview

Displays module for commandcenter/displays/events endpoints

Instance Method Summary collapse

Instance Method Details

#create_event(display_id, opts = {}) ⇒ Hashie::Mash

Create a new display event

Parameters:

  • display_id (Integer) —

    The display id

  • opts (Hash) (defaults to: {}) —

    options hash of parameters

Options Hash (opts):

  • id (Integer) —

    The event id

  • name (String) —

    The event name

  • description (String) —

    The event description

  • displayId (Integer) —

    The display id

  • matched (Boolean) —

    Events rules matched

  • queryId (Integer) —

    Reference query id

  • threshold (Integer) —

    Event mention volume threshold

  • action (Hash) —

    Event action

  • created (String) —

    Date event created

  • enabled (Boolean) —

    Whether event is enabled

  • filters (Hash) —

    Event filter options

Returns:

  • (Hashie::Mash) —

    New display event



41
42
43
# File 'lib/bwapi/client/command_center/displays/events.rb', line 41

def create_event display_id, opts={}
  post "commandcenter/displays/#{display_id}/events", opts
end

#delete_event(display_id, event_id) ⇒ Hashie::Mash

Delete an existing display event

Parameters:

  • display_id (Integer) —

    The display id

  • event_id (Integer) —

    The event id

Returns:

  • (Hashie::Mash) —

    Deleted display event



70
71
72
# File 'lib/bwapi/client/command_center/displays/events.rb', line 70

def delete_event display_id, event_id
  delete "commandcenter/displays/#{display_id}/events/#{event_id}"
end

#events(display_id) ⇒ Hashie::Mash

Get the events for an existing display

Parameters:

  • display_id (Integer) —

    The display id

Returns:

  • (Hashie::Mash) —

    All events for display



12
13
14
# File 'lib/bwapi/client/command_center/displays/events.rb', line 12

def events display_id
  get "commandcenter/displays/#{display_id}/events"
end

#get_event(display_id, event_id) ⇒ Hashie::Mash

Get an existing display event

Parameters:

  • display_id (Integer) —

    The display id

  • event_id (Integer) —

    The event id

Returns:

  • (Hashie::Mash) —

    Specific event for display



21
22
23
# File 'lib/bwapi/client/command_center/displays/events.rb', line 21

def get_event display_id, event_id
  get "commandcenter/displays/#{display_id}/events/#{event_id}"
end

#update_event(display_id, event_id, opts = {}) ⇒ Hashie::Mash

Update an existing display event

Parameters:

  • display_id (Integer) —

    The display id

  • opts (Hash) (defaults to: {}) —

    options hash of parameters

Options Hash (opts):

  • id (Integer) —

    The event id

  • name (String) —

    The event name

  • description (String) —

    The event description

  • displayId (Integer) —

    The display id

  • matched (Boolean) —

    Events rules matched

  • queryId (Integer) —

    Reference query id

  • threshold (Integer) —

    Event mention volume threshold

  • action (Hash) —

    Event action

  • created (String) —

    Date event created

  • enabled (Boolean) —

    Whether event is enabled

  • filters (Hash) —

    Event filter options

Returns:

  • (Hashie::Mash) —

    Updated display event



61
62
63
# File 'lib/bwapi/client/command_center/displays/events.rb', line 61

def update_event display_id, event_id, opts={}
  put "commandcenter/displays/#{display_id}/events/#{event_id}", opts
end