Class: GetStream::Generated::Models::Attachment
- 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
- #actions ⇒ Array<Action>
- #asset_url ⇒ String
- #author_icon ⇒ String
- #author_link ⇒ String
- #author_name ⇒ String
- #color ⇒ String
- #custom ⇒ Object
- #fallback ⇒ String
- #fields ⇒ Array<Field>
- #footer ⇒ String
- #footer_icon ⇒ String
- #giphy ⇒ Images
- #image_url ⇒ String
- #og_scrape_url ⇒ String
- #original_height ⇒ Integer
- #original_width ⇒ Integer
- #pretext ⇒ String
- #text ⇒ String
- #thumb_url ⇒ String
- #title ⇒ String
- #title_link ⇒ String
-
#type ⇒ String
Attachment type (e.g. image, video, url).
Class Method Summary collapse
-
.json_field_mappings ⇒ Object
Override field mappings for JSON serialization.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Attachment
constructor
Initialize with attributes.
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 = attributes[:author_icon] || attributes['author_icon'] || nil = attributes[:author_link] || attributes['author_link'] || nil = attributes[:author_name] || attributes['author_name'] || nil @color = attributes[:color] || attributes['color'] || nil @fallback = attributes[:fallback] || attributes['fallback'] || nil = attributes[:footer] || attributes['footer'] || nil = 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>
71 72 73 |
# File 'lib/getstream_ruby/generated/models/attachment.rb', line 71 def actions @actions end |
#asset_url ⇒ String
17 18 19 |
# File 'lib/getstream_ruby/generated/models/attachment.rb', line 17 def asset_url @asset_url end |
#author_icon ⇒ String
20 21 22 |
# File 'lib/getstream_ruby/generated/models/attachment.rb', line 20 def end |
#author_link ⇒ String
23 24 25 |
# File 'lib/getstream_ruby/generated/models/attachment.rb', line 23 def end |
#author_name ⇒ String
26 27 28 |
# File 'lib/getstream_ruby/generated/models/attachment.rb', line 26 def end |
#color ⇒ String
29 30 31 |
# File 'lib/getstream_ruby/generated/models/attachment.rb', line 29 def color @color end |
#custom ⇒ Object
14 15 16 |
# File 'lib/getstream_ruby/generated/models/attachment.rb', line 14 def custom @custom end |
#fallback ⇒ String
32 33 34 |
# File 'lib/getstream_ruby/generated/models/attachment.rb', line 32 def fallback @fallback end |
#fields ⇒ Array<Field>
74 75 76 |
# File 'lib/getstream_ruby/generated/models/attachment.rb', line 74 def fields @fields end |
#footer ⇒ String
35 36 37 |
# File 'lib/getstream_ruby/generated/models/attachment.rb', line 35 def end |
#footer_icon ⇒ String
38 39 40 |
# File 'lib/getstream_ruby/generated/models/attachment.rb', line 38 def end |
#giphy ⇒ Images
77 78 79 |
# File 'lib/getstream_ruby/generated/models/attachment.rb', line 77 def giphy @giphy end |
#image_url ⇒ String
41 42 43 |
# File 'lib/getstream_ruby/generated/models/attachment.rb', line 41 def image_url @image_url end |
#og_scrape_url ⇒ 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
47 48 49 |
# File 'lib/getstream_ruby/generated/models/attachment.rb', line 47 def original_height @original_height end |
#original_width ⇒ Integer
50 51 52 |
# File 'lib/getstream_ruby/generated/models/attachment.rb', line 50 def original_width @original_width end |
#pretext ⇒ String
53 54 55 |
# File 'lib/getstream_ruby/generated/models/attachment.rb', line 53 def pretext @pretext end |
#text ⇒ String
56 57 58 |
# File 'lib/getstream_ruby/generated/models/attachment.rb', line 56 def text @text end |
#thumb_url ⇒ String
59 60 61 |
# File 'lib/getstream_ruby/generated/models/attachment.rb', line 59 def thumb_url @thumb_url end |
#title ⇒ String
62 63 64 |
# File 'lib/getstream_ruby/generated/models/attachment.rb', line 62 def title @title end |
#title_link ⇒ String
65 66 67 |
# File 'lib/getstream_ruby/generated/models/attachment.rb', line 65 def title_link @title_link end |
#type ⇒ String
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 |