Class: Repull::MarketDetailResponse
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- Repull::MarketDetailResponse
- Defined in:
- lib/repull/models/market_detail_response.rb
Overview
Detailed view for a single city. Several sub-objects are passed through verbatim from upstream — keys mirror the underlying SQL aggregations.
Instance Attribute Summary collapse
-
#bedroom_breakdown ⇒ Object
Returns the value of attribute bedroom_breakdown.
-
#benchmarks ⇒ Object
Returns the value of attribute benchmarks.
-
#capacity_gap ⇒ Object
Returns the value of attribute capacity_gap.
-
#city ⇒ Object
Returns the value of attribute city.
-
#events ⇒ Object
Returns the value of attribute events.
-
#health_summary ⇒ Object
Returns the value of attribute health_summary.
-
#market_position ⇒ Object
Returns the value of attribute market_position.
-
#price_distribution ⇒ Object
Returns the value of attribute price_distribution.
-
#property_type_mix ⇒ Object
Returns the value of attribute property_type_mix.
-
#supply_trend ⇒ Object
Returns the value of attribute supply_trend.
-
#top_comps ⇒ Object
Returns the value of attribute top_comps.
-
#wheelhouse_trends ⇒ Object
Returns the value of attribute wheelhouse_trends.
Class Method Summary collapse
-
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about.
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ MarketDetailResponse
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Methods inherited from ApiModelBase
_deserialize, #_to_hash, #to_body, #to_s
Constructor Details
#initialize(attributes = {}) ⇒ MarketDetailResponse
Initializes the object
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 |
# File 'lib/repull/models/market_detail_response.rb', line 99 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::MarketDetailResponse` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::MarketDetailResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'city') self.city = attributes[:'city'] end if attributes.key?(:'price_distribution') if (value = attributes[:'price_distribution']).is_a?(Array) self.price_distribution = value end end if attributes.key?(:'bedroom_breakdown') if (value = attributes[:'bedroom_breakdown']).is_a?(Array) self.bedroom_breakdown = value end end if attributes.key?(:'property_type_mix') if (value = attributes[:'property_type_mix']).is_a?(Array) self.property_type_mix = value end end if attributes.key?(:'events') if (value = attributes[:'events']).is_a?(Array) self.events = value end end if attributes.key?(:'wheelhouse_trends') if (value = attributes[:'wheelhouse_trends']).is_a?(Array) self.wheelhouse_trends = value end end if attributes.key?(:'benchmarks') if (value = attributes[:'benchmarks']).is_a?(Array) self.benchmarks = value end end if attributes.key?(:'health_summary') if (value = attributes[:'health_summary']).is_a?(Hash) self.health_summary = value end end if attributes.key?(:'top_comps') self.top_comps = attributes[:'top_comps'] end if attributes.key?(:'market_position') if (value = attributes[:'market_position']).is_a?(Hash) self.market_position = value end end if attributes.key?(:'capacity_gap') if (value = attributes[:'capacity_gap']).is_a?(Hash) self.capacity_gap = value end end if attributes.key?(:'supply_trend') if (value = attributes[:'supply_trend']).is_a?(Array) self.supply_trend = value end end end |
Instance Attribute Details
#bedroom_breakdown ⇒ Object
Returns the value of attribute bedroom_breakdown.
23 24 25 |
# File 'lib/repull/models/market_detail_response.rb', line 23 def bedroom_breakdown @bedroom_breakdown end |
#benchmarks ⇒ Object
Returns the value of attribute benchmarks.
31 32 33 |
# File 'lib/repull/models/market_detail_response.rb', line 31 def benchmarks @benchmarks end |
#capacity_gap ⇒ Object
Returns the value of attribute capacity_gap.
39 40 41 |
# File 'lib/repull/models/market_detail_response.rb', line 39 def capacity_gap @capacity_gap end |
#city ⇒ Object
Returns the value of attribute city.
19 20 21 |
# File 'lib/repull/models/market_detail_response.rb', line 19 def city @city end |
#events ⇒ Object
Returns the value of attribute events.
27 28 29 |
# File 'lib/repull/models/market_detail_response.rb', line 27 def events @events end |
#health_summary ⇒ Object
Returns the value of attribute health_summary.
33 34 35 |
# File 'lib/repull/models/market_detail_response.rb', line 33 def health_summary @health_summary end |
#market_position ⇒ Object
Returns the value of attribute market_position.
37 38 39 |
# File 'lib/repull/models/market_detail_response.rb', line 37 def market_position @market_position end |
#price_distribution ⇒ Object
Returns the value of attribute price_distribution.
21 22 23 |
# File 'lib/repull/models/market_detail_response.rb', line 21 def price_distribution @price_distribution end |
#property_type_mix ⇒ Object
Returns the value of attribute property_type_mix.
25 26 27 |
# File 'lib/repull/models/market_detail_response.rb', line 25 def property_type_mix @property_type_mix end |
#supply_trend ⇒ Object
Returns the value of attribute supply_trend.
41 42 43 |
# File 'lib/repull/models/market_detail_response.rb', line 41 def supply_trend @supply_trend end |
#top_comps ⇒ Object
Returns the value of attribute top_comps.
35 36 37 |
# File 'lib/repull/models/market_detail_response.rb', line 35 def top_comps @top_comps end |
#wheelhouse_trends ⇒ Object
Returns the value of attribute wheelhouse_trends.
29 30 31 |
# File 'lib/repull/models/market_detail_response.rb', line 29 def wheelhouse_trends @wheelhouse_trends end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
62 63 64 |
# File 'lib/repull/models/market_detail_response.rb', line 62 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
67 68 69 |
# File 'lib/repull/models/market_detail_response.rb', line 67 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/repull/models/market_detail_response.rb', line 44 def self.attribute_map { :'city' => :'city', :'price_distribution' => :'priceDistribution', :'bedroom_breakdown' => :'bedroomBreakdown', :'property_type_mix' => :'propertyTypeMix', :'events' => :'events', :'wheelhouse_trends' => :'wheelhouseTrends', :'benchmarks' => :'benchmarks', :'health_summary' => :'healthSummary', :'top_comps' => :'topComps', :'market_position' => :'marketPosition', :'capacity_gap' => :'capacityGap', :'supply_trend' => :'supplyTrend' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 |
# File 'lib/repull/models/market_detail_response.rb', line 231 def self.build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) transformed_hash = {} openapi_types.each_pair do |key, type| if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[attribute_map[key]].is_a?(Array) transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end elsif !attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end new(transformed_hash) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
90 91 92 93 94 95 |
# File 'lib/repull/models/market_detail_response.rb', line 90 def self.openapi_nullable Set.new([ :'health_summary', :'market_position', ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/repull/models/market_detail_response.rb', line 72 def self.openapi_types { :'city' => :'String', :'price_distribution' => :'Array<MarketDetailResponsePriceDistributionInner>', :'bedroom_breakdown' => :'Array<Hash<String, Object>>', :'property_type_mix' => :'Array<MarketDetailResponsePropertyTypeMixInner>', :'events' => :'Array<MarketEvent>', :'wheelhouse_trends' => :'Array<Hash<String, Object>>', :'benchmarks' => :'Array<Hash<String, Object>>', :'health_summary' => :'Hash<String, Object>', :'top_comps' => :'MarketDetailResponseTopComps', :'market_position' => :'Hash<String, Object>', :'capacity_gap' => :'Hash<String, Object>', :'supply_trend' => :'Array<MarketDetailResponseSupplyTrendInner>' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 |
# File 'lib/repull/models/market_detail_response.rb', line 199 def ==(o) return true if self.equal?(o) self.class == o.class && city == o.city && price_distribution == o.price_distribution && bedroom_breakdown == o.bedroom_breakdown && property_type_mix == o.property_type_mix && events == o.events && wheelhouse_trends == o.wheelhouse_trends && benchmarks == o.benchmarks && health_summary == o.health_summary && top_comps == o.top_comps && market_position == o.market_position && capacity_gap == o.capacity_gap && supply_trend == o.supply_trend end |
#eql?(o) ⇒ Boolean
218 219 220 |
# File 'lib/repull/models/market_detail_response.rb', line 218 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
224 225 226 |
# File 'lib/repull/models/market_detail_response.rb', line 224 def hash [city, price_distribution, bedroom_breakdown, property_type_mix, events, wheelhouse_trends, benchmarks, health_summary, top_comps, market_position, capacity_gap, supply_trend].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
184 185 186 187 188 |
# File 'lib/repull/models/market_detail_response.rb', line 184 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
253 254 255 256 257 258 259 260 261 262 263 264 265 |
# File 'lib/repull/models/market_detail_response.rb', line 253 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = self.class.openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
192 193 194 195 |
# File 'lib/repull/models/market_detail_response.rb', line 192 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' true end |