# global_miles_airline_api
#
# This file was automatically generated by APIMATIC v2.0
# ( https://apimatic.io ).

require_relative 'response'

module GlobalMilesAirlineApi
  # MemberSearchResponse Model.
  class MemberSearchResponse < Response
    # Type of tiers.
    # @return [TierTypeEnum]
    attr_accessor :tier_type

    # Value of current miles.
    # @return [Integer]
    attr_accessor :base_miles

    # Value of status miles.
    # @return [Integer]
    attr_accessor :promo_miles

    # A mapping from model property names to API property names.
    def self.names
      @_hash = {} if @_hash.nil?
      @_hash['tier_type'] = 'tier_type'
      @_hash['base_miles'] = 'base_miles'
      @_hash['promo_miles'] = 'promo_miles'
      @_hash = super().merge(@_hash)
      @_hash
    end

    def initialize(tier_type = nil,
                   base_miles = nil,
                   promo_miles = nil,
                   status = nil,
                   message = nil)
      @tier_type = tier_type
      @base_miles = base_miles
      @promo_miles = promo_miles

      # Call the constructor of the base class
      super(status,
            message)
    end

    # Creates an instance of the object from a hash.
    def self.from_hash(hash)
      return nil unless hash

      # Extract variables from the hash.
      tier_type = hash['tier_type']
      base_miles = hash['base_miles']
      promo_miles = hash['promo_miles']
      status = hash['status']
      message = hash['message']

      # Create object from extracted values.
      MemberSearchResponse.new(tier_type,
                               base_miles,
                               promo_miles,
                               status,
                               message)
    end
  end
end
