ultracart_api 4.1.102 → 4.1.103

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,804 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.0.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module UltracartClient
17
+ class Affiliate
18
+ # True if affiliate has agreed to the terms associated with recruiting downline affiliates
19
+ attr_accessor :accepted_downline_recruiting_terms
20
+
21
+ # Address 1
22
+ attr_accessor :address_1
23
+
24
+ # Address 2
25
+ attr_accessor :address_2
26
+
27
+ # Commission group that this affiliate is assigned to
28
+ attr_accessor :affiliate_commission_group_oid
29
+
30
+ # Unique object identifier for this Affiliate
31
+ attr_accessor :affiliate_oid
32
+
33
+ # True if affiliate is allowed to recruit downline affiliates
34
+ attr_accessor :allow_downline_recruiting
35
+
36
+ # True if the affiliate is allowed to have their Google Adwords tracking pixel on the receipt
37
+ attr_accessor :allow_google_adwords_tracking
38
+
39
+ # True if the affiliate is allowed to have their Yahoo Search Marketing tracking pixel on the receipt
40
+ attr_accessor :allow_yahoo_search_marketing_tracking
41
+
42
+ # True if this is used for internal tracking and should not influence UltraCart Analytics
43
+ attr_accessor :analytics_internal_tracking
44
+
45
+ # Custom attributes about the affiliate that can be used in the catalog/StoreFront
46
+ attr_accessor :attributes
47
+
48
+ # Coupon code to automatically apply when this affiliate sends traffic
49
+ attr_accessor :auto_apply_coupon_code
50
+
51
+ # Coupon object id to automatically apply when this affiliate sends traffic
52
+ attr_accessor :auto_apply_coupon_oid
53
+
54
+ # True if this affiliates commissions are automatically approved
55
+ attr_accessor :auto_approve_commissions
56
+
57
+ # If the affiliate wants to be paid by check instead of PayPal, then this is the name to make the check out to
58
+ attr_accessor :check_payable_to
59
+
60
+ # City
61
+ attr_accessor :city
62
+
63
+ # Company Name
64
+ attr_accessor :company_name
65
+
66
+ # Number of days the affiliate tracking cookie lasts before expiring
67
+ attr_accessor :cookie_ttl
68
+
69
+ # ISO-3166 two letter country code
70
+ attr_accessor :country_code
71
+
72
+ # Date of birth
73
+ attr_accessor :dob
74
+
75
+ # Email
76
+ attr_accessor :email
77
+
78
+ # Email notification of transactions
79
+ attr_accessor :email_notification_schedule
80
+
81
+ # Fax
82
+ attr_accessor :fax
83
+
84
+ # First Name
85
+ attr_accessor :first_name
86
+
87
+ # Google Adwords conversion id to use for the tracking pixel
88
+ attr_accessor :google_conversion_id
89
+
90
+ # True if the affiliate is allowed to specify custom HTML to render on the receipt
91
+ attr_accessor :html_permitted
92
+
93
+ # Last Name
94
+ attr_accessor :last_name
95
+
96
+ # Last date/time the affiliate program terms were agreed to
97
+ attr_accessor :last_terms_acceptance
98
+
99
+ attr_accessor :marketing_strategy
100
+
101
+ # Member type object identifier the affiliate is assigned to within the program
102
+ attr_accessor :member_type
103
+
104
+ # Merchant ID
105
+ attr_accessor :merchant_id
106
+
107
+ # Minimum balance that must accrue before the affiliate is paid
108
+ attr_accessor :minimum_payout
109
+
110
+ # Password (can only be used to update)
111
+ attr_accessor :password
112
+
113
+ # True if commissions are paid on auto order (rebill) transactions
114
+ attr_accessor :pay_commissions_on_auto_orders
115
+
116
+ # True if commissions are paid on repeat orders matched by customer email
117
+ attr_accessor :pay_commissions_on_repeat_orders_by_email
118
+
119
+ # True if the affiliate is paid via PayPal
120
+ attr_accessor :pay_via_paypal
121
+
122
+ # Fixed adjustment applied to the affiliate's commission payments
123
+ attr_accessor :payment_adjustment
124
+
125
+ # Alternate email address to use for their PayPal payment if different than their primary email
126
+ attr_accessor :paypal_email
127
+
128
+ # Phone
129
+ attr_accessor :phone
130
+
131
+ # Postal Code
132
+ attr_accessor :postal_code
133
+
134
+ # True if cookie stomping of this affiliate is prevented
135
+ attr_accessor :prevent_cookie_stomping
136
+
137
+ # If true, affiliate will not receive any email notifications.
138
+ attr_accessor :prevent_sending_all_emails
139
+
140
+ # Server to server postback URL notified of affiliate refunds
141
+ attr_accessor :refund_server_to_server_postback_url
142
+
143
+ # If true, affiliate cookies are removed after a purchase.
144
+ attr_accessor :remove_cookie_after_purchase
145
+
146
+ # Salesforce.com account id
147
+ attr_accessor :salesforce_account_id
148
+
149
+ # Salesforce.com contact id
150
+ attr_accessor :salesforce_contact_id
151
+
152
+ # Server to server postback URL notified of affiliate transactions
153
+ attr_accessor :server_to_server_postback_url
154
+
155
+ # Short code that can be used in place of the affiliate id within tracking links
156
+ attr_accessor :short_code
157
+
158
+ # State
159
+ attr_accessor :state
160
+
161
+ # Status
162
+ attr_accessor :status
163
+
164
+ # Tax ID (can only be used to update)
165
+ attr_accessor :tax_id
166
+
167
+ # True if the affiliate has been terminated for spamming
168
+ attr_accessor :terminated_for_spam
169
+
170
+ # Relationship with other affiliates that recruted this affiliate
171
+ attr_accessor :tier_relationships
172
+
173
+ # Yahoo Search Marketing account id to use for the tracking pixel
174
+ attr_accessor :ysm_account_id
175
+
176
+ class EnumAttributeValidator
177
+ attr_reader :datatype
178
+ attr_reader :allowable_values
179
+
180
+ def initialize(datatype, allowable_values)
181
+ @allowable_values = allowable_values.map do |value|
182
+ case datatype.to_s
183
+ when /Integer/i
184
+ value.to_i
185
+ when /Float/i
186
+ value.to_f
187
+ else
188
+ value
189
+ end
190
+ end
191
+ end
192
+
193
+ def valid?(value)
194
+ !value || allowable_values.include?(value)
195
+ end
196
+ end
197
+
198
+ # Attribute mapping from ruby-style variable name to JSON key.
199
+ def self.attribute_map
200
+ {
201
+ :'accepted_downline_recruiting_terms' => :'accepted_downline_recruiting_terms',
202
+ :'address_1' => :'address_1',
203
+ :'address_2' => :'address_2',
204
+ :'affiliate_commission_group_oid' => :'affiliate_commission_group_oid',
205
+ :'affiliate_oid' => :'affiliate_oid',
206
+ :'allow_downline_recruiting' => :'allow_downline_recruiting',
207
+ :'allow_google_adwords_tracking' => :'allow_google_adwords_tracking',
208
+ :'allow_yahoo_search_marketing_tracking' => :'allow_yahoo_search_marketing_tracking',
209
+ :'analytics_internal_tracking' => :'analytics_internal_tracking',
210
+ :'attributes' => :'attributes',
211
+ :'auto_apply_coupon_code' => :'auto_apply_coupon_code',
212
+ :'auto_apply_coupon_oid' => :'auto_apply_coupon_oid',
213
+ :'auto_approve_commissions' => :'auto_approve_commissions',
214
+ :'check_payable_to' => :'check_payable_to',
215
+ :'city' => :'city',
216
+ :'company_name' => :'company_name',
217
+ :'cookie_ttl' => :'cookie_ttl',
218
+ :'country_code' => :'country_code',
219
+ :'dob' => :'dob',
220
+ :'email' => :'email',
221
+ :'email_notification_schedule' => :'email_notification_schedule',
222
+ :'fax' => :'fax',
223
+ :'first_name' => :'first_name',
224
+ :'google_conversion_id' => :'google_conversion_id',
225
+ :'html_permitted' => :'html_permitted',
226
+ :'last_name' => :'last_name',
227
+ :'last_terms_acceptance' => :'last_terms_acceptance',
228
+ :'marketing_strategy' => :'marketing_strategy',
229
+ :'member_type' => :'member_type',
230
+ :'merchant_id' => :'merchant_id',
231
+ :'minimum_payout' => :'minimum_payout',
232
+ :'password' => :'password',
233
+ :'pay_commissions_on_auto_orders' => :'pay_commissions_on_auto_orders',
234
+ :'pay_commissions_on_repeat_orders_by_email' => :'pay_commissions_on_repeat_orders_by_email',
235
+ :'pay_via_paypal' => :'pay_via_paypal',
236
+ :'payment_adjustment' => :'payment_adjustment',
237
+ :'paypal_email' => :'paypal_email',
238
+ :'phone' => :'phone',
239
+ :'postal_code' => :'postal_code',
240
+ :'prevent_cookie_stomping' => :'prevent_cookie_stomping',
241
+ :'prevent_sending_all_emails' => :'prevent_sending_all_emails',
242
+ :'refund_server_to_server_postback_url' => :'refund_server_to_server_postback_url',
243
+ :'remove_cookie_after_purchase' => :'remove_cookie_after_purchase',
244
+ :'salesforce_account_id' => :'salesforce_account_id',
245
+ :'salesforce_contact_id' => :'salesforce_contact_id',
246
+ :'server_to_server_postback_url' => :'server_to_server_postback_url',
247
+ :'short_code' => :'short_code',
248
+ :'state' => :'state',
249
+ :'status' => :'status',
250
+ :'tax_id' => :'tax_id',
251
+ :'terminated_for_spam' => :'terminated_for_spam',
252
+ :'tier_relationships' => :'tier_relationships',
253
+ :'ysm_account_id' => :'ysm_account_id'
254
+ }
255
+ end
256
+
257
+ # Returns all the JSON keys this model knows about
258
+ def self.acceptable_attributes
259
+ attribute_map.values
260
+ end
261
+
262
+ # Attribute type mapping.
263
+ def self.openapi_types
264
+ {
265
+ :'accepted_downline_recruiting_terms' => :'Boolean',
266
+ :'address_1' => :'String',
267
+ :'address_2' => :'String',
268
+ :'affiliate_commission_group_oid' => :'Integer',
269
+ :'affiliate_oid' => :'Integer',
270
+ :'allow_downline_recruiting' => :'Boolean',
271
+ :'allow_google_adwords_tracking' => :'Boolean',
272
+ :'allow_yahoo_search_marketing_tracking' => :'Boolean',
273
+ :'analytics_internal_tracking' => :'Boolean',
274
+ :'attributes' => :'Array<AffiliateAttribute>',
275
+ :'auto_apply_coupon_code' => :'String',
276
+ :'auto_apply_coupon_oid' => :'Integer',
277
+ :'auto_approve_commissions' => :'Boolean',
278
+ :'check_payable_to' => :'String',
279
+ :'city' => :'String',
280
+ :'company_name' => :'String',
281
+ :'cookie_ttl' => :'Integer',
282
+ :'country_code' => :'String',
283
+ :'dob' => :'String',
284
+ :'email' => :'String',
285
+ :'email_notification_schedule' => :'String',
286
+ :'fax' => :'String',
287
+ :'first_name' => :'String',
288
+ :'google_conversion_id' => :'String',
289
+ :'html_permitted' => :'Boolean',
290
+ :'last_name' => :'String',
291
+ :'last_terms_acceptance' => :'String',
292
+ :'marketing_strategy' => :'AffiliateMarketingStrategy',
293
+ :'member_type' => :'Integer',
294
+ :'merchant_id' => :'String',
295
+ :'minimum_payout' => :'Float',
296
+ :'password' => :'String',
297
+ :'pay_commissions_on_auto_orders' => :'Boolean',
298
+ :'pay_commissions_on_repeat_orders_by_email' => :'Boolean',
299
+ :'pay_via_paypal' => :'Boolean',
300
+ :'payment_adjustment' => :'Float',
301
+ :'paypal_email' => :'String',
302
+ :'phone' => :'String',
303
+ :'postal_code' => :'String',
304
+ :'prevent_cookie_stomping' => :'Boolean',
305
+ :'prevent_sending_all_emails' => :'Boolean',
306
+ :'refund_server_to_server_postback_url' => :'String',
307
+ :'remove_cookie_after_purchase' => :'Boolean',
308
+ :'salesforce_account_id' => :'String',
309
+ :'salesforce_contact_id' => :'String',
310
+ :'server_to_server_postback_url' => :'String',
311
+ :'short_code' => :'String',
312
+ :'state' => :'String',
313
+ :'status' => :'String',
314
+ :'tax_id' => :'String',
315
+ :'terminated_for_spam' => :'Boolean',
316
+ :'tier_relationships' => :'Array<AffiliateTierRelationship>',
317
+ :'ysm_account_id' => :'String'
318
+ }
319
+ end
320
+
321
+ # List of attributes with nullable: true
322
+ def self.openapi_nullable
323
+ Set.new([
324
+ ])
325
+ end
326
+
327
+ # Initializes the object
328
+ # @param [Hash] attributes Model attributes in the form of hash
329
+ def initialize(attributes = {})
330
+ if (!attributes.is_a?(Hash))
331
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::Affiliate` initialize method"
332
+ end
333
+
334
+ # check to see if the attribute exists and convert string to symbol for hash key
335
+ attributes = attributes.each_with_object({}) { |(k, v), h|
336
+ if (!self.class.attribute_map.key?(k.to_sym))
337
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::Affiliate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
338
+ end
339
+ h[k.to_sym] = v
340
+ }
341
+
342
+ if attributes.key?(:'accepted_downline_recruiting_terms')
343
+ self.accepted_downline_recruiting_terms = attributes[:'accepted_downline_recruiting_terms']
344
+ end
345
+
346
+ if attributes.key?(:'address_1')
347
+ self.address_1 = attributes[:'address_1']
348
+ end
349
+
350
+ if attributes.key?(:'address_2')
351
+ self.address_2 = attributes[:'address_2']
352
+ end
353
+
354
+ if attributes.key?(:'affiliate_commission_group_oid')
355
+ self.affiliate_commission_group_oid = attributes[:'affiliate_commission_group_oid']
356
+ end
357
+
358
+ if attributes.key?(:'affiliate_oid')
359
+ self.affiliate_oid = attributes[:'affiliate_oid']
360
+ end
361
+
362
+ if attributes.key?(:'allow_downline_recruiting')
363
+ self.allow_downline_recruiting = attributes[:'allow_downline_recruiting']
364
+ end
365
+
366
+ if attributes.key?(:'allow_google_adwords_tracking')
367
+ self.allow_google_adwords_tracking = attributes[:'allow_google_adwords_tracking']
368
+ end
369
+
370
+ if attributes.key?(:'allow_yahoo_search_marketing_tracking')
371
+ self.allow_yahoo_search_marketing_tracking = attributes[:'allow_yahoo_search_marketing_tracking']
372
+ end
373
+
374
+ if attributes.key?(:'analytics_internal_tracking')
375
+ self.analytics_internal_tracking = attributes[:'analytics_internal_tracking']
376
+ end
377
+
378
+ if attributes.key?(:'attributes')
379
+ if (value = attributes[:'attributes']).is_a?(Array)
380
+ self.attributes = value
381
+ end
382
+ end
383
+
384
+ if attributes.key?(:'auto_apply_coupon_code')
385
+ self.auto_apply_coupon_code = attributes[:'auto_apply_coupon_code']
386
+ end
387
+
388
+ if attributes.key?(:'auto_apply_coupon_oid')
389
+ self.auto_apply_coupon_oid = attributes[:'auto_apply_coupon_oid']
390
+ end
391
+
392
+ if attributes.key?(:'auto_approve_commissions')
393
+ self.auto_approve_commissions = attributes[:'auto_approve_commissions']
394
+ end
395
+
396
+ if attributes.key?(:'check_payable_to')
397
+ self.check_payable_to = attributes[:'check_payable_to']
398
+ end
399
+
400
+ if attributes.key?(:'city')
401
+ self.city = attributes[:'city']
402
+ end
403
+
404
+ if attributes.key?(:'company_name')
405
+ self.company_name = attributes[:'company_name']
406
+ end
407
+
408
+ if attributes.key?(:'cookie_ttl')
409
+ self.cookie_ttl = attributes[:'cookie_ttl']
410
+ end
411
+
412
+ if attributes.key?(:'country_code')
413
+ self.country_code = attributes[:'country_code']
414
+ end
415
+
416
+ if attributes.key?(:'dob')
417
+ self.dob = attributes[:'dob']
418
+ end
419
+
420
+ if attributes.key?(:'email')
421
+ self.email = attributes[:'email']
422
+ end
423
+
424
+ if attributes.key?(:'email_notification_schedule')
425
+ self.email_notification_schedule = attributes[:'email_notification_schedule']
426
+ end
427
+
428
+ if attributes.key?(:'fax')
429
+ self.fax = attributes[:'fax']
430
+ end
431
+
432
+ if attributes.key?(:'first_name')
433
+ self.first_name = attributes[:'first_name']
434
+ end
435
+
436
+ if attributes.key?(:'google_conversion_id')
437
+ self.google_conversion_id = attributes[:'google_conversion_id']
438
+ end
439
+
440
+ if attributes.key?(:'html_permitted')
441
+ self.html_permitted = attributes[:'html_permitted']
442
+ end
443
+
444
+ if attributes.key?(:'last_name')
445
+ self.last_name = attributes[:'last_name']
446
+ end
447
+
448
+ if attributes.key?(:'last_terms_acceptance')
449
+ self.last_terms_acceptance = attributes[:'last_terms_acceptance']
450
+ end
451
+
452
+ if attributes.key?(:'marketing_strategy')
453
+ self.marketing_strategy = attributes[:'marketing_strategy']
454
+ end
455
+
456
+ if attributes.key?(:'member_type')
457
+ self.member_type = attributes[:'member_type']
458
+ end
459
+
460
+ if attributes.key?(:'merchant_id')
461
+ self.merchant_id = attributes[:'merchant_id']
462
+ end
463
+
464
+ if attributes.key?(:'minimum_payout')
465
+ self.minimum_payout = attributes[:'minimum_payout']
466
+ end
467
+
468
+ if attributes.key?(:'password')
469
+ self.password = attributes[:'password']
470
+ end
471
+
472
+ if attributes.key?(:'pay_commissions_on_auto_orders')
473
+ self.pay_commissions_on_auto_orders = attributes[:'pay_commissions_on_auto_orders']
474
+ end
475
+
476
+ if attributes.key?(:'pay_commissions_on_repeat_orders_by_email')
477
+ self.pay_commissions_on_repeat_orders_by_email = attributes[:'pay_commissions_on_repeat_orders_by_email']
478
+ end
479
+
480
+ if attributes.key?(:'pay_via_paypal')
481
+ self.pay_via_paypal = attributes[:'pay_via_paypal']
482
+ end
483
+
484
+ if attributes.key?(:'payment_adjustment')
485
+ self.payment_adjustment = attributes[:'payment_adjustment']
486
+ end
487
+
488
+ if attributes.key?(:'paypal_email')
489
+ self.paypal_email = attributes[:'paypal_email']
490
+ end
491
+
492
+ if attributes.key?(:'phone')
493
+ self.phone = attributes[:'phone']
494
+ end
495
+
496
+ if attributes.key?(:'postal_code')
497
+ self.postal_code = attributes[:'postal_code']
498
+ end
499
+
500
+ if attributes.key?(:'prevent_cookie_stomping')
501
+ self.prevent_cookie_stomping = attributes[:'prevent_cookie_stomping']
502
+ end
503
+
504
+ if attributes.key?(:'prevent_sending_all_emails')
505
+ self.prevent_sending_all_emails = attributes[:'prevent_sending_all_emails']
506
+ end
507
+
508
+ if attributes.key?(:'refund_server_to_server_postback_url')
509
+ self.refund_server_to_server_postback_url = attributes[:'refund_server_to_server_postback_url']
510
+ end
511
+
512
+ if attributes.key?(:'remove_cookie_after_purchase')
513
+ self.remove_cookie_after_purchase = attributes[:'remove_cookie_after_purchase']
514
+ end
515
+
516
+ if attributes.key?(:'salesforce_account_id')
517
+ self.salesforce_account_id = attributes[:'salesforce_account_id']
518
+ end
519
+
520
+ if attributes.key?(:'salesforce_contact_id')
521
+ self.salesforce_contact_id = attributes[:'salesforce_contact_id']
522
+ end
523
+
524
+ if attributes.key?(:'server_to_server_postback_url')
525
+ self.server_to_server_postback_url = attributes[:'server_to_server_postback_url']
526
+ end
527
+
528
+ if attributes.key?(:'short_code')
529
+ self.short_code = attributes[:'short_code']
530
+ end
531
+
532
+ if attributes.key?(:'state')
533
+ self.state = attributes[:'state']
534
+ end
535
+
536
+ if attributes.key?(:'status')
537
+ self.status = attributes[:'status']
538
+ end
539
+
540
+ if attributes.key?(:'tax_id')
541
+ self.tax_id = attributes[:'tax_id']
542
+ end
543
+
544
+ if attributes.key?(:'terminated_for_spam')
545
+ self.terminated_for_spam = attributes[:'terminated_for_spam']
546
+ end
547
+
548
+ if attributes.key?(:'tier_relationships')
549
+ if (value = attributes[:'tier_relationships']).is_a?(Array)
550
+ self.tier_relationships = value
551
+ end
552
+ end
553
+
554
+ if attributes.key?(:'ysm_account_id')
555
+ self.ysm_account_id = attributes[:'ysm_account_id']
556
+ end
557
+ end
558
+
559
+ # Show invalid properties with the reasons. Usually used together with valid?
560
+ # @return Array for valid properties with the reasons
561
+ def list_invalid_properties
562
+ invalid_properties = Array.new
563
+ if !@country_code.nil? && @country_code.to_s.length > 2
564
+ invalid_properties.push('invalid value for "country_code", the character length must be smaller than or equal to 2.')
565
+ end
566
+
567
+ invalid_properties
568
+ end
569
+
570
+ # Check to see if the all the properties in the model are valid
571
+ # @return true if the model is valid
572
+ def valid?
573
+ return false if !@country_code.nil? && @country_code.to_s.length > 2
574
+ email_notification_schedule_validator = EnumAttributeValidator.new('String', ["None", "Each", "Daily", "Weekly", "Monthly"])
575
+ return false unless email_notification_schedule_validator.valid?(@email_notification_schedule)
576
+ status_validator = EnumAttributeValidator.new('String', ["Active", "Inactive"])
577
+ return false unless status_validator.valid?(@status)
578
+ true
579
+ end
580
+
581
+ # Custom attribute writer method with validation
582
+ # @param [Object] country_code Value to be assigned
583
+ def country_code=(country_code)
584
+ if !country_code.nil? && country_code.to_s.length > 2
585
+ fail ArgumentError, 'invalid value for "country_code", the character length must be smaller than or equal to 2.'
586
+ end
587
+
588
+ @country_code = country_code
589
+ end
590
+
591
+ # Custom attribute writer method checking allowed values (enum).
592
+ # @param [Object] email_notification_schedule Object to be assigned
593
+ def email_notification_schedule=(email_notification_schedule)
594
+ validator = EnumAttributeValidator.new('String', ["None", "Each", "Daily", "Weekly", "Monthly"])
595
+ unless validator.valid?(email_notification_schedule)
596
+ fail ArgumentError, "invalid value for \"email_notification_schedule\", must be one of #{validator.allowable_values}."
597
+ end
598
+ @email_notification_schedule = email_notification_schedule
599
+ end
600
+
601
+ # Custom attribute writer method checking allowed values (enum).
602
+ # @param [Object] status Object to be assigned
603
+ def status=(status)
604
+ validator = EnumAttributeValidator.new('String', ["Active", "Inactive"])
605
+ unless validator.valid?(status)
606
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
607
+ end
608
+ @status = status
609
+ end
610
+
611
+ # Checks equality by comparing each attribute.
612
+ # @param [Object] Object to be compared
613
+ def ==(o)
614
+ return true if self.equal?(o)
615
+ self.class == o.class &&
616
+ accepted_downline_recruiting_terms == o.accepted_downline_recruiting_terms &&
617
+ address_1 == o.address_1 &&
618
+ address_2 == o.address_2 &&
619
+ affiliate_commission_group_oid == o.affiliate_commission_group_oid &&
620
+ affiliate_oid == o.affiliate_oid &&
621
+ allow_downline_recruiting == o.allow_downline_recruiting &&
622
+ allow_google_adwords_tracking == o.allow_google_adwords_tracking &&
623
+ allow_yahoo_search_marketing_tracking == o.allow_yahoo_search_marketing_tracking &&
624
+ analytics_internal_tracking == o.analytics_internal_tracking &&
625
+ attributes == o.attributes &&
626
+ auto_apply_coupon_code == o.auto_apply_coupon_code &&
627
+ auto_apply_coupon_oid == o.auto_apply_coupon_oid &&
628
+ auto_approve_commissions == o.auto_approve_commissions &&
629
+ check_payable_to == o.check_payable_to &&
630
+ city == o.city &&
631
+ company_name == o.company_name &&
632
+ cookie_ttl == o.cookie_ttl &&
633
+ country_code == o.country_code &&
634
+ dob == o.dob &&
635
+ email == o.email &&
636
+ email_notification_schedule == o.email_notification_schedule &&
637
+ fax == o.fax &&
638
+ first_name == o.first_name &&
639
+ google_conversion_id == o.google_conversion_id &&
640
+ html_permitted == o.html_permitted &&
641
+ last_name == o.last_name &&
642
+ last_terms_acceptance == o.last_terms_acceptance &&
643
+ marketing_strategy == o.marketing_strategy &&
644
+ member_type == o.member_type &&
645
+ merchant_id == o.merchant_id &&
646
+ minimum_payout == o.minimum_payout &&
647
+ password == o.password &&
648
+ pay_commissions_on_auto_orders == o.pay_commissions_on_auto_orders &&
649
+ pay_commissions_on_repeat_orders_by_email == o.pay_commissions_on_repeat_orders_by_email &&
650
+ pay_via_paypal == o.pay_via_paypal &&
651
+ payment_adjustment == o.payment_adjustment &&
652
+ paypal_email == o.paypal_email &&
653
+ phone == o.phone &&
654
+ postal_code == o.postal_code &&
655
+ prevent_cookie_stomping == o.prevent_cookie_stomping &&
656
+ prevent_sending_all_emails == o.prevent_sending_all_emails &&
657
+ refund_server_to_server_postback_url == o.refund_server_to_server_postback_url &&
658
+ remove_cookie_after_purchase == o.remove_cookie_after_purchase &&
659
+ salesforce_account_id == o.salesforce_account_id &&
660
+ salesforce_contact_id == o.salesforce_contact_id &&
661
+ server_to_server_postback_url == o.server_to_server_postback_url &&
662
+ short_code == o.short_code &&
663
+ state == o.state &&
664
+ status == o.status &&
665
+ tax_id == o.tax_id &&
666
+ terminated_for_spam == o.terminated_for_spam &&
667
+ tier_relationships == o.tier_relationships &&
668
+ ysm_account_id == o.ysm_account_id
669
+ end
670
+
671
+ # @see the `==` method
672
+ # @param [Object] Object to be compared
673
+ def eql?(o)
674
+ self == o
675
+ end
676
+
677
+ # Calculates hash code according to all attributes.
678
+ # @return [Integer] Hash code
679
+ def hash
680
+ [accepted_downline_recruiting_terms, address_1, address_2, affiliate_commission_group_oid, affiliate_oid, allow_downline_recruiting, allow_google_adwords_tracking, allow_yahoo_search_marketing_tracking, analytics_internal_tracking, attributes, auto_apply_coupon_code, auto_apply_coupon_oid, auto_approve_commissions, check_payable_to, city, company_name, cookie_ttl, country_code, dob, email, email_notification_schedule, fax, first_name, google_conversion_id, html_permitted, last_name, last_terms_acceptance, marketing_strategy, member_type, merchant_id, minimum_payout, password, pay_commissions_on_auto_orders, pay_commissions_on_repeat_orders_by_email, pay_via_paypal, payment_adjustment, paypal_email, phone, postal_code, prevent_cookie_stomping, prevent_sending_all_emails, refund_server_to_server_postback_url, remove_cookie_after_purchase, salesforce_account_id, salesforce_contact_id, server_to_server_postback_url, short_code, state, status, tax_id, terminated_for_spam, tier_relationships, ysm_account_id].hash
681
+ end
682
+
683
+ # Builds the object from hash
684
+ # @param [Hash] attributes Model attributes in the form of hash
685
+ # @return [Object] Returns the model itself
686
+ def self.build_from_hash(attributes)
687
+ new.build_from_hash(attributes)
688
+ end
689
+
690
+ # Builds the object from hash
691
+ # @param [Hash] attributes Model attributes in the form of hash
692
+ # @return [Object] Returns the model itself
693
+ def build_from_hash(attributes)
694
+ return nil unless attributes.is_a?(Hash)
695
+ attributes = attributes.transform_keys(&:to_sym)
696
+ self.class.openapi_types.each_pair do |key, type|
697
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
698
+ self.send("#{key}=", nil)
699
+ elsif type =~ /\AArray<(.*)>/i
700
+ # check to ensure the input is an array given that the attribute
701
+ # is documented as an array but the input is not
702
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
703
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
704
+ end
705
+ elsif !attributes[self.class.attribute_map[key]].nil?
706
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
707
+ end
708
+ end
709
+
710
+ self
711
+ end
712
+
713
+ # Deserializes the data based on type
714
+ # @param string type Data type
715
+ # @param string value Value to be deserialized
716
+ # @return [Object] Deserialized data
717
+ def _deserialize(type, value)
718
+ case type.to_sym
719
+ when :Time
720
+ Time.parse(value)
721
+ when :Date
722
+ Date.parse(value)
723
+ when :String
724
+ value.to_s
725
+ when :Integer
726
+ value.to_i
727
+ when :Float
728
+ value.to_f
729
+ when :Boolean
730
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
731
+ true
732
+ else
733
+ false
734
+ end
735
+ when :Object
736
+ # generic object (usually a Hash), return directly
737
+ value
738
+ when /\AArray<(?<inner_type>.+)>\z/
739
+ inner_type = Regexp.last_match[:inner_type]
740
+ value.map { |v| _deserialize(inner_type, v) }
741
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
742
+ k_type = Regexp.last_match[:k_type]
743
+ v_type = Regexp.last_match[:v_type]
744
+ {}.tap do |hash|
745
+ value.each do |k, v|
746
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
747
+ end
748
+ end
749
+ else # model
750
+ # models (e.g. Pet) or oneOf
751
+ klass = UltracartClient.const_get(type)
752
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
753
+ end
754
+ end
755
+
756
+ # Returns the string representation of the object
757
+ # @return [String] String presentation of the object
758
+ def to_s
759
+ to_hash.to_s
760
+ end
761
+
762
+ # to_body is an alias to to_hash (backward compatibility)
763
+ # @return [Hash] Returns the object in the form of hash
764
+ def to_body
765
+ to_hash
766
+ end
767
+
768
+ # Returns the object in the form of hash
769
+ # @return [Hash] Returns the object in the form of hash
770
+ def to_hash
771
+ hash = {}
772
+ self.class.attribute_map.each_pair do |attr, param|
773
+ value = self.send(attr)
774
+ if value.nil?
775
+ is_nullable = self.class.openapi_nullable.include?(attr)
776
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
777
+ end
778
+
779
+ hash[param] = _to_hash(value)
780
+ end
781
+ hash
782
+ end
783
+
784
+ # Outputs non-array value in the form of hash
785
+ # For object, use to_hash. Otherwise, just return the value
786
+ # @param [Object] value Any valid value
787
+ # @return [Hash] Returns the value in the form of hash
788
+ def _to_hash(value)
789
+ if value.is_a?(Array)
790
+ value.compact.map { |v| _to_hash(v) }
791
+ elsif value.is_a?(Hash)
792
+ {}.tap do |hash|
793
+ value.each { |k, v| hash[k] = _to_hash(v) }
794
+ end
795
+ elsif value.respond_to? :to_hash
796
+ value.to_hash
797
+ else
798
+ value
799
+ end
800
+ end
801
+
802
+ end
803
+
804
+ end