Class: NexosisApi::ImportsResponse
- Inherits:
-
Object
- Object
- NexosisApi::ImportsResponse
- Defined in:
- lib/nexosis_api/imports_response.rb
Overview
class to parse results from an imports call
Instance Attribute Summary collapse
-
#column_metadata ⇒ Object
The column descriptors for the data in this session will reflect either the metadata sent in, defaults form dataset, or inferred values @return[Array of NexosisApi::Column].
-
#datasource_name ⇒ String
echo back the name of the data source uploaded.
-
#import_id ⇒ String
The unique identifier for this import request.
-
#links ⇒ Array of NexosisApi::Link
associated hypermedia.
-
#messages ⇒ Array
Additional details.
-
#parameters ⇒ Hash
The S3 parameters used to import a dataset For an S3 response the keys of this hash should be ‘bucket’, ‘path’, and ‘region’.
-
#requested_date ⇒ DateTime
The date of the import request.
-
#s3 ⇒ String
Where the import was requested from - S3, Azure, or Url.
-
#status ⇒ String
The current status of the import request.
-
#statusHistory ⇒ Hash
Date and status of each status this session has entered.
-
#type ⇒ String
Where the import was requested from - S3, Azure, or Url.
Instance Method Summary collapse
-
#initialize(response_hash) ⇒ ImportsResponse
constructor
A new instance of ImportsResponse.
Constructor Details
#initialize(response_hash) ⇒ ImportsResponse
Returns a new instance of ImportsResponse.
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/nexosis_api/imports_response.rb', line 4 def initialize(response_hash) response_hash.each do |k, v| if(k == 'importId') @import_id = v elsif(k == 'requestedDate') @requested_date = v elsif(k == 'columns') columns = [] next if v.nil? v.keys.each do |col_key| columns << NexosisApi::Column.new(col_key, v[col_key]) end @column_metadata = columns elsif(k == 'links') links = [] v.each { |l| links << NexosisApi::Link.new(l) } instance_variable_set("@#{k}", links) unless v.nil? elsif k == 'dataSetName' @datasource_name = v else instance_variable_set("@#{k}", v) unless v.nil? end end end |
Instance Attribute Details
#column_metadata ⇒ Object
The column descriptors for the data in this session
will reflect either the metadata sent in, defaults form dataset, or inferred values
@return[Array of NexosisApi::Column]
68 69 70 |
# File 'lib/nexosis_api/imports_response.rb', line 68 def @column_metadata end |
#datasource_name ⇒ String
echo back the name of the data source uploaded
50 51 52 |
# File 'lib/nexosis_api/imports_response.rb', line 50 def datasource_name @datasource_name end |
#import_id ⇒ String
The unique identifier for this import request
31 32 33 |
# File 'lib/nexosis_api/imports_response.rb', line 31 def import_id @import_id end |
#links ⇒ Array of NexosisApi::Link
associated hypermedia
72 73 74 |
# File 'lib/nexosis_api/imports_response.rb', line 72 def links @links end |
#messages ⇒ Array
Additional details. Normally empty.
63 64 65 |
# File 'lib/nexosis_api/imports_response.rb', line 63 def @messages end |
#parameters ⇒ Hash
The S3 parameters used to import a dataset For an S3 response the keys of this hash should be ‘bucket’, ‘path’, and ‘region’
55 56 57 |
# File 'lib/nexosis_api/imports_response.rb', line 55 def parameters @parameters end |
#requested_date ⇒ DateTime
The date of the import request
59 60 61 |
# File 'lib/nexosis_api/imports_response.rb', line 59 def requested_date @requested_date end |
#s3 ⇒ String
Where the import was requested from - S3, Azure, or Url
35 36 37 |
# File 'lib/nexosis_api/imports_response.rb', line 35 def s3 @s3 end |
#status ⇒ String
The import will be performed in a FIFO queue. Check back on status before attempting to start a session using the dataset.
The current status of the import request
40 41 42 |
# File 'lib/nexosis_api/imports_response.rb', line 40 def status @status end |
#statusHistory ⇒ Hash
Date and status of each status this session has entered
45 46 47 |
# File 'lib/nexosis_api/imports_response.rb', line 45 def statusHistory @statusHistory end |
#type ⇒ String
Where the import was requested from - S3, Azure, or Url
35 36 37 |
# File 'lib/nexosis_api/imports_response.rb', line 35 def type @type end |