Class: Propertyware::Portfolio
- Inherits:
-
Object
- Object
- Propertyware::Portfolio
- Defined in:
- lib/propertyware/models/portfolio.rb
Overview
Portfolio
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#abbreviation ⇒ Object
Abbreviated name assigned to the portfolio.
-
#active ⇒ Object
Indicates if portfolio is active or inactive.
-
#cash_accrual ⇒ Object
Cash or accrual accounting basis.
-
#closing_date ⇒ Object
Date when the accounting period for the portfolio will close.
-
#created_by ⇒ Object
User who created the record.
-
#created_date_time ⇒ Object
Date and time the record was created.
-
#custom_fields ⇒ Object
Custom fields.
-
#default_bank_account_id ⇒ Object
Id of the portfolio’s default bank account.
-
#default_bank_account_number_and_description ⇒ Object
Portfolio default bank account number and description.
-
#default_security_deposit_bank_account_id ⇒ Object
Portfolio default security deposit bank account ID.
-
#default_security_deposit_bank_account_number_and_description ⇒ Object
Portfolio default security deposit bank account number and description.
-
#do_not_pay_owner_draw ⇒ Object
Indicates if the owner should not be paid owner draws.
-
#id ⇒ Object
Unique identifier.
-
#last_modified_by ⇒ Object
User who last modified the record.
-
#last_modified_date_time ⇒ Object
Date and time the record was last modified.
-
#maintenance_spending_limit ⇒ Object
Monthly or yearly maintenance spending limit set for the portfolio for maintenance bills created by work orders.
-
#maintenance_spending_limit_time ⇒ Object
Monthly or yearly maintenance spending limit time set for the portfolio for maintenance bills created by work orders.
-
#modified_by ⇒ Object
Id of the user who last modified the portfolio information.
-
#name ⇒ Object
Portfolio name.
-
#owner_statement_report_id ⇒ Object
Portfolio Owner Statement Report ID.
-
#owners ⇒ Object
List of portfolio owners.
-
#sticky_note ⇒ Object
Sticky notes.
-
#target_operating_reserve ⇒ Object
Minimum balance to be maintained within the portfolio at all times.
Class Method Summary collapse
-
.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.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ Portfolio
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ Portfolio
Initializes the object
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.default_bank_account_id = attributes[:'default_bank_account_id'] end if attributes.key?(:'default_bank_account_number_and_description') self.default_bank_account_number_and_description = attributes[:'default_bank_account_number_and_description'] end if attributes.key?(:'default_security_deposit_bank_account_id') self.default_security_deposit_bank_account_id = attributes[:'default_security_deposit_bank_account_id'] end if attributes.key?(:'default_security_deposit_bank_account_number_and_description') self.default_security_deposit_bank_account_number_and_description = 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. = attributes[:'target_operating_reserve'] end end |
Instance Attribute Details
#abbreviation ⇒ Object
Abbreviated name assigned to the portfolio.
20 21 22 |
# File 'lib/propertyware/models/portfolio.rb', line 20 def abbreviation @abbreviation end |
#active ⇒ Object
Indicates if portfolio is active or inactive.
23 24 25 |
# File 'lib/propertyware/models/portfolio.rb', line 23 def active @active end |
#cash_accrual ⇒ Object
Cash or accrual accounting basis.
26 27 28 |
# File 'lib/propertyware/models/portfolio.rb', line 26 def cash_accrual @cash_accrual end |
#closing_date ⇒ Object
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_by ⇒ Object
User who created the record.
32 33 34 |
# File 'lib/propertyware/models/portfolio.rb', line 32 def created_by @created_by end |
#created_date_time ⇒ Object
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_fields ⇒ Object
Custom fields.
38 39 40 |
# File 'lib/propertyware/models/portfolio.rb', line 38 def custom_fields @custom_fields end |
#default_bank_account_id ⇒ Object
Id of the portfolio’s default bank account.
41 42 43 |
# File 'lib/propertyware/models/portfolio.rb', line 41 def default_bank_account_id @default_bank_account_id end |
#default_bank_account_number_and_description ⇒ Object
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 @default_bank_account_number_and_description end |
#default_security_deposit_bank_account_id ⇒ Object
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 @default_security_deposit_bank_account_id end |
#default_security_deposit_bank_account_number_and_description ⇒ Object
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 @default_security_deposit_bank_account_number_and_description end |
#do_not_pay_owner_draw ⇒ Object
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 |
#id ⇒ Object
Unique identifier.
56 57 58 |
# File 'lib/propertyware/models/portfolio.rb', line 56 def id @id end |
#last_modified_by ⇒ Object
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_time ⇒ Object
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_limit ⇒ Object
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_time ⇒ Object
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_by ⇒ Object
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 |
#name ⇒ Object
Portfolio name.
74 75 76 |
# File 'lib/propertyware/models/portfolio.rb', line 74 def name @name end |
#owner_statement_report_id ⇒ Object
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 |
#owners ⇒ Object
List of portfolio owners.
80 81 82 |
# File 'lib/propertyware/models/portfolio.rb', line 80 def owners @owners end |
#sticky_note ⇒ Object
Sticky notes.
83 84 85 |
# File 'lib/propertyware/models/portfolio.rb', line 83 def sticky_note @sticky_note end |
#target_operating_reserve ⇒ Object
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 end |
Class Method Details
.acceptable_attributes ⇒ Object
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_map ⇒ Object
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
373 374 375 |
# File 'lib/propertyware/models/portfolio.rb', line 373 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
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_types ⇒ Object
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.
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 && default_bank_account_id == o.default_bank_account_id && default_bank_account_number_and_description == o.default_bank_account_number_and_description && default_security_deposit_bank_account_id == o.default_security_deposit_bank_account_id && default_security_deposit_bank_account_number_and_description == o.default_security_deposit_bank_account_number_and_description && 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 && == o. end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
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
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
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
360 361 362 |
# File 'lib/propertyware/models/portfolio.rb', line 360 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
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, default_bank_account_id, default_bank_account_number_and_description, default_security_deposit_bank_account_id, default_security_deposit_bank_account_number_and_description, 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, ].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
293 294 295 296 |
# File 'lib/propertyware/models/portfolio.rb', line 293 def list_invalid_properties invalid_properties = Array.new invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
451 452 453 |
# File 'lib/propertyware/models/portfolio.rb', line 451 def to_body to_hash end |
#to_hash ⇒ 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_s ⇒ String
Returns the string representation 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
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 |