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].
-
#dataSetName ⇒ String
deprecated
Deprecated.
use datasource_name instead
-
#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
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 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
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::Column]
73 74 75 |
# File 'lib/nexosis_api/imports_response.rb', line 73 def @column_metadata end |
permalink #dataSetName ⇒ String
use datasource_name instead
echo back the dataset name provided
50 51 52 |
# File 'lib/nexosis_api/imports_response.rb', line 50 def dataSetName @dataSetName end |
permalink #datasource_name ⇒ String
echo back the name of the data source uploaded
55 56 57 |
# File 'lib/nexosis_api/imports_response.rb', line 55 def datasource_name @datasource_name end |
permalink #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 |
permalink #links ⇒ Array of NexosisApi::Link
associated hypermedia
77 78 79 |
# File 'lib/nexosis_api/imports_response.rb', line 77 def links @links end |
permalink #messages ⇒ Array
Additional details. Normally empty.
68 69 70 |
# File 'lib/nexosis_api/imports_response.rb', line 68 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’
60 61 62 |
# File 'lib/nexosis_api/imports_response.rb', line 60 def parameters @parameters end |
permalink #requested_date ⇒ DateTime
The date of the import request
64 65 66 |
# File 'lib/nexosis_api/imports_response.rb', line 64 def requested_date @requested_date end |
permalink #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 |
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
40 41 42 |
# File 'lib/nexosis_api/imports_response.rb', line 40 def status @status end |
permalink #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 |
permalink #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 |