Class: LockstepSdk::NoteModel

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

Overview

A note is a customizable text string that can be attached to various account attributes within Lockstep. You can use notes for internal communication, correspondence with clients, or personal reminders. The Note Model represents a note and a number of different metadata attributes related to the creation, storage, and ownership of the note.

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ NoteModel

Initialize the NoteModel using the provided prototype



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

def initialize(params = {})
    @note_id = params.dig(:note_id)
    @group_key = params.dig(:group_key)
    @table_key = params.dig(:table_key)
    @object_key = params.dig(:object_key)
    @note_text = params.dig(:note_text)
    @note_type = params.dig(:note_type)
    @is_archived = params.dig(:is_archived)
    @created = params.dig(:created)
    @created_user_id = params.dig(:created_user_id)
    @created_user_name = params.dig(:created_user_name)
    @app_enrollment_id = params.dig(:app_enrollment_id)
    @recipient_name = params.dig(:recipient_name)
end

Instance Attribute Details

#app_enrollment_idUuid

Returns AppEnrollmentId for this record; used for mapping purposes.

Returns:

  • (Uuid)

    AppEnrollmentId for this record; used for mapping purposes.



89
90
91
# File 'lib/lockstep_sdk/models/note_model.rb', line 89

def app_enrollment_id
  @app_enrollment_id
end

#createdDate-time

Returns The date the note was created.

Returns:

  • (Date-time)

    The date the note was created



77
78
79
# File 'lib/lockstep_sdk/models/note_model.rb', line 77

def created
  @created
end

#created_user_idUuid

Returns The ID of the user who created the note.

Returns:

  • (Uuid)

    The ID of the user who created the note



81
82
83
# File 'lib/lockstep_sdk/models/note_model.rb', line 81

def created_user_id
  @created_user_id
end

#created_user_nameString

Returns The name of the user who created the note.

Returns:

  • (String)

    The name of the user who created the note



85
86
87
# File 'lib/lockstep_sdk/models/note_model.rb', line 85

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



53
54
55
# File 'lib/lockstep_sdk/models/note_model.rb', line 53

def group_key
  @group_key
end

#is_archivedBoolean

Returns Flag indicating if the note has been archived.

Returns:

  • (Boolean)

    Flag indicating if the note has been archived



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

def is_archived
  @is_archived
end

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



49
50
51
# File 'lib/lockstep_sdk/models/note_model.rb', line 49

def note_id
  @note_id
end

#note_textString

Returns The text of the note.

Returns:

  • (String)

    The text of the note



65
66
67
# File 'lib/lockstep_sdk/models/note_model.rb', line 65

def note_text
  @note_text
end

#note_typeString

Returns The type of the note.

Returns:

  • (String)

    The type of the note



69
70
71
# File 'lib/lockstep_sdk/models/note_model.rb', line 69

def note_type
  @note_type
end

#object_keyUuid

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

Returns:

  • (Uuid)

    The ID of the object the note is associated with



61
62
63
# File 'lib/lockstep_sdk/models/note_model.rb', line 61

def object_key
  @object_key
end

#recipient_nameString

Returns The person to whom this note is intended for.

Returns:

  • (String)

    The person to whom this note is intended for.



93
94
95
# File 'lib/lockstep_sdk/models/note_model.rb', line 93

def recipient_name
  @recipient_name
end

#table_keyString

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

Returns:

  • (String)

    The name of the table the note is associated with



57
58
59
# File 'lib/lockstep_sdk/models/note_model.rb', line 57

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



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

def as_json(options={})
    {
        'noteId' => @note_id,
        'groupKey' => @group_key,
        'tableKey' => @table_key,
        'objectKey' => @object_key,
        'noteText' => @note_text,
        'noteType' => @note_type,
        'isArchived' => @is_archived,
        'created' => @created,
        'createdUserId' => @created_user_id,
        'createdUserName' => @created_user_name,
        'appEnrollmentId' => @app_enrollment_id,
        'recipientName' => @recipient_name,
    }
end

#to_json(*options) ⇒ String

Returns This object converted to a JSON string.

Returns:

  • (String)

    This object converted to a JSON string



116
117
118
# File 'lib/lockstep_sdk/models/note_model.rb', line 116

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