Class: Propertyware::SaveContact

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

Overview

Contact for Request

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ SaveContact

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#addressObject

Returns the value of attribute address.



19
20
21
# File 'lib/propertyware/models/save_contact.rb', line 19

def address
  @address
end

#allow_e_signatureObject

Indicate if the contact can receive eSignature request e-mail messages sent through Propertyware.



22
23
24
# File 'lib/propertyware/models/save_contact.rb', line 22

def allow_e_signature
  @allow_e_signature
end

#alt_emailObject

Alternate Email Address.



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

def alt_email
  @alt_email
end

#birth_dateObject

Date of Birth.



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

def birth_date
  @birth_date
end

#categoryObject

Indicate contact category. Send empty "" value if contact is Uncategorized



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

def category
  @category
end

#commentsObject

Description.



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

def comments
  @comments
end

#companyObject

Company where the contact is employed.



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

def company
  @company
end

#emailObject

E-mail Address.



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

def email
  @email
end

#faxObject

Fax.



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

def fax
  @fax
end

#first_nameObject

First Name.



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

def first_name
  @first_name
end

#genderObject

Gender.



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

def gender
  @gender
end

#home_phoneObject

Home Phone.



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

def home_phone
  @home_phone
end

#job_titleObject

Professional title or position for the contact.



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

def job_title
  @job_title
end

#last_nameObject

Last Name.



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

def last_name
  @last_name
end

#middle_nameObject

Middle Name.



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

def middle_name
  @middle_name
end

#mobile_phoneObject

Mobile Phone.



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

def mobile_phone
  @mobile_phone
end

#name_on_checkObject

Name On Check.



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

def name_on_check
  @name_on_check
end

#named_on_leaseObject

Is Named On Lease.



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

def named_on_lease
  @named_on_lease
end

#other_phoneObject

Other Phone.



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

def other_phone
  @other_phone
end

#salutationObject

Salutation.



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

def salutation
  @salutation
end

#search_tagObject

SearchTag.



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

def search_tag
  @search_tag
end

#suffixObject

Suffix.



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

def suffix
  @suffix
end

#work_phoneObject

Work Phone.



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

def work_phone
  @work_phone
end

Class Method Details

.acceptable_attributesObject

Returns all the JSON keys this model knows about



139
140
141
# File 'lib/propertyware/models/save_contact.rb', line 139

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

def self.attribute_map
  {
    :'address' => :'address',
    :'allow_e_signature' => :'allowESignature',
    :'alt_email' => :'altEmail',
    :'birth_date' => :'birthDate',
    :'category' => :'category',
    :'comments' => :'comments',
    :'company' => :'company',
    :'email' => :'email',
    :'fax' => :'fax',
    :'first_name' => :'firstName',
    :'gender' => :'gender',
    :'home_phone' => :'homePhone',
    :'job_title' => :'jobTitle',
    :'last_name' => :'lastName',
    :'middle_name' => :'middleName',
    :'mobile_phone' => :'mobilePhone',
    :'name_on_check' => :'nameOnCheck',
    :'named_on_lease' => :'namedOnLease',
    :'other_phone' => :'otherPhone',
    :'salutation' => :'salutation',
    :'search_tag' => :'searchTag',
    :'suffix' => :'suffix',
    :'work_phone' => :'workPhone'
  }
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



614
615
616
# File 'lib/propertyware/models/save_contact.rb', line 614

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

.openapi_nullableObject

List of attributes with nullable: true



173
174
175
176
# File 'lib/propertyware/models/save_contact.rb', line 173

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

.openapi_typesObject

Attribute type mapping.



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

def self.openapi_types
  {
    :'address' => :'SaveAddress',
    :'allow_e_signature' => :'Boolean',
    :'alt_email' => :'String',
    :'birth_date' => :'Date',
    :'category' => :'String',
    :'comments' => :'String',
    :'company' => :'String',
    :'email' => :'String',
    :'fax' => :'String',
    :'first_name' => :'String',
    :'gender' => :'String',
    :'home_phone' => :'String',
    :'job_title' => :'String',
    :'last_name' => :'String',
    :'middle_name' => :'String',
    :'mobile_phone' => :'String',
    :'name_on_check' => :'String',
    :'named_on_lease' => :'Boolean',
    :'other_phone' => :'String',
    :'salutation' => :'String',
    :'search_tag' => :'String',
    :'suffix' => :'String',
    :'work_phone' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
# File 'lib/propertyware/models/save_contact.rb', line 571

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      address == o.address &&
      allow_e_signature == o.allow_e_signature &&
      alt_email == o.alt_email &&
      birth_date == o.birth_date &&
      category == o.category &&
      comments == o.comments &&
      company == o.company &&
      email == o.email &&
      fax == o.fax &&
      first_name == o.first_name &&
      gender == o.gender &&
      home_phone == o.home_phone &&
      job_title == o.job_title &&
      last_name == o.last_name &&
      middle_name == o.middle_name &&
      mobile_phone == o.mobile_phone &&
      name_on_check == o.name_on_check &&
      named_on_lease == o.named_on_lease &&
      other_phone == o.other_phone &&
      salutation == o.salutation &&
      search_tag == o.search_tag &&
      suffix == o.suffix &&
      work_phone == o.work_phone
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



645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
# File 'lib/propertyware/models/save_contact.rb', line 645

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



716
717
718
719
720
721
722
723
724
725
726
727
728
# File 'lib/propertyware/models/save_contact.rb', line 716

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



621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
# File 'lib/propertyware/models/save_contact.rb', line 621

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


601
602
603
# File 'lib/propertyware/models/save_contact.rb', line 601

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



607
608
609
# File 'lib/propertyware/models/save_contact.rb', line 607

def hash
  [address, allow_e_signature, alt_email, birth_date, category, comments, company, email, fax, first_name, gender, home_phone, job_title, last_name, middle_name, mobile_phone, name_on_check, named_on_lease, other_phone, salutation, search_tag, suffix, work_phone].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



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
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
# File 'lib/propertyware/models/save_contact.rb', line 288

def list_invalid_properties
  invalid_properties = Array.new
  if !@company.nil? && @company.to_s.length > 75
    invalid_properties.push('invalid value for "company", the character length must be smaller than or equal to 75.')
  end

  if !@company.nil? && @company.to_s.length < 1
    invalid_properties.push('invalid value for "company", the character length must be great than or equal to 1.')
  end

  if @first_name.nil?
    invalid_properties.push('invalid value for "first_name", first_name cannot be nil.')
  end

  if @first_name.to_s.length > 30
    invalid_properties.push('invalid value for "first_name", the character length must be smaller than or equal to 30.')
  end

  if @first_name.to_s.length < 1
    invalid_properties.push('invalid value for "first_name", the character length must be great than or equal to 1.')
  end

  if !@home_phone.nil? && @home_phone.to_s.length > 22
    invalid_properties.push('invalid value for "home_phone", the character length must be smaller than or equal to 22.')
  end

  if !@home_phone.nil? && @home_phone.to_s.length < 1
    invalid_properties.push('invalid value for "home_phone", the character length must be great than or equal to 1.')
  end

  if !@job_title.nil? && @job_title.to_s.length > 75
    invalid_properties.push('invalid value for "job_title", the character length must be smaller than or equal to 75.')
  end

  if !@job_title.nil? && @job_title.to_s.length < 1
    invalid_properties.push('invalid value for "job_title", the character length must be great than or equal to 1.')
  end

  if @last_name.nil?
    invalid_properties.push('invalid value for "last_name", last_name cannot be nil.')
  end

  if @last_name.to_s.length > 30
    invalid_properties.push('invalid value for "last_name", the character length must be smaller than or equal to 30.')
  end

  if @last_name.to_s.length < 1
    invalid_properties.push('invalid value for "last_name", the character length must be great than or equal to 1.')
  end

  if !@middle_name.nil? && @middle_name.to_s.length > 30
    invalid_properties.push('invalid value for "middle_name", the character length must be smaller than or equal to 30.')
  end

  if !@middle_name.nil? && @middle_name.to_s.length < 1
    invalid_properties.push('invalid value for "middle_name", the character length must be great than or equal to 1.')
  end

  if !@mobile_phone.nil? && @mobile_phone.to_s.length > 22
    invalid_properties.push('invalid value for "mobile_phone", the character length must be smaller than or equal to 22.')
  end

  if !@mobile_phone.nil? && @mobile_phone.to_s.length < 1
    invalid_properties.push('invalid value for "mobile_phone", the character length must be great than or equal to 1.')
  end

  if !@name_on_check.nil? && @name_on_check.to_s.length > 100
    invalid_properties.push('invalid value for "name_on_check", the character length must be smaller than or equal to 100.')
  end

  if !@name_on_check.nil? && @name_on_check.to_s.length < 1
    invalid_properties.push('invalid value for "name_on_check", the character length must be great than or equal to 1.')
  end

  if !@other_phone.nil? && @other_phone.to_s.length > 22
    invalid_properties.push('invalid value for "other_phone", the character length must be smaller than or equal to 22.')
  end

  if !@other_phone.nil? && @other_phone.to_s.length < 1
    invalid_properties.push('invalid value for "other_phone", the character length must be great than or equal to 1.')
  end

  if !@work_phone.nil? && @work_phone.to_s.length > 22
    invalid_properties.push('invalid value for "work_phone", the character length must be smaller than or equal to 22.')
  end

  if !@work_phone.nil? && @work_phone.to_s.length < 1
    invalid_properties.push('invalid value for "work_phone", the character length must be great than or equal to 1.')
  end

  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



692
693
694
# File 'lib/propertyware/models/save_contact.rb', line 692

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



698
699
700
701
702
703
704
705
706
707
708
709
710
# File 'lib/propertyware/models/save_contact.rb', line 698

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



686
687
688
# File 'lib/propertyware/models/save_contact.rb', line 686

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



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

def valid?
  return false if !@company.nil? && @company.to_s.length > 75
  return false if !@company.nil? && @company.to_s.length < 1
  return false if @first_name.nil?
  return false if @first_name.to_s.length > 30
  return false if @first_name.to_s.length < 1
  gender_validator = EnumAttributeValidator.new('String', ["UNKNOWN", "MALE", "FEMALE", "DECLINE_TO_STATE"])
  return false unless gender_validator.valid?(@gender)
  return false if !@home_phone.nil? && @home_phone.to_s.length > 22
  return false if !@home_phone.nil? && @home_phone.to_s.length < 1
  return false if !@job_title.nil? && @job_title.to_s.length > 75
  return false if !@job_title.nil? && @job_title.to_s.length < 1
  return false if @last_name.nil?
  return false if @last_name.to_s.length > 30
  return false if @last_name.to_s.length < 1
  return false if !@middle_name.nil? && @middle_name.to_s.length > 30
  return false if !@middle_name.nil? && @middle_name.to_s.length < 1
  return false if !@mobile_phone.nil? && @mobile_phone.to_s.length > 22
  return false if !@mobile_phone.nil? && @mobile_phone.to_s.length < 1
  return false if !@name_on_check.nil? && @name_on_check.to_s.length > 100
  return false if !@name_on_check.nil? && @name_on_check.to_s.length < 1
  return false if !@other_phone.nil? && @other_phone.to_s.length > 22
  return false if !@other_phone.nil? && @other_phone.to_s.length < 1
  return false if !@work_phone.nil? && @work_phone.to_s.length > 22
  return false if !@work_phone.nil? && @work_phone.to_s.length < 1
  true
end