Class: AttachmentLinksClient

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

Instance Method Summary collapse

Constructor Details

#initialize(connection) ⇒ AttachmentLinksClient

Initialize the AttachmentLinksClient class with an API client instance.

Parameters:

  • connection (LockstepApi) —

    The API client object for this connection



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

def initialize(connection)
    @connection = connection
end

Instance Method Details

Delete the specified link between an object and its attachment.

An Attachment Link is a link that associates one Attachment with one object within Lockstep.

See Extensibility for more information.

Parameters:

  • attachment_id (uuid)
  • object_key (uuid)
  • table_name (string)


66
67
68
69
70
# File 'lib/lockstep_sdk/clients/attachment_links_client.rb', line 66

def delete_attachment_link(attachment_id:, object_key:, table_name:)
    path = "/api/v1/AttachmentLinks"
    params = {:attachmentId => attachment_id, :objectKey => object_key, :tableName => table_name}
    @connection.request(:delete, path, nil, params)
end

Queries Attachment Links 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 page on the Lockstep Developer website.

An Attachment Link is a link that associates one Attachment with one object within Lockstep.

See Extensibility for more information.

Parameters:

  • filter (string) —

    The filter to use to select from the list of available Attachments, in the Searchlight query syntax.

  • 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.

  • page_size (int32) —

    The page size for results (default 250, maximum of 500)

  • page_number (int32) —

    The page number for results (default 0)



86
87
88
89
90
# File 'lib/lockstep_sdk/clients/attachment_links_client.rb', line 86

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

Retrieves the Attachment Link with the provided Attachment Link identifier.

An Attachment Link is a link that associates one Attachment with one object within Lockstep.

See Extensibility for more information.

Parameters:

  • attachment_id (uuid)
  • object_key (uuid)
  • table_name (string)


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

def retrieve_attachment_link(attachment_id:, object_key:, table_name:)
    path = "/api/v1/AttachmentLinks"
    params = {:attachmentId => attachment_id, :objectKey => object_key, :tableName => table_name}
    @connection.request(:get, path, nil, params)
end

#upload_attachment(body:) ⇒ Object

Creates one Attachment Link from the provided arguments.

An Attachment Link is a link that associates one Attachment with one object within Lockstep.

See Extensibility for more information.

Parameters:

  • body (AttachmentLinkModel)


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

def upload_attachment(body:)
    path = "/api/v1/AttachmentLinks"
    @connection.request(:post, path, body, nil)
end