lib/moneykit/models/security_response.rb in moneykit-0.1.6 vs lib/moneykit/models/security_response.rb in moneykit-0.1.9

- old
+ new

@@ -14,11 +14,11 @@ require 'time' module MoneyKit class SecurityResponse # A unique MoneyKit ID for this security. - attr_accessor :id + attr_accessor :security_id # A user-facing name for this security. attr_accessor :name # The type of this security. Will be one of: <p>`cash`: Cash, currency, and money market funds <p>`crypto`: Digital or virtual currencies <p>`derivative`: Options, warrants, and other derivative instruments <p>`equity`: Equities (stocks) <p>`etf`: Exchange-traded investment funds <p>`bond`: Bonds and certificates of deposit (CDs) <p>`loan`: Loans and loan receivables <p>`fund`: Open- and closed-end vehicles pooling funds of multiple investors <p>`unknown`: Indicates the type is unknown or does not fit into any other category @@ -43,11 +43,11 @@ attr_accessor :close_date # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'id' => :'id', + :'security_id' => :'security_id', :'name' => :'name', :'type' => :'type', :'currency' => :'currency', :'ticker' => :'ticker', :'isin' => :'isin', @@ -63,11 +63,11 @@ end # Attribute type mapping. def self.openapi_types { - :'id' => :'String', + :'security_id' => :'String', :'name' => :'String', :'type' => :'String', :'currency' => :'String', :'ticker' => :'String', :'isin' => :'String', @@ -96,14 +96,14 @@ fail ArgumentError, "`#{k}` is not a valid attribute in `MoneyKit::SecurityResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'id') - self.id = attributes[:'id'] + if attributes.key?(:'security_id') + self.security_id = attributes[:'security_id'] else - self.id = nil + self.security_id = nil end if attributes.key?(:'name') self.name = attributes[:'name'] else @@ -146,12 +146,12 @@ # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') + if @security_id.nil? + invalid_properties.push('invalid value for "security_id", security_id cannot be nil.') end if @name.nil? invalid_properties.push('invalid value for "name", name cannot be nil.') end @@ -169,11 +169,11 @@ # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - return false if @id.nil? + return false if @security_id.nil? return false if @name.nil? return false if @type.nil? return false if @currency.nil? true end @@ -181,11 +181,11 @@ # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && - id == o.id && + security_id == o.security_id && name == o.name && type == o.type && currency == o.currency && ticker == o.ticker && isin == o.isin && @@ -201,10 +201,10 @@ end # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, name, type, currency, ticker, isin, sedol, close_price, close_date].hash + [security_id, name, type, currency, ticker, isin, sedol, close_price, close_date].hash end # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself