Class: LockstepSdk::SyncRequestModel

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

Overview

Represents a Sync action that loads data from a connector into the Lockstep Platform. Users can request Sync actions manually using Lockstep Inbox, or via the [Create Sync API](developer.lockstep.io/reference/post_api-v1-sync). Each Sync action is tied to an [AppEnrollment](developer.lockstep.io/docs/applications-and-enrollments). When the Sync action is complete, the field ‘StatusCode` will be set to either `Success` or `Failed`.

You can fetch a list of detailed results for the Sync API by calling Retrieve or Query with an ‘include` parameter of `details`. These detailed results contain line-by-line errors that were detected during processing of this sync.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ SyncRequestModel

Initialize the SyncRequestModel using the provided prototype



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/lockstep_sdk/models/sync_request_model.rb', line 32

def initialize(params = {})
    @sync_request_id = params.dig(:sync_request_id)
    @group_key = params.dig(:group_key)
    @status_code = params.dig(:status_code)
    @operation_type_name = params.dig(:operation_type_name)
    @operation_type = params.dig(:operation_type)
    @process_result_message = params.dig(:process_result_message)
    @failure_count = params.dig(:failure_count)
    @run_full_sync = params.dig(:run_full_sync)
    @app_enrollment_id = params.dig(:app_enrollment_id)
    @created = params.dig(:created)
    @modified = params.dig(:modified)
    @modified_user_id = params.dig(:modified_user_id)
    @details = params.dig(:details)
end

Instance Attribute Details

#app_enrollment_idUuid



82
83
84
# File 'lib/lockstep_sdk/models/sync_request_model.rb', line 82

def app_enrollment_id
  @app_enrollment_id
end

#createdDate-time



86
87
88
# File 'lib/lockstep_sdk/models/sync_request_model.rb', line 86

def created
  @created
end

#detailsObject



98
99
100
# File 'lib/lockstep_sdk/models/sync_request_model.rb', line 98

def details
  @details
end

#failure_countInt32



74
75
76
# File 'lib/lockstep_sdk/models/sync_request_model.rb', line 74

def failure_count
  @failure_count
end

#group_keyUuid



54
55
56
# File 'lib/lockstep_sdk/models/sync_request_model.rb', line 54

def group_key
  @group_key
end

#modifiedDate-time



90
91
92
# File 'lib/lockstep_sdk/models/sync_request_model.rb', line 90

def modified
  @modified
end

#modified_user_idUuid



94
95
96
# File 'lib/lockstep_sdk/models/sync_request_model.rb', line 94

def modified_user_id
  @modified_user_id
end

#operation_typeSyncOperationType



66
67
68
# File 'lib/lockstep_sdk/models/sync_request_model.rb', line 66

def operation_type
  @operation_type
end

#operation_type_nameString



62
63
64
# File 'lib/lockstep_sdk/models/sync_request_model.rb', line 62

def operation_type_name
  @operation_type_name
end

#process_result_messageString



70
71
72
# File 'lib/lockstep_sdk/models/sync_request_model.rb', line 70

def process_result_message
  @process_result_message
end

#run_full_syncBoolean



78
79
80
# File 'lib/lockstep_sdk/models/sync_request_model.rb', line 78

def run_full_sync
  @run_full_sync
end

#status_codeString



58
59
60
# File 'lib/lockstep_sdk/models/sync_request_model.rb', line 58

def status_code
  @status_code
end

#sync_request_idUuid



50
51
52
# File 'lib/lockstep_sdk/models/sync_request_model.rb', line 50

def sync_request_id
  @sync_request_id
end

Instance Method Details

#as_json(options = {}) ⇒ object



102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'lib/lockstep_sdk/models/sync_request_model.rb', line 102

def as_json(options={})
    {
        'syncRequestId' => @sync_request_id,
        'groupKey' => @group_key,
        'statusCode' => @status_code,
        'operationTypeName' => @operation_type_name,
        'operationType' => @operation_type,
        'processResultMessage' => @process_result_message,
        'failureCount' => @failure_count,
        'runFullSync' => @run_full_sync,
        'appEnrollmentId' => @app_enrollment_id,
        'created' => @created,
        'modified' => @modified,
        'modifiedUserId' => @modified_user_id,
        'details' => @details,
    }
end

#to_json(*options) ⇒ String



122
123
124
# File 'lib/lockstep_sdk/models/sync_request_model.rb', line 122

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