require 'App42Response.rb' module App42 module AppTab # # # This Usage object is the value object which contains the properties of Usage # along with the setter & getter for those properties. # # class Usage < App42Response attr_accessor :levelList, :oneTimeList, :featureList, :bandwidthList, :storageList, :timeList, :customList @levelList = Array.new @oneTimeList = Array.new @featureList = Array.new @bandwidthList = Array.new @storageList = Array.new @timeList = Array.new # @customList = Array.new end class Level attr_accessor :name, :price, :currency, :state, :description, :user @name @price @currency @state @description @user # # This is a constructor that takes no parameter # def initialize(usage) usage.levelList.push(self) end # # Returns the Usage Response in JSON format. # # @return the response in JSON format. # def to_s return "Name : #{@name}" + "Price : #{@price}" + "Currency : #{@currency}" + "State : #{@state}" + "Description : #{@description}"; end end class OneTime attr_accessor :name, :price, :currency, :state,:description,:user @name @price @currency @state @description @user # # This is a constructor that takes no parameter # def initialize(usage) usage.oneTimeList.push(self) end # # Returns the Usage Response in JSON format. # # @return the response in JSON format. # def to_s return "Name : #{@name}" + "Price : #{@price}" + "Currency : #{@currency}" + "State : #{@state}" + "Description : #{@description}"; end end class Feature attr_accessor :name, :price, :currency, :state,:description,:user @name @price @currency @state @description @user # # This is a constructor that takes no parameter # def initialize(usage) usage.featureList.push(self) end # # Returns the Usage Response in JSON format. # # @return the response in JSON format. # def to_s return "Name : #{@name}" + "Price : #{@price}" + "Currency : #{@currency}" + "State : #{@state}" + "Description : #{@description}"; end end class Bandwidth attr_accessor :name, :bandwidth, :unit, :price, :currency, :state,:description,:user @name @bandwidth @unit @price @currency @state @description @user # # This is a constructor that takes no parameter # def initialize(usage) usage.bandwidthList.push(self) end # # Returns the Usage Response in JSON format. # # @return the response in JSON format. # def to_s return "Name : #{@name}" + "Price : #{@price}" + "Currency : #{@currency}" + "State : #{@state}" + "Description : #{@description}"; end end class Storage attr_accessor :name, :space, :unit, :price, :currency, :state,:description,:user @name @space @unit @price @currency @state @description @user # # This is a constructor that takes no parameter # def initialize(usage) usage.storageList.push(self) end # # Returns the Usage Response in JSON format. # # @return the response in JSON format. # def to_s return "Name : #{@name}" + "Price : #{@price}" + "Currency : #{@currency}" + "State : #{@state}" + "Description : #{@description}"; end end class Time attr_accessor :name, :time, :unit, :price, :currency, :state, :description, :user @name @time @unit @price @currency @state @description @user # # This is a constructor that takes no parameter # def initialize(usage) usage.timeList.push(self) end # # Returns the Usage Response in JSON format. # # @return the response in JSON format. # def to_s return "Name : #{@name}" + "Price : #{@price}" + "Currency : #{@currency}" + "State : #{@state}" + "Description : #{@description}"; end end # class Custom # attr_accessor :name, :type, :unit, :price, :currency, :state, :description, :user # @name # @type # @unit # @price # @currency # @state # @description # @user # def initialize(usage) # usage.customList.push(self) # end # end end end