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



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

def  = data['accountId']

#assetsObject



1129
1130
1131
# File 'lib/carddb/collection.rb', line 1129

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

#completed?Boolean

Returns:

  • (Boolean)


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

def completed? = status == 'COMPLETED'

#completed_atObject



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

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

#created_atObject



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

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

#created_fieldsObject



1121
1122
1123
# File 'lib/carddb/collection.rb', line 1121

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

#datasetObject



1117
1118
1119
# File 'lib/carddb/collection.rb', line 1117

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

#dataset_idObject



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

def dataset_id = data['datasetId']

#error_messageObject



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

def error_message = data['errorMessage']

#errorsObject



1125
1126
1127
# File 'lib/carddb/collection.rb', line 1125

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

#failed?Boolean

Returns:

  • (Boolean)


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

def failed? = status == 'FAILED'

#failed_countObject



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

def failed_count = data['failedCount']

#file_idObject



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

def file_id = data['fileId']

#formatObject



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

def format = data['format']

#idObject



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

def id = data['id']

#images_completedObject



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

def images_completed = data['imagesCompleted']

#images_failedObject



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

def images_failed = data['imagesFailed']

#images_pendingObject



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

def images_pending = data['imagesPending']

#inserted_countObject



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

def inserted_count = data['insertedCount']

#last_checkpoint_indexObject



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

def last_checkpoint_index = data['lastCheckpointIndex']

#modeObject



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

def mode = data['mode']

#on_conflictObject



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

def on_conflict = data['onConflict']

#processed_recordsObject



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

def processed_records = data['processedRecords']

#progressObject



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

def progress = data['progress']

#publisherObject



1113
1114
1115
# File 'lib/carddb/collection.rb', line 1113

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

#publisher_idObject



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

def publisher_id = data['publisherId']

#resumed?Boolean

Returns:

  • (Boolean)


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

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

#skipped_countObject



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

def skipped_count = data['skippedCount']

#started_atObject



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

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

#statusObject



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

def status = data['status']

#total_recordsObject



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

def total_records = data['totalRecords']

#updated_atObject



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

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

#updated_countObject



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

def updated_count = data['updatedCount']