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::DatasetColumn].
-
#dataSetName ⇒ String
echo back the dataset name provided.
-
#import_id ⇒ String
The unique identifier for this import request.
- #links ⇒ Array of NexosisApi::Link
-
#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
Currently always s3.
-
#status ⇒ String
The current status of the import request.
-
#type ⇒ String
Currently always s3.
Instance Method Summary collapse
-
#initialize(response_hash) ⇒ ImportsResponse
constructor
A new instance of ImportsResponse.
Constructor Details
permalink #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 |
# 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::DatasetColumn.new(col_key, v[col_key]) end @column_metadata = columns elsif(k == "links") links = Array.new v.each do |l| links << NexosisApi::Link.new(l) end instance_variable_set("@#{k}", links) unless v.nil? else instance_variable_set("@#{k}", v) unless v.nil? end end end |
Instance Attribute Details
permalink #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::DatasetColumn]
60 61 62 |
# File 'lib/nexosis_api/imports_response.rb', line 60 def @column_metadata end |
permalink #dataSetName ⇒ String
echo back the dataset name provided
42 43 44 |
# File 'lib/nexosis_api/imports_response.rb', line 42 def dataSetName @dataSetName end |
permalink #import_id ⇒ String
The unique identifier for this import request
29 30 31 |
# File 'lib/nexosis_api/imports_response.rb', line 29 def import_id @import_id end |
permalink #links ⇒ Array of NexosisApi::Link
64 65 66 |
# File 'lib/nexosis_api/imports_response.rb', line 64 def links @links end |
permalink #messages ⇒ Array
Additional details. Normally empty.
55 56 57 |
# File 'lib/nexosis_api/imports_response.rb', line 55 def @messages end |
permalink #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’
47 48 49 |
# File 'lib/nexosis_api/imports_response.rb', line 47 def parameters @parameters end |
permalink #requested_date ⇒ DateTime
The date of the import request
51 52 53 |
# File 'lib/nexosis_api/imports_response.rb', line 51 def requested_date @requested_date end |
permalink #s3 ⇒ String
Currently always s3
33 34 35 |
# File 'lib/nexosis_api/imports_response.rb', line 33 def s3 @s3 end |
permalink #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
38 39 40 |
# File 'lib/nexosis_api/imports_response.rb', line 38 def status @status end |
permalink #type ⇒ String
Currently always s3
33 34 35 |
# File 'lib/nexosis_api/imports_response.rb', line 33 def type @type end |