Class: UltracartClient::Customer

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Customer

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
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
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
464
465
466
467
468
469
470
471
472
473
474
475
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
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
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
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
# File 'lib/ultracart_api/models/customer.rb', line 355

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

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

  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_drop_shipping')
    self.allow_drop_shipping = attributes[:'allow_drop_shipping']
  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?(:'allow_selection_of_address_type')
    self.allow_selection_of_address_type = attributes[:'allow_selection_of_address_type']
  end

  if attributes.key?(:'attachments')
    if (value = attributes[:'attachments']).is_a?(Array)
      self.attachments = value
    end
  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?(:'automatic_merchant_notes')
    self.automatic_merchant_notes = attributes[:'automatic_merchant_notes']
  end

  if attributes.key?(:'billing')
    if (value = attributes[:'billing']).is_a?(Array)
      self.billing = value
    end
  end

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

  if attributes.key?(:'cards')
    if (value = attributes[:'cards']).is_a?(Array)
      self.cards = value
    end
  end

  if attributes.key?(:'cc_emails')
    if (value = attributes[:'cc_emails']).is_a?(Array)
      self.cc_emails = value
    end
  end

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

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

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

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

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

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

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

  if attributes.key?(:'fedex_account_number')
    self. = attributes[:'fedex_account_number']
  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?(:'last_modified_by')
    self.last_modified_by = attributes[:'last_modified_by']
  end

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

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

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

  if attributes.key?(:'merchant_id')
    self.merchant_id = attributes[:'merchant_id']
  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?(:'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?(:'orders')
    if (value = attributes[:'orders']).is_a?(Array)
      self.orders = value
    end
  end

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

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

  if attributes.key?(:'pricing_tiers')
    if (value = attributes[:'pricing_tiers']).is_a?(Array)
      self.pricing_tiers = value
    end
  end

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

  if attributes.key?(:'properties')
    if (value = attributes[:'properties']).is_a?(Array)
      self.properties = value
    end
  end

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

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

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

  if attributes.key?(:'quotes')
    if (value = attributes[:'quotes']).is_a?(Array)
      self.quotes = value
    end
  end

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

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

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

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

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

  if attributes.key?(:'shipping')
    if (value = attributes[:'shipping']).is_a?(Array)
      self.shipping = value
    end
  end

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

  if attributes.key?(:'software_entitlements')
    if (value = attributes[:'software_entitlements']).is_a?(Array)
      self.software_entitlements = value
    end
  end

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

  if attributes.key?(:'tags')
    if (value = attributes[:'tags']).is_a?(Array)
      self.tags = value
    end
  end

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

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

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

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

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

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

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

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

Instance Attribute Details

#activityObject

Returns the value of attribute activity.



18
19
20
# File 'lib/ultracart_api/models/customer.rb', line 18

def activity
  @activity
end

#affiliate_oidObject

Affiliate oid



21
22
23
# File 'lib/ultracart_api/models/customer.rb', line 21

def affiliate_oid
  @affiliate_oid
end

#allow_3rd_party_billingObject

Allow 3rd party billing



24
25
26
# File 'lib/ultracart_api/models/customer.rb', line 24

def allow_3rd_party_billing
  @allow_3rd_party_billing
end

#allow_codObject

Allow COD



27
28
29
# File 'lib/ultracart_api/models/customer.rb', line 27

def allow_cod
  @allow_cod
end

#allow_drop_shippingObject

Allow Drop Shipping



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

def allow_drop_shipping
  @allow_drop_shipping
end

#allow_purchase_orderObject

Allow purchase orders by this customer



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

def allow_purchase_order
  @allow_purchase_order
end

#allow_quote_requestObject

Allow quote request



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

def allow_quote_request
  @allow_quote_request
end

#allow_selection_of_address_typeObject

Allow selection of residential or business address type



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

def allow_selection_of_address_type
  @allow_selection_of_address_type
end

#attachmentsObject

Attachments



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

def attachments
  @attachments
end

#auto_approve_codObject

Auto approve COD



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

def auto_approve_cod
  @auto_approve_cod
end

#auto_approve_purchase_orderObject

Auto approve purchase orders by this customer



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

def auto_approve_purchase_order
  @auto_approve_purchase_order
end

#automatic_merchant_notesObject

Automatic merchant notes are added to every order placed



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

def automatic_merchant_notes
  @automatic_merchant_notes
end

#billingObject

Billing addresses for this customer



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

def billing
  @billing
end

#business_notesObject

Business notes (internally visible only)



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

def business_notes
  @business_notes
end

#cardsObject

Credit Cards for this customer



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

def cards
  @cards
end

#cc_emailsObject

Additional emails to CC notification



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

def cc_emails
  @cc_emails
end

#customer_profile_oidObject

Customer profile object identifier



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

def customer_profile_oid
  @customer_profile_oid
end

#dhl_account_numberObject

DHL account number



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

def 
  
end

#dhl_duty_account_numberObject

DHL duty account number



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

def 
  
end

#do_not_send_mailObject

Do not send mail (null will not update)



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

def do_not_send_mail
  @do_not_send_mail
end

#ediObject

Returns the value of attribute edi.



77
78
79
# File 'lib/ultracart_api/models/customer.rb', line 77

def edi
  @edi
end

#emailObject

Email address of this customer profile



80
81
82
# File 'lib/ultracart_api/models/customer.rb', line 80

def email
  @email
end

#exempt_shipping_handling_chargeObject

Exempt shipping handling charge



83
84
85
# File 'lib/ultracart_api/models/customer.rb', line 83

def exempt_shipping_handling_charge
  @exempt_shipping_handling_charge
end

#fedex_account_numberObject

FedEx account number



86
87
88
# File 'lib/ultracart_api/models/customer.rb', line 86

def 
  
end

#free_shippingObject

This customer always receives free shipping



89
90
91
# File 'lib/ultracart_api/models/customer.rb', line 89

def free_shipping
  @free_shipping
end

#free_shipping_minimumObject

If free_shipping is true, this is the minimum subtotal required for free shipping



92
93
94
# File 'lib/ultracart_api/models/customer.rb', line 92

def free_shipping_minimum
  @free_shipping_minimum
end

#last_modified_byObject

Last modified by



95
96
97
# File 'lib/ultracart_api/models/customer.rb', line 95

def last_modified_by
  @last_modified_by
end

#last_modified_dtsObject

Last modified date



98
99
100
# File 'lib/ultracart_api/models/customer.rb', line 98

def last_modified_dts
  @last_modified_dts
end

#loyaltyObject

Returns the value of attribute loyalty.



100
101
102
# File 'lib/ultracart_api/models/customer.rb', line 100

def loyalty
  @loyalty
end

#maximum_item_countObject

Maximum item count



103
104
105
# File 'lib/ultracart_api/models/customer.rb', line 103

def maximum_item_count
  @maximum_item_count
end

#merchant_idObject

Merchant ID



106
107
108
# File 'lib/ultracart_api/models/customer.rb', line 106

def merchant_id
  @merchant_id
end

#minimum_item_countObject

Minimum item count



109
110
111
# File 'lib/ultracart_api/models/customer.rb', line 109

def minimum_item_count
  @minimum_item_count
end

#minimum_subtotalObject

Minimum subtotal



112
113
114
# File 'lib/ultracart_api/models/customer.rb', line 112

def minimum_subtotal
  @minimum_subtotal
end

#no_couponsObject

No coupons



115
116
117
# File 'lib/ultracart_api/models/customer.rb', line 115

def no_coupons
  @no_coupons
end

#no_free_shippingObject

No free shipping regardless of coupons or item level settings



118
119
120
# File 'lib/ultracart_api/models/customer.rb', line 118

def no_free_shipping
  @no_free_shipping
end

#no_realtime_chargeObject

No realtime charge



121
122
123
# File 'lib/ultracart_api/models/customer.rb', line 121

def no_realtime_charge
  @no_realtime_charge
end

#ordersObject

Orders associated with this customer profile



124
125
126
# File 'lib/ultracart_api/models/customer.rb', line 124

def orders
  @orders
end

#orders_summaryObject

Returns the value of attribute orders_summary.



126
127
128
# File 'lib/ultracart_api/models/customer.rb', line 126

def orders_summary
  @orders_summary
end

#passwordObject

Password (may only be set, never read)



129
130
131
# File 'lib/ultracart_api/models/customer.rb', line 129

def password
  @password
end

#pricing_tiersObject

Pricing tiers for this customer



132
133
134
# File 'lib/ultracart_api/models/customer.rb', line 132

def pricing_tiers
  @pricing_tiers
end

#privacyObject

Returns the value of attribute privacy.



134
135
136
# File 'lib/ultracart_api/models/customer.rb', line 134

def privacy
  @privacy
end

#propertiesObject

Properties for this customer



137
138
139
# File 'lib/ultracart_api/models/customer.rb', line 137

def properties
  @properties
end

#qb_classObject

QuickBooks class to import this customer as



140
141
142
# File 'lib/ultracart_api/models/customer.rb', line 140

def qb_class
  @qb_class
end

#qb_codeObject

QuickBooks name to import this customer as



143
144
145
# File 'lib/ultracart_api/models/customer.rb', line 143

def qb_code
  @qb_code
end

#qb_tax_exemption_reason_codeObject

QuickBooks tax exemption reason code



146
147
148
# File 'lib/ultracart_api/models/customer.rb', line 146

def qb_tax_exemption_reason_code
  @qb_tax_exemption_reason_code
end

#quotesObject

Quotes associated with this customer profile



149
150
151
# File 'lib/ultracart_api/models/customer.rb', line 149

def quotes
  @quotes
end

#quotes_summaryObject

Returns the value of attribute quotes_summary.



151
152
153
# File 'lib/ultracart_api/models/customer.rb', line 151

def quotes_summary
  @quotes_summary
end

#referral_sourceObject

Referral Source



154
155
156
# File 'lib/ultracart_api/models/customer.rb', line 154

def referral_source
  @referral_source
end

#reviewerObject

Returns the value of attribute reviewer.



156
157
158
# File 'lib/ultracart_api/models/customer.rb', line 156

def reviewer
  @reviewer
end

#sales_rep_codeObject

Sales rep code



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

def sales_rep_code
  @sales_rep_code
end

#send_signup_notificationObject

Send signup notification, if true during customer creation, will send a notification.



162
163
164
# File 'lib/ultracart_api/models/customer.rb', line 162

def 
  
end

#shippingObject

Shipping addresses for this customer



165
166
167
# File 'lib/ultracart_api/models/customer.rb', line 165

def shipping
  @shipping
end

#signup_dtsObject

Signup date



168
169
170
# File 'lib/ultracart_api/models/customer.rb', line 168

def 
  @signup_dts
end

#software_entitlementsObject

Software entitlements owned by this customer



171
172
173
# File 'lib/ultracart_api/models/customer.rb', line 171

def software_entitlements
  @software_entitlements
end

#suppress_buysafeObject

Suppress buySAFE (deprecated)



174
175
176
# File 'lib/ultracart_api/models/customer.rb', line 174

def suppress_buysafe
  @suppress_buysafe
end

#tagsObject

Tags for this customer



177
178
179
# File 'lib/ultracart_api/models/customer.rb', line 177

def tags
  @tags
end

#tax_codesObject

Returns the value of attribute tax_codes.



179
180
181
# File 'lib/ultracart_api/models/customer.rb', line 179

def tax_codes
  @tax_codes
end

#tax_exemptObject

True if the customer is tax exempt



182
183
184
# File 'lib/ultracart_api/models/customer.rb', line 182

def tax_exempt
  @tax_exempt
end

#tax_idObject

Tax ID



185
186
187
# File 'lib/ultracart_api/models/customer.rb', line 185

def tax_id
  @tax_id
end

#termsObject

Terms for this customer



188
189
190
# File 'lib/ultracart_api/models/customer.rb', line 188

def terms
  @terms
end

#track_separatelyObject

True if the customer should be tracked separately in QuickBooks



191
192
193
# File 'lib/ultracart_api/models/customer.rb', line 191

def track_separately
  @track_separately
end

#unapprovedObject

Unapproved



194
195
196
# File 'lib/ultracart_api/models/customer.rb', line 194

def unapproved
  @unapproved
end

#ups_account_numberObject

UPS account number



197
198
199
# File 'lib/ultracart_api/models/customer.rb', line 197

def 
  
end

#website_urlObject

Website url



200
201
202
# File 'lib/ultracart_api/models/customer.rb', line 200

def website_url
  @website_url
end

Class Method Details

.acceptable_attributesObject

Returns all the JSON keys this model knows about



273
274
275
# File 'lib/ultracart_api/models/customer.rb', line 273

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

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



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

def self.attribute_map
  {
    :'activity' => :'activity',
    :'affiliate_oid' => :'affiliate_oid',
    :'allow_3rd_party_billing' => :'allow_3rd_party_billing',
    :'allow_cod' => :'allow_cod',
    :'allow_drop_shipping' => :'allow_drop_shipping',
    :'allow_purchase_order' => :'allow_purchase_order',
    :'allow_quote_request' => :'allow_quote_request',
    :'allow_selection_of_address_type' => :'allow_selection_of_address_type',
    :'attachments' => :'attachments',
    :'auto_approve_cod' => :'auto_approve_cod',
    :'auto_approve_purchase_order' => :'auto_approve_purchase_order',
    :'automatic_merchant_notes' => :'automatic_merchant_notes',
    :'billing' => :'billing',
    :'business_notes' => :'business_notes',
    :'cards' => :'cards',
    :'cc_emails' => :'cc_emails',
    :'customer_profile_oid' => :'customer_profile_oid',
    :'dhl_account_number' => :'dhl_account_number',
    :'dhl_duty_account_number' => :'dhl_duty_account_number',
    :'do_not_send_mail' => :'do_not_send_mail',
    :'edi' => :'edi',
    :'email' => :'email',
    :'exempt_shipping_handling_charge' => :'exempt_shipping_handling_charge',
    :'fedex_account_number' => :'fedex_account_number',
    :'free_shipping' => :'free_shipping',
    :'free_shipping_minimum' => :'free_shipping_minimum',
    :'last_modified_by' => :'last_modified_by',
    :'last_modified_dts' => :'last_modified_dts',
    :'loyalty' => :'loyalty',
    :'maximum_item_count' => :'maximum_item_count',
    :'merchant_id' => :'merchant_id',
    :'minimum_item_count' => :'minimum_item_count',
    :'minimum_subtotal' => :'minimum_subtotal',
    :'no_coupons' => :'no_coupons',
    :'no_free_shipping' => :'no_free_shipping',
    :'no_realtime_charge' => :'no_realtime_charge',
    :'orders' => :'orders',
    :'orders_summary' => :'orders_summary',
    :'password' => :'password',
    :'pricing_tiers' => :'pricing_tiers',
    :'privacy' => :'privacy',
    :'properties' => :'properties',
    :'qb_class' => :'qb_class',
    :'qb_code' => :'qb_code',
    :'qb_tax_exemption_reason_code' => :'qb_tax_exemption_reason_code',
    :'quotes' => :'quotes',
    :'quotes_summary' => :'quotes_summary',
    :'referral_source' => :'referral_source',
    :'reviewer' => :'reviewer',
    :'sales_rep_code' => :'sales_rep_code',
    :'send_signup_notification' => :'send_signup_notification',
    :'shipping' => :'shipping',
    :'signup_dts' => :'signup_dts',
    :'software_entitlements' => :'software_entitlements',
    :'suppress_buysafe' => :'suppress_buysafe',
    :'tags' => :'tags',
    :'tax_codes' => :'tax_codes',
    :'tax_exempt' => :'tax_exempt',
    :'tax_id' => :'tax_id',
    :'terms' => :'terms',
    :'track_separately' => :'track_separately',
    :'unapproved' => :'unapproved',
    :'ups_account_number' => :'ups_account_number',
    :'website_url' => :'website_url'
  }
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



911
912
913
# File 'lib/ultracart_api/models/customer.rb', line 911

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

.openapi_nullableObject

List of attributes with nullable: true



348
349
350
351
# File 'lib/ultracart_api/models/customer.rb', line 348

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

.openapi_typesObject

Attribute type mapping.



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

def self.openapi_types
  {
    :'activity' => :'CustomerActivity',
    :'affiliate_oid' => :'Integer',
    :'allow_3rd_party_billing' => :'Boolean',
    :'allow_cod' => :'Boolean',
    :'allow_drop_shipping' => :'Boolean',
    :'allow_purchase_order' => :'Boolean',
    :'allow_quote_request' => :'Boolean',
    :'allow_selection_of_address_type' => :'Boolean',
    :'attachments' => :'Array<CustomerAttachment>',
    :'auto_approve_cod' => :'Boolean',
    :'auto_approve_purchase_order' => :'Boolean',
    :'automatic_merchant_notes' => :'String',
    :'billing' => :'Array<CustomerBilling>',
    :'business_notes' => :'String',
    :'cards' => :'Array<CustomerCard>',
    :'cc_emails' => :'Array<CustomerEmail>',
    :'customer_profile_oid' => :'Integer',
    :'dhl_account_number' => :'String',
    :'dhl_duty_account_number' => :'String',
    :'do_not_send_mail' => :'Boolean',
    :'edi' => :'CustomerEDI',
    :'email' => :'String',
    :'exempt_shipping_handling_charge' => :'Boolean',
    :'fedex_account_number' => :'String',
    :'free_shipping' => :'Boolean',
    :'free_shipping_minimum' => :'Float',
    :'last_modified_by' => :'String',
    :'last_modified_dts' => :'String',
    :'loyalty' => :'CustomerLoyalty',
    :'maximum_item_count' => :'Integer',
    :'merchant_id' => :'String',
    :'minimum_item_count' => :'Integer',
    :'minimum_subtotal' => :'Float',
    :'no_coupons' => :'Boolean',
    :'no_free_shipping' => :'Boolean',
    :'no_realtime_charge' => :'Boolean',
    :'orders' => :'Array<Order>',
    :'orders_summary' => :'CustomerOrdersSummary',
    :'password' => :'String',
    :'pricing_tiers' => :'Array<CustomerPricingTier>',
    :'privacy' => :'CustomerPrivacy',
    :'properties' => :'Array<CustomerProperty>',
    :'qb_class' => :'String',
    :'qb_code' => :'String',
    :'qb_tax_exemption_reason_code' => :'Integer',
    :'quotes' => :'Array<Order>',
    :'quotes_summary' => :'CustomerQuotesSummary',
    :'referral_source' => :'String',
    :'reviewer' => :'CustomerReviewer',
    :'sales_rep_code' => :'String',
    :'send_signup_notification' => :'Boolean',
    :'shipping' => :'Array<CustomerShipping>',
    :'signup_dts' => :'String',
    :'software_entitlements' => :'Array<CustomerSoftwareEntitlement>',
    :'suppress_buysafe' => :'Boolean',
    :'tags' => :'Array<CustomerTag>',
    :'tax_codes' => :'CustomerTaxCodes',
    :'tax_exempt' => :'Boolean',
    :'tax_id' => :'String',
    :'terms' => :'String',
    :'track_separately' => :'Boolean',
    :'unapproved' => :'Boolean',
    :'ups_account_number' => :'String',
    :'website_url' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
# File 'lib/ultracart_api/models/customer.rb', line 827

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      activity == o.activity &&
      affiliate_oid == o.affiliate_oid &&
      allow_3rd_party_billing == o.allow_3rd_party_billing &&
      allow_cod == o.allow_cod &&
      allow_drop_shipping == o.allow_drop_shipping &&
      allow_purchase_order == o.allow_purchase_order &&
      allow_quote_request == o.allow_quote_request &&
      allow_selection_of_address_type == o.allow_selection_of_address_type &&
      attachments == o.attachments &&
      auto_approve_cod == o.auto_approve_cod &&
      auto_approve_purchase_order == o.auto_approve_purchase_order &&
      automatic_merchant_notes == o.automatic_merchant_notes &&
      billing == o.billing &&
      business_notes == o.business_notes &&
      cards == o.cards &&
      cc_emails == o.cc_emails &&
      customer_profile_oid == o.customer_profile_oid &&
       == o. &&
       == o. &&
      do_not_send_mail == o.do_not_send_mail &&
      edi == o.edi &&
      email == o.email &&
      exempt_shipping_handling_charge == o.exempt_shipping_handling_charge &&
       == o. &&
      free_shipping == o.free_shipping &&
      free_shipping_minimum == o.free_shipping_minimum &&
      last_modified_by == o.last_modified_by &&
      last_modified_dts == o.last_modified_dts &&
      loyalty == o.loyalty &&
      maximum_item_count == o.maximum_item_count &&
      merchant_id == o.merchant_id &&
      minimum_item_count == o.minimum_item_count &&
      minimum_subtotal == o.minimum_subtotal &&
      no_coupons == o.no_coupons &&
      no_free_shipping == o.no_free_shipping &&
      no_realtime_charge == o.no_realtime_charge &&
      orders == o.orders &&
      orders_summary == o.orders_summary &&
      password == o.password &&
      pricing_tiers == o.pricing_tiers &&
      privacy == o.privacy &&
      properties == o.properties &&
      qb_class == o.qb_class &&
      qb_code == o.qb_code &&
      qb_tax_exemption_reason_code == o.qb_tax_exemption_reason_code &&
      quotes == o.quotes &&
      quotes_summary == o.quotes_summary &&
      referral_source == o.referral_source &&
      reviewer == o.reviewer &&
      sales_rep_code == o.sales_rep_code &&
       == o. &&
      shipping == o.shipping &&
       == o. &&
      software_entitlements == o.software_entitlements &&
      suppress_buysafe == o.suppress_buysafe &&
      tags == o.tags &&
      tax_codes == o.tax_codes &&
      tax_exempt == o.tax_exempt &&
      tax_id == o.tax_id &&
      terms == o.terms &&
      track_separately == o.track_separately &&
      unapproved == o.unapproved &&
       == o. &&
      website_url == o.website_url
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



942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
# File 'lib/ultracart_api/models/customer.rb', line 942

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



1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
# File 'lib/ultracart_api/models/customer.rb', line 1013

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



918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
# File 'lib/ultracart_api/models/customer.rb', line 918

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


898
899
900
# File 'lib/ultracart_api/models/customer.rb', line 898

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



904
905
906
# File 'lib/ultracart_api/models/customer.rb', line 904

def hash
  [activity, affiliate_oid, allow_3rd_party_billing, allow_cod, allow_drop_shipping, allow_purchase_order, allow_quote_request, allow_selection_of_address_type, attachments, auto_approve_cod, auto_approve_purchase_order, automatic_merchant_notes, billing, business_notes, cards, cc_emails, customer_profile_oid, , , do_not_send_mail, edi, email, exempt_shipping_handling_charge, , free_shipping, free_shipping_minimum, last_modified_by, last_modified_dts, loyalty, maximum_item_count, merchant_id, minimum_item_count, minimum_subtotal, no_coupons, no_free_shipping, no_realtime_charge, orders, orders_summary, password, pricing_tiers, privacy, properties, qb_class, qb_code, qb_tax_exemption_reason_code, quotes, quotes_summary, referral_source, reviewer, sales_rep_code, , shipping, , software_entitlements, suppress_buysafe, tags, tax_codes, tax_exempt, tax_id, terms, track_separately, unapproved, , website_url].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



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
683
684
685
686
687
688
689
690
691
692
693
694
695
696
# File 'lib/ultracart_api/models/customer.rb', line 649

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

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

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

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

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

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

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

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

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

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

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



989
990
991
# File 'lib/ultracart_api/models/customer.rb', line 989

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



995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
# File 'lib/ultracart_api/models/customer.rb', line 995

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



983
984
985
# File 'lib/ultracart_api/models/customer.rb', line 983

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



700
701
702
703
704
705
706
707
708
709
710
711
712
713
# File 'lib/ultracart_api/models/customer.rb', line 700

def valid?
  return false if !@business_notes.nil? && @business_notes.to_s.length > 2000
  return false if !.nil? && .to_s.length > 20
  return false if !.nil? && .to_s.length > 20
  return false if !.nil? && .to_s.length > 20
  return false if !@last_modified_by.nil? && @last_modified_by.to_s.length > 100
  return false if !@password.nil? && @password.to_s.length > 30
  return false if !@referral_source.nil? && @referral_source.to_s.length > 50
  return false if !@sales_rep_code.nil? && @sales_rep_code.to_s.length > 10
  return false if !@tax_id.nil? && @tax_id.to_s.length > 15
  return false if !.nil? && .to_s.length > 20
  return false if !@website_url.nil? && @website_url.to_s.length > 100
  true
end