Class: Propertyware::Marketing

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

Overview

Marketing Information

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Marketing

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#available_dateObject

Available date to lease for a unit/building.



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

def available_date
  @available_date
end

#commentsObject

Marketing description.



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

def comments
  @comments
end

Indicates if property is featured for rent or sale.



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

def featured
  @featured
end

Indicates if the unit/building is featured for rent.



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

def featured_for_rent
  @featured_for_rent
end

Indicates if unit/building is featured for sale.



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

def featured_for_sale
  @featured_for_sale
end

#for_saleObject

Indicates if this building/unit is for sale.



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

def for_sale
  @for_sale
end

#latitudeObject

Latitude for geolocation of this building/unit.



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

def latitude
  @latitude
end

#lease_termsObject

Lease terms of a unit/building.



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

def lease_terms
  @lease_terms
end

#lease_terms_unitsObject

Unit/building lease terms units.



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

def lease_terms_units
  @lease_terms_units
end

#longitudeObject

Longitude for geolocation of this building/unit.



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

def longitude
  @longitude
end

#marketing_nameObject

Marketing name.



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

def marketing_name
  @marketing_name
end

#mls_lease_numberObject

MLS lease number of this building/unit.



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

def mls_lease_number
  @mls_lease_number
end

#mls_numberObject

MLS number of this building/unit.



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

def mls_number
  @mls_number
end

#other_tenant_chargesObject

Other tenant charges.



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

def other_tenant_charges
  @other_tenant_charges
end

#parcel_numberObject

Parcel number of this building/unit.



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

def parcel_number
  @parcel_number
end

#pets_allowedObject

Indicates if pets are allowed in a unit/building.



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

def pets_allowed
  @pets_allowed
end

#posting_titleObject

Posting title name for marketing this building/unit.



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

def posting_title
  @posting_title
end

#published_for_saleObject

Indicates if the unit/building is published for sale.



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

def published_for_sale
  @published_for_sale
end

#sale_priceObject

Sale price of this building/unit.



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

def sale_price
  @sale_price
end

#sale_termsObject

Sale terms of this building/unit.



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

def sale_terms
  @sale_terms
end

#short_descriptionObject

Marketing short description.



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

def short_description
  @short_description
end

#smoking_allowedObject

Indicates if smoking is allowed in this unit/building.



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

def smoking_allowed
  @smoking_allowed
end

#specialsObject

Specials of this building/unit.



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

def specials
  @specials
end

Class Method Details

.acceptable_attributesObject

Returns all the JSON keys this model knows about



118
119
120
# File 'lib/propertyware/models/marketing.rb', line 118

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

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



89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'lib/propertyware/models/marketing.rb', line 89

def self.attribute_map
  {
    :'available_date' => :'availableDate',
    :'comments' => :'comments',
    :'featured' => :'featured',
    :'featured_for_rent' => :'featuredForRent',
    :'featured_for_sale' => :'featuredForSale',
    :'for_sale' => :'forSale',
    :'latitude' => :'latitude',
    :'lease_terms' => :'leaseTerms',
    :'lease_terms_units' => :'leaseTermsUnits',
    :'longitude' => :'longitude',
    :'marketing_name' => :'marketingName',
    :'mls_lease_number' => :'mlsLeaseNumber',
    :'mls_number' => :'mlsNumber',
    :'other_tenant_charges' => :'otherTenantCharges',
    :'parcel_number' => :'parcelNumber',
    :'pets_allowed' => :'petsAllowed',
    :'posting_title' => :'postingTitle',
    :'published_for_sale' => :'publishedForSale',
    :'sale_price' => :'salePrice',
    :'sale_terms' => :'saleTerms',
    :'short_description' => :'shortDescription',
    :'smoking_allowed' => :'smokingAllowed',
    :'specials' => :'specials'
  }
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



323
324
325
# File 'lib/propertyware/models/marketing.rb', line 323

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

.openapi_nullableObject

List of attributes with nullable: true



152
153
154
155
# File 'lib/propertyware/models/marketing.rb', line 152

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

.openapi_typesObject

Attribute type mapping.



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

def self.openapi_types
  {
    :'available_date' => :'Date',
    :'comments' => :'String',
    :'featured' => :'Boolean',
    :'featured_for_rent' => :'Boolean',
    :'featured_for_sale' => :'Boolean',
    :'for_sale' => :'Boolean',
    :'latitude' => :'Float',
    :'lease_terms' => :'Integer',
    :'lease_terms_units' => :'String',
    :'longitude' => :'Float',
    :'marketing_name' => :'String',
    :'mls_lease_number' => :'String',
    :'mls_number' => :'String',
    :'other_tenant_charges' => :'String',
    :'parcel_number' => :'String',
    :'pets_allowed' => :'Boolean',
    :'posting_title' => :'String',
    :'published_for_sale' => :'Boolean',
    :'sale_price' => :'Float',
    :'sale_terms' => :'String',
    :'short_description' => :'String',
    :'smoking_allowed' => :'Boolean',
    :'specials' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



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

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      available_date == o.available_date &&
      comments == o.comments &&
      featured == o.featured &&
      featured_for_rent == o.featured_for_rent &&
      featured_for_sale == o.featured_for_sale &&
      for_sale == o.for_sale &&
      latitude == o.latitude &&
      lease_terms == o.lease_terms &&
      lease_terms_units == o.lease_terms_units &&
      longitude == o.longitude &&
      marketing_name == o.marketing_name &&
      mls_lease_number == o.mls_lease_number &&
      mls_number == o.mls_number &&
      other_tenant_charges == o.other_tenant_charges &&
      parcel_number == o.parcel_number &&
      pets_allowed == o.pets_allowed &&
      posting_title == o.posting_title &&
      published_for_sale == o.published_for_sale &&
      sale_price == o.sale_price &&
      sale_terms == o.sale_terms &&
      short_description == o.short_description &&
      smoking_allowed == o.smoking_allowed &&
      specials == o.specials
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



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
380
381
382
383
384
385
386
387
388
389
390
391
# File 'lib/propertyware/models/marketing.rb', line 354

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



425
426
427
428
429
430
431
432
433
434
435
436
437
# File 'lib/propertyware/models/marketing.rb', line 425

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



330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
# File 'lib/propertyware/models/marketing.rb', line 330

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


310
311
312
# File 'lib/propertyware/models/marketing.rb', line 310

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



316
317
318
# File 'lib/propertyware/models/marketing.rb', line 316

def hash
  [available_date, comments, featured, featured_for_rent, featured_for_sale, for_sale, latitude, lease_terms, lease_terms_units, longitude, marketing_name, mls_lease_number, mls_number, other_tenant_charges, parcel_number, pets_allowed, posting_title, published_for_sale, sale_price, sale_terms, short_description, smoking_allowed, specials].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



267
268
269
270
# File 'lib/propertyware/models/marketing.rb', line 267

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



401
402
403
# File 'lib/propertyware/models/marketing.rb', line 401

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



407
408
409
410
411
412
413
414
415
416
417
418
419
# File 'lib/propertyware/models/marketing.rb', line 407

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



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

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



274
275
276
# File 'lib/propertyware/models/marketing.rb', line 274

def valid?
  true
end