Class: Propertyware::Portfolio

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

Overview

Portfolio

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Portfolio

Initializes the object

Parameters:

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

    Model attributes in the form of hash



181
182
183
184
185
186
187
188
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
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
# File 'lib/propertyware/models/portfolio.rb', line 181

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

  if attributes.key?(:'closing_date')
    self.closing_date = attributes[:'closing_date']
  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?(:'default_bank_account_id')
    self. = attributes[:'default_bank_account_id']
  end

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

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

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

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

  if attributes.key?(:'id')
    self.id = attributes[:'id']
  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?(:'maintenance_spending_limit')
    self.maintenance_spending_limit = attributes[:'maintenance_spending_limit']
  end

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

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

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

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

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

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

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

Instance Attribute Details

#abbreviationObject

Abbreviated name assigned to the portfolio.



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

def abbreviation
  @abbreviation
end

#activeObject

Indicates if portfolio is active or inactive.



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

def active
  @active
end

#cash_accrualObject

Cash or accrual accounting basis.



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

def cash_accrual
  @cash_accrual
end

#closing_dateObject

Date when the accounting period for the portfolio will close.



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

def closing_date
  @closing_date
end

#created_byObject

User who created the record.



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

def created_by
  @created_by
end

#created_date_timeObject

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



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

def created_date_time
  @created_date_time
end

#custom_fieldsObject

Custom fields.



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

def custom_fields
  @custom_fields
end

#default_bank_account_idObject

Id of the portfolio’s default bank account.



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

def 
  @default_bank_account_id
end

#default_bank_account_number_and_descriptionObject

Portfolio default bank account number and description



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

def 
  @default_bank_account_number_and_description
end

#default_security_deposit_bank_account_idObject

Portfolio default security deposit bank account ID



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

def 
  @default_security_deposit_bank_account_id
end

#default_security_deposit_bank_account_number_and_descriptionObject

Portfolio default security deposit bank account number and description



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

def 
  @default_security_deposit_bank_account_number_and_description
end

#do_not_pay_owner_drawObject

Indicates if the owner should not be paid owner draws.



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

def do_not_pay_owner_draw
  @do_not_pay_owner_draw
end

#idObject

Unique identifier.



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

def id
  @id
end

#last_modified_byObject

User who last modified the record.



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

def last_modified_by
  @last_modified_by
end

#last_modified_date_timeObject

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



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

def last_modified_date_time
  @last_modified_date_time
end

#maintenance_spending_limitObject

Monthly or yearly maintenance spending limit set for the portfolio for maintenance bills created by work orders.



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

def maintenance_spending_limit
  @maintenance_spending_limit
end

#maintenance_spending_limit_timeObject

Monthly or yearly maintenance spending limit time set for the portfolio for maintenance bills created by work orders.



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

def maintenance_spending_limit_time
  @maintenance_spending_limit_time
end

#modified_byObject

Id of the user who last modified the portfolio information.



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

def modified_by
  @modified_by
end

#nameObject

Portfolio name.



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

def name
  @name
end

#owner_statement_report_idObject

Portfolio Owner Statement Report ID



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

def owner_statement_report_id
  @owner_statement_report_id
end

#ownersObject

List of portfolio owners.



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

def owners
  @owners
end

#sticky_noteObject

Sticky notes.



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

def sticky_note
  @sticky_note
end

#target_operating_reserveObject

Minimum balance to be maintained within the portfolio at all times.



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

def target_operating_reserve
  @target_operating_reserve
end

Class Method Details

.acceptable_attributesObject

Returns all the JSON keys this model knows about



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

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

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



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

def self.attribute_map
  {
    :'abbreviation' => :'abbreviation',
    :'active' => :'active',
    :'cash_accrual' => :'cashAccrual',
    :'closing_date' => :'closingDate',
    :'created_by' => :'createdBy',
    :'created_date_time' => :'createdDateTime',
    :'custom_fields' => :'customFields',
    :'default_bank_account_id' => :'defaultBankAccountID',
    :'default_bank_account_number_and_description' => :'defaultBankAccountNumberAndDescription',
    :'default_security_deposit_bank_account_id' => :'defaultSecurityDepositBankAccountID',
    :'default_security_deposit_bank_account_number_and_description' => :'defaultSecurityDepositBankAccountNumberAndDescription',
    :'do_not_pay_owner_draw' => :'doNotPayOwnerDraw',
    :'id' => :'id',
    :'last_modified_by' => :'lastModifiedBy',
    :'last_modified_date_time' => :'lastModifiedDateTime',
    :'maintenance_spending_limit' => :'maintenanceSpendingLimit',
    :'maintenance_spending_limit_time' => :'maintenanceSpendingLimitTime',
    :'modified_by' => :'modifiedBy',
    :'name' => :'name',
    :'owner_statement_report_id' => :'ownerStatementReportID',
    :'owners' => :'owners',
    :'sticky_note' => :'stickyNote',
    :'target_operating_reserve' => :'targetOperatingReserve'
  }
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



373
374
375
# File 'lib/propertyware/models/portfolio.rb', line 373

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

.openapi_nullableObject

List of attributes with nullable: true



174
175
176
177
# File 'lib/propertyware/models/portfolio.rb', line 174

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

.openapi_typesObject

Attribute type mapping.



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

def self.openapi_types
  {
    :'abbreviation' => :'String',
    :'active' => :'Boolean',
    :'cash_accrual' => :'String',
    :'closing_date' => :'Date',
    :'created_by' => :'String',
    :'created_date_time' => :'Time',
    :'custom_fields' => :'Array<CustomField>',
    :'default_bank_account_id' => :'Integer',
    :'default_bank_account_number_and_description' => :'String',
    :'default_security_deposit_bank_account_id' => :'Integer',
    :'default_security_deposit_bank_account_number_and_description' => :'String',
    :'do_not_pay_owner_draw' => :'Boolean',
    :'id' => :'Integer',
    :'last_modified_by' => :'String',
    :'last_modified_date_time' => :'Time',
    :'maintenance_spending_limit' => :'Float',
    :'maintenance_spending_limit_time' => :'String',
    :'modified_by' => :'String',
    :'name' => :'String',
    :'owner_statement_report_id' => :'Integer',
    :'owners' => :'Array<Owner>',
    :'sticky_note' => :'String',
    :'target_operating_reserve' => :'Float'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



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

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      abbreviation == o.abbreviation &&
      active == o.active &&
      cash_accrual == o.cash_accrual &&
      closing_date == o.closing_date &&
      created_by == o.created_by &&
      created_date_time == o.created_date_time &&
      custom_fields == o.custom_fields &&
       == o. &&
       == o. &&
       == o. &&
       == o. &&
      do_not_pay_owner_draw == o.do_not_pay_owner_draw &&
      id == o.id &&
      last_modified_by == o.last_modified_by &&
      last_modified_date_time == o.last_modified_date_time &&
      maintenance_spending_limit == o.maintenance_spending_limit &&
      maintenance_spending_limit_time == o.maintenance_spending_limit_time &&
      modified_by == o.modified_by &&
      name == o.name &&
      owner_statement_report_id == o.owner_statement_report_id &&
      owners == o.owners &&
      sticky_note == o.sticky_note &&
      target_operating_reserve == o.target_operating_reserve
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



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

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



475
476
477
478
479
480
481
482
483
484
485
486
487
# File 'lib/propertyware/models/portfolio.rb', line 475

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



380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
# File 'lib/propertyware/models/portfolio.rb', line 380

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


360
361
362
# File 'lib/propertyware/models/portfolio.rb', line 360

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



366
367
368
# File 'lib/propertyware/models/portfolio.rb', line 366

def hash
  [abbreviation, active, cash_accrual, closing_date, created_by, created_date_time, custom_fields, , , , , do_not_pay_owner_draw, id, last_modified_by, last_modified_date_time, maintenance_spending_limit, maintenance_spending_limit_time, modified_by, name, owner_statement_report_id, owners, sticky_note, target_operating_reserve].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



293
294
295
296
# File 'lib/propertyware/models/portfolio.rb', line 293

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



451
452
453
# File 'lib/propertyware/models/portfolio.rb', line 451

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



457
458
459
460
461
462
463
464
465
466
467
468
469
# File 'lib/propertyware/models/portfolio.rb', line 457

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



445
446
447
# File 'lib/propertyware/models/portfolio.rb', line 445

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



300
301
302
303
304
305
306
# File 'lib/propertyware/models/portfolio.rb', line 300

def valid?
  cash_accrual_validator = EnumAttributeValidator.new('String', ["COMPANY_DEFAULT", "CASH", "ACCRUAL"])
  return false unless cash_accrual_validator.valid?(@cash_accrual)
  maintenance_spending_limit_time_validator = EnumAttributeValidator.new('String', ["NO_LIMIT", "DOLLAR_PER_MONTH", "DOLLAR_PER_YEAR"])
  return false unless maintenance_spending_limit_time_validator.valid?(@maintenance_spending_limit_time)
  true
end