Class: SyncClient
- Inherits:
-
Object
- Object
- SyncClient
- Defined in:
- lib/lockstep_sdk/clients/sync_client.rb
Instance Method Summary collapse
-
#create_sync(body:) ⇒ Object
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.
-
#initialize(lockstepsdk) ⇒ SyncClient
constructor
Initialize the SyncClient class with a lockstepsdk instance.
-
#query_syncs(filter:, include_param:, order:, page_size:, page_number:) ⇒ Object
Queries Sync tasks for this account using the specified filtering, sorting, nested fetch, and pagination rules requested.
-
#retrieve_sync(id:, include_param:) ⇒ Object
Retrieves the status and information about a Sync operation by the requested ID.
-
#update_sync(id:, body:) ⇒ Object
Updates an existing Sync with the information supplied to this PATCH call.
-
#upload_sync_file ⇒ Object
Requests a new Sync task from a ZIP file you provide.
Constructor Details
#initialize(lockstepsdk) ⇒ SyncClient
Initialize the SyncClient class with a lockstepsdk instance.
25 26 27 |
# File 'lib/lockstep_sdk/clients/sync_client.rb', line 25 def initialize(lockstepsdk) @lockstepsdk = lockstepsdk end |
Instance Method Details
#create_sync(body:) ⇒ Object
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.
36 37 38 39 |
# File 'lib/lockstep_sdk/clients/sync_client.rb', line 36 def create_sync(body:) path = "/api/v1/Sync" @lockstepsdk.request(:post, path, body, nil) end |
#query_syncs(filter:, include_param:, order:, page_size:, page_number:) ⇒ 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.
92 93 94 95 96 |
# File 'lib/lockstep_sdk/clients/sync_client.rb', line 92 def query_syncs(filter:, include_param:, order:, page_size:, page_number:) path = "/api/v1/Sync/query" params = {:filter => filter, :include => include_param, :order => order, :pageSize => page_size, :pageNumber => page_number} @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.
74 75 76 77 78 |
# File 'lib/lockstep_sdk/clients/sync_client.rb', line 74 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:, body:) ⇒ 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.
62 63 64 65 |
# File 'lib/lockstep_sdk/clients/sync_client.rb', line 62 def update_sync(id:, body:) path = "/api/v1/Sync/#{id}" @lockstepsdk.request(:patch, path, body.to_camelback_keys.to_json, nil) end |
#upload_sync_file ⇒ Object
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.
46 47 48 49 |
# File 'lib/lockstep_sdk/clients/sync_client.rb', line 46 def upload_sync_file() path = "/api/v1/Sync/zip" @lockstepsdk.request(:post, path, nil, nil) end |