class SimplyRetsClient::Listing
Attributes
Comprehensive property address information
Comprehensive listing agent information
co-listing agent information. NOTE: If your RETS feed stores co-list information outside of the ‘Property` resource, co-list agent information will not be available.
Data accuracy disclaimer. The value in the disclaimer may change depending on your MLS vendors rules.
Geographic data for the listing
Represents the length of the lease.
Information about the status of the existing lease on the property.
Date and time the listing became Active
Price of the listing
Data Dictionary v1.3 ListingId. The well known identifier for the listing. The value is the id or number by the MLS as a public identifier for the listing. This identifier should not be confused with the ‘mlsId`, which is specific to the SimplyRETS API.
MLS vendor information and data
A unique identifier for this listing specific to the SimplyRETS API. Thie identifier is specific to the SimplyRETS api and has no correlation with the MLS number. Use this id when making requests to the single listing endpoint (eg, ‘/properties/{mlsId}`). Applications should not rely on specific `mlsId`s being present. Instead, apps should dynamically use the `mlsId` after using other more general query parameters. Many mls vendors require listings which are expired, terminated or sold to be purged, which will render calls to specific `mlsId`s to return nothing (or possibly a 404).
Date and time of the last modification
Listing
office or brokerage.
Photos of the property. Images are served over https and are suitable for production use on secure websites
Agent
only remarks
Specific property data associated with listing.
Description or remarks
Sales
data
Comprehensive school zone data
Public instructions for showing the property.
Associate tax data
The URL for an unbranded virtual tour of the property. **Added on 2016/05/04 - Not available for all RETS vendors**
Public Class Methods
Attribute mapping from ruby-style variable name to JSON key.
# File lib/simplyrets/models/listing.rb, line 100 def self.attribute_map { :'private_remarks' => :'privateRemarks', :'property' => :'property', :'mls_id' => :'mlsId', :'showing_instructions' => :'showingInstructions', :'office' => :'office', :'lease_term' => :'leaseTerm', :'disclaimer' => :'disclaimer', :'address' => :'address', :'list_date' => :'listDate', :'agent' => :'agent', :'modified' => :'modified', :'school' => :'school', :'photos' => :'photos', :'list_price' => :'listPrice', :'listing_id' => :'listingId', :'mls' => :'mls', :'geo' => :'geo', :'tax' => :'tax', :'co_agent' => :'coAgent', :'sales' => :'sales', :'lease_type' => :'leaseType', :'virtual_tour_url' => :'virtualTourUrl', :'remarks' => :'remarks' } end
Initializes the object @param [Hash] attributes Model attributes in the form of hash
# File lib/simplyrets/models/listing.rb, line 159 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?(:'privateRemarks') self.private_remarks = attributes[:'privateRemarks'] end if attributes.has_key?(:'property') self.property = attributes[:'property'] end if attributes.has_key?(:'mlsId') self.mls_id = attributes[:'mlsId'] end if attributes.has_key?(:'showingInstructions') self.showing_instructions = attributes[:'showingInstructions'] end if attributes.has_key?(:'office') self.office = attributes[:'office'] end if attributes.has_key?(:'leaseTerm') self.lease_term = attributes[:'leaseTerm'] end if attributes.has_key?(:'disclaimer') self.disclaimer = attributes[:'disclaimer'] end if attributes.has_key?(:'address') self.address = attributes[:'address'] end if attributes.has_key?(:'listDate') self.list_date = attributes[:'listDate'] end if attributes.has_key?(:'agent') self.agent = attributes[:'agent'] end if attributes.has_key?(:'modified') self.modified = attributes[:'modified'] end if attributes.has_key?(:'school') self.school = attributes[:'school'] end if attributes.has_key?(:'photos') if (value = attributes[:'photos']).is_a?(Array) self.photos = value end end if attributes.has_key?(:'listPrice') self.list_price = attributes[:'listPrice'] end if attributes.has_key?(:'listingId') self.listing_id = attributes[:'listingId'] end if attributes.has_key?(:'mls') self.mls = attributes[:'mls'] end if attributes.has_key?(:'geo') self.geo = attributes[:'geo'] end if attributes.has_key?(:'tax') self.tax = attributes[:'tax'] end if attributes.has_key?(:'coAgent') self.co_agent = attributes[:'coAgent'] end if attributes.has_key?(:'sales') self.sales = attributes[:'sales'] end if attributes.has_key?(:'leaseType') self.lease_type = attributes[:'leaseType'] end if attributes.has_key?(:'virtualTourUrl') self.virtual_tour_url = attributes[:'virtualTourUrl'] end if attributes.has_key?(:'remarks') self.remarks = attributes[:'remarks'] end end
Attribute type mapping.
# File lib/simplyrets/models/listing.rb, line 129 def self.swagger_types { :'private_remarks' => :'String', :'property' => :'Property', :'mls_id' => :'Integer', :'showing_instructions' => :'String', :'office' => :'Office', :'lease_term' => :'String', :'disclaimer' => :'String', :'address' => :'StreetAddress', :'list_date' => :'DateTime', :'agent' => :'Agent', :'modified' => :'DateTime', :'school' => :'School', :'photos' => :'Array<String>', :'list_price' => :'Float', :'listing_id' => :'String', :'mls' => :'MlsInformation', :'geo' => :'GeographicData', :'tax' => :'Tax', :'co_agent' => :'Agent', :'sales' => :'Sales', :'lease_type' => :'String', :'virtual_tour_url' => :'String', :'remarks' => :'String' } end
Public Instance Methods
Checks equality by comparing each attribute. @param [Object] Object to be compared
# File lib/simplyrets/models/listing.rb, line 276 def ==(o) return true if self.equal?(o) self.class == o.class && private_remarks == o.private_remarks && property == o.property && mls_id == o.mls_id && showing_instructions == o.showing_instructions && office == o.office && lease_term == o.lease_term && disclaimer == o.disclaimer && address == o.address && list_date == o.list_date && agent == o.agent && modified == o.modified && school == o.school && photos == o.photos && list_price == o.list_price && listing_id == o.listing_id && mls == o.mls && geo == o.geo && tax == o.tax && co_agent == o.co_agent && sales == o.sales && lease_type == o.lease_type && virtual_tour_url == o.virtual_tour_url && remarks == o.remarks 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/listing.rb, line 340 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/listing.rb, line 406 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/listing.rb, line 319 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/listing.rb, line 306 def eql?(o) self == o end
Calculates hash code according to all attributes. @return [Fixnum] Hash code
# File lib/simplyrets/models/listing.rb, line 312 def hash [private_remarks, property, mls_id, showing_instructions, office, lease_term, disclaimer, address, list_date, agent, modified, school, photos, list_price, listing_id, mls, geo, tax, co_agent, sales, lease_type, virtual_tour_url, remarks].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/listing.rb, line 263 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/listing.rb, line 392 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/listing.rb, line 380 def to_s to_hash.to_s 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/listing.rb, line 270 def valid? return true end