Class: GetStream::Generated::Models::NotificationTarget

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/getstream_ruby/generated/models/notification_target.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#==, #inspect, omit_empty_fields, #to_h, #to_json

Constructor Details

#initialize(attributes = {}) ⇒ NotificationTarget

Initialize with attributes



35
36
37
38
39
40
41
42
43
44
# File 'lib/getstream_ruby/generated/models/notification_target.rb', line 35

def initialize(attributes = {})
  super(attributes)
  @id = attributes[:id] || attributes['id']
  @name = attributes[:name] || attributes['name'] || nil
  @text = attributes[:text] || attributes['text'] || nil
  @type = attributes[:type] || attributes['type'] || nil
  @user_id = attributes[:user_id] || attributes['user_id'] || nil
  @attachments = attributes[:attachments] || attributes['attachments'] || nil
  @comment = attributes[:comment] || attributes['comment'] || nil
end

Instance Attribute Details

#attachmentsArray<Attachment>

Returns Attachments on the target activity (for activity targets).

Returns:

  • (Array<Attachment>)

    Attachments on the target activity (for activity targets)



29
30
31
# File 'lib/getstream_ruby/generated/models/notification_target.rb', line 29

def attachments
  @attachments
end

#commentNotificationComment

Returns:



32
33
34
# File 'lib/getstream_ruby/generated/models/notification_target.rb', line 32

def comment
  @comment
end

#idString

Returns The ID of the target (activity ID or user ID).

Returns:

  • (String)

    The ID of the target (activity ID or user ID)



14
15
16
# File 'lib/getstream_ruby/generated/models/notification_target.rb', line 14

def id
  @id
end

#nameString

Returns The name of the target user (for user targets like follows).

Returns:

  • (String)

    The name of the target user (for user targets like follows)



17
18
19
# File 'lib/getstream_ruby/generated/models/notification_target.rb', line 17

def name
  @name
end

#textString

Returns The text content of the target activity (for activity targets).

Returns:

  • (String)

    The text content of the target activity (for activity targets)



20
21
22
# File 'lib/getstream_ruby/generated/models/notification_target.rb', line 20

def text
  @text
end

#typeString

Returns The type of the target activity (for activity targets).

Returns:

  • (String)

    The type of the target activity (for activity targets)



23
24
25
# File 'lib/getstream_ruby/generated/models/notification_target.rb', line 23

def type
  @type
end

#user_idString

Returns The ID of the user who created the target activity (for activity targets).

Returns:

  • (String)

    The ID of the user who created the target activity (for activity targets)



26
27
28
# File 'lib/getstream_ruby/generated/models/notification_target.rb', line 26

def user_id
  @user_id
end

Class Method Details

.json_field_mappingsObject

Override field mappings for JSON serialization



47
48
49
50
51
52
53
54
55
56
57
# File 'lib/getstream_ruby/generated/models/notification_target.rb', line 47

def self.json_field_mappings
  {
    id: 'id',
    name: 'name',
    text: 'text',
    type: 'type',
    user_id: 'user_id',
    attachments: 'attachments',
    comment: 'comment'
  }
end