Class: NexosisApi::SessionListQuery
- Defined in:
- lib/nexosis_api/list_queries.rb
Overview
sort by properties include id, name, type, status, dataSourceName, and requestedDate
class to hold the query options for list datasets
Instance Attribute Summary collapse
-
#datasource_name ⇒ String
Limits sessions to those for a particular data source.
-
#event_name ⇒ String
Limits impact sessions to those for a particular event.
-
#model_id ⇒ String
Limits model-building sessions to those that built the specified model.
-
#requested_after_date ⇒ String
Format - date-time (as date-time in ISO8601).
-
#requested_before_date ⇒ String
Format - date-time (as date-time in ISO8601).
Attributes inherited from ListQuery
#page_number, #page_size, #sort_by, #sort_order
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ SessionListQuery
constructor
A new instance of SessionListQuery.
-
#query_parameters ⇒ Hash
A hash suitable for using as the query portion of an HTTP request to the API.
Methods inherited from ListQuery
Constructor Details
#initialize(options = {}) ⇒ SessionListQuery
Returns a new instance of SessionListQuery.
87 88 89 90 91 92 93 94 |
# File 'lib/nexosis_api/list_queries.rb', line 87 def initialize( = {}) @datasource_name = [:datasource_name] if .key? :datasource_name @event_name = [:event_name] if .key? :event_name @model_id = [:model_id] if .key? :model_id @requested_after_date = [:requested_after_date] if .key? :requested_after_date @requested_before_date = [:requested_before_date] if .key? :requested_before_date super(, :datasource_name, :event_name, :model_id, :requested_after_date, :requested_before_date) end |
Instance Attribute Details
#datasource_name ⇒ String
Limits sessions to those for a particular data source
110 111 112 |
# File 'lib/nexosis_api/list_queries.rb', line 110 def datasource_name @datasource_name end |
#event_name ⇒ String
Limits impact sessions to those for a particular event
114 115 116 |
# File 'lib/nexosis_api/list_queries.rb', line 114 def event_name @event_name end |
#model_id ⇒ String
Limits model-building sessions to those that built the specified model
118 119 120 |
# File 'lib/nexosis_api/list_queries.rb', line 118 def model_id @model_id end |
#requested_after_date ⇒ String
Format - date-time (as date-time in ISO8601). Limits sessions to those requested on or after the specified date
122 123 124 |
# File 'lib/nexosis_api/list_queries.rb', line 122 def requested_after_date @requested_after_date end |
#requested_before_date ⇒ String
Format - date-time (as date-time in ISO8601). Limits sessions to those requested on or before the specified date
126 127 128 |
# File 'lib/nexosis_api/list_queries.rb', line 126 def requested_before_date @requested_before_date end |
Instance Method Details
#query_parameters ⇒ Hash
A hash suitable for using as the query portion of an HTTP request to the API
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 |