Class: ActivitiesClient

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

Instance Method Summary collapse

Constructor Details

#initialize(lockstepsdk) ⇒ ActivitiesClient

Initialize the ActivitiesClient class with a lockstepsdk instance.

Parameters:

  • lockstepsdk (LockstepApi)

    The Lockstep API client object for this connection



24
25
26
# File 'lib/lockstep_sdk/clients/activities.rb', line 24

def initialize(lockstepsdk)
    @lockstepsdk = lockstepsdk
end

Instance Method Details

#create_activities(body:) ⇒ Object

Creates one or more activities from a given model.

An Activity contains information about work being done on a specific accounting task. You can use Activities to track information about who has been assigned a specific task, the current status of the task, the name and description given for the particular task, the priority of the task, and any amounts collected, paid, or credited for the task.

Parameters:

  • body (ActivityModel)

    The Activities to create



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

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

#delete_activity(id:) ⇒ Object

Delete the Activity referred to by this unique identifier.

An Activity contains information about work being done on a specific accounting task. You can use Activities to track information about who has been assigned a specific task, the current status of the task, the name and description given for the particular task, the priority of the task, and any amounts collected, paid, or credited for the task.

Parameters:

  • id (uuid)

    The unique Lockstep Platform ID number of the Activity to delete



59
60
61
62
# File 'lib/lockstep_sdk/clients/activities.rb', line 59

def delete_activity(id:)
    path = "/api/v1/Activities/#{id}"
    @lockstepsdk.request(:delete, path, nil, nil)
end

#forward_activity(activity_id:, user_id:) ⇒ Object

Forwards an activity by creating a new activity with all child references and assigning the new activity to a new user.

An Activity contains information about work being done on a specific accounting task. You can use Activities to track information about who has been assigned a specific task, the current status of the task, the name and description given for the particular task, the priority of the task, and any amounts collected, paid, or credited for the task.

Parameters:

  • activity_id (uuid)
  • user_id (uuid)


107
108
109
110
# File 'lib/lockstep_sdk/clients/activities.rb', line 107

def forward_activity(activity_id:, user_id:)
    path = "/api/v1/Activities/#{activityId}/forward/#{userId}"
    @lockstepsdk.request(:post, path, nil, nil)
end

#query_activities(filter:, include_param:, order:, page_size:, page_number:) ⇒ Object

Queries Activities 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.

An Activity contains information about work being done on a specific accounting task. You can use Activities to track information about who has been assigned a specific task, the current status of the task, the name and description given for the particular task, the priority of the task, and any amounts collected, paid, or credited for the task.

Parameters:



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

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

#retrieve_activity(id:, include_param:) ⇒ Object

Retrieves the Activity specified by this unique identifier, optionally including nested data sets.

An Activity contains information about work being done on a specific accounting task. You can use Activities to track information about who has been assigned a specific task, the current status of the task, the name and description given for the particular task, the priority of the task, and any amounts collected, paid, or credited for the task.

Parameters:

  • id (uuid)

    The unique Lockstep Platform ID number of this Activity

  • include_param (string)

    To fetch additional data on this object, specify the list of elements to retrieve. Available collections: Company, Attachments, CustomFields, Notes, References, and UserAssignedToName



35
36
37
38
39
# File 'lib/lockstep_sdk/clients/activities.rb', line 35

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

#retrieve_activity_stream(id:) ⇒ Object

Retrieves a list of items representing the activity stream for the supplied activity id.

An Activity contains information about work being done on a specific accounting task. You can use Activities to track information about who has been assigned a specific task, the current status of the task, the name and description given for the particular task, the priority of the task, and any amounts collected, paid, or credited for the task.

Parameters:

  • id (uuid)

    The unique Lockstep Platform ID number of this Activity



96
97
98
99
# File 'lib/lockstep_sdk/clients/activities.rb', line 96

def retrieve_activity_stream(id:)
    path = "/api/v1/Activities/#{id}/stream"
    @lockstepsdk.request(:get, path, nil, nil)
end

#update_activity(id:, body:) ⇒ Object

Updates an activity that matches the specified id with the requested information.

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. If you do not provide the name of a field, that field will remain unchanged. This allows you to ensure that you are only updating the specific fields desired.

An Activity contains information about work being done on a specific accounting task. You can use Activities to track information about who has been assigned a specific task, the current status of the task, the name and description given for the particular task, the priority of the task, and any amounts collected, paid, or credited for the task.

Parameters:

  • id (uuid)

    The unique Lockstep Platform ID number of the Activity to update

  • body (object)

    A list of changes to apply to this Activity



49
50
51
52
# File 'lib/lockstep_sdk/clients/activities.rb', line 49

def update_activity(id:, body:)
    path = "/api/v1/Activities/#{id}"
    @lockstepsdk.request(:patch, path, body.to_camelback_keys.to_json, nil)
end