# Webhook Type Definition
# Webhook event definition of the LINE Messaging API
#
# The version of the OpenAPI document: 1.0.0
#
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
# https://openapi-generator.tech
# Do not edit the class manually.

require_relative './message_content'

module Line
  module Bot
    module V2
      module Webhook
        # @see https://developers.line.biz/en/reference/messaging-api/#wh-sticker
        class StickerMessageContent < MessageContent
          # @!attribute [r] type
          #   @return [String] Type
          attr_reader :type
          # @!attribute [rw] id
          #   @return [String] Message ID
          attr_accessor :id
          # @!attribute [rw] package_id
          #   @return [String] Package ID
          attr_accessor :package_id
          # @!attribute [rw] sticker_id
          #   @return [String] Sticker ID
          attr_accessor :sticker_id
          # @!attribute [rw] sticker_resource_type
          #   @return [String] ('STATIC'|'ANIMATION'|'SOUND'|'ANIMATION_SOUND'|'POPUP'|'POPUP_SOUND'|'CUSTOM'|'MESSAGE'|'NAME_TEXT'|'PER_STICKER_TEXT') 
          attr_accessor :sticker_resource_type
          # @!attribute [rw] keywords
          #   @return [Array[String],nil] Array of up to 15 keywords describing the sticker. If a sticker has 16 or more keywords, a random selection of 15 keywords will be returned. The keyword selection is random for each event, so different keywords may be returned for the same sticker. 
          attr_accessor :keywords
          # @!attribute [rw] text
          #   @return [String,nil] Any text entered by the user. This property is only included for message stickers. Max character limit: 100 
          attr_accessor :text
          # @!attribute [rw] quote_token
          #   @return [String] Quote token to quote this message. 
          attr_accessor :quote_token
          # @!attribute [rw] quoted_message_id
          #   @return [String,nil] Message ID of a quoted message. Only included when the received message quotes a past message.  
          attr_accessor :quoted_message_id

          # @param id [String] Message ID
          # @param package_id [String] Package ID
          # @param sticker_id [String] Sticker ID
          # @param sticker_resource_type [String] ('STATIC'|'ANIMATION'|'SOUND'|'ANIMATION_SOUND'|'POPUP'|'POPUP_SOUND'|'CUSTOM'|'MESSAGE'|'NAME_TEXT'|'PER_STICKER_TEXT') 
          # @param keywords [Array[String],nil] Array of up to 15 keywords describing the sticker. If a sticker has 16 or more keywords, a random selection of 15 keywords will be returned. The keyword selection is random for each event, so different keywords may be returned for the same sticker. 
          # @param text [String,nil] Any text entered by the user. This property is only included for message stickers. Max character limit: 100 
          # @param quote_token [String] Quote token to quote this message. 
          # @param quoted_message_id [String,nil] Message ID of a quoted message. Only included when the received message quotes a past message.  
          def initialize(
            id:,
            package_id:,
            sticker_id:,
            sticker_resource_type:,
            keywords: nil,
            text: nil,
            quote_token:,
            quoted_message_id: nil,
            **dynamic_attributes
          )
            @type = "sticker"
            
            @id = id
            @package_id = package_id
            @sticker_id = sticker_id
            @sticker_resource_type = sticker_resource_type
            @keywords = keywords
            @text = text
            @quote_token = quote_token
            @quoted_message_id = quoted_message_id

            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

          # Create an instance of the class from a hash
          # @param args [Hash] Hash containing all the required attributes
          # @return [Line::Bot::V2::Webhook::StickerMessageContent] Instance of the class
          def self.create(args) # steep:ignore
            symbolized_args = Line::Bot::V2::Utils.deep_symbolize(args)
            return new(**symbolized_args) # steep:ignore
          end

          # @param other [Object] Object to compare
          # @return [Boolean] true if the objects are equal, false otherwise
          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

          # @return [Integer] Hash code of the object
          def hash
            [self.class, *instance_variables.map { |var| instance_variable_get(var) }].hash
          end
        end
      end
    end
  end
end
