Class: SyncClient

Inherits:
Object
  • Object
show all
Defined in:
lib/lockstep_sdk/clients/sync.rb

Instance Method Summary collapse

Constructor Details

#initialize(lockstepsdk) ⇒ SyncClient

Initialize the SyncClient class with a lockstepsdk instance.

Parameters:

  • lockstepsdk (LockstepApi)

    The Lockstep API client object for this connection



22
23
24
# File 'lib/lockstep_sdk/clients/sync.rb', line 22

def initialize(lockstepsdk)
    @lockstepsdk = lockstepsdk
end

Instance Method Details

#create_syncObject

Requests a new Sync task from the Application specified in the request and returns a token that can be used to check the progress and status of the task.

A Sync task represents an action performed by an Application for a particular account. An Application can provide many different tasks as part of their capabilities. Sync tasks are executed in the background and will continue running after they are created. Use one of the creation APIs to request execution of a task. To check on the progress of the task, call GetSync or QuerySync.

Parameters:

  • body (SyncSubmitModel)

    Information about the Sync to execute



32
33
34
35
# File 'lib/lockstep_sdk/clients/sync.rb', line 32

def create_sync()
    path = "/api/v1/Sync"
    @lockstepsdk.request(:post, path, body, nil)
end

#query_syncs(filter:, include_param:, order:, pageSize:, pageNumber:) ⇒ Object

Queries Sync tasks for this account using the specified filtering, sorting, nested fetch, and pagination rules requested.

More information on querying can be found on the [Searchlight Query Language](developer.lockstep.io/docs/querying-with-searchlight) page on the Lockstep Developer website.

A Sync task represents an action performed by an Application for a particular account. An Application can provide many different tasks as part of their capabilities. Sync tasks are executed in the background and will continue running after they are created. Use one of the creation APIs to request execution of a task. To check on the progress of the task, call GetSync or QuerySync.

Parameters:



85
86
87
88
89
# File 'lib/lockstep_sdk/clients/sync.rb', line 85

def query_syncs(filter:, include_param:, order:, pageSize:, pageNumber:)
    path = "/api/v1/Sync/query"
    params = {:filter => filter, :include => include_param, :order => order, :pageSize => pageSize, :pageNumber => pageNumber}
    @lockstepsdk.request(:get, path, nil, params)
end

#retrieve_sync(id:, include_param:) ⇒ Object

Retrieves the status and information about a Sync operation by the requested ID. Provides status and progress information about this task.

A Sync task represents an action performed by an Application for a particular account. An Application can provide many different tasks as part of their capabilities. Sync tasks are executed in the background and will continue running after they are created. Use one of the creation APIs to request execution of a task. To check on the progress of the task, call GetSync or QuerySync.

Parameters:

  • id (uuid)

    The unique ID number of the Sync task to retrieve

  • include_param (string)

    To fetch additional data on this object, specify the list of elements to retrieve. Available collections: Details



68
69
70
71
72
# File 'lib/lockstep_sdk/clients/sync.rb', line 68

def retrieve_sync(id:, include_param:)
    path = "/api/v1/Sync/#{id}"
    params = {:include => include_param}
    @lockstepsdk.request(:get, path, nil, params)
end

#update_sync(id:) ⇒ Object

Updates an existing Sync with the information supplied to this PATCH call.

This API is restricted to internal service users and may not be called by customers or partners.

The PATCH method allows you to change specific values on the object while leaving other values alone. As input you should supply a list of field names and new values. For example, you can provide the field name “IsActive” and specify the new value “False”; this API will then change the value of IsActive to false.

A Sync task represents an action performed by an Application for a particular account. An Application can provide many different tasks as part of their capabilities. Sync tasks are executed in the background and will continue running after they are created. Use one of the creation APIs to request execution of a task. To check on the progress of the task, call GetSync or QuerySync.

Parameters:

  • id (uuid)

    The unique ID number of the Sync to update

  • body (object)

    A list of changes to apply to this Application



56
57
58
59
60
# File 'lib/lockstep_sdk/clients/sync.rb', line 56

def update_sync(id:)
    path = "/api/v1/Sync/#{id}"
    params = {}
    @lockstepsdk.request(:patch, path, body, params)
end

#upload_sync_fileObject

Requests a new Sync task from a ZIP file you provide. This ZIP file can contain one or more files with data from the customer's platform. Individual files can be in the format CSV or JSONL (JSON with Lines).

A Sync task represents an action performed by an Application for a particular account. An Application can provide many different tasks as part of their capabilities. Sync tasks are executed in the background and will continue running after they are created. Use one of the creation APIs to request execution of a task. To check on the progress of the task, call GetSync or QuerySync.



41
42
43
44
# File 'lib/lockstep_sdk/clients/sync.rb', line 41

def upload_sync_file()
    path = "/api/v1/Sync/zip"
    @lockstepsdk.request(:post, path, nil, nil)
end