class SimplyRetsClient::Property
Attributes
Additional room information
Square footage of the building associated with a listing
Number of full bathrooms
Number of half bathrooms
Number of bedrooms
The materials that were used in the construction of the property.
A description of the cooling or air conditioning features of the property.
Exterior Features for the listing
Number of fireplaces
The type(s) of flooring found within the property.
Number of garage spaces
Heating description or short string
The properties interior features
Lot size dimensions or square footage as a text. This field is generally used to show the pretty formatted lot size.
Lot size in acres **Added on 2016/05/04 - Not available for all RETS vendors**
The total area of the lot. See ‘lotSizeUnits` for the units of measurement (Square Feet, Square Meters, Acres, etc.). **Added on 2016/05/04 - Not available for all RETS vendors**
Unit of measurement for the lotSizeArea field. e.g. Square Feet, Square Meters, Acres, etc. If this field is ‘null` the units is the default unit of measure specified by your RETS provider. **Added on 2016/05/04 - Not available for all RETS vendors**
Yearly maintenance expense
Property
roof description
Number of stories or levels. Represented as a ‘double’ to account for half stories.
Property
style description or short string
The property’s sub-type, i.e. SingleFamilyResidential, Condo, etc. Or a list of Sub Types for Mobile, such as Expando, Manufactured, Modular, etc.
The subdivision or community name
Abbreviated property type. RES is Residential, CND is CondoOrTownhome, RNT is Rental, MLF is Multi-Family, CRE is Commercial, LND is Land, FRM is Farm. See the ‘propertySubType` field for more information.
View details and description
Water description and details
Year the property was built
Public Class Methods
Attribute mapping from ruby-style variable name to JSON key.
# File lib/simplyrets/models/property.rb, line 151 def self.attribute_map { :'roof' => :'roof', :'cooling' => :'cooling', :'style' => :'style', :'area' => :'area', :'baths_full' => :'bathsFull', :'baths_half' => :'bathsHalf', :'stories' => :'stories', :'fireplaces' => :'fireplaces', :'flooring' => :'flooring', :'heating' => :'heating', :'foundation' => :'foundation', :'pool_features' => :'poolFeatures', :'laundry_features' => :'laundryFeatures', :'occupant_name' => :'occupantName', :'lot_description' => :'lotDescription', :'lot_size_acres' => :'lotSizeAcres', :'sub_type' => :'subType', :'bedrooms' => :'bedrooms', :'interior_features' => :'interiorFeatures', :'lot_size' => :'lotSize', :'area_source' => :'areaSource', :'maintenance_expense' => :'maintenanceExpense', :'additional_rooms' => :'additionalRooms', :'exterior_features' => :'exteriorFeatures', :'water' => :'water', :'view' => :'view', :'lot_size_area' => :'lotSizeArea', :'subdivision' => :'subdivision', :'construction' => :'construction', :'parking' => :'parking', :'lot_size_area_units' => :'lotSizeAreaUnits', :'type' => :'type', :'garage_spaces' => :'garageSpaces', :'accessibility' => :'accessibility', :'occupant_type' => :'occupantType', :'year_built' => :'yearBuilt' } end
Initializes the object @param [Hash] attributes Model attributes in the form of hash
# File lib/simplyrets/models/property.rb, line 236 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} if attributes.has_key?(:'roof') self.roof = attributes[:'roof'] end if attributes.has_key?(:'cooling') self.cooling = attributes[:'cooling'] end if attributes.has_key?(:'style') self.style = attributes[:'style'] end if attributes.has_key?(:'area') self.area = attributes[:'area'] end if attributes.has_key?(:'bathsFull') self.baths_full = attributes[:'bathsFull'] end if attributes.has_key?(:'bathsHalf') self.baths_half = attributes[:'bathsHalf'] end if attributes.has_key?(:'stories') self.stories = attributes[:'stories'] end if attributes.has_key?(:'fireplaces') self.fireplaces = attributes[:'fireplaces'] end if attributes.has_key?(:'flooring') self.flooring = attributes[:'flooring'] end if attributes.has_key?(:'heating') self.heating = attributes[:'heating'] end if attributes.has_key?(:'foundation') self.foundation = attributes[:'foundation'] end if attributes.has_key?(:'poolFeatures') self.pool_features = attributes[:'poolFeatures'] end if attributes.has_key?(:'laundryFeatures') self.laundry_features = attributes[:'laundryFeatures'] end if attributes.has_key?(:'occupantName') self.occupant_name = attributes[:'occupantName'] end if attributes.has_key?(:'lotDescription') self.lot_description = attributes[:'lotDescription'] end if attributes.has_key?(:'lotSizeAcres') self.lot_size_acres = attributes[:'lotSizeAcres'] end if attributes.has_key?(:'subType') self.sub_type = attributes[:'subType'] end if attributes.has_key?(:'bedrooms') self.bedrooms = attributes[:'bedrooms'] end if attributes.has_key?(:'interiorFeatures') self.interior_features = attributes[:'interiorFeatures'] end if attributes.has_key?(:'lotSize') self.lot_size = attributes[:'lotSize'] end if attributes.has_key?(:'areaSource') self.area_source = attributes[:'areaSource'] end if attributes.has_key?(:'maintenanceExpense') self.maintenance_expense = attributes[:'maintenanceExpense'] end if attributes.has_key?(:'additionalRooms') self.additional_rooms = attributes[:'additionalRooms'] end if attributes.has_key?(:'exteriorFeatures') self.exterior_features = attributes[:'exteriorFeatures'] end if attributes.has_key?(:'water') self.water = attributes[:'water'] end if attributes.has_key?(:'view') self.view = attributes[:'view'] end if attributes.has_key?(:'lotSizeArea') self.lot_size_area = attributes[:'lotSizeArea'] end if attributes.has_key?(:'subdivision') self.subdivision = attributes[:'subdivision'] end if attributes.has_key?(:'construction') self.construction = attributes[:'construction'] end if attributes.has_key?(:'parking') self.parking = attributes[:'parking'] end if attributes.has_key?(:'lotSizeAreaUnits') self.lot_size_area_units = attributes[:'lotSizeAreaUnits'] end if attributes.has_key?(:'type') self.type = attributes[:'type'] end if attributes.has_key?(:'garageSpaces') self.garage_spaces = attributes[:'garageSpaces'] end if attributes.has_key?(:'accessibility') self.accessibility = attributes[:'accessibility'] end if attributes.has_key?(:'occupantType') self.occupant_type = attributes[:'occupantType'] end if attributes.has_key?(:'yearBuilt') self.year_built = attributes[:'yearBuilt'] end end
Attribute type mapping.
# File lib/simplyrets/models/property.rb, line 193 def self.swagger_types { :'roof' => :'String', :'cooling' => :'String', :'style' => :'String', :'area' => :'Integer', :'baths_full' => :'Integer', :'baths_half' => :'Integer', :'stories' => :'Float', :'fireplaces' => :'Integer', :'flooring' => :'String', :'heating' => :'String', :'foundation' => :'String', :'pool_features' => :'String', :'laundry_features' => :'String', :'occupant_name' => :'String', :'lot_description' => :'String', :'lot_size_acres' => :'Float', :'sub_type' => :'String', :'bedrooms' => :'Integer', :'interior_features' => :'String', :'lot_size' => :'String', :'area_source' => :'String', :'maintenance_expense' => :'Float', :'additional_rooms' => :'String', :'exterior_features' => :'String', :'water' => :'String', :'view' => :'String', :'lot_size_area' => :'Float', :'subdivision' => :'String', :'construction' => :'String', :'parking' => :'Parking', :'lot_size_area_units' => :'String', :'type' => :'String', :'garage_spaces' => :'Float', :'accessibility' => :'String', :'occupant_type' => :'String', :'year_built' => :'Integer' } end
Public Instance Methods
Checks equality by comparing each attribute. @param [Object] Object to be compared
# File lib/simplyrets/models/property.rb, line 415 def ==(o) return true if self.equal?(o) self.class == o.class && roof == o.roof && cooling == o.cooling && style == o.style && area == o.area && baths_full == o.baths_full && baths_half == o.baths_half && stories == o.stories && fireplaces == o.fireplaces && flooring == o.flooring && heating == o.heating && foundation == o.foundation && pool_features == o.pool_features && laundry_features == o.laundry_features && occupant_name == o.occupant_name && lot_description == o.lot_description && lot_size_acres == o.lot_size_acres && sub_type == o.sub_type && bedrooms == o.bedrooms && interior_features == o.interior_features && lot_size == o.lot_size && area_source == o.area_source && maintenance_expense == o.maintenance_expense && additional_rooms == o.additional_rooms && exterior_features == o.exterior_features && water == o.water && view == o.view && lot_size_area == o.lot_size_area && subdivision == o.subdivision && construction == o.construction && parking == o.parking && lot_size_area_units == o.lot_size_area_units && type == o.type && garage_spaces == o.garage_spaces && accessibility == o.accessibility && occupant_type == o.occupant_type && year_built == o.year_built end
Deserializes the data based on type @param string type Data type @param string value Value to be deserialized @return [Object] Deserialized data
# File lib/simplyrets/models/property.rb, line 492 def _deserialize(type, value) case type.to_sym when :DateTime DateTime.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :BOOLEAN if value.to_s =~ /^(true|t|yes|y|1)$/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model temp_model = SimplyRetsClient.const_get(type).new temp_model.build_from_hash(value) end end
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value @param [Object] value Any valid value @return [Hash] Returns the value in the form of hash
# File lib/simplyrets/models/property.rb, line 558 def _to_hash(value) if value.is_a?(Array) value.compact.map{ |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end
Builds the object from hash @param [Hash] attributes Model attributes in the form of hash @return [Object] Returns the model itself
# File lib/simplyrets/models/property.rb, line 471 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /^Array<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end
@see the ‘==` method @param [Object] Object to be compared
# File lib/simplyrets/models/property.rb, line 458 def eql?(o) self == o end
Calculates hash code according to all attributes. @return [Fixnum] Hash code
# File lib/simplyrets/models/property.rb, line 464 def hash [roof, cooling, style, area, baths_full, baths_half, stories, fireplaces, flooring, heating, foundation, pool_features, laundry_features, occupant_name, lot_description, lot_size_acres, sub_type, bedrooms, interior_features, lot_size, area_source, maintenance_expense, additional_rooms, exterior_features, water, view, lot_size_area, subdivision, construction, parking, lot_size_area_units, type, garage_spaces, accessibility, occupant_type, year_built].hash end
Show invalid properties with the reasons. Usually used together with valid? @return Array for valid properies with the reasons
# File lib/simplyrets/models/property.rb, line 390 def list_invalid_properties invalid_properties = Array.new return invalid_properties end
Returns the object in the form of hash @return [Hash] Returns the object in the form of hash
# File lib/simplyrets/models/property.rb, line 544 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) next if value.nil? hash[param] = _to_hash(value) end hash end
Returns the string representation of the object @return [String] String presentation of the object
# File lib/simplyrets/models/property.rb, line 532 def to_s to_hash.to_s end
Custom attribute writer method checking allowed values (enum). @param [Object] type Object to be assigned
# File lib/simplyrets/models/property.rb, line 405 def type=(type) validator = EnumAttributeValidator.new('String', ["RES", "CND", "RNT", "MLF", "CRE", "LND", "FRM"]) unless validator.valid?(type) fail ArgumentError, "invalid value for 'type', must be one of #{validator.allowable_values}." end @type = type end
Check to see if the all the properties in the model are valid @return true if the model is valid
# File lib/simplyrets/models/property.rb, line 397 def valid? type_validator = EnumAttributeValidator.new('String', ["RES", "CND", "RNT", "MLF", "CRE", "LND", "FRM"]) return false unless type_validator.valid?(@type) return true end