Class: NexosisApi::SessionListQuery

Inherits:
ListQuery
  • Object
show all
Defined in:
lib/nexosis_api/list_queries.rb

Overview

Note:

sort by properties include id, name, type, status, dataSourceName, and requestedDate

class to hold the query options for list datasets

Instance Attribute Summary collapse

Attributes inherited from ListQuery

#page_number, #page_size, #sort_by, #sort_order

Instance Method Summary collapse

Methods inherited from ListQuery

#to_hash

Constructor Details

#initialize(options = {}) ⇒ SessionListQuery

Returns a new instance of SessionListQuery.

Since:

  • 3.0.0



87
88
89
90
91
92
93
94
# File 'lib/nexosis_api/list_queries.rb', line 87

def initialize(options = {})
  @datasource_name = options[:datasource_name] if options.key? :datasource_name
  @event_name = options[:event_name] if options.key? :event_name
  @model_id = options[:model_id] if options.key? :model_id
  @requested_after_date = options[:requested_after_date] if options.key? :requested_after_date
  @requested_before_date = options[:requested_before_date] if options.key? :requested_before_date
  super(options, :datasource_name, :event_name, :model_id, :requested_after_date, :requested_before_date)
end

Instance Attribute Details

#datasource_nameString

Limits sessions to those for a particular data source

Returns:

  • (String)

Since:

  • 3.0.0



110
111
112
# File 'lib/nexosis_api/list_queries.rb', line 110

def datasource_name
  @datasource_name
end

#event_nameString

Limits impact sessions to those for a particular event

Returns:

  • (String)

Since:

  • 3.0.0



114
115
116
# File 'lib/nexosis_api/list_queries.rb', line 114

def event_name
  @event_name
end

#model_idString

Limits model-building sessions to those that built the specified model

Returns:

  • (String)

Since:

  • 3.0.0



118
119
120
# File 'lib/nexosis_api/list_queries.rb', line 118

def model_id
  @model_id
end

#requested_after_dateString

Format - date-time (as date-time in ISO8601). Limits sessions to those requested on or after the specified date

Returns:

  • (String)

Since:

  • 3.0.0



122
123
124
# File 'lib/nexosis_api/list_queries.rb', line 122

def requested_after_date
  @requested_after_date
end

#requested_before_dateString

Format - date-time (as date-time in ISO8601). Limits sessions to those requested on or before the specified date

Returns:

  • (String)

Since:

  • 3.0.0



126
127
128
# File 'lib/nexosis_api/list_queries.rb', line 126

def requested_before_date
  @requested_before_date
end

Instance Method Details

#query_parametersHash

A hash suitable for using as the query portion of an HTTP request to the API

Returns:

  • (Hash)

Since:

  • 3.0.0



98
99
100
101
102
103
104
105
106
# File 'lib/nexosis_api/list_queries.rb', line 98

def query_parameters
  parm_hash = {}
  parm_hash.store(:dataSourceName, @datasource_name) unless @datasource_name.nil?
  parm_hash.store(:eventName, @event_name) unless @event_name.nil?
  parm_hash.store(:modelId, @model_id) unless @model_id.nil?
  parm_hash.store(:requestedAfterDate, date_string(@requested_after_date)) unless @requested_after_date.nil?
  parm_hash.store(:requestedBeforeDate, date_string(@requested_before_date)) unless @requested_before_date.nil?
  self.to_hash.merge(parm_hash)
end