Class: Repull::MarketCalendarDay

Inherits:
ApiModelBase show all
Defined in:
lib/repull/models/market_calendar_day.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ApiModelBase

_deserialize, #_to_hash, #to_body, #to_s

Constructor Details

#initialize(attributes = {}) ⇒ MarketCalendarDay

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



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
# File 'lib/repull/models/market_calendar_day.rb', line 105

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::MarketCalendarDay` 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::MarketCalendarDay`. 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?(:'date')
    self.date = attributes[:'date']
  end

  if attributes.key?(:'market_avg_rate')
    self.market_avg_rate = attributes[:'market_avg_rate']
  end

  if attributes.key?(:'market_min_rate')
    self.market_min_rate = attributes[:'market_min_rate']
  end

  if attributes.key?(:'market_max_rate')
    self.market_max_rate = attributes[:'market_max_rate']
  end

  if attributes.key?(:'priced_listings')
    self.priced_listings = attributes[:'priced_listings']
  end

  if attributes.key?(:'occupancy_pct')
    self.occupancy_pct = attributes[:'occupancy_pct']
  end

  if attributes.key?(:'total_listings')
    self.total_listings = attributes[:'total_listings']
  end

  if attributes.key?(:'wheelhouse_occupancy')
    self.wheelhouse_occupancy = attributes[:'wheelhouse_occupancy']
  end

  if attributes.key?(:'wheelhouse_adr')
    self.wheelhouse_adr = attributes[:'wheelhouse_adr']
  end

  if attributes.key?(:'events')
    if (value = attributes[:'events']).is_a?(Array)
      self.events = value
    end
  end

  if attributes.key?(:'my_price')
    self.my_price = attributes[:'my_price']
  end

  if attributes.key?(:'my_available')
    self.my_available = attributes[:'my_available']
  end
end

Instance Attribute Details

#dateObject

Returns the value of attribute date.



18
19
20
# File 'lib/repull/models/market_calendar_day.rb', line 18

def date
  @date
end

#eventsObject

Returns the value of attribute events.



36
37
38
# File 'lib/repull/models/market_calendar_day.rb', line 36

def events
  @events
end

#market_avg_rateObject

Returns the value of attribute market_avg_rate.



20
21
22
# File 'lib/repull/models/market_calendar_day.rb', line 20

def market_avg_rate
  @market_avg_rate
end

#market_max_rateObject

Returns the value of attribute market_max_rate.



24
25
26
# File 'lib/repull/models/market_calendar_day.rb', line 24

def market_max_rate
  @market_max_rate
end

#market_min_rateObject

Returns the value of attribute market_min_rate.



22
23
24
# File 'lib/repull/models/market_calendar_day.rb', line 22

def market_min_rate
  @market_min_rate
end

#my_availableObject

Only meaningful when ‘listingId` is supplied.



42
43
44
# File 'lib/repull/models/market_calendar_day.rb', line 42

def my_available
  @my_available
end

#my_priceObject

Only present when ‘listingId` is supplied.



39
40
41
# File 'lib/repull/models/market_calendar_day.rb', line 39

def my_price
  @my_price
end

#occupancy_pctObject

Returns the value of attribute occupancy_pct.



28
29
30
# File 'lib/repull/models/market_calendar_day.rb', line 28

def occupancy_pct
  @occupancy_pct
end

#priced_listingsObject

Returns the value of attribute priced_listings.



26
27
28
# File 'lib/repull/models/market_calendar_day.rb', line 26

def priced_listings
  @priced_listings
end

#total_listingsObject

Returns the value of attribute total_listings.



30
31
32
# File 'lib/repull/models/market_calendar_day.rb', line 30

def total_listings
  @total_listings
end

#wheelhouse_adrObject

Returns the value of attribute wheelhouse_adr.



34
35
36
# File 'lib/repull/models/market_calendar_day.rb', line 34

def wheelhouse_adr
  @wheelhouse_adr
end

#wheelhouse_occupancyObject

Returns the value of attribute wheelhouse_occupancy.



32
33
34
# File 'lib/repull/models/market_calendar_day.rb', line 32

def wheelhouse_occupancy
  @wheelhouse_occupancy
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



63
64
65
# File 'lib/repull/models/market_calendar_day.rb', line 63

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



68
69
70
# File 'lib/repull/models/market_calendar_day.rb', line 68

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/repull/models/market_calendar_day.rb', line 45

def self.attribute_map
  {
    :'date' => :'date',
    :'market_avg_rate' => :'marketAvgRate',
    :'market_min_rate' => :'marketMinRate',
    :'market_max_rate' => :'marketMaxRate',
    :'priced_listings' => :'pricedListings',
    :'occupancy_pct' => :'occupancyPct',
    :'total_listings' => :'totalListings',
    :'wheelhouse_occupancy' => :'wheelhouseOccupancy',
    :'wheelhouse_adr' => :'wheelhouseAdr',
    :'events' => :'events',
    :'my_price' => :'myPrice',
    :'my_available' => :'myAvailable'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
# File 'lib/repull/models/market_calendar_day.rb', line 219

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_nullableObject

List of attributes with nullable: true



91
92
93
94
95
96
97
98
99
100
101
# File 'lib/repull/models/market_calendar_day.rb', line 91

def self.openapi_nullable
  Set.new([
    :'market_avg_rate',
    :'market_min_rate',
    :'market_max_rate',
    :'occupancy_pct',
    :'wheelhouse_occupancy',
    :'wheelhouse_adr',
    :'my_price',
  ])
end

.openapi_typesObject

Attribute type mapping.



73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/repull/models/market_calendar_day.rb', line 73

def self.openapi_types
  {
    :'date' => :'Date',
    :'market_avg_rate' => :'Float',
    :'market_min_rate' => :'Float',
    :'market_max_rate' => :'Float',
    :'priced_listings' => :'Integer',
    :'occupancy_pct' => :'Float',
    :'total_listings' => :'Integer',
    :'wheelhouse_occupancy' => :'Float',
    :'wheelhouse_adr' => :'Float',
    :'events' => :'Array<MarketCalendarDayEventsInner>',
    :'my_price' => :'Float',
    :'my_available' => :'Boolean'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
# File 'lib/repull/models/market_calendar_day.rb', line 187

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      date == o.date &&
      market_avg_rate == o.market_avg_rate &&
      market_min_rate == o.market_min_rate &&
      market_max_rate == o.market_max_rate &&
      priced_listings == o.priced_listings &&
      occupancy_pct == o.occupancy_pct &&
      total_listings == o.total_listings &&
      wheelhouse_occupancy == o.wheelhouse_occupancy &&
      wheelhouse_adr == o.wheelhouse_adr &&
      events == o.events &&
      my_price == o.my_price &&
      my_available == o.my_available
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


206
207
208
# File 'lib/repull/models/market_calendar_day.rb', line 206

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



212
213
214
# File 'lib/repull/models/market_calendar_day.rb', line 212

def hash
  [date, market_avg_rate, market_min_rate, market_max_rate, priced_listings, occupancy_pct, total_listings, wheelhouse_occupancy, wheelhouse_adr, events, my_price, my_available].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



172
173
174
175
176
# File 'lib/repull/models/market_calendar_day.rb', line 172

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  invalid_properties
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



241
242
243
244
245
246
247
248
249
250
251
252
253
# File 'lib/repull/models/market_calendar_day.rb', line 241

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

Returns:

  • (Boolean)

    true if the model is valid



180
181
182
183
# File 'lib/repull/models/market_calendar_day.rb', line 180

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  true
end