Class: Propertyware::Building

Inherits:
Object
  • Object
show all
Defined in:
lib/propertyware/models/building.rb

Overview

Building

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Building

Initializes the object

Parameters:

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

    Model attributes in the form of hash



313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
# File 'lib/propertyware/models/building.rb', line 313

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `Propertyware::Building` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!self.class.attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `Propertyware::Building`. 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?(:'abbreviation')
    self.abbreviation = attributes[:'abbreviation']
  end

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#abbreviationObject

Property abbreviation.



20
21
22
# File 'lib/propertyware/models/building.rb', line 20

def abbreviation
  @abbreviation
end

#activeObject

Indicates if the property is active or inactive.



23
24
25
# File 'lib/propertyware/models/building.rb', line 23

def active
  @active
end

#addressObject

Returns the value of attribute address.



25
26
27
# File 'lib/propertyware/models/building.rb', line 25

def address
  @address
end

#amenitiesObject

Property amenities list.



28
29
30
# File 'lib/propertyware/models/building.rb', line 28

def amenities
  @amenities
end

#application_fee_ruleObject

Application fee rule



31
32
33
# File 'lib/propertyware/models/building.rb', line 31

def application_fee_rule
  @application_fee_rule
end

#area_unitsObject

Property total area units.



34
35
36
# File 'lib/propertyware/models/building.rb', line 34

def area_units
  @area_units
end

#categoryObject

Property category.



37
38
39
# File 'lib/propertyware/models/building.rb', line 37

def category
  @category
end

#count_unitObject

Number of units in the building.



40
41
42
# File 'lib/propertyware/models/building.rb', line 40

def count_unit
  @count_unit
end

#countyObject

Property region of a state.



43
44
45
# File 'lib/propertyware/models/building.rb', line 43

def county
  @county
end

#created_byObject

User who created the record.



46
47
48
# File 'lib/propertyware/models/building.rb', line 46

def created_by
  @created_by
end

#created_date_timeObject

Date and time the record was created. (Timezone: UTC)



49
50
51
# File 'lib/propertyware/models/building.rb', line 49

def created_date_time
  @created_date_time
end

#custom_fieldsObject

Custom fields.



52
53
54
# File 'lib/propertyware/models/building.rb', line 52

def custom_fields
  @custom_fields
end

#floor_numberObject

Floor number.



55
56
57
# File 'lib/propertyware/models/building.rb', line 55

def floor_number
  @floor_number
end

#ftb_deductableObject

FTB deductible amount



58
59
60
# File 'lib/propertyware/models/building.rb', line 58

def ftb_deductable
  @ftb_deductable
end

#ftb_withholding_percentageObject

FTB withholding percentage



61
62
63
# File 'lib/propertyware/models/building.rb', line 61

def ftb_withholding_percentage
  @ftb_withholding_percentage
end

#ftb_withholding_typeObject

FTB withholding type



64
65
66
# File 'lib/propertyware/models/building.rb', line 64

def ftb_withholding_type
  @ftb_withholding_type
end

#idObject

Unique identifier.



67
68
69
# File 'lib/propertyware/models/building.rb', line 67

def id
  @id
end

#id_numberObject

Unique identifier for Global Search.



70
71
72
# File 'lib/propertyware/models/building.rb', line 70

def id_number
  @id_number
end

#last_modified_byObject

User who last modified the record.



73
74
75
# File 'lib/propertyware/models/building.rb', line 73

def last_modified_by
  @last_modified_by
end

#last_modified_date_timeObject

Date and time the record was last modified. (Timezone: UTC)



76
77
78
# File 'lib/propertyware/models/building.rb', line 76

def last_modified_date_time
  @last_modified_date_time
end

#lease_idObject

Related lease ID.



79
80
81
# File 'lib/propertyware/models/building.rb', line 79

def lease_id
  @lease_id
end

#maintenance_labor_surcharge_amountObject

Maintenance labor surcharge amount



82
83
84
# File 'lib/propertyware/models/building.rb', line 82

def maintenance_labor_surcharge_amount
  @maintenance_labor_surcharge_amount
end

#maintenance_labor_surcharge_typeObject

Maintenance labor surcharge type



85
86
87
# File 'lib/propertyware/models/building.rb', line 85

def maintenance_labor_surcharge_type
  @maintenance_labor_surcharge_type
end

#maintenance_noticeObject

Property maintenance description.



88
89
90
# File 'lib/propertyware/models/building.rb', line 88

def maintenance_notice
  @maintenance_notice
end

#maintenance_spending_limit_amountObject

Maintenance spending limit amount



91
92
93
# File 'lib/propertyware/models/building.rb', line 91

def maintenance_spending_limit_amount
  @maintenance_spending_limit_amount
end

#maintenance_spending_limit_timeObject

Property maintenance spending limit.



94
95
96
# File 'lib/propertyware/models/building.rb', line 94

def maintenance_spending_limit_time
  @maintenance_spending_limit_time
end

#managementObject

Returns the value of attribute management.



96
97
98
# File 'lib/propertyware/models/building.rb', line 96

def management
  @management
end

#marketingObject

Returns the value of attribute marketing.



98
99
100
# File 'lib/propertyware/models/building.rb', line 98

def marketing
  @marketing
end

#multi_unitObject

Indicates if the building is multi family or single family.



101
102
103
# File 'lib/propertyware/models/building.rb', line 101

def multi_unit
  @multi_unit
end

#nameObject

Name of the property.



104
105
106
# File 'lib/propertyware/models/building.rb', line 104

def name
  @name
end

#neighborhoodObject

Property neighborhood.



107
108
109
# File 'lib/propertyware/models/building.rb', line 107

def neighborhood
  @neighborhood
end

#number_floorsObject

Number floors



110
111
112
# File 'lib/propertyware/models/building.rb', line 110

def number_floors
  @number_floors
end

#number_of_bathroomsObject

Number of bathrooms in the property.



113
114
115
# File 'lib/propertyware/models/building.rb', line 113

def number_of_bathrooms
  @number_of_bathrooms
end

#number_of_bedroomsObject

Number of bedrooms in the property.



116
117
118
# File 'lib/propertyware/models/building.rb', line 116

def number_of_bedrooms
  @number_of_bedrooms
end

#portfolio_idObject

ID of the portfolio associated with this property.



119
120
121
# File 'lib/propertyware/models/building.rb', line 119

def portfolio_id
  @portfolio_id
end

#property_manager_listObject

Property manager details.



122
123
124
# File 'lib/propertyware/models/building.rb', line 122

def property_manager_list
  @property_manager_list
end

#property_typeObject

Type of property.



125
126
127
# File 'lib/propertyware/models/building.rb', line 125

def property_type
  @property_type
end

#readyObject

Indicates if the property is ready to lease.



128
129
130
# File 'lib/propertyware/models/building.rb', line 128

def ready
  @ready
end

#reason_for_property_lostObject

Reason for property lost



131
132
133
# File 'lib/propertyware/models/building.rb', line 131

def reason_for_property_lost
  @reason_for_property_lost
end

#rentableObject

Indicates if the property is available for rent.



134
135
136
# File 'lib/propertyware/models/building.rb', line 134

def rentable
  @rentable
end

#search_tagObject

Property search tag.



137
138
139
# File 'lib/propertyware/models/building.rb', line 137

def search_tag
  @search_tag
end

#statusObject

Property status (occupied/vacant).



140
141
142
# File 'lib/propertyware/models/building.rb', line 140

def status
  @status
end

#syndicateObject

Property syndicate.



143
144
145
# File 'lib/propertyware/models/building.rb', line 143

def syndicate
  @syndicate
end

#target_depositObject

Target deposit.



146
147
148
# File 'lib/propertyware/models/building.rb', line 146

def target_deposit
  @target_deposit
end

#target_rentObject

Property target rent.



149
150
151
# File 'lib/propertyware/models/building.rb', line 149

def target_rent
  @target_rent
end

#target_rent_unitsObject

Property target rent units.



152
153
154
# File 'lib/propertyware/models/building.rb', line 152

def target_rent_units
  @target_rent_units
end

#total_areaObject

Property total area.



155
156
157
# File 'lib/propertyware/models/building.rb', line 155

def total_area
  @total_area
end

#typeObject

Property type.



158
159
160
# File 'lib/propertyware/models/building.rb', line 158

def type
  @type
end

#websiteObject

Property website URL.



161
162
163
# File 'lib/propertyware/models/building.rb', line 161

def website
  @website
end

#year_builtObject

Property built year.



164
165
166
# File 'lib/propertyware/models/building.rb', line 164

def year_built
  @year_built
end

Class Method Details

.acceptable_attributesObject

Returns all the JSON keys this model knows about



245
246
247
# File 'lib/propertyware/models/building.rb', line 245

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

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



189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
# File 'lib/propertyware/models/building.rb', line 189

def self.attribute_map
  {
    :'abbreviation' => :'abbreviation',
    :'active' => :'active',
    :'address' => :'address',
    :'amenities' => :'amenities',
    :'application_fee_rule' => :'applicationFeeRule',
    :'area_units' => :'areaUnits',
    :'category' => :'category',
    :'count_unit' => :'countUnit',
    :'county' => :'county',
    :'created_by' => :'createdBy',
    :'created_date_time' => :'createdDateTime',
    :'custom_fields' => :'customFields',
    :'floor_number' => :'floorNumber',
    :'ftb_deductable' => :'ftbDeductable',
    :'ftb_withholding_percentage' => :'ftbWithholdingPercentage',
    :'ftb_withholding_type' => :'ftbWithholdingType',
    :'id' => :'id',
    :'id_number' => :'idNumber',
    :'last_modified_by' => :'lastModifiedBy',
    :'last_modified_date_time' => :'lastModifiedDateTime',
    :'lease_id' => :'leaseID',
    :'maintenance_labor_surcharge_amount' => :'maintenanceLaborSurchargeAmount',
    :'maintenance_labor_surcharge_type' => :'maintenanceLaborSurchargeType',
    :'maintenance_notice' => :'maintenanceNotice',
    :'maintenance_spending_limit_amount' => :'maintenanceSpendingLimitAmount',
    :'maintenance_spending_limit_time' => :'maintenanceSpendingLimitTime',
    :'management' => :'management',
    :'marketing' => :'marketing',
    :'multi_unit' => :'multiUnit',
    :'name' => :'name',
    :'neighborhood' => :'neighborhood',
    :'number_floors' => :'numberFloors',
    :'number_of_bathrooms' => :'numberOfBathrooms',
    :'number_of_bedrooms' => :'numberOfBedrooms',
    :'portfolio_id' => :'portfolioID',
    :'property_manager_list' => :'propertyManagerList',
    :'property_type' => :'propertyType',
    :'ready' => :'ready',
    :'reason_for_property_lost' => :'reasonForPropertyLost',
    :'rentable' => :'rentable',
    :'search_tag' => :'searchTag',
    :'status' => :'status',
    :'syndicate' => :'syndicate',
    :'target_deposit' => :'targetDeposit',
    :'target_rent' => :'targetRent',
    :'target_rent_units' => :'targetRentUnits',
    :'total_area' => :'totalArea',
    :'type' => :'type',
    :'website' => :'website',
    :'year_built' => :'yearBuilt'
  }
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



678
679
680
# File 'lib/propertyware/models/building.rb', line 678

def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end

.openapi_nullableObject

List of attributes with nullable: true



306
307
308
309
# File 'lib/propertyware/models/building.rb', line 306

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
# File 'lib/propertyware/models/building.rb', line 250

def self.openapi_types
  {
    :'abbreviation' => :'String',
    :'active' => :'Boolean',
    :'address' => :'Address',
    :'amenities' => :'Array<Amenity>',
    :'application_fee_rule' => :'String',
    :'area_units' => :'String',
    :'category' => :'String',
    :'count_unit' => :'Integer',
    :'county' => :'String',
    :'created_by' => :'String',
    :'created_date_time' => :'Time',
    :'custom_fields' => :'Array<CustomField>',
    :'floor_number' => :'Integer',
    :'ftb_deductable' => :'Float',
    :'ftb_withholding_percentage' => :'Float',
    :'ftb_withholding_type' => :'String',
    :'id' => :'Integer',
    :'id_number' => :'Integer',
    :'last_modified_by' => :'String',
    :'last_modified_date_time' => :'Time',
    :'lease_id' => :'Integer',
    :'maintenance_labor_surcharge_amount' => :'Float',
    :'maintenance_labor_surcharge_type' => :'String',
    :'maintenance_notice' => :'String',
    :'maintenance_spending_limit_amount' => :'Float',
    :'maintenance_spending_limit_time' => :'String',
    :'management' => :'ManagementSettings',
    :'marketing' => :'Marketing',
    :'multi_unit' => :'String',
    :'name' => :'String',
    :'neighborhood' => :'String',
    :'number_floors' => :'Integer',
    :'number_of_bathrooms' => :'Float',
    :'number_of_bedrooms' => :'Integer',
    :'portfolio_id' => :'Integer',
    :'property_manager_list' => :'Array<PropertyManager>',
    :'property_type' => :'String',
    :'ready' => :'Boolean',
    :'reason_for_property_lost' => :'String',
    :'rentable' => :'Boolean',
    :'search_tag' => :'String',
    :'status' => :'String',
    :'syndicate' => :'Boolean',
    :'target_deposit' => :'Float',
    :'target_rent' => :'Float',
    :'target_rent_units' => :'String',
    :'total_area' => :'Float',
    :'type' => :'String',
    :'website' => :'String',
    :'year_built' => :'Integer'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
# File 'lib/propertyware/models/building.rb', line 608

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      abbreviation == o.abbreviation &&
      active == o.active &&
      address == o.address &&
      amenities == o.amenities &&
      application_fee_rule == o.application_fee_rule &&
      area_units == o.area_units &&
      category == o.category &&
      count_unit == o.count_unit &&
      county == o.county &&
      created_by == o.created_by &&
      created_date_time == o.created_date_time &&
      custom_fields == o.custom_fields &&
      floor_number == o.floor_number &&
      ftb_deductable == o.ftb_deductable &&
      ftb_withholding_percentage == o.ftb_withholding_percentage &&
      ftb_withholding_type == o.ftb_withholding_type &&
      id == o.id &&
      id_number == o.id_number &&
      last_modified_by == o.last_modified_by &&
      last_modified_date_time == o.last_modified_date_time &&
      lease_id == o.lease_id &&
      maintenance_labor_surcharge_amount == o.maintenance_labor_surcharge_amount &&
      maintenance_labor_surcharge_type == o.maintenance_labor_surcharge_type &&
      maintenance_notice == o.maintenance_notice &&
      maintenance_spending_limit_amount == o.maintenance_spending_limit_amount &&
      maintenance_spending_limit_time == o.maintenance_spending_limit_time &&
      management == o.management &&
      marketing == o.marketing &&
      multi_unit == o.multi_unit &&
      name == o.name &&
      neighborhood == o.neighborhood &&
      number_floors == o.number_floors &&
      number_of_bathrooms == o.number_of_bathrooms &&
      number_of_bedrooms == o.number_of_bedrooms &&
      portfolio_id == o.portfolio_id &&
      property_manager_list == o.property_manager_list &&
      property_type == o.property_type &&
      ready == o.ready &&
      reason_for_property_lost == o.reason_for_property_lost &&
      rentable == o.rentable &&
      search_tag == o.search_tag &&
      status == o.status &&
      syndicate == o.syndicate &&
      target_deposit == o.target_deposit &&
      target_rent == o.target_rent &&
      target_rent_units == o.target_rent_units &&
      total_area == o.total_area &&
      type == o.type &&
      website == o.website &&
      year_built == o.year_built
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
# File 'lib/propertyware/models/building.rb', line 709

def _deserialize(type, value)
  case type.to_sym
  when :Time
    Time.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 =~ /\A(true|t|yes|y|1)\z/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
    # models (e.g. Pet) or oneOf
    klass = Propertyware.const_get(type)
    klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



780
781
782
783
784
785
786
787
788
789
790
791
792
# File 'lib/propertyware/models/building.rb', line 780

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

#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



685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
# File 'lib/propertyware/models/building.rb', line 685

def build_from_hash(attributes)
  return unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  self.class.openapi_types.each_pair do |key, type|
    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
      self.send("#{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[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
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


665
666
667
# File 'lib/propertyware/models/building.rb', line 665

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



671
672
673
# File 'lib/propertyware/models/building.rb', line 671

def hash
  [abbreviation, active, address, amenities, application_fee_rule, area_units, category, count_unit, county, created_by, created_date_time, custom_fields, floor_number, ftb_deductable, ftb_withholding_percentage, ftb_withholding_type, id, id_number, last_modified_by, last_modified_date_time, lease_id, maintenance_labor_surcharge_amount, maintenance_labor_surcharge_type, maintenance_notice, maintenance_spending_limit_amount, maintenance_spending_limit_time, management, marketing, multi_unit, name, neighborhood, number_floors, number_of_bathrooms, number_of_bedrooms, portfolio_id, property_manager_list, property_type, ready, reason_for_property_lost, rentable, search_tag, status, syndicate, target_deposit, target_rent, target_rent_units, total_area, type, website, year_built].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



535
536
537
538
# File 'lib/propertyware/models/building.rb', line 535

def list_invalid_properties
  invalid_properties = Array.new
  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



756
757
758
# File 'lib/propertyware/models/building.rb', line 756

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



762
763
764
765
766
767
768
769
770
771
772
773
774
# File 'lib/propertyware/models/building.rb', line 762

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

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



750
751
752
# File 'lib/propertyware/models/building.rb', line 750

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



542
543
544
545
546
547
548
549
550
551
552
553
554
# File 'lib/propertyware/models/building.rb', line 542

def valid?
  area_units_validator = EnumAttributeValidator.new('String', ["Sq Ft", "Sq M"])
  return false unless area_units_validator.valid?(@area_units)
  category_validator = EnumAttributeValidator.new('String', ["RESIDENTIAL", "COMMERCIAL"])
  return false unless category_validator.valid?(@category)
  maintenance_spending_limit_time_validator = EnumAttributeValidator.new('String', ["NO_LIMIT", "MONTHLY_LIMIT", "YEARLY_LIMIT"])
  return false unless maintenance_spending_limit_time_validator.valid?(@maintenance_spending_limit_time)
  property_type_validator = EnumAttributeValidator.new('String', ["NONE", "APARTMENT", "CONDO", "COMMERCIAL", "DU_FOUR_PLEX", "HOUSE", "SECTION_8_AFFORDABLE", "SENIOR", "SHORT_TERM_VACATION", "STUDENT", "TOWNHOUSE", "OTHER"])
  return false unless property_type_validator.valid?(@property_type)
  target_rent_units_validator = EnumAttributeValidator.new('String', ["DOLLAR_PER_SQ_FT_MONTH", "DOLLAR_PER_SQ_FT_YEAR", "DOLLAR_PER_SQ_M_MONTH", "DOLLAR_PER_SQ_M_YEAR", "DOLLAR_PER_MONTH", "DOLLAR_PER_WEEK", "DOLLAR_PER_NIGHT"])
  return false unless target_rent_units_validator.valid?(@target_rent_units)
  true
end