Class: GetStream::Generated::Models::Attachment

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

Overview

An attachment is a message object that represents a file uploaded by a user.

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 = {}) ⇒ Attachment

Initialize with attributes



80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/getstream_ruby/generated/models/attachment.rb', line 80

def initialize(attributes = {})
  super(attributes)
  @custom = attributes[:custom] || attributes['custom']
  @asset_url = attributes[:asset_url] || attributes['asset_url'] || nil
  @author_icon = attributes[:author_icon] || attributes['author_icon'] || nil
  @author_link = attributes[:author_link] || attributes['author_link'] || nil
  @author_name = attributes[:author_name] || attributes['author_name'] || nil
  @color = attributes[:color] || attributes['color'] || nil
  @fallback = attributes[:fallback] || attributes['fallback'] || nil
  @footer = attributes[:footer] || attributes['footer'] || nil
  @footer_icon = attributes[:footer_icon] || attributes['footer_icon'] || nil
  @image_url = attributes[:image_url] || attributes['image_url'] || nil
  @og_scrape_url = attributes[:og_scrape_url] || attributes['og_scrape_url'] || nil
  @original_height = attributes[:original_height] || attributes['original_height'] || nil
  @original_width = attributes[:original_width] || attributes['original_width'] || nil
  @pretext = attributes[:pretext] || attributes['pretext'] || nil
  @text = attributes[:text] || attributes['text'] || nil
  @thumb_url = attributes[:thumb_url] || attributes['thumb_url'] || nil
  @title = attributes[:title] || attributes['title'] || nil
  @title_link = attributes[:title_link] || attributes['title_link'] || nil
  @type = attributes[:type] || attributes['type'] || nil
  @actions = attributes[:actions] || attributes['actions'] || nil
  @fields = attributes[:fields] || attributes['fields'] || nil
  @giphy = attributes[:giphy] || attributes['giphy'] || nil
end

Instance Attribute Details

#actions ⇒ Array<Action>

Returns:



71
72
73
# File 'lib/getstream_ruby/generated/models/attachment.rb', line 71

def actions
  @actions
end

#asset_url ⇒ String

Returns:

  • (String)


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

def asset_url
  @asset_url
end

#author_icon ⇒ String

Returns:

  • (String)


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

def author_icon
  @author_icon
end

Returns:

  • (String)


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

def author_link
  @author_link
end

#author_name ⇒ String

Returns:

  • (String)


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

def author_name
  @author_name
end

#color ⇒ String

Returns:

  • (String)


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

def color
  @color
end

#custom ⇒ Object

Returns:

  • (Object)


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

def custom
  @custom
end

#fallback ⇒ String

Returns:

  • (String)


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

def fallback
  @fallback
end

#fields ⇒ Array<Field>

Returns:



74
75
76
# File 'lib/getstream_ruby/generated/models/attachment.rb', line 74

def fields
  @fields
end

Returns:

  • (String)


35
36
37
# File 'lib/getstream_ruby/generated/models/attachment.rb', line 35

def footer
  @footer
end

Returns:

  • (String)


38
39
40
# File 'lib/getstream_ruby/generated/models/attachment.rb', line 38

def footer_icon
  @footer_icon
end

#giphy ⇒ Images

Returns:



77
78
79
# File 'lib/getstream_ruby/generated/models/attachment.rb', line 77

def giphy
  @giphy
end

#image_url ⇒ String

Returns:

  • (String)


41
42
43
# File 'lib/getstream_ruby/generated/models/attachment.rb', line 41

def image_url
  @image_url
end

#og_scrape_url ⇒ String

Returns:

  • (String)


44
45
46
# File 'lib/getstream_ruby/generated/models/attachment.rb', line 44

def og_scrape_url
  @og_scrape_url
end

#original_height ⇒ Integer

Returns:

  • (Integer)


47
48
49
# File 'lib/getstream_ruby/generated/models/attachment.rb', line 47

def original_height
  @original_height
end

#original_width ⇒ Integer

Returns:

  • (Integer)


50
51
52
# File 'lib/getstream_ruby/generated/models/attachment.rb', line 50

def original_width
  @original_width
end

#pretext ⇒ String

Returns:

  • (String)


53
54
55
# File 'lib/getstream_ruby/generated/models/attachment.rb', line 53

def pretext
  @pretext
end

#text ⇒ String

Returns:

  • (String)


56
57
58
# File 'lib/getstream_ruby/generated/models/attachment.rb', line 56

def text
  @text
end

#thumb_url ⇒ String

Returns:

  • (String)


59
60
61
# File 'lib/getstream_ruby/generated/models/attachment.rb', line 59

def thumb_url
  @thumb_url
end

#title ⇒ String

Returns:

  • (String)


62
63
64
# File 'lib/getstream_ruby/generated/models/attachment.rb', line 62

def title
  @title
end

Returns:

  • (String)


65
66
67
# File 'lib/getstream_ruby/generated/models/attachment.rb', line 65

def title_link
  @title_link
end

#type ⇒ String

Returns Attachment type (e.g. image, video, url).

Returns:

  • (String) —

    Attachment type (e.g. image, video, url)



68
69
70
# File 'lib/getstream_ruby/generated/models/attachment.rb', line 68

def type
  @type
end

Class Method Details

.json_field_mappings ⇒ Object

Override field mappings for JSON serialization



107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# File 'lib/getstream_ruby/generated/models/attachment.rb', line 107

def self.json_field_mappings
  {
    custom: 'custom',
    asset_url: 'asset_url',
    author_icon: 'author_icon',
    author_link: 'author_link',
    author_name: 'author_name',
    color: 'color',
    fallback: 'fallback',
    footer: 'footer',
    footer_icon: 'footer_icon',
    image_url: 'image_url',
    og_scrape_url: 'og_scrape_url',
    original_height: 'original_height',
    original_width: 'original_width',
    pretext: 'pretext',
    text: 'text',
    thumb_url: 'thumb_url',
    title: 'title',
    title_link: 'title_link',
    type: 'type',
    actions: 'actions',
    fields: 'fields',
    giphy: 'giphy'
  }
end