Class: LockstepSdk::AttachmentModel

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

Overview

An Attachment is a file that can be attached to various account attributes within Lockstep. This data model contains metadata about the attachment. You can upload and download attachments into the Lockstep Platform along with this metadata. Attachments can be used for invoices, payments, legal documents, or any other external files that you wish to track.

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ AttachmentModel

Initialize the AttachmentModel using the provided prototype



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/lockstep_sdk/models/attachment_model.rb', line 30

def initialize(params = {})
    @attachment_id = params.dig(:attachment_id)
    @group_key = params.dig(:group_key)
    @table_key = params.dig(:table_key)
    @object_key = params.dig(:object_key)
    @file_name = params.dig(:file_name)
    @file_ext = params.dig(:file_ext)
    @attachment_type_id = params.dig(:attachment_type_id)
    @is_archived = params.dig(:is_archived)
    @origin_attachment_id = params.dig(:origin_attachment_id)
    @view_internal = params.dig(:view_internal)
    @view_external = params.dig(:view_external)
    @erp_key = params.dig(:erp_key)
    @app_enrollment_id = params.dig(:app_enrollment_id)
    @created = params.dig(:created)
    @created_user_id = params.dig(:created_user_id)
    @attachment_type = params.dig(:attachment_type)
end

Instance Attribute Details

#app_enrollment_idUuid

Returns The AppEnrollmentId of the application that imported this record. For accounts with more than one financial system connected, this field identifies the originating financial system that produced this record. This value is null if this record was not loaded from an external ERP or financial system.

Returns:

  • (Uuid)

    The AppEnrollmentId of the application that imported this record. For accounts with more than one financial system connected, this field identifies the originating financial system that produced this record. This value is null if this record was not loaded from an external ERP or financial system.



99
100
101
# File 'lib/lockstep_sdk/models/attachment_model.rb', line 99

def app_enrollment_id
  @app_enrollment_id
end

#attachment_idUuid

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

Returns:

  • (Uuid)

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



51
52
53
# File 'lib/lockstep_sdk/models/attachment_model.rb', line 51

def attachment_id
  @attachment_id
end

#attachment_typeString

Returns A text string describing the type of this Attachment.

Returns:

  • (String)

    A text string describing the type of this Attachment.



111
112
113
# File 'lib/lockstep_sdk/models/attachment_model.rb', line 111

def attachment_type
  @attachment_type
end

#attachment_type_idUuid

Returns DEPRECATED: This field is replaced by ‘AttachmentType`.

Returns:

  • (Uuid)

    DEPRECATED: This field is replaced by ‘AttachmentType`.



75
76
77
# File 'lib/lockstep_sdk/models/attachment_model.rb', line 75

def attachment_type_id
  @attachment_type_id
end

#createdDate-time

Returns The date the attachment was created.

Returns:

  • (Date-time)

    The date the attachment was created.



103
104
105
# File 'lib/lockstep_sdk/models/attachment_model.rb', line 103

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.

Returns:



107
108
109
# File 'lib/lockstep_sdk/models/attachment_model.rb', line 107

def created_user_id
  @created_user_id
end

#erp_keyString

Returns The unique ID of this record as it was known in its originating financial system. If this company record was imported from a financial system, it will have the value ‘ErpKey` set to the original primary key number of the record as it was known in the originating financial system. If this record was not imported from a financial system, this value will be `null`. For more information, see [Identity Columns](developer.lockstep.io/docs/identity-columns).

Returns:

  • (String)

    The unique ID of this record as it was known in its originating financial system. If this company record was imported from a financial system, it will have the value ‘ErpKey` set to the original primary key number of the record as it was known in the originating financial system. If this record was not imported from a financial system, this value will be `null`. For more information, see [Identity Columns](developer.lockstep.io/docs/identity-columns).



95
96
97
# File 'lib/lockstep_sdk/models/attachment_model.rb', line 95

def erp_key
  @erp_key
end

#file_extString

Returns An Attachment represents a file that was uploaded to the Lockstep Platform. This field contains the original extension name of the file on disk.

Returns:

  • (String)

    An Attachment represents a file that was uploaded to the Lockstep Platform. This field contains the original extension name of the file on disk.



71
72
73
# File 'lib/lockstep_sdk/models/attachment_model.rb', line 71

def file_ext
  @file_ext
end

#file_nameString

Returns An Attachment represents a file that was uploaded to the Lockstep Platform. This field contains the original name of the file on disk, without its extension.

Returns:

  • (String)

    An Attachment represents a file that was uploaded to the Lockstep Platform. This field contains the original name of the file on disk, without its extension.



67
68
69
# File 'lib/lockstep_sdk/models/attachment_model.rb', line 67

def file_name
  @file_name
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).



55
56
57
# File 'lib/lockstep_sdk/models/attachment_model.rb', line 55

def group_key
  @group_key
end

#is_archivedBoolean

Returns A flag indicating whether this Attachment is archived (also known as hidden or deleted). When you call [ArchiveAttachment](developer.lockstep.io/reference/delete_api-v1-attachments-id) this field will be set to true. You should avoid displaying Attachments with the IsArchived field set to true in your user interface.

Returns:

  • (Boolean)

    A flag indicating whether this Attachment is archived (also known as hidden or deleted). When you call [ArchiveAttachment](developer.lockstep.io/reference/delete_api-v1-attachments-id) this field will be set to true. You should avoid displaying Attachments with the IsArchived field set to true in your user interface.



79
80
81
# File 'lib/lockstep_sdk/models/attachment_model.rb', line 79

def is_archived
  @is_archived
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).



63
64
65
# File 'lib/lockstep_sdk/models/attachment_model.rb', line 63

def object_key
  @object_key
end

#origin_attachment_idUuid

Returns DEPRECATED - Do not use.

Returns:

  • (Uuid)

    DEPRECATED - Do not use



83
84
85
# File 'lib/lockstep_sdk/models/attachment_model.rb', line 83

def origin_attachment_id
  @origin_attachment_id
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).



59
60
61
# File 'lib/lockstep_sdk/models/attachment_model.rb', line 59

def table_key
  @table_key
end

#view_externalBoolean

Returns Flag for if Vendors and customers can see this file.

Returns:

  • (Boolean)

    Flag for if Vendors and customers can see this file



91
92
93
# File 'lib/lockstep_sdk/models/attachment_model.rb', line 91

def view_external
  @view_external
end

#view_internalBoolean

Returns Flag for if LS clients can see this file.

Returns:

  • (Boolean)

    Flag for if LS clients can see this file



87
88
89
# File 'lib/lockstep_sdk/models/attachment_model.rb', line 87

def view_internal
  @view_internal
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



115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# File 'lib/lockstep_sdk/models/attachment_model.rb', line 115

def as_json(options={})
    {
        'attachmentId' => @attachment_id,
        'groupKey' => @group_key,
        'tableKey' => @table_key,
        'objectKey' => @object_key,
        'fileName' => @file_name,
        'fileExt' => @file_ext,
        'attachmentTypeId' => @attachment_type_id,
        'isArchived' => @is_archived,
        'originAttachmentId' => @origin_attachment_id,
        'viewInternal' => @view_internal,
        'viewExternal' => @view_external,
        'erpKey' => @erp_key,
        'appEnrollmentId' => @app_enrollment_id,
        'created' => @created,
        'createdUserId' => @created_user_id,
        'attachmentType' => @attachment_type,
    }
end

#to_json(*options) ⇒ String

Returns This object converted to a JSON string.

Returns:

  • (String)

    This object converted to a JSON string



138
139
140
# File 'lib/lockstep_sdk/models/attachment_model.rb', line 138

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