Class: NexosisApi::ImportListQuery

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

Overview

Note:

sort by properties include id, dataSetName, requestedDate, and currentStatusDate

class to hold the query options for list imports

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 = {}) ⇒ ImportListQuery

Returns a new instance of ImportListQuery.

Since:

  • 3.0.0



169
170
171
172
173
174
# File 'lib/nexosis_api/list_queries.rb', line 169

def initialize(options = {})
  @dataset_name = options[:dataset_name] if options.key? :dataset_name
  @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, :dataset_name, :requested_after_date, :requested_before_date)
end

Instance Attribute Details

#dataset_nameString

Limits imports to those for a particular dataset

Returns:

  • (String)

Since:

  • 3.0.0



188
189
190
# File 'lib/nexosis_api/list_queries.rb', line 188

def dataset_name
  @dataset_name
end

#requested_after_dateString

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

Returns:

  • (String)

Since:

  • 3.0.0



192
193
194
# File 'lib/nexosis_api/list_queries.rb', line 192

def requested_after_date
  @requested_after_date
end

#requested_before_dateString

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

Returns:

  • (String)

Since:

  • 3.0.0



196
197
198
# File 'lib/nexosis_api/list_queries.rb', line 196

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



178
179
180
181
182
183
184
# File 'lib/nexosis_api/list_queries.rb', line 178

def query_parameters
  parm_hash = {}
  parm_hash.store(:dataSourceName, @dataset_name) unless @dataset_name.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