Class: UltracartClient::PricingTier

Inherits:
Object
  • Object
show all
Defined in:
lib/ultracart_api/models/pricing_tier.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ PricingTier

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
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
# File 'lib/ultracart_api/models/pricing_tier.rb', line 211

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#allow_3rd_party_billingObject

Allow 3rd party billing



19
20
21
# File 'lib/ultracart_api/models/pricing_tier.rb', line 19

def allow_3rd_party_billing
  @allow_3rd_party_billing
end

#allow_codObject

Allow COD



22
23
24
# File 'lib/ultracart_api/models/pricing_tier.rb', line 22

def allow_cod
  @allow_cod
end

#allow_purchase_orderObject

Allow purchase order



25
26
27
# File 'lib/ultracart_api/models/pricing_tier.rb', line 25

def allow_purchase_order
  @allow_purchase_order
end

#allow_quote_requestObject

Allow quote request



28
29
30
# File 'lib/ultracart_api/models/pricing_tier.rb', line 28

def allow_quote_request
  @allow_quote_request
end

#approval_notificationObject

Returns the value of attribute approval_notification.



30
31
32
# File 'lib/ultracart_api/models/pricing_tier.rb', line 30

def approval_notification
  @approval_notification
end

#auto_approve_codObject

Auto approve COD



33
34
35
# File 'lib/ultracart_api/models/pricing_tier.rb', line 33

def auto_approve_cod
  @auto_approve_cod
end

#auto_approve_purchase_orderObject

Auto approve purchase order



36
37
38
# File 'lib/ultracart_api/models/pricing_tier.rb', line 36

def auto_approve_purchase_order
  @auto_approve_purchase_order
end

#currency_codeObject

Any currency code specified on this pricing tier will force a shopping cart into that currency



39
40
41
# File 'lib/ultracart_api/models/pricing_tier.rb', line 39

def currency_code
  @currency_code
end

#default_on_wholesale_signupObject

Default on wholesale signup



42
43
44
# File 'lib/ultracart_api/models/pricing_tier.rb', line 42

def 
  @default_on_wholesale_signup
end

#default_percentage_discountObject

Default percentage discount



45
46
47
# File 'lib/ultracart_api/models/pricing_tier.rb', line 45

def default_percentage_discount
  @default_percentage_discount
end

#default_shipping_method_oidObject

Default shipping method oid



48
49
50
# File 'lib/ultracart_api/models/pricing_tier.rb', line 48

def default_shipping_method_oid
  @default_shipping_method_oid
end

#default_tierObject

Default tier



51
52
53
# File 'lib/ultracart_api/models/pricing_tier.rb', line 51

def default_tier
  @default_tier
end

#display_on_wholesale_signupObject

Display on wholesale signup



54
55
56
# File 'lib/ultracart_api/models/pricing_tier.rb', line 54

def 
  @display_on_wholesale_signup
end

#exclude_from_free_promotionObject

Exclude from free promotion



57
58
59
# File 'lib/ultracart_api/models/pricing_tier.rb', line 57

def exclude_from_free_promotion
  @exclude_from_free_promotion
end

#exempt_loyalty_rewardsObject

Exempt from Loyalty Rewards



60
61
62
# File 'lib/ultracart_api/models/pricing_tier.rb', line 60

def exempt_loyalty_rewards
  @exempt_loyalty_rewards
end

#exempt_shipping_handling_chargeObject

Exempt shipping handling charge



63
64
65
# File 'lib/ultracart_api/models/pricing_tier.rb', line 63

def exempt_shipping_handling_charge
  @exempt_shipping_handling_charge
end

#free_shippingObject

Free shipping



66
67
68
# File 'lib/ultracart_api/models/pricing_tier.rb', line 66

def free_shipping
  @free_shipping
end

#free_shipping_minimumObject

Free shipping minimum



69
70
71
# File 'lib/ultracart_api/models/pricing_tier.rb', line 69

def free_shipping_minimum
  @free_shipping_minimum
end

#maximum_item_countObject

Maximum item count



72
73
74
# File 'lib/ultracart_api/models/pricing_tier.rb', line 72

def maximum_item_count
  @maximum_item_count
end

#minimum_item_countObject

Minimum item count



75
76
77
# File 'lib/ultracart_api/models/pricing_tier.rb', line 75

def minimum_item_count
  @minimum_item_count
end

#minimum_subtotalObject

Minimum subtotal



78
79
80
# File 'lib/ultracart_api/models/pricing_tier.rb', line 78

def minimum_subtotal
  @minimum_subtotal
end

#nameObject

Name



81
82
83
# File 'lib/ultracart_api/models/pricing_tier.rb', line 81

def name
  @name
end

#no_couponsObject

No coupons



84
85
86
# File 'lib/ultracart_api/models/pricing_tier.rb', line 84

def no_coupons
  @no_coupons
end

#no_free_shippingObject

No free shipping



87
88
89
# File 'lib/ultracart_api/models/pricing_tier.rb', line 87

def no_free_shipping
  @no_free_shipping
end

#no_realtime_chargeObject

No realtime charge



90
91
92
# File 'lib/ultracart_api/models/pricing_tier.rb', line 90

def no_realtime_charge
  @no_realtime_charge
end

#not_valid_when_coupon_presentObject

Not valid when coupon present



93
94
95
# File 'lib/ultracart_api/models/pricing_tier.rb', line 93

def not_valid_when_coupon_present
  @not_valid_when_coupon_present
end

#pricing_tier_oidObject

Pricing Tier Oid



96
97
98
# File 'lib/ultracart_api/models/pricing_tier.rb', line 96

def pricing_tier_oid
  @pricing_tier_oid
end

#realtime_percentage_discountObject

Realtime percentage discount



99
100
101
# File 'lib/ultracart_api/models/pricing_tier.rb', line 99

def realtime_percentage_discount
  @realtime_percentage_discount
end

#restrict_to_distribution_center_oidObject

Restrict inventory to this distribution center oid



102
103
104
# File 'lib/ultracart_api/models/pricing_tier.rb', line 102

def restrict_to_distribution_center_oid
  @restrict_to_distribution_center_oid
end

#signup_notificationObject

Returns the value of attribute signup_notification.



104
105
106
# File 'lib/ultracart_api/models/pricing_tier.rb', line 104

def 
  @signup_notification
end

#suppress_buysafeObject

Suppress buySAFE (deprecated)



107
108
109
# File 'lib/ultracart_api/models/pricing_tier.rb', line 107

def suppress_buysafe
  @suppress_buysafe
end

#suppress_mailing_listObject

Suppress mailing list



110
111
112
# File 'lib/ultracart_api/models/pricing_tier.rb', line 110

def suppress_mailing_list
  @suppress_mailing_list
end

#tax_exemptObject

Tax Exempt



113
114
115
# File 'lib/ultracart_api/models/pricing_tier.rb', line 113

def tax_exempt
  @tax_exempt
end

#track_separatelyObject

Track separately



116
117
118
# File 'lib/ultracart_api/models/pricing_tier.rb', line 116

def track_separately
  @track_separately
end

Class Method Details

.acceptable_attributesObject

Returns all the JSON keys this model knows about



159
160
161
# File 'lib/ultracart_api/models/pricing_tier.rb', line 159

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

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



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
144
145
146
147
148
149
150
151
152
153
154
155
156
# File 'lib/ultracart_api/models/pricing_tier.rb', line 119

def self.attribute_map
  {
    :'allow_3rd_party_billing' => :'allow_3rd_party_billing',
    :'allow_cod' => :'allow_cod',
    :'allow_purchase_order' => :'allow_purchase_order',
    :'allow_quote_request' => :'allow_quote_request',
    :'approval_notification' => :'approval_notification',
    :'auto_approve_cod' => :'auto_approve_cod',
    :'auto_approve_purchase_order' => :'auto_approve_purchase_order',
    :'currency_code' => :'currency_code',
    :'default_on_wholesale_signup' => :'default_on_wholesale_signup',
    :'default_percentage_discount' => :'default_percentage_discount',
    :'default_shipping_method_oid' => :'default_shipping_method_oid',
    :'default_tier' => :'default_tier',
    :'display_on_wholesale_signup' => :'display_on_wholesale_signup',
    :'exclude_from_free_promotion' => :'exclude_from_free_promotion',
    :'exempt_loyalty_rewards' => :'exempt_loyalty_rewards',
    :'exempt_shipping_handling_charge' => :'exempt_shipping_handling_charge',
    :'free_shipping' => :'free_shipping',
    :'free_shipping_minimum' => :'free_shipping_minimum',
    :'maximum_item_count' => :'maximum_item_count',
    :'minimum_item_count' => :'minimum_item_count',
    :'minimum_subtotal' => :'minimum_subtotal',
    :'name' => :'name',
    :'no_coupons' => :'no_coupons',
    :'no_free_shipping' => :'no_free_shipping',
    :'no_realtime_charge' => :'no_realtime_charge',
    :'not_valid_when_coupon_present' => :'not_valid_when_coupon_present',
    :'pricing_tier_oid' => :'pricing_tier_oid',
    :'realtime_percentage_discount' => :'realtime_percentage_discount',
    :'restrict_to_distribution_center_oid' => :'restrict_to_distribution_center_oid',
    :'signup_notification' => :'signup_notification',
    :'suppress_buysafe' => :'suppress_buysafe',
    :'suppress_mailing_list' => :'suppress_mailing_list',
    :'tax_exempt' => :'tax_exempt',
    :'track_separately' => :'track_separately'
  }
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



445
446
447
# File 'lib/ultracart_api/models/pricing_tier.rb', line 445

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

.openapi_nullableObject

List of attributes with nullable: true



204
205
206
207
# File 'lib/ultracart_api/models/pricing_tier.rb', line 204

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

.openapi_typesObject

Attribute type mapping.



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
# File 'lib/ultracart_api/models/pricing_tier.rb', line 164

def self.openapi_types
  {
    :'allow_3rd_party_billing' => :'Boolean',
    :'allow_cod' => :'Boolean',
    :'allow_purchase_order' => :'Boolean',
    :'allow_quote_request' => :'Boolean',
    :'approval_notification' => :'PricingTierNotification',
    :'auto_approve_cod' => :'Boolean',
    :'auto_approve_purchase_order' => :'Boolean',
    :'currency_code' => :'String',
    :'default_on_wholesale_signup' => :'Boolean',
    :'default_percentage_discount' => :'Float',
    :'default_shipping_method_oid' => :'Integer',
    :'default_tier' => :'Boolean',
    :'display_on_wholesale_signup' => :'Boolean',
    :'exclude_from_free_promotion' => :'Boolean',
    :'exempt_loyalty_rewards' => :'Boolean',
    :'exempt_shipping_handling_charge' => :'Boolean',
    :'free_shipping' => :'Boolean',
    :'free_shipping_minimum' => :'Float',
    :'maximum_item_count' => :'Integer',
    :'minimum_item_count' => :'Integer',
    :'minimum_subtotal' => :'Float',
    :'name' => :'String',
    :'no_coupons' => :'Boolean',
    :'no_free_shipping' => :'Boolean',
    :'no_realtime_charge' => :'Boolean',
    :'not_valid_when_coupon_present' => :'Boolean',
    :'pricing_tier_oid' => :'Integer',
    :'realtime_percentage_discount' => :'Float',
    :'restrict_to_distribution_center_oid' => :'Integer',
    :'signup_notification' => :'PricingTierNotification',
    :'suppress_buysafe' => :'Boolean',
    :'suppress_mailing_list' => :'Boolean',
    :'tax_exempt' => :'Boolean',
    :'track_separately' => :'Boolean'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



391
392
393
394
395
396
397
398
399
400
401
402
403
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
# File 'lib/ultracart_api/models/pricing_tier.rb', line 391

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      allow_3rd_party_billing == o.allow_3rd_party_billing &&
      allow_cod == o.allow_cod &&
      allow_purchase_order == o.allow_purchase_order &&
      allow_quote_request == o.allow_quote_request &&
      approval_notification == o.approval_notification &&
      auto_approve_cod == o.auto_approve_cod &&
      auto_approve_purchase_order == o.auto_approve_purchase_order &&
      currency_code == o.currency_code &&
       == o. &&
      default_percentage_discount == o.default_percentage_discount &&
      default_shipping_method_oid == o.default_shipping_method_oid &&
      default_tier == o.default_tier &&
       == o. &&
      exclude_from_free_promotion == o.exclude_from_free_promotion &&
      exempt_loyalty_rewards == o.exempt_loyalty_rewards &&
      exempt_shipping_handling_charge == o.exempt_shipping_handling_charge &&
      free_shipping == o.free_shipping &&
      free_shipping_minimum == o.free_shipping_minimum &&
      maximum_item_count == o.maximum_item_count &&
      minimum_item_count == o.minimum_item_count &&
      minimum_subtotal == o.minimum_subtotal &&
      name == o.name &&
      no_coupons == o.no_coupons &&
      no_free_shipping == o.no_free_shipping &&
      no_realtime_charge == o.no_realtime_charge &&
      not_valid_when_coupon_present == o.not_valid_when_coupon_present &&
      pricing_tier_oid == o.pricing_tier_oid &&
      realtime_percentage_discount == o.realtime_percentage_discount &&
      restrict_to_distribution_center_oid == o.restrict_to_distribution_center_oid &&
       == o. &&
      suppress_buysafe == o.suppress_buysafe &&
      suppress_mailing_list == o.suppress_mailing_list &&
      tax_exempt == o.tax_exempt &&
      track_separately == o.track_separately
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



476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
# File 'lib/ultracart_api/models/pricing_tier.rb', line 476

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 = UltracartClient.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



547
548
549
550
551
552
553
554
555
556
557
558
559
# File 'lib/ultracart_api/models/pricing_tier.rb', line 547

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



452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
# File 'lib/ultracart_api/models/pricing_tier.rb', line 452

def build_from_hash(attributes)
  return nil 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


432
433
434
# File 'lib/ultracart_api/models/pricing_tier.rb', line 432

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



438
439
440
# File 'lib/ultracart_api/models/pricing_tier.rb', line 438

def hash
  [allow_3rd_party_billing, allow_cod, allow_purchase_order, allow_quote_request, approval_notification, auto_approve_cod, auto_approve_purchase_order, currency_code, , default_percentage_discount, default_shipping_method_oid, default_tier, , exclude_from_free_promotion, exempt_loyalty_rewards, exempt_shipping_handling_charge, free_shipping, free_shipping_minimum, maximum_item_count, minimum_item_count, minimum_subtotal, name, no_coupons, no_free_shipping, no_realtime_charge, not_valid_when_coupon_present, pricing_tier_oid, realtime_percentage_discount, restrict_to_distribution_center_oid, , suppress_buysafe, suppress_mailing_list, tax_exempt, track_separately].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



363
364
365
366
367
368
369
370
# File 'lib/ultracart_api/models/pricing_tier.rb', line 363

def list_invalid_properties
  invalid_properties = Array.new
  if !@name.nil? && @name.to_s.length > 50
    invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 50.')
  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



523
524
525
# File 'lib/ultracart_api/models/pricing_tier.rb', line 523

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



529
530
531
532
533
534
535
536
537
538
539
540
541
# File 'lib/ultracart_api/models/pricing_tier.rb', line 529

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



517
518
519
# File 'lib/ultracart_api/models/pricing_tier.rb', line 517

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



374
375
376
377
# File 'lib/ultracart_api/models/pricing_tier.rb', line 374

def valid?
  return false if !@name.nil? && @name.to_s.length > 50
  true
end