Class: LockstepSdk::AttachmentModel

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

Overview

Represents a user uploaded attachment

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ AttachmentModel

Initialize the AttachmentModel using the provided prototype



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/lockstep_sdk/models/attachment_model.rb', line 28

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)
    @created = params.dig(:created)
    @created_user_id = params.dig(:created_user_id)
end

Instance Attribute Details

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



46
47
48
# File 'lib/lockstep_sdk/models/attachment_model.rb', line 46

def attachment_id
  @attachment_id
end

#attachment_type_idUuid

Returns Corresponding AttachmentType object to describe this attachment.

Returns:

  • (Uuid)

    Corresponding AttachmentType object to describe this attachment



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

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



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

def created
  @created
end

#created_user_idUuid

Returns Id of the user who made the file.

Returns:

  • (Uuid)

    Id of the user who made the file



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

def created_user_id
  @created_user_id
end

#file_extString

Returns Extension type of the file.

Returns:

  • (String)

    Extension type of the file



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

def file_ext
  @file_ext
end

#file_nameString

Returns Name of the file.

Returns:

  • (String)

    Name of the file



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

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



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

def group_key
  @group_key
end

#is_archivedBoolean

Returns Flag indicating the attachment was archived.

Returns:

  • (Boolean)

    Flag indicating the attachment was archived



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

def is_archived
  @is_archived
end

#object_keyUuid

Returns The ID of the object the attachment is associated with.

Returns:

  • (Uuid)

    The ID of the object the attachment is associated with



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

def object_key
  @object_key
end

#origin_attachment_idUuid

Returns:

  • (Uuid)


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

def origin_attachment_id
  @origin_attachment_id
end

#table_keyString

Returns The name of the table the attachment is associated with.

Returns:

  • (String)

    The name of the table the attachment is associated with



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

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



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

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



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

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



98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/lockstep_sdk/models/attachment_model.rb', line 98

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,
        '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



118
119
120
# File 'lib/lockstep_sdk/models/attachment_model.rb', line 118

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