module BWAPI::Client::User::Notifications

Notifications module for projects/notifications endpoints

Public Instance Methods

create_notification(opts = {}) click to toggle source

Post a new user notification

@param opts [Hash] options hash of parameters @option opts [Boolean] hidden if the notification is hidden from users @option opts [Boolean] read if the notification has been read @option opts [String] body the body text of the notification @option opts [String] subject the subject text of the notification @option opts [String] type the type of notification @return [Hash] new user notification

# File lib/bwapi/client/user/notifications.rb, line 15
def create_notification(opts = {})
  post 'user/notifications', opts
end
notifications(opts = {}) click to toggle source

Get the current user notifications

@param opts [Hash] options hash of parameters @option opts [Integer] page Page of projects to retrieve @option opts [Integer] pageSize Results per page of results @return [Hash] user notifications

# File lib/bwapi/client/user/notifications.rb, line 25
def notifications(opts = {})
  get 'user/notifications', opts
end
patch_notification(notification_id, opts = {}) click to toggle source

Patch a users existing notification

@param notification_id [Integer] Id of notification @param opts [Hash] options Hash of parameters @option opts [Boolean] read if the notification has been read @return [Hash] patched user notifications

# File lib/bwapi/client/user/notifications.rb, line 49
def patch_notification(notification_id, opts = {})
  patch "user/notifications/#{notification_id}", opts
end
update_notification(notification_id, opts = {}) click to toggle source

Update users existing notification

@param notification_id [Integer] Id of notification @param opts [Hash] options hash of parameters @option opts [Boolean] hidden if the notification is hidden from users @option opts [Boolean] read if the notification has been read @option opts [String] body the body text of the notification @option opts [String] subject the subject text of the notification @option opts [String] type the type of notification @return [Hash] edited user notification

# File lib/bwapi/client/user/notifications.rb, line 39
def update_notification(notification_id, opts = {})
  put "user/notifications/#{notification_id}", opts
end