Class: LockstepSdk::ActivityStreamItemModel

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

Overview

Represents an item belonging to the activity stream.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ ActivityStreamItemModel

Initialize the ActivityStreamItemModel using the provided prototype



26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/lockstep_sdk/models/activity_stream_item_model.rb', line 26

def initialize(params = {})
    @object_key = params.dig(:object_key)
    @activity_stream_type = params.dig(:activity_stream_type)
    @text_value = params.dig(:text_value)
    @created = params.dig(:created)
    @created_user_id = params.dig(:created_user_id)
    @group_key = params.dig(:group_key)
    @from_email_address = params.dig(:from_email_address)
    @to_email_address = params.dig(:to_email_address)
    @from_contact_name = params.dig(:from_contact_name)
    @to_contact_name = params.dig(:to_contact_name)
end

Instance Attribute Details

#activity_stream_typeString

Returns The type code of the activity stream item.

Returns:

  • (String)

    The type code of the activity stream item.



42
43
44
# File 'lib/lockstep_sdk/models/activity_stream_item_model.rb', line 42

def activity_stream_type
  @activity_stream_type
end

#createdDate-time

Returns The date on which this activity stream item was created.

Returns:

  • (Date-time)

    The date on which this activity stream item was created.



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

def created
  @created
end

#created_user_idUuid

Returns The ID of the user who created this activity.

Returns:

  • (Uuid)

    The ID of the user who created this activity.



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

def created_user_id
  @created_user_id
end

#from_contact_nameString

Returns The name of the contact sending the activity otherwise null.

Returns:

  • (String)

    The name of the contact sending the activity otherwise null.



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

def from_contact_name
  @from_contact_name
end

#from_email_addressString

Returns The sender's email address if activity stream item is an Email.

Returns:

  • (String)

    The sender's email address if activity stream item is an Email.



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

def from_email_address
  @from_email_address
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/activity_stream_item_model.rb', line 50

def group_key
  @group_key
end

#object_keyUuid

Returns The object key of the activity stream item.

Returns:

  • (Uuid)

    The object key of the activity stream item.



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

def object_key
  @object_key
end

#text_valueString

Returns The text body description for this Activity Stream Item.

Returns:

  • (String)

    The text body description for this Activity Stream Item.



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

def text_value
  @text_value
end

#to_contact_nameString

Returns The name of the contact sending the activity otherwise null.

Returns:

  • (String)

    The name of the contact sending the activity otherwise null.



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

def to_contact_name
  @to_contact_name
end

#to_email_addressString

Returns The recipient's email address if activity stream item is an Email.

Returns:

  • (String)

    The recipient's email address if activity stream item is an Email.



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

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



61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/lockstep_sdk/models/activity_stream_item_model.rb', line 61

def as_json(options={})
    {
        'objectKey' => @object_key,
        'activityStreamType' => @activity_stream_type,
        'textValue' => @text_value,
        'created' => @created,
        'createdUserId' => @created_user_id,
        'groupKey' => @group_key,
        'fromEmailAddress' => @from_email_address,
        'toEmailAddress' => @to_email_address,
        'fromContactName' => @from_contact_name,
        'toContactName' => @to_contact_name,
    }
end

#to_json(*options) ⇒ String

Returns This object converted to a JSON string.

Returns:

  • (String)

    This object converted to a JSON string



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

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