Class: ActivitiesClient

Inherits:
Object
  • Object
show all
Defined in:
lib/lockstep_sdk/clients/activities_client.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



25
26
27
# File 'lib/lockstep_sdk/clients/activities_client.rb', line 25

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



74
75
76
77
# File 'lib/lockstep_sdk/clients/activities_client.rb', line 74

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



63
64
65
66
# File 'lib/lockstep_sdk/clients/activities_client.rb', line 63

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)


115
116
117
118
# File 'lib/lockstep_sdk/clients/activities_client.rb', line 115

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:



91
92
93
94
95
# File 'lib/lockstep_sdk/clients/activities_client.rb', line 91

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



37
38
39
40
41
# File 'lib/lockstep_sdk/clients/activities_client.rb', line 37

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



103
104
105
106
# File 'lib/lockstep_sdk/clients/activities_client.rb', line 103

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



52
53
54
55
# File 'lib/lockstep_sdk/clients/activities_client.rb', line 52

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