Class: LockstepSdk::AttachmentLinkModel

Inherits:
Object
  • Object
show all
Defined in:
lib/lockstep_sdk/models/attachment_link_model.rb

Overview

An Attachment Link represents a single link between any nestable object and an attachment

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ AttachmentLinkModel

Initialize the AttachmentLinkModel using the provided prototype



25
26
27
28
29
30
31
32
# File 'lib/lockstep_sdk/models/attachment_link_model.rb', line 25

def initialize(params = {})
    @group_key = params.dig(:group_key)
    @attachment_id = params.dig(:attachment_id)
    @object_key = params.dig(:object_key)
    @table_key = params.dig(:table_key)
    @created = params.dig(:created)
    @created_user_id = params.dig(:created_user_id)
end

Instance Attribute Details

#attachment_idUuid

Returns The unique ID of an attachment record, automatically assigned by Lockstep when this record is added to the Lockstep platform.

Returns:

  • (Uuid)

    The unique ID of an attachment record, automatically assigned by Lockstep when this record is added to the Lockstep platform.



40
41
42
# File 'lib/lockstep_sdk/models/attachment_link_model.rb', line 40

def attachment_id
  @attachment_id
end

#createdDate-time

Returns The date the Attachment Link was created.

Returns:

  • (Date-time)

    The date the Attachment Link was created.



52
53
54
# File 'lib/lockstep_sdk/models/attachment_link_model.rb', line 52

def created
  @created
end

#created_user_idUuid

Returns The unique ID of the [UserAccount](developer.lockstep.io/docs/useraccountmodel) of the user who created this Attachment Link.

Returns:



56
57
58
# File 'lib/lockstep_sdk/models/attachment_link_model.rb', line 56

def created_user_id
  @created_user_id
end

#group_keyUuid

Returns The GroupKey uniquely identifies a single Lockstep Platform account. All records for this account will share the same GroupKey value. GroupKey values cannot be changed once created. For more information, see [Accounts and GroupKeys](developer.lockstep.io/docs/accounts-and-groupkeys).

Returns:

  • (Uuid)

    The GroupKey uniquely identifies a single Lockstep Platform account. All records for this account will share the same GroupKey value. GroupKey values cannot be changed once created. For more information, see [Accounts and GroupKeys](developer.lockstep.io/docs/accounts-and-groupkeys).



36
37
38
# File 'lib/lockstep_sdk/models/attachment_link_model.rb', line 36

def group_key
  @group_key
end

#object_keyUuid

Returns An Attachment is connected to an existing item within the Lockstep Platform by the fields ‘TableKey` and `ObjectKey`. For example, an Attachment connected to Invoice 12345 would have a `TableKey` value of `Invoice` and an `ObjectKey` value of `12345`. The `ObjectKey` value contains the primary key of the record within the Lockstep Platform to which this Attachment is connected. For more information, see [linking metadata to an object](developer.lockstep.io/docs/custom-fields#linking-metadata-to-an-object).

Returns:

  • (Uuid)

    An Attachment is connected to an existing item within the Lockstep Platform by the fields ‘TableKey` and `ObjectKey`. For example, an Attachment connected to Invoice 12345 would have a `TableKey` value of `Invoice` and an `ObjectKey` value of `12345`. The `ObjectKey` value contains the primary key of the record within the Lockstep Platform to which this Attachment is connected. For more information, see [linking metadata to an object](developer.lockstep.io/docs/custom-fields#linking-metadata-to-an-object).



44
45
46
# File 'lib/lockstep_sdk/models/attachment_link_model.rb', line 44

def object_key
  @object_key
end

#table_keyString

Returns An Attachment is connected to an existing item within the Lockstep Platform by the fields ‘TableKey` and `ObjectKey`. For example, an Attachment connected to Invoice 12345 would have a `TableKey` value of `Invoice` and an `ObjectKey` value of `12345`. The `TableKey` value contains the name of the table within the Lockstep Platform to which this Attachment is connected. For more information, see [linking metadata to an object](developer.lockstep.io/docs/custom-fields#linking-metadata-to-an-object).

Returns:

  • (String)

    An Attachment is connected to an existing item within the Lockstep Platform by the fields ‘TableKey` and `ObjectKey`. For example, an Attachment connected to Invoice 12345 would have a `TableKey` value of `Invoice` and an `ObjectKey` value of `12345`. The `TableKey` value contains the name of the table within the Lockstep Platform to which this Attachment is connected. For more information, see [linking metadata to an object](developer.lockstep.io/docs/custom-fields#linking-metadata-to-an-object).



48
49
50
# File 'lib/lockstep_sdk/models/attachment_link_model.rb', line 48

def table_key
  @table_key
end

Instance Method Details

#as_json(options = {}) ⇒ object

Returns This object as a JSON key-value structure.

Returns:

  • (object)

    This object as a JSON key-value structure



60
61
62
63
64
65
66
67
68
69
# File 'lib/lockstep_sdk/models/attachment_link_model.rb', line 60

def as_json(options={})
    {
        'groupKey' => @group_key,
        'attachmentId' => @attachment_id,
        'objectKey' => @object_key,
        'tableKey' => @table_key,
        'created' => @created,
        'createdUserId' => @created_user_id,
    }
end

#to_json(*options) ⇒ String

Returns This object converted to a JSON string.

Returns:

  • (String)

    This object converted to a JSON string



73
74
75
# File 'lib/lockstep_sdk/models/attachment_link_model.rb', line 73

def to_json(*options)
    "[#{as_json(*options).to_json(*options)}]"
end