Class: Propertyware::Lease

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

Overview

Lease

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Lease

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
243
244
245
246
247
248
249
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
304
305
306
307
308
309
310
311
312
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
# File 'lib/propertyware/models/lease.rb', line 209

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

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

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

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

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

  if attributes.key?(:'contacts')
    if (value = attributes[:'contacts']).is_a?(Array)
      self.contacts = value
    end
  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?(:'end_date')
    self.end_date = attributes[:'end_date']
  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?(:'late_fee_rule')
    self.late_fee_rule = attributes[:'late_fee_rule']
  end

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#activeObject

Indicates if lease is Active.



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

def active
  @active
end

#addendumsObject

Lease addendum(s).



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

def addendums
  @addendums
end

#base_rentObject

Property base rent.



26
27
28
# File 'lib/propertyware/models/lease.rb', line 26

def base_rent
  @base_rent
end

#building_idObject

Id of the building associated with this lease.



29
30
31
# File 'lib/propertyware/models/lease.rb', line 29

def building_id
  @building_id
end

#commentsObject

Description of the lease.



32
33
34
# File 'lib/propertyware/models/lease.rb', line 32

def comments
  @comments
end

#contactsObject

List of the current tenants on the lease.



35
36
37
# File 'lib/propertyware/models/lease.rb', line 35

def contacts
  @contacts
end

#created_byObject

User who created the record.



38
39
40
# File 'lib/propertyware/models/lease.rb', line 38

def created_by
  @created_by
end

#created_date_timeObject

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



41
42
43
# File 'lib/propertyware/models/lease.rb', line 41

def created_date_time
  @created_date_time
end

#custom_fieldsObject

Custom fields.



44
45
46
# File 'lib/propertyware/models/lease.rb', line 44

def custom_fields
  @custom_fields
end

#end_dateObject

End date of the lease term.



47
48
49
# File 'lib/propertyware/models/lease.rb', line 47

def end_date
  @end_date
end

#idObject

Unique identifier.



50
51
52
# File 'lib/propertyware/models/lease.rb', line 50

def id
  @id
end

#id_numberObject

Lease identification number.



53
54
55
# File 'lib/propertyware/models/lease.rb', line 53

def id_number
  @id_number
end

#last_modified_byObject

User who last modified the record.



56
57
58
# File 'lib/propertyware/models/lease.rb', line 56

def last_modified_by
  @last_modified_by
end

#last_modified_date_timeObject

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



59
60
61
# File 'lib/propertyware/models/lease.rb', line 59

def last_modified_date_time
  @last_modified_date_time
end

#late_fee_ruleObject

Textual description of the late fee rule applied to delinquent or unpaid lease charges.



62
63
64
# File 'lib/propertyware/models/lease.rb', line 62

def late_fee_rule
  @late_fee_rule
end

#lease_balanceObject

Lease Balance.



65
66
67
# File 'lib/propertyware/models/lease.rb', line 65

def lease_balance
  @lease_balance
end

#lease_nameObject

Lease Name.



68
69
70
# File 'lib/propertyware/models/lease.rb', line 68

def lease_name
  @lease_name
end

#locationObject

Building and/or units the lease is currently attached to.



71
72
73
# File 'lib/propertyware/models/lease.rb', line 71

def location
  @location
end

#move_in_dateObject

Day that the tenant(s) moved into the property.



74
75
76
# File 'lib/propertyware/models/lease.rb', line 74

def move_in_date
  @move_in_date
end

#move_out_dateObject

Day that the tenant(s) vacated the property.



77
78
79
# File 'lib/propertyware/models/lease.rb', line 77

def move_out_date
  @move_out_date
end

#notice_given_dateObject

Day that the tenant(s) turned in a notice to vacate.



80
81
82
# File 'lib/propertyware/models/lease.rb', line 80

def notice_given_date
  @notice_given_date
end

#payment_restrictionObject

Indicates if the lease has any payment types that they are prevented from using. For example, a lease with several bounced checks may be restricted from paying with checks for future payments.



83
84
85
# File 'lib/propertyware/models/lease.rb', line 83

def payment_restriction
  @payment_restriction
end

#portfolio_idObject

Id of the portfolio associated with this lease.



86
87
88
# File 'lib/propertyware/models/lease.rb', line 86

def portfolio_id
  @portfolio_id
end

#public_assistance_programObject

Indicates if the tenant(s) of the lease receive any aid from a Public Assistance Program.



89
90
91
# File 'lib/propertyware/models/lease.rb', line 89

def public_assistance_program
  @public_assistance_program
end

#reason_for_leavingObject

Reason for vacating the property.



92
93
94
# File 'lib/propertyware/models/lease.rb', line 92

def reason_for_leaving
  @reason_for_leaving
end

#schedule_move_out_dateObject

Day that the tenant(s) are expected to vacate the property.



95
96
97
# File 'lib/propertyware/models/lease.rb', line 95

def schedule_move_out_date
  @schedule_move_out_date
end

#search_tagObject

Search tag.



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

def search_tag
  @search_tag
end

#signed_dateObject

Lease signed date.



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

def signed_date
  @signed_date
end

#start_dateObject

Start date of the lease term.



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

def start_date
  @start_date
end

#statusObject

Lease’s current status.



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

def status
  @status
end

#tenants_opts_into_asset_protection_planObject

Indicates if the tenants opted into Asset Protection Plan.



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

def tenants_opts_into_asset_protection_plan
  @tenants_opts_into_asset_protection_plan
end

#terminated_dateObject

Lease Terminated Date.



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

def terminated_date
  @terminated_date
end

#unit_idObject

Id of the unit associated with this lease.



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

def unit_id
  @unit_id
end

Class Method Details

.acceptable_attributesObject

Returns all the JSON keys this model knows about



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

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

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



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
# File 'lib/propertyware/models/lease.rb', line 119

def self.attribute_map
  {
    :'active' => :'active',
    :'addendums' => :'addendums',
    :'base_rent' => :'baseRent',
    :'building_id' => :'buildingID',
    :'comments' => :'comments',
    :'contacts' => :'contacts',
    :'created_by' => :'createdBy',
    :'created_date_time' => :'createdDateTime',
    :'custom_fields' => :'customFields',
    :'end_date' => :'endDate',
    :'id' => :'id',
    :'id_number' => :'idNumber',
    :'last_modified_by' => :'lastModifiedBy',
    :'last_modified_date_time' => :'lastModifiedDateTime',
    :'late_fee_rule' => :'lateFeeRule',
    :'lease_balance' => :'leaseBalance',
    :'lease_name' => :'leaseName',
    :'location' => :'location',
    :'move_in_date' => :'moveInDate',
    :'move_out_date' => :'moveOutDate',
    :'notice_given_date' => :'noticeGivenDate',
    :'payment_restriction' => :'paymentRestriction',
    :'portfolio_id' => :'portfolioID',
    :'public_assistance_program' => :'publicAssistanceProgram',
    :'reason_for_leaving' => :'reasonForLeaving',
    :'schedule_move_out_date' => :'scheduleMoveOutDate',
    :'search_tag' => :'searchTag',
    :'signed_date' => :'signedDate',
    :'start_date' => :'startDate',
    :'status' => :'status',
    :'tenants_opts_into_asset_protection_plan' => :'tenantsOptsIntoAssetProtectionPlan',
    :'terminated_date' => :'terminatedDate',
    :'unit_id' => :'unitID'
  }
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



429
430
431
# File 'lib/propertyware/models/lease.rb', line 429

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

.openapi_nullableObject

List of attributes with nullable: true



202
203
204
205
# File 'lib/propertyware/models/lease.rb', line 202

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

.openapi_typesObject

Attribute type mapping.



163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# File 'lib/propertyware/models/lease.rb', line 163

def self.openapi_types
  {
    :'active' => :'Boolean',
    :'addendums' => :'Array<LeaseClause>',
    :'base_rent' => :'Float',
    :'building_id' => :'Integer',
    :'comments' => :'String',
    :'contacts' => :'Array<LeaseContact>',
    :'created_by' => :'String',
    :'created_date_time' => :'Time',
    :'custom_fields' => :'Array<CustomField>',
    :'end_date' => :'Date',
    :'id' => :'Integer',
    :'id_number' => :'Integer',
    :'last_modified_by' => :'String',
    :'last_modified_date_time' => :'Time',
    :'late_fee_rule' => :'String',
    :'lease_balance' => :'Float',
    :'lease_name' => :'String',
    :'location' => :'String',
    :'move_in_date' => :'Date',
    :'move_out_date' => :'Date',
    :'notice_given_date' => :'Date',
    :'payment_restriction' => :'String',
    :'portfolio_id' => :'Integer',
    :'public_assistance_program' => :'String',
    :'reason_for_leaving' => :'String',
    :'schedule_move_out_date' => :'Date',
    :'search_tag' => :'String',
    :'signed_date' => :'Date',
    :'start_date' => :'Date',
    :'status' => :'String',
    :'tenants_opts_into_asset_protection_plan' => :'String',
    :'terminated_date' => :'Date',
    :'unit_id' => :'Integer'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



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
# File 'lib/propertyware/models/lease.rb', line 376

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      active == o.active &&
      addendums == o.addendums &&
      base_rent == o.base_rent &&
      building_id == o.building_id &&
      comments == o.comments &&
      contacts == o.contacts &&
      created_by == o.created_by &&
      created_date_time == o.created_date_time &&
      custom_fields == o.custom_fields &&
      end_date == o.end_date &&
      id == o.id &&
      id_number == o.id_number &&
      last_modified_by == o.last_modified_by &&
      last_modified_date_time == o.last_modified_date_time &&
      late_fee_rule == o.late_fee_rule &&
      lease_balance == o.lease_balance &&
      lease_name == o.lease_name &&
      location == o.location &&
      move_in_date == o.move_in_date &&
      move_out_date == o.move_out_date &&
      notice_given_date == o.notice_given_date &&
      payment_restriction == o.payment_restriction &&
      portfolio_id == o.portfolio_id &&
      public_assistance_program == o.public_assistance_program &&
      reason_for_leaving == o.reason_for_leaving &&
      schedule_move_out_date == o.schedule_move_out_date &&
      search_tag == o.search_tag &&
      signed_date == o.signed_date &&
      start_date == o.start_date &&
      status == o.status &&
      tenants_opts_into_asset_protection_plan == o.tenants_opts_into_asset_protection_plan &&
      terminated_date == o.terminated_date &&
      unit_id == o.unit_id
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



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
# File 'lib/propertyware/models/lease.rb', line 460

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



531
532
533
534
535
536
537
538
539
540
541
542
543
# File 'lib/propertyware/models/lease.rb', line 531

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



436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
# File 'lib/propertyware/models/lease.rb', line 436

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


416
417
418
# File 'lib/propertyware/models/lease.rb', line 416

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



422
423
424
# File 'lib/propertyware/models/lease.rb', line 422

def hash
  [active, addendums, base_rent, building_id, comments, contacts, created_by, created_date_time, custom_fields, end_date, id, id_number, last_modified_by, last_modified_date_time, late_fee_rule, lease_balance, lease_name, location, move_in_date, move_out_date, notice_given_date, payment_restriction, portfolio_id, public_assistance_program, reason_for_leaving, schedule_move_out_date, search_tag, signed_date, start_date, status, tenants_opts_into_asset_protection_plan, terminated_date, unit_id].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



363
364
365
366
# File 'lib/propertyware/models/lease.rb', line 363

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



507
508
509
# File 'lib/propertyware/models/lease.rb', line 507

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



513
514
515
516
517
518
519
520
521
522
523
524
525
# File 'lib/propertyware/models/lease.rb', line 513

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



501
502
503
# File 'lib/propertyware/models/lease.rb', line 501

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



370
371
372
# File 'lib/propertyware/models/lease.rb', line 370

def valid?
  true
end