Class: LockstepSdk::SyncSubmitModel

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

Overview

A SyncSubmitModel represents a task that loads data from a connector to load into the Lockstep Platform. Data contained in a sync will be merged with your existing data. Each record will be matched with existing data inside the Lockstep Platform using the [Identity Column](developer.lockstep.io/docs/identity-columns) rules. Any record that represents a new AppEnrollmentId+ErpKey will be inserted. A record that matches an existing AppEnrollmentId+ErpKey will be updated, but only if the data has changed.

A Sync process permits either a complete data file or a partial / delta data file. Lockstep recommends using a sliding time window to avoid the risk of clock skew errors that might accidentally omit records. Best practice is to run a Sync process daily, and to export all data that has changed in the past 48 hours.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ SyncSubmitModel

Initialize the SyncSubmitModel using the provided prototype



35
36
37
# File 'lib/lockstep_sdk/models/sync_submit_model.rb', line 35

def initialize(params = {})
    @app_enrollment_id = params.dig(:app_enrollment_id)
end

Instance Attribute Details

#app_enrollment_idUuid

Returns The unique identifier of the app enrollment that is creating this sync request.

Returns:

  • (Uuid)

    The unique identifier of the app enrollment that is creating this sync request.



41
42
43
# File 'lib/lockstep_sdk/models/sync_submit_model.rb', line 41

def app_enrollment_id
  @app_enrollment_id
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



45
46
47
48
49
# File 'lib/lockstep_sdk/models/sync_submit_model.rb', line 45

def as_json(options={})
    {
        'appEnrollmentId' => @app_enrollment_id,
    }
end

#to_json(*options) ⇒ String

Returns This object converted to a JSON string.

Returns:

  • (String)

    This object converted to a JSON string



53
54
55
# File 'lib/lockstep_sdk/models/sync_submit_model.rb', line 53

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