class NexosisApi::ImportsResponse

class to parse results from an imports call

Attributes

column_metadata[RW]

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[RW]

echo back the name of the data source uploaded @return [String] @since 1.3.0

import_id[RW]

The unique identifier for this import request @return [String]

messages[RW]

Additional details. Normally empty. @return [Array]

parameters[RW]

The S3 parameters used to import a dataset @return [Hash] For an S3 response the keys of this hash should be 'bucket', 'path', and 'region'

requested_date[RW]

The date of the import request @return [DateTime]

s3[RW]

Where the import was requested from - S3, Azure, or Url @return [String]

status[RW]

The current status of the import request @return [String] @note The import will be performed in a FIFO queue. Check back on status before attempting to start a session using the dataset.

statusHistory[RW]

Date and status of each status this session has entered @return [Hash] @since 1.3.0

type[RW]

Where the import was requested from - S3, Azure, or Url @return [String]

Public Class Methods

new(response_hash) click to toggle source
# 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