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



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

def initialize(lockstepsdk)
    @lockstepsdk = lockstepsdk
end

Instance Method Details

#create_activitiesObject

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()
    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



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

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

#forward_activity(activityId:, userId:) ⇒ 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:

  • activityId (uuid)
  • userId (uuid)


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

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

#query_activities(filter:, include_param:, order:, pageSize:, pageNumber:) ⇒ 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:, pageSize:, pageNumber:)
    path = "/api/v1/Activities/query"
    params = {:filter => filter, :include => include_param, :order => order, :pageSize => pageSize, :pageNumber => pageNumber}
    @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



33
34
35
36
37
# File 'lib/lockstep_sdk/clients/activities.rb', line 33

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
100
# File 'lib/lockstep_sdk/clients/activities.rb', line 96

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

#update_activity(id:) ⇒ 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



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

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