lib/losant_rest/events.rb in losant_rest-1.0.1 vs lib/losant_rest/events.rb in losant_rest-1.0.2
- old
+ new
@@ -16,10 +16,11 @@
# * {string} page - Which page of results to return
# * {string} perPage - How many items to return per page
# * {string} filterField - Field to filter the results by. Blank or not provided means no filtering. Accepted values are: subject
# * {string} filter - Filter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering.
# * {string} state - If provided, return events only in the given state. Accepted values are: new, acknowledged, resolved
+ # * {string} losantdomain - Domain scope of request (rarely needed)
# * {boolean} _actions - Return resource actions in response
# * {boolean} _links - Return resource link in response
# * {boolean} _embedded - Return embedded resources in response
#
# Responses:
@@ -41,10 +42,11 @@
query_params[:page] = params[:page] if params.has_key?(:page)
query_params[:perPage] = params[:perPage] if params.has_key?(:perPage)
query_params[:filterField] = params[:filterField] if params.has_key?(:filterField)
query_params[:filter] = params[:filter] if params.has_key?(:filter)
query_params[:state] = params[:state] if params.has_key?(:state)
+ headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
query_params[:_links] = params[:_links] if params.has_key?(:_links)
query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
path = "/applications/#{params[:applicationId]}/events"
@@ -60,10 +62,11 @@
# Returns the first new event ordered by severity and then creation
#
# Parameters:
# * {string} applicationId - ID associated with the application
# * {string} filter - Filter to apply against event subjects. Supports globbing. Blank or not provided means no filtering.
+ # * {string} losantdomain - Domain scope of request (rarely needed)
# * {boolean} _actions - Return resource actions in response
# * {boolean} _links - Return resource link in response
# * {boolean} _embedded - Return embedded resources in response
#
# Responses:
@@ -78,10 +81,11 @@
body = nil
raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
query_params[:filter] = params[:filter] if params.has_key?(:filter)
+ headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
query_params[:_links] = params[:_links] if params.has_key?(:_links)
query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
path = "/applications/#{params[:applicationId]}/events/mostRecentBySeverity"
@@ -100,10 +104,11 @@
# * {string} applicationId - ID associated with the application
# * {string} filterField - Field to filter the events to act on by. Blank or not provided means no filtering. Accepted values are: subject
# * {string} filter - Filter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering.
# * {string} state - If provided, act on events only in the given state. Accepted values are: new, acknowledged, resolved
# * {hash} updates - Object containing updated information for the events (https://api.losant.com/#/definitions/eventPatch)
+ # * {string} losantdomain - Domain scope of request (rarely needed)
# * {boolean} _actions - Return resource actions in response
# * {boolean} _links - Return resource link in response
# * {boolean} _embedded - Return embedded resources in response
#
# Responses:
@@ -123,10 +128,11 @@
query_params[:filterField] = params[:filterField] if params.has_key?(:filterField)
query_params[:filter] = params[:filter] if params.has_key?(:filter)
query_params[:state] = params[:state] if params.has_key?(:state)
body = params[:updates] if params.has_key?(:updates)
+ headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
query_params[:_links] = params[:_links] if params.has_key?(:_links)
query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
path = "/applications/#{params[:applicationId]}/events"
@@ -142,10 +148,11 @@
# Create a new event for an application
#
# Parameters:
# * {string} applicationId - ID associated with the application
# * {hash} event - New event information (https://api.losant.com/#/definitions/eventPost)
+ # * {string} losantdomain - Domain scope of request (rarely needed)
# * {boolean} _actions - Return resource actions in response
# * {boolean} _links - Return resource link in response
# * {boolean} _embedded - Return embedded resources in response
#
# Responses:
@@ -163,9 +170,10 @@
raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
raise ArgumentError.new("event is required") unless params.has_key?(:event)
body = params[:event] if params.has_key?(:event)
+ headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
query_params[:_links] = params[:_links] if params.has_key?(:_links)
query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
path = "/applications/#{params[:applicationId]}/events"