Class: GetStream::Generated::Models::ReactionRequest
- Defined in:
- lib/getstream_ruby/generated/models/reaction_request.rb
Overview
Represents user reaction to a message
Instance Attribute Summary collapse
-
#created_at ⇒ DateTime
Date/time of creation.
- #custom ⇒ Object
-
#score ⇒ Integer
Reaction score.
-
#type ⇒ String
The type of reaction (e.g. 'like', 'laugh', 'wow').
-
#updated_at ⇒ DateTime
Date/time of the last update.
-
#user ⇒ UserRequest
User request object.
- #user_id ⇒ String
Class Method Summary collapse
-
.json_field_mappings ⇒ Object
Override field mappings for JSON serialization.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ ReactionRequest
constructor
Initialize with attributes.
Methods inherited from BaseModel
#==, #inspect, omit_empty_fields, #to_h, #to_json
Constructor Details
#initialize(attributes = {}) ⇒ ReactionRequest
Initialize with attributes
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/getstream_ruby/generated/models/reaction_request.rb', line 35 def initialize(attributes = {}) super(attributes) @type = attributes.fetch(:type) { attributes.fetch('type', nil) } @created_at = attributes.fetch(:created_at) { attributes.fetch('created_at', nil) } @score = attributes.fetch(:score) { attributes.fetch('score', nil) } @updated_at = attributes.fetch(:updated_at) { attributes.fetch('updated_at', nil) } @user_id = attributes.fetch(:user_id) { attributes.fetch('user_id', nil) } @custom = attributes.fetch(:custom) { attributes.fetch('custom', nil) } @user = attributes.fetch(:user) { attributes.fetch('user', nil) } end |
Instance Attribute Details
#created_at ⇒ DateTime
Returns Date/time of creation.
17 18 19 |
# File 'lib/getstream_ruby/generated/models/reaction_request.rb', line 17 def created_at @created_at end |
#custom ⇒ Object
29 30 31 |
# File 'lib/getstream_ruby/generated/models/reaction_request.rb', line 29 def custom @custom end |
#score ⇒ Integer
Returns Reaction score. If not specified reaction has score of 1.
20 21 22 |
# File 'lib/getstream_ruby/generated/models/reaction_request.rb', line 20 def score @score end |
#type ⇒ String
Returns The type of reaction (e.g. 'like', 'laugh', 'wow').
14 15 16 |
# File 'lib/getstream_ruby/generated/models/reaction_request.rb', line 14 def type @type end |
#updated_at ⇒ DateTime
Returns Date/time of the last update.
23 24 25 |
# File 'lib/getstream_ruby/generated/models/reaction_request.rb', line 23 def updated_at @updated_at end |
#user ⇒ UserRequest
Returns User request object.
32 33 34 |
# File 'lib/getstream_ruby/generated/models/reaction_request.rb', line 32 def user @user end |
#user_id ⇒ String
26 27 28 |
# File 'lib/getstream_ruby/generated/models/reaction_request.rb', line 26 def user_id @user_id end |
Class Method Details
.json_field_mappings ⇒ Object
Override field mappings for JSON serialization
47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/getstream_ruby/generated/models/reaction_request.rb', line 47 def self.json_field_mappings { type: 'type', created_at: 'created_at', score: 'score', updated_at: 'updated_at', user_id: 'user_id', custom: 'custom', user: 'user' } end |