Class: LockstepSdk::EmailModel

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

Overview

An Email represents a communication sent from one company to another. The creator of the email is identified by the CompanyId field, recipient(s) by the EmailTo field, and cc recipient(s) by the ‘EmailCC’ field. The Email Model represents an email and a number of different metadata attributes related to the creation, storage, and ownership of the email.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ EmailModel

Initialize the EmailModel using the provided prototype



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/lockstep_sdk/models/email_model.rb', line 28

def initialize(params = {})
    @email_id = params.dig(:email_id)
    @thread_id = params.dig(:thread_id)
    @group_key = params.dig(:group_key)
    @company_id = params.dig(:company_id)
    @email_from = params.dig(:email_from)
    @email_to = params.dig(:email_to)
    @email_cc = params.dig(:email_cc)
    @email_subject = params.dig(:email_subject)
    @email_body = params.dig(:email_body)
    @sent_date = params.dig(:sent_date)
    @is_unread = params.dig(:is_unread)
    @is_priority = params.dig(:is_priority)
    @is_spam = params.dig(:is_spam)
    @created = params.dig(:created)
    @created_user_id = params.dig(:created_user_id)
    @to_be_sent = params.dig(:to_be_sent)
    @customer_id = params.dig(:customer_id)
    @received_time_stamp = params.dig(:received_time_stamp)
    @opened_timestamp = params.dig(:opened_timestamp)
    @view_count = params.dig(:view_count)
    @app_enrollment_id = params.dig(:app_enrollment_id)
    @external_email_id = params.dig(:external_email_id)
    @external_thread_id = params.dig(:external_thread_id)
    @email_bcc = params.dig(:email_bcc)
    @send_type = params.dig(:send_type)
    @modified = params.dig(:modified)
    @modified_user_id = params.dig(:modified_user_id)
    @response_origin_id = params.dig(:response_origin_id)
    @response_origin = params.dig(:response_origin)
    @notes = params.dig(:notes)
    @attachments = params.dig(:attachments)
    @custom_field_definitions = params.dig(:custom_field_definitions)
    @custom_field_values = params.dig(:custom_field_values)
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.



146
147
148
# File 'lib/lockstep_sdk/models/email_model.rb', line 146

def app_enrollment_id
  @app_enrollment_id
end

#attachmentsAttachmentModel

Returns A collection of attachments linked to this record. To retrieve this collection, specify Attachments in the include parameter when retrieving data. To create an attachment, use the [Upload Attachment](developer.lockstep.io/reference/post_api-v1-attachments) endpoint with the TableKey to Email and the ObjectKey set to the EmailId for this record. For more information on extensibility, see [linking extensible metadata to objects](developer.lockstep.io/docs/custom-fields#linking-metadata-to-an-object).

Returns:



186
187
188
# File 'lib/lockstep_sdk/models/email_model.rb', line 186

def attachments
  @attachments
end

#company_idUuid

Returns The ID number of the company that created this email.

Returns:

  • (Uuid)

    The ID number of the company that created this email.



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

def company_id
  @company_id
end

#createdDate-time

Returns The date on which this email was created.

Returns:

  • (Date-time)

    The date on which this email was created.



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

def created
  @created
end

#created_user_idUuid

Returns The ID number of the user who created this email.

Returns:

  • (Uuid)

    The ID number of the user who created this email.



122
123
124
# File 'lib/lockstep_sdk/models/email_model.rb', line 122

def created_user_id
  @created_user_id
end

#custom_field_definitionsCustomFieldDefinitionModel

Returns A collection of custom fields linked to this record. To retrieve this collection, specify CustomFieldDefinitions in the include parameter when retrieving data. To create a custom field, use the [Create Custom Field](developer.lockstep.io/reference/post_api-v1-customfieldvalues) endpoint with the TableKey to Email and the ObjectKey set to the EmailId for this record. For more information on extensibility, see [linking extensible metadata to objects](developer.lockstep.io/docs/custom-fields#linking-metadata-to-an-object).

Returns:



190
191
192
# File 'lib/lockstep_sdk/models/email_model.rb', line 190

def custom_field_definitions
  @custom_field_definitions
end

#custom_field_valuesCustomFieldValueModel

Returns A collection of custom fields linked to this record. To retrieve this collection, specify CustomFieldValues in the include parameter when retrieving data. To create a custom field, use the [Create Custom Field](developer.lockstep.io/reference/post_api-v1-customfieldvalues) endpoint with the TableKey to Email and the ObjectKey set to the EmailId for this record. For more information on extensibility, see [linking extensible metadata to objects](developer.lockstep.io/docs/custom-fields#linking-metadata-to-an-object).

Returns:



194
195
196
# File 'lib/lockstep_sdk/models/email_model.rb', line 194

def custom_field_values
  @custom_field_values
end

#customer_idUuid

Returns The ID number of the customer that sent this email.

Returns:

  • (Uuid)

    The ID number of the customer that sent this email.



130
131
132
# File 'lib/lockstep_sdk/models/email_model.rb', line 130

def customer_id
  @customer_id
end

#email_bccString

Returns The email address(es) for the BCC recipient(s) of this email.

Returns:

  • (String)

    The email address(es) for the BCC recipient(s) of this email



158
159
160
# File 'lib/lockstep_sdk/models/email_model.rb', line 158

def email_bcc
  @email_bcc
end

#email_bodyString

Returns The body content of this email.

Returns:

  • (String)

    The body content of this email.



98
99
100
# File 'lib/lockstep_sdk/models/email_model.rb', line 98

def email_body
  @email_body
end

#email_ccString

Returns The email address for the CC recipient(s) of this email.

Returns:

  • (String)

    The email address for the CC recipient(s) of this email



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

def email_cc
  @email_cc
end

#email_fromString

Returns The email address for the sender of this email.

Returns:

  • (String)

    The email address for the sender of this email.



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

def email_from
  @email_from
end

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



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

def email_id
  @email_id
end

#email_subjectString

Returns The subject line of this email.

Returns:

  • (String)

    The subject line of this email.



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

def email_subject
  @email_subject
end

#email_toString

Returns The email address for the recipient(s) of this email.

Returns:

  • (String)

    The email address for the recipient(s) of this email.



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

def email_to
  @email_to
end

#external_email_idString

Returns The id of the email in an external system if imported.

Returns:

  • (String)

    The id of the email in an external system if imported.



150
151
152
# File 'lib/lockstep_sdk/models/email_model.rb', line 150

def external_email_id
  @external_email_id
end

#external_thread_idString

Returns The id of the email thread in an external system if imported.

Returns:

  • (String)

    The id of the email thread in an external system if imported.



154
155
156
# File 'lib/lockstep_sdk/models/email_model.rb', line 154

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



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

def group_key
  @group_key
end

#is_priorityBoolean

Returns A status flag indicating if this email is priority status.

Returns:

  • (Boolean)

    A status flag indicating if this email is priority status.



110
111
112
# File 'lib/lockstep_sdk/models/email_model.rb', line 110

def is_priority
  @is_priority
end

#is_spamBoolean

Returns A status flag indicating if this email is marked as spam.

Returns:

  • (Boolean)

    A status flag indicating if this email is marked as spam.



114
115
116
# File 'lib/lockstep_sdk/models/email_model.rb', line 114

def is_spam
  @is_spam
end

#is_unreadBoolean

Returns A status flag indicating if this email is unread.

Returns:

  • (Boolean)

    A status flag indicating if this email is unread.



106
107
108
# File 'lib/lockstep_sdk/models/email_model.rb', line 106

def is_unread
  @is_unread
end

#modifiedDate-time

Returns The date on which this email was modified. Email modification should only be done by internal services.

Returns:

  • (Date-time)

    The date on which this email was modified. Email modification should only be done by internal services.



166
167
168
# File 'lib/lockstep_sdk/models/email_model.rb', line 166

def modified
  @modified
end

#modified_user_idUuid

Returns The ID of the user who modified this email. Email modification should only be done by internal services.

Returns:

  • (Uuid)

    The ID of the user who modified this email. Email modification should only be done by internal services.



170
171
172
# File 'lib/lockstep_sdk/models/email_model.rb', line 170

def modified_user_id
  @modified_user_id
end

#notesNoteModel

Returns A collection of notes linked to this record. To retrieve this collection, specify Notes in the include parameter when retrieving data. To create a note, use the [Create Note](developer.lockstep.io/reference/post_api-v1-notes) endpoint with the TableKey to Email and the ObjectKey set to the EmailId for this record. For more information on extensibility, see [linking extensible metadata to objects](developer.lockstep.io/docs/custom-fields#linking-metadata-to-an-object).

Returns:



182
183
184
# File 'lib/lockstep_sdk/models/email_model.rb', line 182

def notes
  @notes
end

#opened_timestampDate-time

Returns The date on which this email was opened.

Returns:

  • (Date-time)

    The date on which this email was opened.



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

def opened_timestamp
  @opened_timestamp
end

#received_time_stampDate-time

Returns The date on which this email was received.

Returns:

  • (Date-time)

    The date on which this email was received.



134
135
136
# File 'lib/lockstep_sdk/models/email_model.rb', line 134

def received_time_stamp
  @received_time_stamp
end

#response_originEmailModel

Returns The email object associated with the response origin id.

Returns:

  • (EmailModel)

    The email object associated with the response origin id.



178
179
180
# File 'lib/lockstep_sdk/models/email_model.rb', line 178

def response_origin
  @response_origin
end

#response_origin_idUuid

Returns If the message being sent is a reply or a forward, the id of the the email being replied to or forwarded. Otherwise null.

Returns:

  • (Uuid)

    If the message being sent is a reply or a forward, the id of the the email being replied to or forwarded. Otherwise null.



174
175
176
# File 'lib/lockstep_sdk/models/email_model.rb', line 174

def response_origin_id
  @response_origin_id
end

#send_typeString

Returns The type message being sent (New, Reply, Forward) or null for messages not being sent.

Returns:

  • (String)

    The type message being sent (New, Reply, Forward) or null for messages not being sent.



162
163
164
# File 'lib/lockstep_sdk/models/email_model.rb', line 162

def send_type
  @send_type
end

#sent_dateDate-time

Returns The date on which this email was sent.

Returns:

  • (Date-time)

    The date on which this email was sent.



102
103
104
# File 'lib/lockstep_sdk/models/email_model.rb', line 102

def sent_date
  @sent_date
end

#thread_idUuid

Returns The unique ID number of this email’s conversation thread.

Returns:

  • (Uuid)

    The unique ID number of this email’s conversation thread.



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

def thread_id
  @thread_id
end

#to_be_sentBoolean

Returns A status flag indicating if this email is to be sent.

Returns:

  • (Boolean)

    A status flag indicating if this email is to be sent.



126
127
128
# File 'lib/lockstep_sdk/models/email_model.rb', line 126

def to_be_sent
  @to_be_sent
end

#view_countInt32

Returns The number of times this email was viewed.

Returns:

  • (Int32)

    The number of times this email was viewed.



142
143
144
# File 'lib/lockstep_sdk/models/email_model.rb', line 142

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



198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
# File 'lib/lockstep_sdk/models/email_model.rb', line 198

def as_json(options={})
    {
        'emailId' => @email_id,
        'threadId' => @thread_id,
        'groupKey' => @group_key,
        'companyId' => @company_id,
        'emailFrom' => @email_from,
        'emailTo' => @email_to,
        'emailCC' => @email_cc,
        'emailSubject' => @email_subject,
        'emailBody' => @email_body,
        'sentDate' => @sent_date,
        'isUnread' => @is_unread,
        'isPriority' => @is_priority,
        'isSpam' => @is_spam,
        'created' => @created,
        'createdUserId' => @created_user_id,
        'toBeSent' => @to_be_sent,
        'customerId' => @customer_id,
        'receivedTimeStamp' => @received_time_stamp,
        'openedTimestamp' => @opened_timestamp,
        'viewCount' => @view_count,
        'appEnrollmentId' => @app_enrollment_id,
        'externalEmailId' => @external_email_id,
        'externalThreadId' => @external_thread_id,
        'emailBcc' => @email_bcc,
        'sendType' => @send_type,
        'modified' => @modified,
        'modifiedUserId' => @modified_user_id,
        'responseOriginId' => @response_origin_id,
        'responseOrigin' => @response_origin,
        'notes' => @notes,
        'attachments' => @attachments,
        'customFieldDefinitions' => @custom_field_definitions,
        'customFieldValues' => @custom_field_values,
    }
end

#to_json(*options) ⇒ String

Returns This object converted to a JSON string.

Returns:

  • (String)

    This object converted to a JSON string



238
239
240
# File 'lib/lockstep_sdk/models/email_model.rb', line 238

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