Class: CardDB::ImportJob

Inherits:
Resource show all
Defined in:
lib/carddb/collection.rb

Instance Attribute Summary

Attributes inherited from Resource

#client, #data

Instance Method Summary collapse

Methods inherited from Resource

#[], #initialize, #key?, #to_h, #to_json

Constructor Details

This class inherits a constructor from CardDB::Resource

Instance Method Details

#account_idObject



1348
# File 'lib/carddb/collection.rb', line 1348

def  = data['accountId']

#assetsObject



1390
1391
1392
# File 'lib/carddb/collection.rb', line 1390

def assets
  @assets ||= (data['assets'] || []).map { |asset| ImportJobAsset.new(asset, client: client) }
end

#completed?Boolean

Returns:

  • (Boolean)


1371
# File 'lib/carddb/collection.rb', line 1371

def completed? = status == 'COMPLETED'

#completed_atObject



1363
# File 'lib/carddb/collection.rb', line 1363

def completed_at = parse_time(data['completedAt'])

#created_atObject



1364
# File 'lib/carddb/collection.rb', line 1364

def created_at = parse_time(data['createdAt'])

#created_fieldsObject



1382
1383
1384
# File 'lib/carddb/collection.rb', line 1382

def created_fields
  @created_fields ||= (data['createdFields'] || []).map { |field| ObjectField.new(field, client: client) }
end

#datasetObject



1378
1379
1380
# File 'lib/carddb/collection.rb', line 1378

def dataset
  @dataset ||= data['dataset'] ? Dataset.new(data['dataset'], client: client) : nil
end

#dataset_idObject



1347
# File 'lib/carddb/collection.rb', line 1347

def dataset_id = data['datasetId']

#error_messageObject



1361
# File 'lib/carddb/collection.rb', line 1361

def error_message = data['errorMessage']

#errorsObject



1386
1387
1388
# File 'lib/carddb/collection.rb', line 1386

def errors
  @errors ||= (data['errors'] || []).map { |error| BulkRecordError.new(error, client: client) }
end

#failed?Boolean

Returns:

  • (Boolean)


1372
# File 'lib/carddb/collection.rb', line 1372

def failed? = status == 'FAILED'

#failed_countObject



1360
# File 'lib/carddb/collection.rb', line 1360

def failed_count = data['failedCount']

#file_idObject



1353
# File 'lib/carddb/collection.rb', line 1353

def file_id = data['fileId']

#formatObject



1352
# File 'lib/carddb/collection.rb', line 1352

def format = data['format']

#idObject



1345
# File 'lib/carddb/collection.rb', line 1345

def id = data['id']

#images_completedObject



1369
# File 'lib/carddb/collection.rb', line 1369

def images_completed = data['imagesCompleted']

#images_failedObject



1370
# File 'lib/carddb/collection.rb', line 1370

def images_failed = data['imagesFailed']

#images_pendingObject



1368
# File 'lib/carddb/collection.rb', line 1368

def images_pending = data['imagesPending']

#inserted_countObject



1357
# File 'lib/carddb/collection.rb', line 1357

def inserted_count = data['insertedCount']

#last_checkpoint_indexObject



1366
# File 'lib/carddb/collection.rb', line 1366

def last_checkpoint_index = data['lastCheckpointIndex']

#modeObject



1350
# File 'lib/carddb/collection.rb', line 1350

def mode = data['mode']

#on_conflictObject



1351
# File 'lib/carddb/collection.rb', line 1351

def on_conflict = data['onConflict']

#processed_recordsObject



1356
# File 'lib/carddb/collection.rb', line 1356

def processed_records = data['processedRecords']

#progressObject



1354
# File 'lib/carddb/collection.rb', line 1354

def progress = data['progress']

#publisherObject



1374
1375
1376
# File 'lib/carddb/collection.rb', line 1374

def publisher
  @publisher ||= data['publisher'] ? Publisher.new(data['publisher'], client: client) : nil
end

#publisher_idObject



1346
# File 'lib/carddb/collection.rb', line 1346

def publisher_id = data['publisherId']

#resumed?Boolean

Returns:

  • (Boolean)


1367
# File 'lib/carddb/collection.rb', line 1367

def resumed? = !!data['isResumed']

#skipped_countObject



1359
# File 'lib/carddb/collection.rb', line 1359

def skipped_count = data['skippedCount']

#started_atObject



1362
# File 'lib/carddb/collection.rb', line 1362

def started_at = parse_time(data['startedAt'])

#statusObject



1349
# File 'lib/carddb/collection.rb', line 1349

def status = data['status']

#total_recordsObject



1355
# File 'lib/carddb/collection.rb', line 1355

def total_records = data['totalRecords']

#updated_atObject



1365
# File 'lib/carddb/collection.rb', line 1365

def updated_at = parse_time(data['updatedAt'])

#updated_countObject



1358
# File 'lib/carddb/collection.rb', line 1358

def updated_count = data['updatedCount']