ultracart_api 3.9.8 → 3.10.0

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,1569 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ OpenAPI spec version: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.15-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module UltracartClient
16
+ class ChannelPartnerOrder
17
+ # advertising_source
18
+ attr_accessor :advertising_source
19
+
20
+ # Affiliate Id
21
+ attr_accessor :affiliate_id
22
+
23
+ # Affiliate Sub Id
24
+ attr_accessor :affiliate_sub_id
25
+
26
+ # Arbitrary shipping handling total
27
+ attr_accessor :arbitrary_shipping_handling_total
28
+
29
+ # Arbitrary tax for overriding calculated taxes
30
+ attr_accessor :arbitrary_tax
31
+
32
+ # Arbitrary tax rate
33
+ attr_accessor :arbitrary_tax_rate
34
+
35
+ # Arbitrary taxable subtotal
36
+ attr_accessor :arbitrary_taxable_subtotal
37
+
38
+ # If true any matching customer profile based on email is associated with this order
39
+ attr_accessor :associate_with_customer_profile_if_present
40
+
41
+ # If true any purchase orders are automatically approved
42
+ attr_accessor :auto_approve_purchase_order
43
+
44
+ # Billing Address line 1
45
+ attr_accessor :billto_address1
46
+
47
+ # Billing Address line 2
48
+ attr_accessor :billto_address2
49
+
50
+ # Billing City
51
+ attr_accessor :billto_city
52
+
53
+ # Billing Company
54
+ attr_accessor :billto_company
55
+
56
+ # Billing ISO-3166 two letter country code
57
+ attr_accessor :billto_country_code
58
+
59
+ # Billing Day phone
60
+ attr_accessor :billto_day_phone
61
+
62
+ # Billing Evening phone
63
+ attr_accessor :billto_evening_phone
64
+
65
+ # Billing First name
66
+ attr_accessor :billto_first_name
67
+
68
+ # Billing Last name
69
+ attr_accessor :billto_last_name
70
+
71
+ # Billing Postal code
72
+ attr_accessor :billto_postal_code
73
+
74
+ # Billing State for United States otherwise region or province for other countries
75
+ attr_accessor :billto_state_region
76
+
77
+ # Billing Title
78
+ attr_accessor :billto_title
79
+
80
+ # CC email.
81
+ attr_accessor :cc_email
82
+
83
+ # The id for this order within the channel partner system.
84
+ attr_accessor :channel_partner_order_id
85
+
86
+ # If true this order is marked as an auto order (recurring)
87
+ attr_accessor :consider_recurring
88
+
89
+ # Array of coupon codes
90
+ attr_accessor :coupons
91
+
92
+ # The amount authorized externally
93
+ attr_accessor :credit_card_authorization_amount
94
+
95
+ # Date/Time of credit card authorization in ISO8601 format
96
+ attr_accessor :credit_card_authorization_dts
97
+
98
+ # The reference number provided by an externally processed transaction
99
+ attr_accessor :credit_card_authorization_number
100
+
101
+ # Credit card expiration month
102
+ attr_accessor :credit_card_expiration_month
103
+
104
+ # Credit card expiration year
105
+ attr_accessor :credit_card_expiration_year
106
+
107
+ # Credit card type
108
+ attr_accessor :credit_card_type
109
+
110
+ # Custom field 1
111
+ attr_accessor :custom_field1
112
+
113
+ # Custom field 2
114
+ attr_accessor :custom_field2
115
+
116
+ # Custom field 3
117
+ attr_accessor :custom_field3
118
+
119
+ # Custom field 4
120
+ attr_accessor :custom_field4
121
+
122
+ # Custom field 5
123
+ attr_accessor :custom_field5
124
+
125
+ # Custom field 6
126
+ attr_accessor :custom_field6
127
+
128
+ # Custom field 7
129
+ attr_accessor :custom_field7
130
+
131
+ # Date the customer is requesting delivery on. Typically used for perishable product delivery.
132
+ attr_accessor :delivery_date
133
+
134
+ # Email
135
+ attr_accessor :email
136
+
137
+ # True if this order is a gift
138
+ attr_accessor :gift
139
+
140
+ # Email address of the gift recipient
141
+ attr_accessor :gift_email
142
+
143
+ # Message to the gift recipient
144
+ attr_accessor :gift_message
145
+
146
+ # The token provided by UltraCart hosted fields when a credit card number is uploaded into the system. This is the only way to provide a credit card number.
147
+ attr_accessor :hosted_fields_card_token
148
+
149
+ # The token provided by UltraCart hosted fields when a credit card cvv is uploaded into the system. This is the only way to provide a cvv number.
150
+ attr_accessor :hosted_fields_cvv_token
151
+
152
+ # Insurance application id
153
+ attr_accessor :insurance_application_id
154
+
155
+ # Insurance claim id
156
+ attr_accessor :insurance_claim_id
157
+
158
+ # IP Address of the customer
159
+ attr_accessor :ip_address
160
+
161
+ # Items
162
+ attr_accessor :items
163
+
164
+ # If true the least expensive shipping method is automatically chosen during the order import
165
+ attr_accessor :least_cost_route
166
+
167
+ # An optional array of shipping methods to restict choices if least_cost_route is true
168
+ attr_accessor :least_cost_route_shipping_methods
169
+
170
+ # If true the customer is subscribed to any configured mailing lists
171
+ attr_accessor :mailing_list_opt_in
172
+
173
+ # If true no payment processing is done and the order is placed into Accounts Receivable
174
+ attr_accessor :no_realtime_payment_processing
175
+
176
+ # Payment method
177
+ attr_accessor :payment_method
178
+
179
+ # Purchase order number
180
+ attr_accessor :purchase_order_number
181
+
182
+ # The rotating transaction gateway code for the gateway used to charge this order
183
+ attr_accessor :rotating_transaction_gateway_code
184
+
185
+ # Screen branding theme code
186
+ attr_accessor :screen_branding_theme_code
187
+
188
+ # Date the customer is requesting that the order ship on. Typically used for perishable product delivery.
189
+ attr_accessor :ship_on_date
190
+
191
+ # True if the shipping adress is residential. Effects the methods that are available to the customer as well as the price of the shipping method.
192
+ attr_accessor :ship_to_residential
193
+
194
+ # Shipping method
195
+ attr_accessor :shipping_method
196
+
197
+ # Shipping Address line 1
198
+ attr_accessor :shipto_address1
199
+
200
+ # Shipping Address line 2
201
+ attr_accessor :shipto_address2
202
+
203
+ # Shipping City
204
+ attr_accessor :shipto_city
205
+
206
+ # Shipping Company
207
+ attr_accessor :shipto_company
208
+
209
+ # Shipping ISO-3166 two letter country code
210
+ attr_accessor :shipto_country_code
211
+
212
+ # Shipping Day phone
213
+ attr_accessor :shipto_day_phone
214
+
215
+ # Shipping Evening phone
216
+ attr_accessor :shipto_evening_phone
217
+
218
+ # Shipping First name
219
+ attr_accessor :shipto_first_name
220
+
221
+ # Shipping Last name
222
+ attr_accessor :shipto_last_name
223
+
224
+ # Shipping Postal code
225
+ attr_accessor :shipto_postal_code
226
+
227
+ # Shipping State for United States otherwise region or province for other countries
228
+ attr_accessor :shipto_state_region
229
+
230
+ # Shipping Title
231
+ attr_accessor :shipto_title
232
+
233
+ # If true the order is placed directly into the shipping department
234
+ attr_accessor :skip_payment_processing
235
+
236
+ # Special instructions from the customer regarding shipping
237
+ attr_accessor :special_instructions
238
+
239
+ # If true the order bypasses shipping and is marked completed
240
+ attr_accessor :store_completed
241
+
242
+ # If true any failed payments are placed into Accounts Receivable. If false any failed payments result in a rejected order resulting in errors thrown during the insert routine
243
+ attr_accessor :store_if_payment_declines
244
+
245
+ # The optional shipping county used to determine exact taxes
246
+ attr_accessor :tax_county
247
+
248
+ # If true this order is marked as being tax exempt
249
+ attr_accessor :tax_exempt
250
+
251
+ attr_accessor :transaction
252
+
253
+ # If true all warnings are considered errors, this is true by default
254
+ attr_accessor :treat_warnings_as_errors
255
+
256
+ class EnumAttributeValidator
257
+ attr_reader :datatype
258
+ attr_reader :allowable_values
259
+
260
+ def initialize(datatype, allowable_values)
261
+ @allowable_values = allowable_values.map do |value|
262
+ case datatype.to_s
263
+ when /Integer/i
264
+ value.to_i
265
+ when /Float/i
266
+ value.to_f
267
+ else
268
+ value
269
+ end
270
+ end
271
+ end
272
+
273
+ def valid?(value)
274
+ !value || allowable_values.include?(value)
275
+ end
276
+ end
277
+
278
+ # Attribute mapping from ruby-style variable name to JSON key.
279
+ def self.attribute_map
280
+ {
281
+ :'advertising_source' => :'advertisingSource',
282
+ :'affiliate_id' => :'affiliate_id',
283
+ :'affiliate_sub_id' => :'affiliate_sub_id',
284
+ :'arbitrary_shipping_handling_total' => :'arbitrary_shipping_handling_total',
285
+ :'arbitrary_tax' => :'arbitrary_tax',
286
+ :'arbitrary_tax_rate' => :'arbitrary_tax_rate',
287
+ :'arbitrary_taxable_subtotal' => :'arbitrary_taxable_subtotal',
288
+ :'associate_with_customer_profile_if_present' => :'associate_with_customer_profile_if_present',
289
+ :'auto_approve_purchase_order' => :'auto_approve_purchase_order',
290
+ :'billto_address1' => :'billto_address1',
291
+ :'billto_address2' => :'billto_address2',
292
+ :'billto_city' => :'billto_city',
293
+ :'billto_company' => :'billto_company',
294
+ :'billto_country_code' => :'billto_country_code',
295
+ :'billto_day_phone' => :'billto_day_phone',
296
+ :'billto_evening_phone' => :'billto_evening_phone',
297
+ :'billto_first_name' => :'billto_first_name',
298
+ :'billto_last_name' => :'billto_last_name',
299
+ :'billto_postal_code' => :'billto_postal_code',
300
+ :'billto_state_region' => :'billto_state_region',
301
+ :'billto_title' => :'billto_title',
302
+ :'cc_email' => :'cc_email',
303
+ :'channel_partner_order_id' => :'channel_partner_order_id',
304
+ :'consider_recurring' => :'consider_recurring',
305
+ :'coupons' => :'coupons',
306
+ :'credit_card_authorization_amount' => :'credit_card_authorization_amount',
307
+ :'credit_card_authorization_dts' => :'credit_card_authorization_dts',
308
+ :'credit_card_authorization_number' => :'credit_card_authorization_number',
309
+ :'credit_card_expiration_month' => :'credit_card_expiration_month',
310
+ :'credit_card_expiration_year' => :'credit_card_expiration_year',
311
+ :'credit_card_type' => :'credit_card_type',
312
+ :'custom_field1' => :'custom_field1',
313
+ :'custom_field2' => :'custom_field2',
314
+ :'custom_field3' => :'custom_field3',
315
+ :'custom_field4' => :'custom_field4',
316
+ :'custom_field5' => :'custom_field5',
317
+ :'custom_field6' => :'custom_field6',
318
+ :'custom_field7' => :'custom_field7',
319
+ :'delivery_date' => :'delivery_date',
320
+ :'email' => :'email',
321
+ :'gift' => :'gift',
322
+ :'gift_email' => :'gift_email',
323
+ :'gift_message' => :'gift_message',
324
+ :'hosted_fields_card_token' => :'hosted_fields_card_token',
325
+ :'hosted_fields_cvv_token' => :'hosted_fields_cvv_token',
326
+ :'insurance_application_id' => :'insurance_application_id',
327
+ :'insurance_claim_id' => :'insurance_claim_id',
328
+ :'ip_address' => :'ip_address',
329
+ :'items' => :'items',
330
+ :'least_cost_route' => :'least_cost_route',
331
+ :'least_cost_route_shipping_methods' => :'least_cost_route_shipping_methods',
332
+ :'mailing_list_opt_in' => :'mailing_list_opt_in',
333
+ :'no_realtime_payment_processing' => :'no_realtime_payment_processing',
334
+ :'payment_method' => :'payment_method',
335
+ :'purchase_order_number' => :'purchase_order_number',
336
+ :'rotating_transaction_gateway_code' => :'rotating_transaction_gateway_code',
337
+ :'screen_branding_theme_code' => :'screen_branding_theme_code',
338
+ :'ship_on_date' => :'ship_on_date',
339
+ :'ship_to_residential' => :'ship_to_residential',
340
+ :'shipping_method' => :'shipping_method',
341
+ :'shipto_address1' => :'shipto_address1',
342
+ :'shipto_address2' => :'shipto_address2',
343
+ :'shipto_city' => :'shipto_city',
344
+ :'shipto_company' => :'shipto_company',
345
+ :'shipto_country_code' => :'shipto_country_code',
346
+ :'shipto_day_phone' => :'shipto_day_phone',
347
+ :'shipto_evening_phone' => :'shipto_evening_phone',
348
+ :'shipto_first_name' => :'shipto_first_name',
349
+ :'shipto_last_name' => :'shipto_last_name',
350
+ :'shipto_postal_code' => :'shipto_postal_code',
351
+ :'shipto_state_region' => :'shipto_state_region',
352
+ :'shipto_title' => :'shipto_title',
353
+ :'skip_payment_processing' => :'skip_payment_processing',
354
+ :'special_instructions' => :'special_instructions',
355
+ :'store_completed' => :'store_completed',
356
+ :'store_if_payment_declines' => :'store_if_payment_declines',
357
+ :'tax_county' => :'tax_county',
358
+ :'tax_exempt' => :'tax_exempt',
359
+ :'transaction' => :'transaction',
360
+ :'treat_warnings_as_errors' => :'treat_warnings_as_errors'
361
+ }
362
+ end
363
+
364
+ # Attribute type mapping.
365
+ def self.swagger_types
366
+ {
367
+ :'advertising_source' => :'String',
368
+ :'affiliate_id' => :'String',
369
+ :'affiliate_sub_id' => :'String',
370
+ :'arbitrary_shipping_handling_total' => :'Float',
371
+ :'arbitrary_tax' => :'Float',
372
+ :'arbitrary_tax_rate' => :'Float',
373
+ :'arbitrary_taxable_subtotal' => :'Float',
374
+ :'associate_with_customer_profile_if_present' => :'BOOLEAN',
375
+ :'auto_approve_purchase_order' => :'BOOLEAN',
376
+ :'billto_address1' => :'String',
377
+ :'billto_address2' => :'String',
378
+ :'billto_city' => :'String',
379
+ :'billto_company' => :'String',
380
+ :'billto_country_code' => :'String',
381
+ :'billto_day_phone' => :'String',
382
+ :'billto_evening_phone' => :'String',
383
+ :'billto_first_name' => :'String',
384
+ :'billto_last_name' => :'String',
385
+ :'billto_postal_code' => :'String',
386
+ :'billto_state_region' => :'String',
387
+ :'billto_title' => :'String',
388
+ :'cc_email' => :'String',
389
+ :'channel_partner_order_id' => :'String',
390
+ :'consider_recurring' => :'BOOLEAN',
391
+ :'coupons' => :'Array<String>',
392
+ :'credit_card_authorization_amount' => :'Float',
393
+ :'credit_card_authorization_dts' => :'String',
394
+ :'credit_card_authorization_number' => :'String',
395
+ :'credit_card_expiration_month' => :'Integer',
396
+ :'credit_card_expiration_year' => :'Integer',
397
+ :'credit_card_type' => :'String',
398
+ :'custom_field1' => :'String',
399
+ :'custom_field2' => :'String',
400
+ :'custom_field3' => :'String',
401
+ :'custom_field4' => :'String',
402
+ :'custom_field5' => :'String',
403
+ :'custom_field6' => :'String',
404
+ :'custom_field7' => :'String',
405
+ :'delivery_date' => :'String',
406
+ :'email' => :'String',
407
+ :'gift' => :'BOOLEAN',
408
+ :'gift_email' => :'String',
409
+ :'gift_message' => :'String',
410
+ :'hosted_fields_card_token' => :'String',
411
+ :'hosted_fields_cvv_token' => :'String',
412
+ :'insurance_application_id' => :'String',
413
+ :'insurance_claim_id' => :'String',
414
+ :'ip_address' => :'String',
415
+ :'items' => :'Array<ChannelPartnerOrderItem>',
416
+ :'least_cost_route' => :'BOOLEAN',
417
+ :'least_cost_route_shipping_methods' => :'Array<String>',
418
+ :'mailing_list_opt_in' => :'BOOLEAN',
419
+ :'no_realtime_payment_processing' => :'BOOLEAN',
420
+ :'payment_method' => :'String',
421
+ :'purchase_order_number' => :'String',
422
+ :'rotating_transaction_gateway_code' => :'String',
423
+ :'screen_branding_theme_code' => :'String',
424
+ :'ship_on_date' => :'String',
425
+ :'ship_to_residential' => :'BOOLEAN',
426
+ :'shipping_method' => :'String',
427
+ :'shipto_address1' => :'String',
428
+ :'shipto_address2' => :'String',
429
+ :'shipto_city' => :'String',
430
+ :'shipto_company' => :'String',
431
+ :'shipto_country_code' => :'String',
432
+ :'shipto_day_phone' => :'String',
433
+ :'shipto_evening_phone' => :'String',
434
+ :'shipto_first_name' => :'String',
435
+ :'shipto_last_name' => :'String',
436
+ :'shipto_postal_code' => :'String',
437
+ :'shipto_state_region' => :'String',
438
+ :'shipto_title' => :'String',
439
+ :'skip_payment_processing' => :'BOOLEAN',
440
+ :'special_instructions' => :'String',
441
+ :'store_completed' => :'BOOLEAN',
442
+ :'store_if_payment_declines' => :'BOOLEAN',
443
+ :'tax_county' => :'String',
444
+ :'tax_exempt' => :'BOOLEAN',
445
+ :'transaction' => :'ChannelPartnerOrderTransaction',
446
+ :'treat_warnings_as_errors' => :'BOOLEAN'
447
+ }
448
+ end
449
+
450
+ # Initializes the object
451
+ # @param [Hash] attributes Model attributes in the form of hash
452
+ def initialize(attributes = {})
453
+ return unless attributes.is_a?(Hash)
454
+
455
+ # convert string to symbol for hash key
456
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
457
+
458
+ if attributes.has_key?(:'advertisingSource')
459
+ self.advertising_source = attributes[:'advertisingSource']
460
+ end
461
+
462
+ if attributes.has_key?(:'affiliate_id')
463
+ self.affiliate_id = attributes[:'affiliate_id']
464
+ end
465
+
466
+ if attributes.has_key?(:'affiliate_sub_id')
467
+ self.affiliate_sub_id = attributes[:'affiliate_sub_id']
468
+ end
469
+
470
+ if attributes.has_key?(:'arbitrary_shipping_handling_total')
471
+ self.arbitrary_shipping_handling_total = attributes[:'arbitrary_shipping_handling_total']
472
+ end
473
+
474
+ if attributes.has_key?(:'arbitrary_tax')
475
+ self.arbitrary_tax = attributes[:'arbitrary_tax']
476
+ end
477
+
478
+ if attributes.has_key?(:'arbitrary_tax_rate')
479
+ self.arbitrary_tax_rate = attributes[:'arbitrary_tax_rate']
480
+ end
481
+
482
+ if attributes.has_key?(:'arbitrary_taxable_subtotal')
483
+ self.arbitrary_taxable_subtotal = attributes[:'arbitrary_taxable_subtotal']
484
+ end
485
+
486
+ if attributes.has_key?(:'associate_with_customer_profile_if_present')
487
+ self.associate_with_customer_profile_if_present = attributes[:'associate_with_customer_profile_if_present']
488
+ end
489
+
490
+ if attributes.has_key?(:'auto_approve_purchase_order')
491
+ self.auto_approve_purchase_order = attributes[:'auto_approve_purchase_order']
492
+ end
493
+
494
+ if attributes.has_key?(:'billto_address1')
495
+ self.billto_address1 = attributes[:'billto_address1']
496
+ end
497
+
498
+ if attributes.has_key?(:'billto_address2')
499
+ self.billto_address2 = attributes[:'billto_address2']
500
+ end
501
+
502
+ if attributes.has_key?(:'billto_city')
503
+ self.billto_city = attributes[:'billto_city']
504
+ end
505
+
506
+ if attributes.has_key?(:'billto_company')
507
+ self.billto_company = attributes[:'billto_company']
508
+ end
509
+
510
+ if attributes.has_key?(:'billto_country_code')
511
+ self.billto_country_code = attributes[:'billto_country_code']
512
+ end
513
+
514
+ if attributes.has_key?(:'billto_day_phone')
515
+ self.billto_day_phone = attributes[:'billto_day_phone']
516
+ end
517
+
518
+ if attributes.has_key?(:'billto_evening_phone')
519
+ self.billto_evening_phone = attributes[:'billto_evening_phone']
520
+ end
521
+
522
+ if attributes.has_key?(:'billto_first_name')
523
+ self.billto_first_name = attributes[:'billto_first_name']
524
+ end
525
+
526
+ if attributes.has_key?(:'billto_last_name')
527
+ self.billto_last_name = attributes[:'billto_last_name']
528
+ end
529
+
530
+ if attributes.has_key?(:'billto_postal_code')
531
+ self.billto_postal_code = attributes[:'billto_postal_code']
532
+ end
533
+
534
+ if attributes.has_key?(:'billto_state_region')
535
+ self.billto_state_region = attributes[:'billto_state_region']
536
+ end
537
+
538
+ if attributes.has_key?(:'billto_title')
539
+ self.billto_title = attributes[:'billto_title']
540
+ end
541
+
542
+ if attributes.has_key?(:'cc_email')
543
+ self.cc_email = attributes[:'cc_email']
544
+ end
545
+
546
+ if attributes.has_key?(:'channel_partner_order_id')
547
+ self.channel_partner_order_id = attributes[:'channel_partner_order_id']
548
+ end
549
+
550
+ if attributes.has_key?(:'consider_recurring')
551
+ self.consider_recurring = attributes[:'consider_recurring']
552
+ end
553
+
554
+ if attributes.has_key?(:'coupons')
555
+ if (value = attributes[:'coupons']).is_a?(Array)
556
+ self.coupons = value
557
+ end
558
+ end
559
+
560
+ if attributes.has_key?(:'credit_card_authorization_amount')
561
+ self.credit_card_authorization_amount = attributes[:'credit_card_authorization_amount']
562
+ end
563
+
564
+ if attributes.has_key?(:'credit_card_authorization_dts')
565
+ self.credit_card_authorization_dts = attributes[:'credit_card_authorization_dts']
566
+ end
567
+
568
+ if attributes.has_key?(:'credit_card_authorization_number')
569
+ self.credit_card_authorization_number = attributes[:'credit_card_authorization_number']
570
+ end
571
+
572
+ if attributes.has_key?(:'credit_card_expiration_month')
573
+ self.credit_card_expiration_month = attributes[:'credit_card_expiration_month']
574
+ end
575
+
576
+ if attributes.has_key?(:'credit_card_expiration_year')
577
+ self.credit_card_expiration_year = attributes[:'credit_card_expiration_year']
578
+ end
579
+
580
+ if attributes.has_key?(:'credit_card_type')
581
+ self.credit_card_type = attributes[:'credit_card_type']
582
+ end
583
+
584
+ if attributes.has_key?(:'custom_field1')
585
+ self.custom_field1 = attributes[:'custom_field1']
586
+ end
587
+
588
+ if attributes.has_key?(:'custom_field2')
589
+ self.custom_field2 = attributes[:'custom_field2']
590
+ end
591
+
592
+ if attributes.has_key?(:'custom_field3')
593
+ self.custom_field3 = attributes[:'custom_field3']
594
+ end
595
+
596
+ if attributes.has_key?(:'custom_field4')
597
+ self.custom_field4 = attributes[:'custom_field4']
598
+ end
599
+
600
+ if attributes.has_key?(:'custom_field5')
601
+ self.custom_field5 = attributes[:'custom_field5']
602
+ end
603
+
604
+ if attributes.has_key?(:'custom_field6')
605
+ self.custom_field6 = attributes[:'custom_field6']
606
+ end
607
+
608
+ if attributes.has_key?(:'custom_field7')
609
+ self.custom_field7 = attributes[:'custom_field7']
610
+ end
611
+
612
+ if attributes.has_key?(:'delivery_date')
613
+ self.delivery_date = attributes[:'delivery_date']
614
+ end
615
+
616
+ if attributes.has_key?(:'email')
617
+ self.email = attributes[:'email']
618
+ end
619
+
620
+ if attributes.has_key?(:'gift')
621
+ self.gift = attributes[:'gift']
622
+ end
623
+
624
+ if attributes.has_key?(:'gift_email')
625
+ self.gift_email = attributes[:'gift_email']
626
+ end
627
+
628
+ if attributes.has_key?(:'gift_message')
629
+ self.gift_message = attributes[:'gift_message']
630
+ end
631
+
632
+ if attributes.has_key?(:'hosted_fields_card_token')
633
+ self.hosted_fields_card_token = attributes[:'hosted_fields_card_token']
634
+ end
635
+
636
+ if attributes.has_key?(:'hosted_fields_cvv_token')
637
+ self.hosted_fields_cvv_token = attributes[:'hosted_fields_cvv_token']
638
+ end
639
+
640
+ if attributes.has_key?(:'insurance_application_id')
641
+ self.insurance_application_id = attributes[:'insurance_application_id']
642
+ end
643
+
644
+ if attributes.has_key?(:'insurance_claim_id')
645
+ self.insurance_claim_id = attributes[:'insurance_claim_id']
646
+ end
647
+
648
+ if attributes.has_key?(:'ip_address')
649
+ self.ip_address = attributes[:'ip_address']
650
+ end
651
+
652
+ if attributes.has_key?(:'items')
653
+ if (value = attributes[:'items']).is_a?(Array)
654
+ self.items = value
655
+ end
656
+ end
657
+
658
+ if attributes.has_key?(:'least_cost_route')
659
+ self.least_cost_route = attributes[:'least_cost_route']
660
+ end
661
+
662
+ if attributes.has_key?(:'least_cost_route_shipping_methods')
663
+ if (value = attributes[:'least_cost_route_shipping_methods']).is_a?(Array)
664
+ self.least_cost_route_shipping_methods = value
665
+ end
666
+ end
667
+
668
+ if attributes.has_key?(:'mailing_list_opt_in')
669
+ self.mailing_list_opt_in = attributes[:'mailing_list_opt_in']
670
+ end
671
+
672
+ if attributes.has_key?(:'no_realtime_payment_processing')
673
+ self.no_realtime_payment_processing = attributes[:'no_realtime_payment_processing']
674
+ end
675
+
676
+ if attributes.has_key?(:'payment_method')
677
+ self.payment_method = attributes[:'payment_method']
678
+ end
679
+
680
+ if attributes.has_key?(:'purchase_order_number')
681
+ self.purchase_order_number = attributes[:'purchase_order_number']
682
+ end
683
+
684
+ if attributes.has_key?(:'rotating_transaction_gateway_code')
685
+ self.rotating_transaction_gateway_code = attributes[:'rotating_transaction_gateway_code']
686
+ end
687
+
688
+ if attributes.has_key?(:'screen_branding_theme_code')
689
+ self.screen_branding_theme_code = attributes[:'screen_branding_theme_code']
690
+ end
691
+
692
+ if attributes.has_key?(:'ship_on_date')
693
+ self.ship_on_date = attributes[:'ship_on_date']
694
+ end
695
+
696
+ if attributes.has_key?(:'ship_to_residential')
697
+ self.ship_to_residential = attributes[:'ship_to_residential']
698
+ end
699
+
700
+ if attributes.has_key?(:'shipping_method')
701
+ self.shipping_method = attributes[:'shipping_method']
702
+ end
703
+
704
+ if attributes.has_key?(:'shipto_address1')
705
+ self.shipto_address1 = attributes[:'shipto_address1']
706
+ end
707
+
708
+ if attributes.has_key?(:'shipto_address2')
709
+ self.shipto_address2 = attributes[:'shipto_address2']
710
+ end
711
+
712
+ if attributes.has_key?(:'shipto_city')
713
+ self.shipto_city = attributes[:'shipto_city']
714
+ end
715
+
716
+ if attributes.has_key?(:'shipto_company')
717
+ self.shipto_company = attributes[:'shipto_company']
718
+ end
719
+
720
+ if attributes.has_key?(:'shipto_country_code')
721
+ self.shipto_country_code = attributes[:'shipto_country_code']
722
+ end
723
+
724
+ if attributes.has_key?(:'shipto_day_phone')
725
+ self.shipto_day_phone = attributes[:'shipto_day_phone']
726
+ end
727
+
728
+ if attributes.has_key?(:'shipto_evening_phone')
729
+ self.shipto_evening_phone = attributes[:'shipto_evening_phone']
730
+ end
731
+
732
+ if attributes.has_key?(:'shipto_first_name')
733
+ self.shipto_first_name = attributes[:'shipto_first_name']
734
+ end
735
+
736
+ if attributes.has_key?(:'shipto_last_name')
737
+ self.shipto_last_name = attributes[:'shipto_last_name']
738
+ end
739
+
740
+ if attributes.has_key?(:'shipto_postal_code')
741
+ self.shipto_postal_code = attributes[:'shipto_postal_code']
742
+ end
743
+
744
+ if attributes.has_key?(:'shipto_state_region')
745
+ self.shipto_state_region = attributes[:'shipto_state_region']
746
+ end
747
+
748
+ if attributes.has_key?(:'shipto_title')
749
+ self.shipto_title = attributes[:'shipto_title']
750
+ end
751
+
752
+ if attributes.has_key?(:'skip_payment_processing')
753
+ self.skip_payment_processing = attributes[:'skip_payment_processing']
754
+ end
755
+
756
+ if attributes.has_key?(:'special_instructions')
757
+ self.special_instructions = attributes[:'special_instructions']
758
+ end
759
+
760
+ if attributes.has_key?(:'store_completed')
761
+ self.store_completed = attributes[:'store_completed']
762
+ end
763
+
764
+ if attributes.has_key?(:'store_if_payment_declines')
765
+ self.store_if_payment_declines = attributes[:'store_if_payment_declines']
766
+ end
767
+
768
+ if attributes.has_key?(:'tax_county')
769
+ self.tax_county = attributes[:'tax_county']
770
+ end
771
+
772
+ if attributes.has_key?(:'tax_exempt')
773
+ self.tax_exempt = attributes[:'tax_exempt']
774
+ end
775
+
776
+ if attributes.has_key?(:'transaction')
777
+ self.transaction = attributes[:'transaction']
778
+ end
779
+
780
+ if attributes.has_key?(:'treat_warnings_as_errors')
781
+ self.treat_warnings_as_errors = attributes[:'treat_warnings_as_errors']
782
+ end
783
+ end
784
+
785
+ # Show invalid properties with the reasons. Usually used together with valid?
786
+ # @return Array for valid properties with the reasons
787
+ def list_invalid_properties
788
+ invalid_properties = Array.new
789
+ if !@billto_address1.nil? && @billto_address1.to_s.length > 50
790
+ invalid_properties.push('invalid value for "billto_address1", the character length must be smaller than or equal to 50.')
791
+ end
792
+
793
+ if !@billto_address2.nil? && @billto_address2.to_s.length > 50
794
+ invalid_properties.push('invalid value for "billto_address2", the character length must be smaller than or equal to 50.')
795
+ end
796
+
797
+ if !@billto_city.nil? && @billto_city.to_s.length > 32
798
+ invalid_properties.push('invalid value for "billto_city", the character length must be smaller than or equal to 32.')
799
+ end
800
+
801
+ if !@billto_company.nil? && @billto_company.to_s.length > 50
802
+ invalid_properties.push('invalid value for "billto_company", the character length must be smaller than or equal to 50.')
803
+ end
804
+
805
+ if !@billto_country_code.nil? && @billto_country_code.to_s.length > 2
806
+ invalid_properties.push('invalid value for "billto_country_code", the character length must be smaller than or equal to 2.')
807
+ end
808
+
809
+ if !@billto_day_phone.nil? && @billto_day_phone.to_s.length > 25
810
+ invalid_properties.push('invalid value for "billto_day_phone", the character length must be smaller than or equal to 25.')
811
+ end
812
+
813
+ if !@billto_evening_phone.nil? && @billto_evening_phone.to_s.length > 25
814
+ invalid_properties.push('invalid value for "billto_evening_phone", the character length must be smaller than or equal to 25.')
815
+ end
816
+
817
+ if !@billto_first_name.nil? && @billto_first_name.to_s.length > 30
818
+ invalid_properties.push('invalid value for "billto_first_name", the character length must be smaller than or equal to 30.')
819
+ end
820
+
821
+ if !@billto_last_name.nil? && @billto_last_name.to_s.length > 30
822
+ invalid_properties.push('invalid value for "billto_last_name", the character length must be smaller than or equal to 30.')
823
+ end
824
+
825
+ if !@billto_postal_code.nil? && @billto_postal_code.to_s.length > 20
826
+ invalid_properties.push('invalid value for "billto_postal_code", the character length must be smaller than or equal to 20.')
827
+ end
828
+
829
+ if !@billto_state_region.nil? && @billto_state_region.to_s.length > 32
830
+ invalid_properties.push('invalid value for "billto_state_region", the character length must be smaller than or equal to 32.')
831
+ end
832
+
833
+ if !@billto_title.nil? && @billto_title.to_s.length > 50
834
+ invalid_properties.push('invalid value for "billto_title", the character length must be smaller than or equal to 50.')
835
+ end
836
+
837
+ if !@cc_email.nil? && @cc_email.to_s.length > 100
838
+ invalid_properties.push('invalid value for "cc_email", the character length must be smaller than or equal to 100.')
839
+ end
840
+
841
+ if !@custom_field1.nil? && @custom_field1.to_s.length > 50
842
+ invalid_properties.push('invalid value for "custom_field1", the character length must be smaller than or equal to 50.')
843
+ end
844
+
845
+ if !@custom_field2.nil? && @custom_field2.to_s.length > 50
846
+ invalid_properties.push('invalid value for "custom_field2", the character length must be smaller than or equal to 50.')
847
+ end
848
+
849
+ if !@custom_field3.nil? && @custom_field3.to_s.length > 50
850
+ invalid_properties.push('invalid value for "custom_field3", the character length must be smaller than or equal to 50.')
851
+ end
852
+
853
+ if !@custom_field4.nil? && @custom_field4.to_s.length > 50
854
+ invalid_properties.push('invalid value for "custom_field4", the character length must be smaller than or equal to 50.')
855
+ end
856
+
857
+ if !@custom_field5.nil? && @custom_field5.to_s.length > 75
858
+ invalid_properties.push('invalid value for "custom_field5", the character length must be smaller than or equal to 75.')
859
+ end
860
+
861
+ if !@custom_field6.nil? && @custom_field6.to_s.length > 50
862
+ invalid_properties.push('invalid value for "custom_field6", the character length must be smaller than or equal to 50.')
863
+ end
864
+
865
+ if !@custom_field7.nil? && @custom_field7.to_s.length > 50
866
+ invalid_properties.push('invalid value for "custom_field7", the character length must be smaller than or equal to 50.')
867
+ end
868
+
869
+ if !@email.nil? && @email.to_s.length > 100
870
+ invalid_properties.push('invalid value for "email", the character length must be smaller than or equal to 100.')
871
+ end
872
+
873
+ if !@gift_email.nil? && @gift_email.to_s.length > 100
874
+ invalid_properties.push('invalid value for "gift_email", the character length must be smaller than or equal to 100.')
875
+ end
876
+
877
+ if !@gift_message.nil? && @gift_message.to_s.length > 10000
878
+ invalid_properties.push('invalid value for "gift_message", the character length must be smaller than or equal to 10000.')
879
+ end
880
+
881
+ if !@screen_branding_theme_code.nil? && @screen_branding_theme_code.to_s.length > 10
882
+ invalid_properties.push('invalid value for "screen_branding_theme_code", the character length must be smaller than or equal to 10.')
883
+ end
884
+
885
+ if !@shipto_address1.nil? && @shipto_address1.to_s.length > 50
886
+ invalid_properties.push('invalid value for "shipto_address1", the character length must be smaller than or equal to 50.')
887
+ end
888
+
889
+ if !@shipto_address2.nil? && @shipto_address2.to_s.length > 50
890
+ invalid_properties.push('invalid value for "shipto_address2", the character length must be smaller than or equal to 50.')
891
+ end
892
+
893
+ if !@shipto_city.nil? && @shipto_city.to_s.length > 32
894
+ invalid_properties.push('invalid value for "shipto_city", the character length must be smaller than or equal to 32.')
895
+ end
896
+
897
+ if !@shipto_company.nil? && @shipto_company.to_s.length > 50
898
+ invalid_properties.push('invalid value for "shipto_company", the character length must be smaller than or equal to 50.')
899
+ end
900
+
901
+ if !@shipto_country_code.nil? && @shipto_country_code.to_s.length > 2
902
+ invalid_properties.push('invalid value for "shipto_country_code", the character length must be smaller than or equal to 2.')
903
+ end
904
+
905
+ if !@shipto_day_phone.nil? && @shipto_day_phone.to_s.length > 25
906
+ invalid_properties.push('invalid value for "shipto_day_phone", the character length must be smaller than or equal to 25.')
907
+ end
908
+
909
+ if !@shipto_evening_phone.nil? && @shipto_evening_phone.to_s.length > 25
910
+ invalid_properties.push('invalid value for "shipto_evening_phone", the character length must be smaller than or equal to 25.')
911
+ end
912
+
913
+ if !@shipto_first_name.nil? && @shipto_first_name.to_s.length > 30
914
+ invalid_properties.push('invalid value for "shipto_first_name", the character length must be smaller than or equal to 30.')
915
+ end
916
+
917
+ if !@shipto_last_name.nil? && @shipto_last_name.to_s.length > 30
918
+ invalid_properties.push('invalid value for "shipto_last_name", the character length must be smaller than or equal to 30.')
919
+ end
920
+
921
+ if !@shipto_postal_code.nil? && @shipto_postal_code.to_s.length > 20
922
+ invalid_properties.push('invalid value for "shipto_postal_code", the character length must be smaller than or equal to 20.')
923
+ end
924
+
925
+ if !@shipto_state_region.nil? && @shipto_state_region.to_s.length > 32
926
+ invalid_properties.push('invalid value for "shipto_state_region", the character length must be smaller than or equal to 32.')
927
+ end
928
+
929
+ if !@shipto_title.nil? && @shipto_title.to_s.length > 50
930
+ invalid_properties.push('invalid value for "shipto_title", the character length must be smaller than or equal to 50.')
931
+ end
932
+
933
+ if !@special_instructions.nil? && @special_instructions.to_s.length > 10000
934
+ invalid_properties.push('invalid value for "special_instructions", the character length must be smaller than or equal to 10000.')
935
+ end
936
+
937
+ invalid_properties
938
+ end
939
+
940
+ # Check to see if the all the properties in the model are valid
941
+ # @return true if the model is valid
942
+ def valid?
943
+ return false if !@billto_address1.nil? && @billto_address1.to_s.length > 50
944
+ return false if !@billto_address2.nil? && @billto_address2.to_s.length > 50
945
+ return false if !@billto_city.nil? && @billto_city.to_s.length > 32
946
+ return false if !@billto_company.nil? && @billto_company.to_s.length > 50
947
+ return false if !@billto_country_code.nil? && @billto_country_code.to_s.length > 2
948
+ return false if !@billto_day_phone.nil? && @billto_day_phone.to_s.length > 25
949
+ return false if !@billto_evening_phone.nil? && @billto_evening_phone.to_s.length > 25
950
+ return false if !@billto_first_name.nil? && @billto_first_name.to_s.length > 30
951
+ return false if !@billto_last_name.nil? && @billto_last_name.to_s.length > 30
952
+ return false if !@billto_postal_code.nil? && @billto_postal_code.to_s.length > 20
953
+ return false if !@billto_state_region.nil? && @billto_state_region.to_s.length > 32
954
+ return false if !@billto_title.nil? && @billto_title.to_s.length > 50
955
+ return false if !@cc_email.nil? && @cc_email.to_s.length > 100
956
+ return false if !@custom_field1.nil? && @custom_field1.to_s.length > 50
957
+ return false if !@custom_field2.nil? && @custom_field2.to_s.length > 50
958
+ return false if !@custom_field3.nil? && @custom_field3.to_s.length > 50
959
+ return false if !@custom_field4.nil? && @custom_field4.to_s.length > 50
960
+ return false if !@custom_field5.nil? && @custom_field5.to_s.length > 75
961
+ return false if !@custom_field6.nil? && @custom_field6.to_s.length > 50
962
+ return false if !@custom_field7.nil? && @custom_field7.to_s.length > 50
963
+ return false if !@email.nil? && @email.to_s.length > 100
964
+ return false if !@gift_email.nil? && @gift_email.to_s.length > 100
965
+ return false if !@gift_message.nil? && @gift_message.to_s.length > 10000
966
+ payment_method_validator = EnumAttributeValidator.new('String', ['Affirm', 'Amazon', 'Check', 'COD', 'Credit Card', 'LoanHero', 'Money Order', 'PayPal', 'Purchase Order', 'Quote Request', 'Wire Transfer'])
967
+ return false unless payment_method_validator.valid?(@payment_method)
968
+ return false if !@screen_branding_theme_code.nil? && @screen_branding_theme_code.to_s.length > 10
969
+ return false if !@shipto_address1.nil? && @shipto_address1.to_s.length > 50
970
+ return false if !@shipto_address2.nil? && @shipto_address2.to_s.length > 50
971
+ return false if !@shipto_city.nil? && @shipto_city.to_s.length > 32
972
+ return false if !@shipto_company.nil? && @shipto_company.to_s.length > 50
973
+ return false if !@shipto_country_code.nil? && @shipto_country_code.to_s.length > 2
974
+ return false if !@shipto_day_phone.nil? && @shipto_day_phone.to_s.length > 25
975
+ return false if !@shipto_evening_phone.nil? && @shipto_evening_phone.to_s.length > 25
976
+ return false if !@shipto_first_name.nil? && @shipto_first_name.to_s.length > 30
977
+ return false if !@shipto_last_name.nil? && @shipto_last_name.to_s.length > 30
978
+ return false if !@shipto_postal_code.nil? && @shipto_postal_code.to_s.length > 20
979
+ return false if !@shipto_state_region.nil? && @shipto_state_region.to_s.length > 32
980
+ return false if !@shipto_title.nil? && @shipto_title.to_s.length > 50
981
+ return false if !@special_instructions.nil? && @special_instructions.to_s.length > 10000
982
+ true
983
+ end
984
+
985
+ # Custom attribute writer method with validation
986
+ # @param [Object] billto_address1 Value to be assigned
987
+ def billto_address1=(billto_address1)
988
+ if !billto_address1.nil? && billto_address1.to_s.length > 50
989
+ fail ArgumentError, 'invalid value for "billto_address1", the character length must be smaller than or equal to 50.'
990
+ end
991
+
992
+ @billto_address1 = billto_address1
993
+ end
994
+
995
+ # Custom attribute writer method with validation
996
+ # @param [Object] billto_address2 Value to be assigned
997
+ def billto_address2=(billto_address2)
998
+ if !billto_address2.nil? && billto_address2.to_s.length > 50
999
+ fail ArgumentError, 'invalid value for "billto_address2", the character length must be smaller than or equal to 50.'
1000
+ end
1001
+
1002
+ @billto_address2 = billto_address2
1003
+ end
1004
+
1005
+ # Custom attribute writer method with validation
1006
+ # @param [Object] billto_city Value to be assigned
1007
+ def billto_city=(billto_city)
1008
+ if !billto_city.nil? && billto_city.to_s.length > 32
1009
+ fail ArgumentError, 'invalid value for "billto_city", the character length must be smaller than or equal to 32.'
1010
+ end
1011
+
1012
+ @billto_city = billto_city
1013
+ end
1014
+
1015
+ # Custom attribute writer method with validation
1016
+ # @param [Object] billto_company Value to be assigned
1017
+ def billto_company=(billto_company)
1018
+ if !billto_company.nil? && billto_company.to_s.length > 50
1019
+ fail ArgumentError, 'invalid value for "billto_company", the character length must be smaller than or equal to 50.'
1020
+ end
1021
+
1022
+ @billto_company = billto_company
1023
+ end
1024
+
1025
+ # Custom attribute writer method with validation
1026
+ # @param [Object] billto_country_code Value to be assigned
1027
+ def billto_country_code=(billto_country_code)
1028
+ if !billto_country_code.nil? && billto_country_code.to_s.length > 2
1029
+ fail ArgumentError, 'invalid value for "billto_country_code", the character length must be smaller than or equal to 2.'
1030
+ end
1031
+
1032
+ @billto_country_code = billto_country_code
1033
+ end
1034
+
1035
+ # Custom attribute writer method with validation
1036
+ # @param [Object] billto_day_phone Value to be assigned
1037
+ def billto_day_phone=(billto_day_phone)
1038
+ if !billto_day_phone.nil? && billto_day_phone.to_s.length > 25
1039
+ fail ArgumentError, 'invalid value for "billto_day_phone", the character length must be smaller than or equal to 25.'
1040
+ end
1041
+
1042
+ @billto_day_phone = billto_day_phone
1043
+ end
1044
+
1045
+ # Custom attribute writer method with validation
1046
+ # @param [Object] billto_evening_phone Value to be assigned
1047
+ def billto_evening_phone=(billto_evening_phone)
1048
+ if !billto_evening_phone.nil? && billto_evening_phone.to_s.length > 25
1049
+ fail ArgumentError, 'invalid value for "billto_evening_phone", the character length must be smaller than or equal to 25.'
1050
+ end
1051
+
1052
+ @billto_evening_phone = billto_evening_phone
1053
+ end
1054
+
1055
+ # Custom attribute writer method with validation
1056
+ # @param [Object] billto_first_name Value to be assigned
1057
+ def billto_first_name=(billto_first_name)
1058
+ if !billto_first_name.nil? && billto_first_name.to_s.length > 30
1059
+ fail ArgumentError, 'invalid value for "billto_first_name", the character length must be smaller than or equal to 30.'
1060
+ end
1061
+
1062
+ @billto_first_name = billto_first_name
1063
+ end
1064
+
1065
+ # Custom attribute writer method with validation
1066
+ # @param [Object] billto_last_name Value to be assigned
1067
+ def billto_last_name=(billto_last_name)
1068
+ if !billto_last_name.nil? && billto_last_name.to_s.length > 30
1069
+ fail ArgumentError, 'invalid value for "billto_last_name", the character length must be smaller than or equal to 30.'
1070
+ end
1071
+
1072
+ @billto_last_name = billto_last_name
1073
+ end
1074
+
1075
+ # Custom attribute writer method with validation
1076
+ # @param [Object] billto_postal_code Value to be assigned
1077
+ def billto_postal_code=(billto_postal_code)
1078
+ if !billto_postal_code.nil? && billto_postal_code.to_s.length > 20
1079
+ fail ArgumentError, 'invalid value for "billto_postal_code", the character length must be smaller than or equal to 20.'
1080
+ end
1081
+
1082
+ @billto_postal_code = billto_postal_code
1083
+ end
1084
+
1085
+ # Custom attribute writer method with validation
1086
+ # @param [Object] billto_state_region Value to be assigned
1087
+ def billto_state_region=(billto_state_region)
1088
+ if !billto_state_region.nil? && billto_state_region.to_s.length > 32
1089
+ fail ArgumentError, 'invalid value for "billto_state_region", the character length must be smaller than or equal to 32.'
1090
+ end
1091
+
1092
+ @billto_state_region = billto_state_region
1093
+ end
1094
+
1095
+ # Custom attribute writer method with validation
1096
+ # @param [Object] billto_title Value to be assigned
1097
+ def billto_title=(billto_title)
1098
+ if !billto_title.nil? && billto_title.to_s.length > 50
1099
+ fail ArgumentError, 'invalid value for "billto_title", the character length must be smaller than or equal to 50.'
1100
+ end
1101
+
1102
+ @billto_title = billto_title
1103
+ end
1104
+
1105
+ # Custom attribute writer method with validation
1106
+ # @param [Object] cc_email Value to be assigned
1107
+ def cc_email=(cc_email)
1108
+ if !cc_email.nil? && cc_email.to_s.length > 100
1109
+ fail ArgumentError, 'invalid value for "cc_email", the character length must be smaller than or equal to 100.'
1110
+ end
1111
+
1112
+ @cc_email = cc_email
1113
+ end
1114
+
1115
+ # Custom attribute writer method with validation
1116
+ # @param [Object] custom_field1 Value to be assigned
1117
+ def custom_field1=(custom_field1)
1118
+ if !custom_field1.nil? && custom_field1.to_s.length > 50
1119
+ fail ArgumentError, 'invalid value for "custom_field1", the character length must be smaller than or equal to 50.'
1120
+ end
1121
+
1122
+ @custom_field1 = custom_field1
1123
+ end
1124
+
1125
+ # Custom attribute writer method with validation
1126
+ # @param [Object] custom_field2 Value to be assigned
1127
+ def custom_field2=(custom_field2)
1128
+ if !custom_field2.nil? && custom_field2.to_s.length > 50
1129
+ fail ArgumentError, 'invalid value for "custom_field2", the character length must be smaller than or equal to 50.'
1130
+ end
1131
+
1132
+ @custom_field2 = custom_field2
1133
+ end
1134
+
1135
+ # Custom attribute writer method with validation
1136
+ # @param [Object] custom_field3 Value to be assigned
1137
+ def custom_field3=(custom_field3)
1138
+ if !custom_field3.nil? && custom_field3.to_s.length > 50
1139
+ fail ArgumentError, 'invalid value for "custom_field3", the character length must be smaller than or equal to 50.'
1140
+ end
1141
+
1142
+ @custom_field3 = custom_field3
1143
+ end
1144
+
1145
+ # Custom attribute writer method with validation
1146
+ # @param [Object] custom_field4 Value to be assigned
1147
+ def custom_field4=(custom_field4)
1148
+ if !custom_field4.nil? && custom_field4.to_s.length > 50
1149
+ fail ArgumentError, 'invalid value for "custom_field4", the character length must be smaller than or equal to 50.'
1150
+ end
1151
+
1152
+ @custom_field4 = custom_field4
1153
+ end
1154
+
1155
+ # Custom attribute writer method with validation
1156
+ # @param [Object] custom_field5 Value to be assigned
1157
+ def custom_field5=(custom_field5)
1158
+ if !custom_field5.nil? && custom_field5.to_s.length > 75
1159
+ fail ArgumentError, 'invalid value for "custom_field5", the character length must be smaller than or equal to 75.'
1160
+ end
1161
+
1162
+ @custom_field5 = custom_field5
1163
+ end
1164
+
1165
+ # Custom attribute writer method with validation
1166
+ # @param [Object] custom_field6 Value to be assigned
1167
+ def custom_field6=(custom_field6)
1168
+ if !custom_field6.nil? && custom_field6.to_s.length > 50
1169
+ fail ArgumentError, 'invalid value for "custom_field6", the character length must be smaller than or equal to 50.'
1170
+ end
1171
+
1172
+ @custom_field6 = custom_field6
1173
+ end
1174
+
1175
+ # Custom attribute writer method with validation
1176
+ # @param [Object] custom_field7 Value to be assigned
1177
+ def custom_field7=(custom_field7)
1178
+ if !custom_field7.nil? && custom_field7.to_s.length > 50
1179
+ fail ArgumentError, 'invalid value for "custom_field7", the character length must be smaller than or equal to 50.'
1180
+ end
1181
+
1182
+ @custom_field7 = custom_field7
1183
+ end
1184
+
1185
+ # Custom attribute writer method with validation
1186
+ # @param [Object] email Value to be assigned
1187
+ def email=(email)
1188
+ if !email.nil? && email.to_s.length > 100
1189
+ fail ArgumentError, 'invalid value for "email", the character length must be smaller than or equal to 100.'
1190
+ end
1191
+
1192
+ @email = email
1193
+ end
1194
+
1195
+ # Custom attribute writer method with validation
1196
+ # @param [Object] gift_email Value to be assigned
1197
+ def gift_email=(gift_email)
1198
+ if !gift_email.nil? && gift_email.to_s.length > 100
1199
+ fail ArgumentError, 'invalid value for "gift_email", the character length must be smaller than or equal to 100.'
1200
+ end
1201
+
1202
+ @gift_email = gift_email
1203
+ end
1204
+
1205
+ # Custom attribute writer method with validation
1206
+ # @param [Object] gift_message Value to be assigned
1207
+ def gift_message=(gift_message)
1208
+ if !gift_message.nil? && gift_message.to_s.length > 10000
1209
+ fail ArgumentError, 'invalid value for "gift_message", the character length must be smaller than or equal to 10000.'
1210
+ end
1211
+
1212
+ @gift_message = gift_message
1213
+ end
1214
+
1215
+ # Custom attribute writer method checking allowed values (enum).
1216
+ # @param [Object] payment_method Object to be assigned
1217
+ def payment_method=(payment_method)
1218
+ validator = EnumAttributeValidator.new('String', ['Affirm', 'Amazon', 'Check', 'COD', 'Credit Card', 'LoanHero', 'Money Order', 'PayPal', 'Purchase Order', 'Quote Request', 'Wire Transfer'])
1219
+ unless validator.valid?(payment_method)
1220
+ fail ArgumentError, 'invalid value for "payment_method", must be one of #{validator.allowable_values}.'
1221
+ end
1222
+ @payment_method = payment_method
1223
+ end
1224
+
1225
+ # Custom attribute writer method with validation
1226
+ # @param [Object] screen_branding_theme_code Value to be assigned
1227
+ def screen_branding_theme_code=(screen_branding_theme_code)
1228
+ if !screen_branding_theme_code.nil? && screen_branding_theme_code.to_s.length > 10
1229
+ fail ArgumentError, 'invalid value for "screen_branding_theme_code", the character length must be smaller than or equal to 10.'
1230
+ end
1231
+
1232
+ @screen_branding_theme_code = screen_branding_theme_code
1233
+ end
1234
+
1235
+ # Custom attribute writer method with validation
1236
+ # @param [Object] shipto_address1 Value to be assigned
1237
+ def shipto_address1=(shipto_address1)
1238
+ if !shipto_address1.nil? && shipto_address1.to_s.length > 50
1239
+ fail ArgumentError, 'invalid value for "shipto_address1", the character length must be smaller than or equal to 50.'
1240
+ end
1241
+
1242
+ @shipto_address1 = shipto_address1
1243
+ end
1244
+
1245
+ # Custom attribute writer method with validation
1246
+ # @param [Object] shipto_address2 Value to be assigned
1247
+ def shipto_address2=(shipto_address2)
1248
+ if !shipto_address2.nil? && shipto_address2.to_s.length > 50
1249
+ fail ArgumentError, 'invalid value for "shipto_address2", the character length must be smaller than or equal to 50.'
1250
+ end
1251
+
1252
+ @shipto_address2 = shipto_address2
1253
+ end
1254
+
1255
+ # Custom attribute writer method with validation
1256
+ # @param [Object] shipto_city Value to be assigned
1257
+ def shipto_city=(shipto_city)
1258
+ if !shipto_city.nil? && shipto_city.to_s.length > 32
1259
+ fail ArgumentError, 'invalid value for "shipto_city", the character length must be smaller than or equal to 32.'
1260
+ end
1261
+
1262
+ @shipto_city = shipto_city
1263
+ end
1264
+
1265
+ # Custom attribute writer method with validation
1266
+ # @param [Object] shipto_company Value to be assigned
1267
+ def shipto_company=(shipto_company)
1268
+ if !shipto_company.nil? && shipto_company.to_s.length > 50
1269
+ fail ArgumentError, 'invalid value for "shipto_company", the character length must be smaller than or equal to 50.'
1270
+ end
1271
+
1272
+ @shipto_company = shipto_company
1273
+ end
1274
+
1275
+ # Custom attribute writer method with validation
1276
+ # @param [Object] shipto_country_code Value to be assigned
1277
+ def shipto_country_code=(shipto_country_code)
1278
+ if !shipto_country_code.nil? && shipto_country_code.to_s.length > 2
1279
+ fail ArgumentError, 'invalid value for "shipto_country_code", the character length must be smaller than or equal to 2.'
1280
+ end
1281
+
1282
+ @shipto_country_code = shipto_country_code
1283
+ end
1284
+
1285
+ # Custom attribute writer method with validation
1286
+ # @param [Object] shipto_day_phone Value to be assigned
1287
+ def shipto_day_phone=(shipto_day_phone)
1288
+ if !shipto_day_phone.nil? && shipto_day_phone.to_s.length > 25
1289
+ fail ArgumentError, 'invalid value for "shipto_day_phone", the character length must be smaller than or equal to 25.'
1290
+ end
1291
+
1292
+ @shipto_day_phone = shipto_day_phone
1293
+ end
1294
+
1295
+ # Custom attribute writer method with validation
1296
+ # @param [Object] shipto_evening_phone Value to be assigned
1297
+ def shipto_evening_phone=(shipto_evening_phone)
1298
+ if !shipto_evening_phone.nil? && shipto_evening_phone.to_s.length > 25
1299
+ fail ArgumentError, 'invalid value for "shipto_evening_phone", the character length must be smaller than or equal to 25.'
1300
+ end
1301
+
1302
+ @shipto_evening_phone = shipto_evening_phone
1303
+ end
1304
+
1305
+ # Custom attribute writer method with validation
1306
+ # @param [Object] shipto_first_name Value to be assigned
1307
+ def shipto_first_name=(shipto_first_name)
1308
+ if !shipto_first_name.nil? && shipto_first_name.to_s.length > 30
1309
+ fail ArgumentError, 'invalid value for "shipto_first_name", the character length must be smaller than or equal to 30.'
1310
+ end
1311
+
1312
+ @shipto_first_name = shipto_first_name
1313
+ end
1314
+
1315
+ # Custom attribute writer method with validation
1316
+ # @param [Object] shipto_last_name Value to be assigned
1317
+ def shipto_last_name=(shipto_last_name)
1318
+ if !shipto_last_name.nil? && shipto_last_name.to_s.length > 30
1319
+ fail ArgumentError, 'invalid value for "shipto_last_name", the character length must be smaller than or equal to 30.'
1320
+ end
1321
+
1322
+ @shipto_last_name = shipto_last_name
1323
+ end
1324
+
1325
+ # Custom attribute writer method with validation
1326
+ # @param [Object] shipto_postal_code Value to be assigned
1327
+ def shipto_postal_code=(shipto_postal_code)
1328
+ if !shipto_postal_code.nil? && shipto_postal_code.to_s.length > 20
1329
+ fail ArgumentError, 'invalid value for "shipto_postal_code", the character length must be smaller than or equal to 20.'
1330
+ end
1331
+
1332
+ @shipto_postal_code = shipto_postal_code
1333
+ end
1334
+
1335
+ # Custom attribute writer method with validation
1336
+ # @param [Object] shipto_state_region Value to be assigned
1337
+ def shipto_state_region=(shipto_state_region)
1338
+ if !shipto_state_region.nil? && shipto_state_region.to_s.length > 32
1339
+ fail ArgumentError, 'invalid value for "shipto_state_region", the character length must be smaller than or equal to 32.'
1340
+ end
1341
+
1342
+ @shipto_state_region = shipto_state_region
1343
+ end
1344
+
1345
+ # Custom attribute writer method with validation
1346
+ # @param [Object] shipto_title Value to be assigned
1347
+ def shipto_title=(shipto_title)
1348
+ if !shipto_title.nil? && shipto_title.to_s.length > 50
1349
+ fail ArgumentError, 'invalid value for "shipto_title", the character length must be smaller than or equal to 50.'
1350
+ end
1351
+
1352
+ @shipto_title = shipto_title
1353
+ end
1354
+
1355
+ # Custom attribute writer method with validation
1356
+ # @param [Object] special_instructions Value to be assigned
1357
+ def special_instructions=(special_instructions)
1358
+ if !special_instructions.nil? && special_instructions.to_s.length > 10000
1359
+ fail ArgumentError, 'invalid value for "special_instructions", the character length must be smaller than or equal to 10000.'
1360
+ end
1361
+
1362
+ @special_instructions = special_instructions
1363
+ end
1364
+
1365
+ # Checks equality by comparing each attribute.
1366
+ # @param [Object] Object to be compared
1367
+ def ==(o)
1368
+ return true if self.equal?(o)
1369
+ self.class == o.class &&
1370
+ advertising_source == o.advertising_source &&
1371
+ affiliate_id == o.affiliate_id &&
1372
+ affiliate_sub_id == o.affiliate_sub_id &&
1373
+ arbitrary_shipping_handling_total == o.arbitrary_shipping_handling_total &&
1374
+ arbitrary_tax == o.arbitrary_tax &&
1375
+ arbitrary_tax_rate == o.arbitrary_tax_rate &&
1376
+ arbitrary_taxable_subtotal == o.arbitrary_taxable_subtotal &&
1377
+ associate_with_customer_profile_if_present == o.associate_with_customer_profile_if_present &&
1378
+ auto_approve_purchase_order == o.auto_approve_purchase_order &&
1379
+ billto_address1 == o.billto_address1 &&
1380
+ billto_address2 == o.billto_address2 &&
1381
+ billto_city == o.billto_city &&
1382
+ billto_company == o.billto_company &&
1383
+ billto_country_code == o.billto_country_code &&
1384
+ billto_day_phone == o.billto_day_phone &&
1385
+ billto_evening_phone == o.billto_evening_phone &&
1386
+ billto_first_name == o.billto_first_name &&
1387
+ billto_last_name == o.billto_last_name &&
1388
+ billto_postal_code == o.billto_postal_code &&
1389
+ billto_state_region == o.billto_state_region &&
1390
+ billto_title == o.billto_title &&
1391
+ cc_email == o.cc_email &&
1392
+ channel_partner_order_id == o.channel_partner_order_id &&
1393
+ consider_recurring == o.consider_recurring &&
1394
+ coupons == o.coupons &&
1395
+ credit_card_authorization_amount == o.credit_card_authorization_amount &&
1396
+ credit_card_authorization_dts == o.credit_card_authorization_dts &&
1397
+ credit_card_authorization_number == o.credit_card_authorization_number &&
1398
+ credit_card_expiration_month == o.credit_card_expiration_month &&
1399
+ credit_card_expiration_year == o.credit_card_expiration_year &&
1400
+ credit_card_type == o.credit_card_type &&
1401
+ custom_field1 == o.custom_field1 &&
1402
+ custom_field2 == o.custom_field2 &&
1403
+ custom_field3 == o.custom_field3 &&
1404
+ custom_field4 == o.custom_field4 &&
1405
+ custom_field5 == o.custom_field5 &&
1406
+ custom_field6 == o.custom_field6 &&
1407
+ custom_field7 == o.custom_field7 &&
1408
+ delivery_date == o.delivery_date &&
1409
+ email == o.email &&
1410
+ gift == o.gift &&
1411
+ gift_email == o.gift_email &&
1412
+ gift_message == o.gift_message &&
1413
+ hosted_fields_card_token == o.hosted_fields_card_token &&
1414
+ hosted_fields_cvv_token == o.hosted_fields_cvv_token &&
1415
+ insurance_application_id == o.insurance_application_id &&
1416
+ insurance_claim_id == o.insurance_claim_id &&
1417
+ ip_address == o.ip_address &&
1418
+ items == o.items &&
1419
+ least_cost_route == o.least_cost_route &&
1420
+ least_cost_route_shipping_methods == o.least_cost_route_shipping_methods &&
1421
+ mailing_list_opt_in == o.mailing_list_opt_in &&
1422
+ no_realtime_payment_processing == o.no_realtime_payment_processing &&
1423
+ payment_method == o.payment_method &&
1424
+ purchase_order_number == o.purchase_order_number &&
1425
+ rotating_transaction_gateway_code == o.rotating_transaction_gateway_code &&
1426
+ screen_branding_theme_code == o.screen_branding_theme_code &&
1427
+ ship_on_date == o.ship_on_date &&
1428
+ ship_to_residential == o.ship_to_residential &&
1429
+ shipping_method == o.shipping_method &&
1430
+ shipto_address1 == o.shipto_address1 &&
1431
+ shipto_address2 == o.shipto_address2 &&
1432
+ shipto_city == o.shipto_city &&
1433
+ shipto_company == o.shipto_company &&
1434
+ shipto_country_code == o.shipto_country_code &&
1435
+ shipto_day_phone == o.shipto_day_phone &&
1436
+ shipto_evening_phone == o.shipto_evening_phone &&
1437
+ shipto_first_name == o.shipto_first_name &&
1438
+ shipto_last_name == o.shipto_last_name &&
1439
+ shipto_postal_code == o.shipto_postal_code &&
1440
+ shipto_state_region == o.shipto_state_region &&
1441
+ shipto_title == o.shipto_title &&
1442
+ skip_payment_processing == o.skip_payment_processing &&
1443
+ special_instructions == o.special_instructions &&
1444
+ store_completed == o.store_completed &&
1445
+ store_if_payment_declines == o.store_if_payment_declines &&
1446
+ tax_county == o.tax_county &&
1447
+ tax_exempt == o.tax_exempt &&
1448
+ transaction == o.transaction &&
1449
+ treat_warnings_as_errors == o.treat_warnings_as_errors
1450
+ end
1451
+
1452
+ # @see the `==` method
1453
+ # @param [Object] Object to be compared
1454
+ def eql?(o)
1455
+ self == o
1456
+ end
1457
+
1458
+ # Calculates hash code according to all attributes.
1459
+ # @return [Fixnum] Hash code
1460
+ def hash
1461
+ [advertising_source, affiliate_id, affiliate_sub_id, arbitrary_shipping_handling_total, arbitrary_tax, arbitrary_tax_rate, arbitrary_taxable_subtotal, associate_with_customer_profile_if_present, auto_approve_purchase_order, billto_address1, billto_address2, billto_city, billto_company, billto_country_code, billto_day_phone, billto_evening_phone, billto_first_name, billto_last_name, billto_postal_code, billto_state_region, billto_title, cc_email, channel_partner_order_id, consider_recurring, coupons, credit_card_authorization_amount, credit_card_authorization_dts, credit_card_authorization_number, credit_card_expiration_month, credit_card_expiration_year, credit_card_type, custom_field1, custom_field2, custom_field3, custom_field4, custom_field5, custom_field6, custom_field7, delivery_date, email, gift, gift_email, gift_message, hosted_fields_card_token, hosted_fields_cvv_token, insurance_application_id, insurance_claim_id, ip_address, items, least_cost_route, least_cost_route_shipping_methods, mailing_list_opt_in, no_realtime_payment_processing, payment_method, purchase_order_number, rotating_transaction_gateway_code, screen_branding_theme_code, ship_on_date, ship_to_residential, shipping_method, shipto_address1, shipto_address2, shipto_city, shipto_company, shipto_country_code, shipto_day_phone, shipto_evening_phone, shipto_first_name, shipto_last_name, shipto_postal_code, shipto_state_region, shipto_title, skip_payment_processing, special_instructions, store_completed, store_if_payment_declines, tax_county, tax_exempt, transaction, treat_warnings_as_errors].hash
1462
+ end
1463
+
1464
+ # Builds the object from hash
1465
+ # @param [Hash] attributes Model attributes in the form of hash
1466
+ # @return [Object] Returns the model itself
1467
+ def build_from_hash(attributes)
1468
+ return nil unless attributes.is_a?(Hash)
1469
+ self.class.swagger_types.each_pair do |key, type|
1470
+ if type =~ /\AArray<(.*)>/i
1471
+ # check to ensure the input is an array given that the attribute
1472
+ # is documented as an array but the input is not
1473
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
1474
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
1475
+ end
1476
+ elsif !attributes[self.class.attribute_map[key]].nil?
1477
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
1478
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
1479
+ end
1480
+
1481
+ self
1482
+ end
1483
+
1484
+ # Deserializes the data based on type
1485
+ # @param string type Data type
1486
+ # @param string value Value to be deserialized
1487
+ # @return [Object] Deserialized data
1488
+ def _deserialize(type, value)
1489
+ case type.to_sym
1490
+ when :DateTime
1491
+ DateTime.parse(value)
1492
+ when :Date
1493
+ Date.parse(value)
1494
+ when :String
1495
+ value.to_s
1496
+ when :Integer
1497
+ value.to_i
1498
+ when :Float
1499
+ value.to_f
1500
+ when :BOOLEAN
1501
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
1502
+ true
1503
+ else
1504
+ false
1505
+ end
1506
+ when :Object
1507
+ # generic object (usually a Hash), return directly
1508
+ value
1509
+ when /\AArray<(?<inner_type>.+)>\z/
1510
+ inner_type = Regexp.last_match[:inner_type]
1511
+ value.map { |v| _deserialize(inner_type, v) }
1512
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
1513
+ k_type = Regexp.last_match[:k_type]
1514
+ v_type = Regexp.last_match[:v_type]
1515
+ {}.tap do |hash|
1516
+ value.each do |k, v|
1517
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
1518
+ end
1519
+ end
1520
+ else # model
1521
+ temp_model = UltracartClient.const_get(type).new
1522
+ temp_model.build_from_hash(value)
1523
+ end
1524
+ end
1525
+
1526
+ # Returns the string representation of the object
1527
+ # @return [String] String presentation of the object
1528
+ def to_s
1529
+ to_hash.to_s
1530
+ end
1531
+
1532
+ # to_body is an alias to to_hash (backward compatibility)
1533
+ # @return [Hash] Returns the object in the form of hash
1534
+ def to_body
1535
+ to_hash
1536
+ end
1537
+
1538
+ # Returns the object in the form of hash
1539
+ # @return [Hash] Returns the object in the form of hash
1540
+ def to_hash
1541
+ hash = {}
1542
+ self.class.attribute_map.each_pair do |attr, param|
1543
+ value = self.send(attr)
1544
+ next if value.nil?
1545
+ hash[param] = _to_hash(value)
1546
+ end
1547
+ hash
1548
+ end
1549
+
1550
+ # Outputs non-array value in the form of hash
1551
+ # For object, use to_hash. Otherwise, just return the value
1552
+ # @param [Object] value Any valid value
1553
+ # @return [Hash] Returns the value in the form of hash
1554
+ def _to_hash(value)
1555
+ if value.is_a?(Array)
1556
+ value.compact.map { |v| _to_hash(v) }
1557
+ elsif value.is_a?(Hash)
1558
+ {}.tap do |hash|
1559
+ value.each { |k, v| hash[k] = _to_hash(v) }
1560
+ end
1561
+ elsif value.respond_to? :to_hash
1562
+ value.to_hash
1563
+ else
1564
+ value
1565
+ end
1566
+ end
1567
+
1568
+ end
1569
+ end