Class: AttachmentsClient

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

Instance Method Summary collapse

Constructor Details

#initialize(lockstepsdk) ⇒ AttachmentsClient

Initialize the AttachmentsClient class with a lockstepsdk instance.

Parameters:

  • lockstepsdk (LockstepApi)

    The Lockstep API client object for this connection



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

def initialize(lockstepsdk)
    @lockstepsdk = lockstepsdk
end

Instance Method Details

#archive_attachment(id:) ⇒ Object

Flag this attachment as archived, which can distinguish between attachments currently active and attachments not intended for active use. This is similar to deletion but preserves information about the record's existence.

An Attachment is a file that can be attached to various account attributes within Lockstep. Attachments can be used for invoices, bills, or any other external files that you wish to track and have access to. Attachments represents an Attachment and a number of different metadata attributes related to the creation, storage, and ownership of the Attachment.

See [Extensibility](developer.lockstep.io/docs/extensibility) for more information.

Parameters:

  • id (uuid)

    The unique ID number of the Attachment to be archived



64
65
66
67
68
# File 'lib/lockstep_sdk/clients/attachments.rb', line 64

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

#download_attachment(id:) ⇒ Object

Returns a URI for the Attachment file to be downloaded, based on the ID provided.

An Attachment is a file that can be attached to various account attributes within Lockstep. Attachments can be used for invoices, bills, or any other external files that you wish to track and have access to. Attachments represents an Attachment and a number of different metadata attributes related to the creation, storage, and ownership of the Attachment.

See [Extensibility](developer.lockstep.io/docs/extensibility) for more information.

Parameters:

  • id (uuid)

    The unique ID number of the Attachment whose URI will be returned



77
78
79
80
81
# File 'lib/lockstep_sdk/clients/attachments.rb', line 77

def download_attachment(id:)
    path = "/api/v1/Attachments/#{id}/download"
    params = {}
    @lockstepsdk.request(:get, path, nil, params)
end

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

Queries Attachments 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 Attachment is a file that can be attached to various account attributes within Lockstep. Attachments can be used for invoices, bills, or any other external files that you wish to track and have access to. Attachments represents an Attachment and a number of different metadata attributes related to the creation, storage, and ownership of the Attachment.

See [Extensibility](developer.lockstep.io/docs/extensibility) for more information.

Parameters:

  • filter (string)

    The filter to use to select from the list of available Attachments, in the [Searchlight query syntax](github.com/tspence/csharp-searchlight).

  • include_param (string)

    To fetch additional data on this object, specify the list of elements to retrieve. No collections are currently available for querying but may be available in the future.

  • order (string)

    The sort order for the results, in the [Searchlight order syntax](github.com/tspence/csharp-searchlight).

  • pageSize (int32)

    The page size for results (default 200, maximum of 10,000)

  • pageNumber (int32)

    The page number for results (default 0)



110
111
112
113
114
# File 'lib/lockstep_sdk/clients/attachments.rb', line 110

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

#retrieve_attachment(id:, include_param:) ⇒ Object

Retrieves the Attachment with the provided Attachment identifier.

An Attachment is a file that can be attached to various account attributes within Lockstep. Attachments can be used for invoices, bills, or any other external files that you wish to track and have access to. Attachments represents an Attachment and a number of different metadata attributes related to the creation, storage, and ownership of the Attachment.

See [Extensibility](developer.lockstep.io/docs/extensibility) for more information.

Parameters:

  • id (uuid)

    The unique ID number of the Attachment to retrieve

  • include_param (string)

    To fetch additional data on this object, specify the list of elements to retrieve. No collections are currently available for querying but may be available in the future.



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

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

#update_attachment(id:) ⇒ Object

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

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 Attachment is a file that can be attached to various account attributes within Lockstep. Attachments can be used for invoices, bills, or any other external files that you wish to track and have access to. Attachments represents an Attachment and a number of different metadata attributes related to the creation, storage, and ownership of the Attachment.

See [Extensibility](developer.lockstep.io/docs/extensibility) for more information.

Parameters:

  • id (uuid)

    The unique Lockstep Platform ID number of the attachment to update

  • body (object)

    A list of changes to apply to this Attachment



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

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

#upload_attachment(tableName:, objectId:) ⇒ Object

Uploads and creates one or more Attachments from the provided arguments.

An Attachment is a file that can be attached to various account attributes within Lockstep. Attachments can be used for invoices, bills, or any other external files that you wish to track and have access to. Attachments represents an Attachment and a number of different metadata attributes related to the creation, storage, and ownership of the Attachment.

See [Extensibility](developer.lockstep.io/docs/extensibility) for more information.

Parameters:

  • tableName (string)

    The name of the type of object to which this Attachment will be linked

  • objectId (uuid)

    The unique ID of the object to which this Attachment will be linked



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

def upload_attachment(tableName:, objectId:)
    path = "/api/v1/Attachments"
    params = {:tableName => tableName, :objectId => objectId}
    @lockstepsdk.request(:post, path, nil, params)
end