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



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

def  = data['accountId']

#assetsObject



1453
1454
1455
# File 'lib/carddb/collection.rb', line 1453

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

#completed?Boolean

Returns:

  • (Boolean)


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

def completed? = status == 'COMPLETED'

#completed_atObject



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

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

#created_atObject



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

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

#created_fieldsObject



1445
1446
1447
# File 'lib/carddb/collection.rb', line 1445

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

#datasetObject



1441
1442
1443
# File 'lib/carddb/collection.rb', line 1441

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

#dataset_idObject



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

def dataset_id = data['datasetId']

#error_messageObject



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

def error_message = data['errorMessage']

#errorsObject



1449
1450
1451
# File 'lib/carddb/collection.rb', line 1449

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

#failed?Boolean

Returns:

  • (Boolean)


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

def failed? = status == 'FAILED'

#failed_countObject



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

def failed_count = data['failedCount']

#file_idObject



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

def file_id = data['fileId']

#formatObject



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

def format = data['format']

#idObject



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

def id = data['id']

#images_completedObject



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

def images_completed = data['imagesCompleted']

#images_failedObject



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

def images_failed = data['imagesFailed']

#images_pendingObject



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

def images_pending = data['imagesPending']

#inserted_countObject



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

def inserted_count = data['insertedCount']

#last_checkpoint_indexObject



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

def last_checkpoint_index = data['lastCheckpointIndex']

#modeObject



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

def mode = data['mode']

#on_conflictObject



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

def on_conflict = data['onConflict']

#processed_recordsObject



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

def processed_records = data['processedRecords']

#progressObject



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

def progress = data['progress']

#publisherObject



1437
1438
1439
# File 'lib/carddb/collection.rb', line 1437

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

#publisher_idObject



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

def publisher_id = data['publisherId']

#resumed?Boolean

Returns:

  • (Boolean)


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

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

#skipped_countObject



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

def skipped_count = data['skippedCount']

#started_atObject



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

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

#statusObject



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

def status = data['status']

#total_recordsObject



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

def total_records = data['totalRecords']

#updated_atObject



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

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

#updated_countObject



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

def updated_count = data['updatedCount']