Class: Line::Bot::V2::Insight::GetMessageEventResponseMessage

Inherits:
Object
  • Object
show all
Defined in:
lib/line/bot/v2/insight/model/get_message_event_response_message.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(seq: nil, impression: nil, media_played: nil, media_played25_percent: nil, media_played50_percent: nil, media_played75_percent: nil, media_played100_percent: nil, unique_media_played: nil, unique_media_played25_percent: nil, unique_media_played50_percent: nil, unique_media_played75_percent: nil, unique_media_played100_percent: nil, **dynamic_attributes) ⇒ GetMessageEventResponseMessage

Returns a new instance of GetMessageEventResponseMessage.

Parameters:

  • seq (Integer, nil) (defaults to: nil)

    Bubble’s serial number.

  • impression (Integer, nil) (defaults to: nil)

    Number of times the bubble was displayed.

  • media_played (Integer, nil) (defaults to: nil)

    Number of times audio or video in the bubble started playing.

  • media_played25_percent (Integer, nil) (defaults to: nil)

    Number of times audio or video in the bubble started playing and was played 25% of the total time.

  • media_played50_percent (Integer, nil) (defaults to: nil)

    Number of times audio or video in the bubble started playing and was played 50% of the total time.

  • media_played75_percent (Integer, nil) (defaults to: nil)

    Number of times audio or video in the bubble started playing and was played 75% of the total time.

  • media_played100_percent (Integer, nil) (defaults to: nil)

    Number of times audio or video in the bubble started playing and was played 100% of the total time.

  • unique_media_played (Integer, nil) (defaults to: nil)

    Number of users that started playing audio or video in the bubble.

  • unique_media_played25_percent (Integer, nil) (defaults to: nil)

    Number of users that started playing audio or video in the bubble and played 25% of the total time.

  • unique_media_played50_percent (Integer, nil) (defaults to: nil)

    Number of users that started playing audio or video in the bubble and played 50% of the total time.

  • unique_media_played75_percent (Integer, nil) (defaults to: nil)

    Number of users that started playing audio or video in the bubble and played 75% of the total time.

  • unique_media_played100_percent (Integer, nil) (defaults to: nil)

    Number of users that started playing audio or video in the bubble and played 100% of the total time.



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
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/line/bot/v2/insight/model/get_message_event_response_message.rb', line 64

def initialize(
  seq: nil,
  impression: nil,
  media_played: nil,
  media_played25_percent: nil,
  media_played50_percent: nil,
  media_played75_percent: nil,
  media_played100_percent: nil,
  unique_media_played: nil,
  unique_media_played25_percent: nil,
  unique_media_played50_percent: nil,
  unique_media_played75_percent: nil,
  unique_media_played100_percent: nil,
  **dynamic_attributes
)
  
  @seq = seq
  @impression = impression
  @media_played = media_played
  @media_played25_percent = media_played25_percent
  @media_played50_percent = media_played50_percent
  @media_played75_percent = media_played75_percent
  @media_played100_percent = media_played100_percent
  @unique_media_played = unique_media_played
  @unique_media_played25_percent = unique_media_played25_percent
  @unique_media_played50_percent = unique_media_played50_percent
  @unique_media_played75_percent = unique_media_played75_percent
  @unique_media_played100_percent = unique_media_played100_percent

  dynamic_attributes.each do |key, value|
    self.class.attr_accessor key

    if value.is_a?(Hash)
      struct_klass = Struct.new(*value.keys.map(&:to_sym))
      struct_values = value.map { |_k, v| v.is_a?(Hash) ? Line::Bot::V2::Utils.hash_to_struct(v) : v }
      instance_variable_set("@#{key}", struct_klass.new(*struct_values))
    else
      instance_variable_set("@#{key}", value)
    end
  end
end

Instance Attribute Details

#impressionInteger?

Returns Number of times the bubble was displayed.

Returns:

  • (Integer, nil)

    Number of times the bubble was displayed.



20
21
22
# File 'lib/line/bot/v2/insight/model/get_message_event_response_message.rb', line 20

def impression
  @impression
end

#media_playedInteger?

Returns Number of times audio or video in the bubble started playing.

Returns:

  • (Integer, nil)

    Number of times audio or video in the bubble started playing.



23
24
25
# File 'lib/line/bot/v2/insight/model/get_message_event_response_message.rb', line 23

def media_played
  @media_played
end

#media_played100_percentInteger?

Returns Number of times audio or video in the bubble started playing and was played 100% of the total time.

Returns:

  • (Integer, nil)

    Number of times audio or video in the bubble started playing and was played 100% of the total time.



35
36
37
# File 'lib/line/bot/v2/insight/model/get_message_event_response_message.rb', line 35

def media_played100_percent
  @media_played100_percent
end

#media_played25_percentInteger?

Returns Number of times audio or video in the bubble started playing and was played 25% of the total time.

Returns:

  • (Integer, nil)

    Number of times audio or video in the bubble started playing and was played 25% of the total time.



26
27
28
# File 'lib/line/bot/v2/insight/model/get_message_event_response_message.rb', line 26

def media_played25_percent
  @media_played25_percent
end

#media_played50_percentInteger?

Returns Number of times audio or video in the bubble started playing and was played 50% of the total time.

Returns:

  • (Integer, nil)

    Number of times audio or video in the bubble started playing and was played 50% of the total time.



29
30
31
# File 'lib/line/bot/v2/insight/model/get_message_event_response_message.rb', line 29

def media_played50_percent
  @media_played50_percent
end

#media_played75_percentInteger?

Returns Number of times audio or video in the bubble started playing and was played 75% of the total time.

Returns:

  • (Integer, nil)

    Number of times audio or video in the bubble started playing and was played 75% of the total time.



32
33
34
# File 'lib/line/bot/v2/insight/model/get_message_event_response_message.rb', line 32

def media_played75_percent
  @media_played75_percent
end

#seqInteger?

Returns Bubble’s serial number.

Returns:

  • (Integer, nil)

    Bubble’s serial number.



17
18
19
# File 'lib/line/bot/v2/insight/model/get_message_event_response_message.rb', line 17

def seq
  @seq
end

#unique_media_playedInteger?

Returns Number of users that started playing audio or video in the bubble.

Returns:

  • (Integer, nil)

    Number of users that started playing audio or video in the bubble.



38
39
40
# File 'lib/line/bot/v2/insight/model/get_message_event_response_message.rb', line 38

def unique_media_played
  @unique_media_played
end

#unique_media_played100_percentInteger?

Returns Number of users that started playing audio or video in the bubble and played 100% of the total time.

Returns:

  • (Integer, nil)

    Number of users that started playing audio or video in the bubble and played 100% of the total time.



50
51
52
# File 'lib/line/bot/v2/insight/model/get_message_event_response_message.rb', line 50

def unique_media_played100_percent
  @unique_media_played100_percent
end

#unique_media_played25_percentInteger?

Returns Number of users that started playing audio or video in the bubble and played 25% of the total time.

Returns:

  • (Integer, nil)

    Number of users that started playing audio or video in the bubble and played 25% of the total time.



41
42
43
# File 'lib/line/bot/v2/insight/model/get_message_event_response_message.rb', line 41

def unique_media_played25_percent
  @unique_media_played25_percent
end

#unique_media_played50_percentInteger?

Returns Number of users that started playing audio or video in the bubble and played 50% of the total time.

Returns:

  • (Integer, nil)

    Number of users that started playing audio or video in the bubble and played 50% of the total time.



44
45
46
# File 'lib/line/bot/v2/insight/model/get_message_event_response_message.rb', line 44

def unique_media_played50_percent
  @unique_media_played50_percent
end

#unique_media_played75_percentInteger?

Returns Number of users that started playing audio or video in the bubble and played 75% of the total time.

Returns:

  • (Integer, nil)

    Number of users that started playing audio or video in the bubble and played 75% of the total time.



47
48
49
# File 'lib/line/bot/v2/insight/model/get_message_event_response_message.rb', line 47

def unique_media_played75_percent
  @unique_media_played75_percent
end

Class Method Details

.create(args) ⇒ Line::Bot::V2::Insight::GetMessageEventResponseMessage

Create an instance of the class from a hash

Parameters:

  • args (Hash)

    Hash containing all the required attributes

Returns:



109
110
111
112
# File 'lib/line/bot/v2/insight/model/get_message_event_response_message.rb', line 109

def self.create(args) # steep:ignore
  symbolized_args = Line::Bot::V2::Utils.deep_symbolize(args)
  return new(**symbolized_args) # steep:ignore
end

Instance Method Details

#==(other) ⇒ Boolean

Returns true if the objects are equal, false otherwise.

Parameters:

  • other (Object)

    Object to compare

Returns:

  • (Boolean)

    true if the objects are equal, false otherwise



116
117
118
119
120
121
122
# File 'lib/line/bot/v2/insight/model/get_message_event_response_message.rb', line 116

def ==(other)
  return false unless self.class == other.class

  instance_variables.all? do |var|
      instance_variable_get(var) == other.instance_variable_get(var)
  end
end

#hashInteger

Returns Hash code of the object.

Returns:

  • (Integer)

    Hash code of the object



125
126
127
# File 'lib/line/bot/v2/insight/model/get_message_event_response_message.rb', line 125

def hash
  [self.class, *instance_variables.map { |var| instance_variable_get(var) }].hash
end