Class: Propertyware::SaveProspect

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

Overview

Save Prospect

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ SaveProspect

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#building_idObject

Unique identifier of the building associated with the prospect.



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

def building_id
  @building_id
end

#commentsObject

This is a description of the Prospect.



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

def comments
  @comments
end

#contactsObject

Prospect contacts.



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

def contacts
  @contacts
end

#current_home_typeObject

Prospect Current Home Type.



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

def current_home_type
  @current_home_type
end

#current_rent_mortgageObject

Prospect Current Home Mortgage.



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

def current_rent_mortgage
  @current_rent_mortgage
end

#has_petsObject

Prospect Has Pets.



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

def has_pets
  @has_pets
end

#move_in_dateObject

Prospect Move In Date.



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

def move_in_date
  @move_in_date
end

#neighborhood_desiredObject

Prospect Neighborhood Desired.



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

def neighborhood_desired
  @neighborhood_desired
end

#number_bathroomsObject

Prospect Number Of Bathrooms.



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

def number_bathrooms
  @number_bathrooms
end

#number_bedroomsObject

Prospect Number Of Bedrooms.



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

def number_bedrooms
  @number_bedrooms
end

#number_of_petsObject

Prospect Number Of Pets.



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

def number_of_pets
  @number_of_pets
end

#pet_typeObject

Prospect Pet Type.



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

def pet_type
  @pet_type
end

#pet_weightsObject

Prospect Pet Weights.



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

def pet_weights
  @pet_weights
end

#preferred_contact_methodObject

Prospect Preferred Contact Method.



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

def preferred_contact_method
  @preferred_contact_method
end

#property_addressObject

Property Address.



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

def property_address
  @property_address
end

#property_address2Object

Property Address Continued.



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

def property_address2
  @property_address2
end

#property_cityObject

Property City.



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

def property_city
  @property_city
end

#property_countryObject

Property Country.



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

def property_country
  @property_country
end

#property_number_bathroomsObject

Property Number Of Bath rooms.



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

def property_number_bathrooms
  @property_number_bathrooms
end

#property_number_bedroomsObject

Property Number Of Bedrooms.



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

def property_number_bedrooms
  @property_number_bedrooms
end

#property_stateObject

Property State.



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

def property_state
  @property_state
end

#property_zipObject

Property Zip.



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

def property_zip
  @property_zip
end

#reason_for_movingObject

Prospect Reason For Moving.



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

def reason_for_moving
  @reason_for_moving
end

#rent_maxObject

Prospect Rent Maximum.



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

def rent_max
  @rent_max
end

#rent_minObject

Prospect Rent Minimum.



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

def rent_min
  @rent_min
end

#sourceObject

Prospect Source.



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

def source
  @source
end

#statusObject

Prospect Status.



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

def status
  @status
end

#time_at_current_residenceObject

Prospect Time At Current Residence.



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

def time_at_current_residence
  @time_at_current_residence
end

#typeObject

Prospect Type.



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

def type
  @type
end

#type_of_inquiryObject

Prospect Type Of Inquiry.



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

def type_of_inquiry
  @type_of_inquiry
end

Class Method Details

.acceptable_attributesObject

Returns all the JSON keys this model knows about



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

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

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



110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# File 'lib/propertyware/models/save_prospect.rb', line 110

def self.attribute_map
  {
    :'building_id' => :'buildingID',
    :'comments' => :'comments',
    :'contacts' => :'contacts',
    :'current_home_type' => :'currentHomeType',
    :'current_rent_mortgage' => :'currentRentMortgage',
    :'has_pets' => :'hasPets',
    :'move_in_date' => :'moveInDate',
    :'neighborhood_desired' => :'neighborhoodDesired',
    :'number_bathrooms' => :'numberBathrooms',
    :'number_bedrooms' => :'numberBedrooms',
    :'number_of_pets' => :'numberOfPets',
    :'pet_type' => :'petType',
    :'pet_weights' => :'petWeights',
    :'preferred_contact_method' => :'preferredContactMethod',
    :'property_address' => :'propertyAddress',
    :'property_address2' => :'propertyAddress2',
    :'property_city' => :'propertyCity',
    :'property_country' => :'propertyCountry',
    :'property_number_bathrooms' => :'propertyNumberBathrooms',
    :'property_number_bedrooms' => :'propertyNumberBedrooms',
    :'property_state' => :'propertyState',
    :'property_zip' => :'propertyZip',
    :'reason_for_moving' => :'reasonForMoving',
    :'rent_max' => :'rentMax',
    :'rent_min' => :'rentMin',
    :'source' => :'source',
    :'status' => :'status',
    :'time_at_current_residence' => :'timeAtCurrentResidence',
    :'type' => :'type',
    :'type_of_inquiry' => :'typeOfInquiry'
  }
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



395
396
397
# File 'lib/propertyware/models/save_prospect.rb', line 395

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

.openapi_nullableObject

List of attributes with nullable: true



187
188
189
190
# File 'lib/propertyware/models/save_prospect.rb', line 187

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

.openapi_typesObject

Attribute type mapping.



151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# File 'lib/propertyware/models/save_prospect.rb', line 151

def self.openapi_types
  {
    :'building_id' => :'Integer',
    :'comments' => :'String',
    :'contacts' => :'Array<SaveProspectContact>',
    :'current_home_type' => :'String',
    :'current_rent_mortgage' => :'Float',
    :'has_pets' => :'Boolean',
    :'move_in_date' => :'Date',
    :'neighborhood_desired' => :'String',
    :'number_bathrooms' => :'Float',
    :'number_bedrooms' => :'Integer',
    :'number_of_pets' => :'Integer',
    :'pet_type' => :'String',
    :'pet_weights' => :'String',
    :'preferred_contact_method' => :'String',
    :'property_address' => :'String',
    :'property_address2' => :'String',
    :'property_city' => :'String',
    :'property_country' => :'String',
    :'property_number_bathrooms' => :'Float',
    :'property_number_bedrooms' => :'Integer',
    :'property_state' => :'String',
    :'property_zip' => :'String',
    :'reason_for_moving' => :'String',
    :'rent_max' => :'Float',
    :'rent_min' => :'Float',
    :'source' => :'String',
    :'status' => :'String',
    :'time_at_current_residence' => :'String',
    :'type' => :'String',
    :'type_of_inquiry' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



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

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      building_id == o.building_id &&
      comments == o.comments &&
      contacts == o.contacts &&
      current_home_type == o.current_home_type &&
      current_rent_mortgage == o.current_rent_mortgage &&
      has_pets == o.has_pets &&
      move_in_date == o.move_in_date &&
      neighborhood_desired == o.neighborhood_desired &&
      number_bathrooms == o.number_bathrooms &&
      number_bedrooms == o.number_bedrooms &&
      number_of_pets == o.number_of_pets &&
      pet_type == o.pet_type &&
      pet_weights == o.pet_weights &&
      preferred_contact_method == o.preferred_contact_method &&
      property_address == o.property_address &&
      property_address2 == o.property_address2 &&
      property_city == o.property_city &&
      property_country == o.property_country &&
      property_number_bathrooms == o.property_number_bathrooms &&
      property_number_bedrooms == o.property_number_bedrooms &&
      property_state == o.property_state &&
      property_zip == o.property_zip &&
      reason_for_moving == o.reason_for_moving &&
      rent_max == o.rent_max &&
      rent_min == o.rent_min &&
      source == o.source &&
      status == o.status &&
      time_at_current_residence == o.time_at_current_residence &&
      type == o.type &&
      type_of_inquiry == o.type_of_inquiry
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



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

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



497
498
499
500
501
502
503
504
505
506
507
508
509
# File 'lib/propertyware/models/save_prospect.rb', line 497

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



402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
# File 'lib/propertyware/models/save_prospect.rb', line 402

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


382
383
384
# File 'lib/propertyware/models/save_prospect.rb', line 382

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



388
389
390
# File 'lib/propertyware/models/save_prospect.rb', line 388

def hash
  [building_id, comments, contacts, current_home_type, current_rent_mortgage, has_pets, move_in_date, neighborhood_desired, number_bathrooms, number_bedrooms, number_of_pets, pet_type, pet_weights, preferred_contact_method, property_address, property_address2, property_city, property_country, property_number_bathrooms, property_number_bedrooms, property_state, property_zip, reason_for_moving, rent_max, rent_min, source, status, time_at_current_residence, type, type_of_inquiry].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



332
333
334
335
# File 'lib/propertyware/models/save_prospect.rb', line 332

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



473
474
475
# File 'lib/propertyware/models/save_prospect.rb', line 473

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



479
480
481
482
483
484
485
486
487
488
489
490
491
# File 'lib/propertyware/models/save_prospect.rb', line 479

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



467
468
469
# File 'lib/propertyware/models/save_prospect.rb', line 467

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



339
340
341
# File 'lib/propertyware/models/save_prospect.rb', line 339

def valid?
  true
end