class Line::Bot::V2::Webhook::ScenarioResult
@see developers.line.biz/en/reference/messaging-api/#scenario-result-event
Attributes
@!attribute [rw] action_results
@return [Array[ActionResult],nil] Execution result of individual operations specified in action. Only included when things.result.resultCode is success.
@!attribute [rw] ble_notification_payload
@return [String,nil] Data contained in notification.
@!attribute [rw] end_time
@return [Integer] Timestamp for when execution of scenario was completed (milliseconds, LINE app time)
@!attribute [rw] error_reason
@return [String,nil] Error reason.
@!attribute [rw] result_code
@return [String] Scenario execution completion status
@!attribute [rw] revision
@return [Integer,nil] Revision number of the scenario set containing the executed scenario
@!attribute [rw] scenario_id
@return [String,nil] Scenario ID executed
@!attribute [rw] start_time
@return [Integer] Timestamp for when execution of scenario action started (milliseconds, LINE app time)
Public Class Methods
Source
# File lib/line/bot/v2/webhook/model/scenario_result.rb, line 92 def self.create(args) # steep:ignore symbolized_args = Line::Bot::V2::Utils.deep_symbolize(args) return new(**symbolized_args) # steep:ignore end
Create an instance of the class from a hash @param args [Hash] Hash containing all the required attributes @return [Line::Bot::V2::Webhook::ScenarioResult] Instance of the class
Source
# File lib/line/bot/v2/webhook/model/scenario_result.rb, line 49 def initialize( scenario_id: nil, revision: nil, start_time:, end_time:, result_code:, action_results: nil, ble_notification_payload: nil, error_reason: nil, **dynamic_attributes ) @scenario_id = scenario_id @revision = revision @start_time = start_time @end_time = end_time @result_code = result_code @action_results = action_results&.map do |item| if item.is_a?(Hash) Line::Bot::V2::Webhook::ActionResult.create(**item) # steep:ignore InsufficientKeywordArguments else item end end @ble_notification_payload = ble_notification_payload @error_reason = error_reason 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
@param scenario_id
[String,nil] Scenario ID executed @param revision [Integer,nil] Revision number of the scenario set containing the executed scenario @param start_time
[Integer] Timestamp for when execution of scenario action started (milliseconds, LINE app time) @param end_time
[Integer] Timestamp for when execution of scenario was completed (milliseconds, LINE app time) @param result_code
[String] Scenario execution completion status @param action_results
[Array[ActionResult, Hash[Symbol, untyped]],nil] Execution result of individual operations specified in action. Only included when things.result.resultCode is success. @param ble_notification_payload
[String,nil] Data contained in notification. @param error_reason
[String,nil] Error reason.
Public Instance Methods
Source
# File lib/line/bot/v2/webhook/model/scenario_result.rb, line 99 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
@param other [Object] Object to compare @return [Boolean] true if the objects are equal, false otherwise
Source
# File lib/line/bot/v2/webhook/model/scenario_result.rb, line 108 def hash [self.class, *instance_variables.map { |var| instance_variable_get(var) }].hash end
@return [Integer] Hash code of the object