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



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

def  = data['accountId']

#assetsObject



1403
1404
1405
# File 'lib/carddb/collection.rb', line 1403

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

#completed?Boolean

Returns:

  • (Boolean)


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

def completed? = status == 'COMPLETED'

#completed_atObject



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

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

#created_atObject



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

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

#created_fieldsObject



1395
1396
1397
# File 'lib/carddb/collection.rb', line 1395

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

#datasetObject



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

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

#dataset_idObject



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

def dataset_id = data['datasetId']

#error_messageObject



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

def error_message = data['errorMessage']

#errorsObject



1399
1400
1401
# File 'lib/carddb/collection.rb', line 1399

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

#failed?Boolean

Returns:

  • (Boolean)


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

def failed? = status == 'FAILED'

#failed_countObject



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

def failed_count = data['failedCount']

#file_idObject



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

def file_id = data['fileId']

#formatObject



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

def format = data['format']

#idObject



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

def id = data['id']

#images_completedObject



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

def images_completed = data['imagesCompleted']

#images_failedObject



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

def images_failed = data['imagesFailed']

#images_pendingObject



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

def images_pending = data['imagesPending']

#inserted_countObject



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

def inserted_count = data['insertedCount']

#last_checkpoint_indexObject



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

def last_checkpoint_index = data['lastCheckpointIndex']

#modeObject



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

def mode = data['mode']

#on_conflictObject



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

def on_conflict = data['onConflict']

#processed_recordsObject



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

def processed_records = data['processedRecords']

#progressObject



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

def progress = data['progress']

#publisherObject



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

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

#publisher_idObject



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

def publisher_id = data['publisherId']

#resumed?Boolean

Returns:

  • (Boolean)


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

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

#skipped_countObject



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

def skipped_count = data['skippedCount']

#started_atObject



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

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

#statusObject



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

def status = data['status']

#total_recordsObject



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

def total_records = data['totalRecords']

#updated_atObject



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

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

#updated_countObject



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

def updated_count = data['updatedCount']