Class: LockstepSdk::SyncEntityResultModel

Inherits:
Object
  • Object
show all
Defined in:
lib/lockstep_sdk/models/sync_entity_result_model.rb

Overview

Contains information about a sync process for an entity.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ SyncEntityResultModel

Initialize the SyncEntityResultModel using the provided prototype



25
26
27
28
29
30
31
32
# File 'lib/lockstep_sdk/models/sync_entity_result_model.rb', line 25

def initialize(params = {})
    @insert_count = params.dig(:insert_count)
    @update_count = params.dig(:update_count)
    @delete_count = params.dig(:delete_count)
    @skip_count = params.dig(:skip_count)
    @error_count = params.dig(:error_count)
    @errors = params.dig(:errors)
end

Instance Attribute Details

#delete_countInt32

Returns The number of entities deleted.

Returns:

  • (Int32)

    The number of entities deleted



44
45
46
# File 'lib/lockstep_sdk/models/sync_entity_result_model.rb', line 44

def delete_count
  @delete_count
end

#error_countInt32

Returns The number of errors encountered during sync.

Returns:

  • (Int32)

    The number of errors encountered during sync



52
53
54
# File 'lib/lockstep_sdk/models/sync_entity_result_model.rb', line 52

def error_count
  @error_count
end

#errorsObject

Returns The errors encountered during sync keyed by ERP key.

Returns:

  • (Object)

    The errors encountered during sync keyed by ERP key



56
57
58
# File 'lib/lockstep_sdk/models/sync_entity_result_model.rb', line 56

def errors
  @errors
end

#insert_countInt32

Returns The number of entities inserted.

Returns:

  • (Int32)

    The number of entities inserted



36
37
38
# File 'lib/lockstep_sdk/models/sync_entity_result_model.rb', line 36

def insert_count
  @insert_count
end

#skip_countInt32

Returns The number of entities skipped.

Returns:

  • (Int32)

    The number of entities skipped



48
49
50
# File 'lib/lockstep_sdk/models/sync_entity_result_model.rb', line 48

def skip_count
  @skip_count
end

#update_countInt32

Returns The number of entities updated.

Returns:

  • (Int32)

    The number of entities updated



40
41
42
# File 'lib/lockstep_sdk/models/sync_entity_result_model.rb', line 40

def update_count
  @update_count
end

Instance Method Details

#as_json(options = {}) ⇒ object

Returns This object as a JSON key-value structure.

Returns:

  • (object)

    This object as a JSON key-value structure



60
61
62
63
64
65
66
67
68
69
# File 'lib/lockstep_sdk/models/sync_entity_result_model.rb', line 60

def as_json(options={})
    {
        'insertCount' => @insert_count,
        'updateCount' => @update_count,
        'deleteCount' => @delete_count,
        'skipCount' => @skip_count,
        'errorCount' => @error_count,
        'errors' => @errors,
    }
end

#to_json(*options) ⇒ String

Returns This object converted to a JSON string.

Returns:

  • (String)

    This object converted to a JSON string



73
74
75
# File 'lib/lockstep_sdk/models/sync_entity_result_model.rb', line 73

def to_json(*options)
    "[#{as_json(*options).to_json(*options)}]"
end