Class: UltracartClient::OrderQuery

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

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ OrderQuery

Initializes the object

Parameters:

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

    Model attributes in the form of hash



295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
# File 'lib/ultracart_api/models/order_query.rb', line 295

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::OrderQuery` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!self.class.attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::OrderQuery`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#card_bin ⇒ Object

First six digits (BIN) of the credit card number. Must be specified together with card_last4 and a payment_date_begin/payment_date_end range. Requires query_target=cache.



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

def card_bin
  @card_bin
end

#card_last4 ⇒ Object

Last four digits of the credit card number. Must be specified together with card_bin and a payment_date_begin/payment_date_end range. Always supply four digits, including for American Express. Requires query_target=cache.



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

def card_last4
  @card_last4
end

#cc_email ⇒ Object

CC Email



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

def cc_email
  @cc_email
end

#channel_partner_code ⇒ Object

The code of the channel partner



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

def channel_partner_code
  @channel_partner_code
end

#channel_partner_order_id ⇒ Object

The order ID assigned by the channel partner for this order



31
32
33
# File 'lib/ultracart_api/models/order_query.rb', line 31

def channel_partner_order_id
  @channel_partner_order_id
end

#city ⇒ Object

City



34
35
36
# File 'lib/ultracart_api/models/order_query.rb', line 34

def city
  @city
end

#company ⇒ Object

Company



37
38
39
# File 'lib/ultracart_api/models/order_query.rb', line 37

def company
  @company
end

#country_code ⇒ Object

ISO-3166 two letter country code



40
41
42
# File 'lib/ultracart_api/models/order_query.rb', line 40

def country_code
  @country_code
end

#creation_date_begin ⇒ Object

Date/time that the order was created



43
44
45
# File 'lib/ultracart_api/models/order_query.rb', line 43

def creation_date_begin
  @creation_date_begin
end

#creation_date_end ⇒ Object

Date/time that the order was created



46
47
48
# File 'lib/ultracart_api/models/order_query.rb', line 46

def creation_date_end
  @creation_date_end
end

#current_stage ⇒ Object

Current stage that the order is in.



49
50
51
# File 'lib/ultracart_api/models/order_query.rb', line 49

def current_stage
  @current_stage
end

#custom_field_1 ⇒ Object

Custom field 1



52
53
54
# File 'lib/ultracart_api/models/order_query.rb', line 52

def custom_field_1
  @custom_field_1
end

#custom_field_10 ⇒ Object

Custom field 10



55
56
57
# File 'lib/ultracart_api/models/order_query.rb', line 55

def custom_field_10
  @custom_field_10
end

#custom_field_2 ⇒ Object

Custom field 2



58
59
60
# File 'lib/ultracart_api/models/order_query.rb', line 58

def custom_field_2
  @custom_field_2
end

#custom_field_3 ⇒ Object

Custom field 3



61
62
63
# File 'lib/ultracart_api/models/order_query.rb', line 61

def custom_field_3
  @custom_field_3
end

#custom_field_4 ⇒ Object

Custom field 4



64
65
66
# File 'lib/ultracart_api/models/order_query.rb', line 64

def custom_field_4
  @custom_field_4
end

#custom_field_5 ⇒ Object

Custom field 5



67
68
69
# File 'lib/ultracart_api/models/order_query.rb', line 67

def custom_field_5
  @custom_field_5
end

#custom_field_6 ⇒ Object

Custom field 6



70
71
72
# File 'lib/ultracart_api/models/order_query.rb', line 70

def custom_field_6
  @custom_field_6
end

#custom_field_7 ⇒ Object

Custom field 7



73
74
75
# File 'lib/ultracart_api/models/order_query.rb', line 73

def custom_field_7
  @custom_field_7
end

#custom_field_8 ⇒ Object

Custom field 8



76
77
78
# File 'lib/ultracart_api/models/order_query.rb', line 76

def custom_field_8
  @custom_field_8
end

#custom_field_9 ⇒ Object

Custom field 9



79
80
81
# File 'lib/ultracart_api/models/order_query.rb', line 79

def custom_field_9
  @custom_field_9
end

#customer_profile_oid ⇒ Object

The customer profile to find associated orders for



82
83
84
# File 'lib/ultracart_api/models/order_query.rb', line 82

def customer_profile_oid
  @customer_profile_oid
end

#email ⇒ Object

Email



85
86
87
# File 'lib/ultracart_api/models/order_query.rb', line 85

def email
  @email
end

#first_name ⇒ Object

First name



88
89
90
# File 'lib/ultracart_api/models/order_query.rb', line 88

def first_name
  @first_name
end

#item_id ⇒ Object

Item ID



91
92
93
# File 'lib/ultracart_api/models/order_query.rb', line 91

def item_id
  @item_id
end

#last_name ⇒ Object

Last name



94
95
96
# File 'lib/ultracart_api/models/order_query.rb', line 94

def last_name
  @last_name
end

#order_id ⇒ Object

Order ID



97
98
99
# File 'lib/ultracart_api/models/order_query.rb', line 97

def order_id
  @order_id
end

#payment_date_begin ⇒ Object

Date/time that the order was successfully processed



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

def payment_date_begin
  @payment_date_begin
end

#payment_date_end ⇒ Object

Date/time that the order was successfully processed



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

def payment_date_end
  @payment_date_end
end

#payment_method ⇒ Object

Payment method



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

def payment_method
  @payment_method
end

#payment_transaction_filters ⇒ Object

Exact-match filters on the detail name/value pairs of a single payment transaction, AND-ed against the same transaction. Requires query_target=cache. The origin or database path cannot search transaction details. The rotating gateway is just another pair, name equals rotatingTransactionGatewayCode or rotatingTransactionGatewayName.



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

def payment_transaction_filters
  @payment_transaction_filters
end

#phone ⇒ Object

Phone



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

def phone
  @phone
end

#postal_code ⇒ Object

Postal code



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

def postal_code
  @postal_code
end

#purchase_order_number ⇒ Object

Purchase order number



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

def purchase_order_number
  @purchase_order_number
end

#query_target ⇒ Object

Query Target



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

def query_target
  @query_target
end

#refund_date_begin ⇒ Object

Date/time that the order was refunded



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

def refund_date_begin
  @refund_date_begin
end

#refund_date_end ⇒ Object

Date/time that the order was refunded



127
128
129
# File 'lib/ultracart_api/models/order_query.rb', line 127

def refund_date_end
  @refund_date_end
end

#rma ⇒ Object

RMA number



130
131
132
# File 'lib/ultracart_api/models/order_query.rb', line 130

def rma
  @rma
end

#screen_branding_theme_code ⇒ Object

Screen branding theme code associated with the order (legacy checkout)



133
134
135
# File 'lib/ultracart_api/models/order_query.rb', line 133

def screen_branding_theme_code
  @screen_branding_theme_code
end

#shipment_date_begin ⇒ Object

Date/time that the order was shipped



136
137
138
# File 'lib/ultracart_api/models/order_query.rb', line 136

def shipment_date_begin
  @shipment_date_begin
end

#shipment_date_end ⇒ Object

Date/time that the order was shipped



139
140
141
# File 'lib/ultracart_api/models/order_query.rb', line 139

def shipment_date_end
  @shipment_date_end
end

#shipped_on_date_begin ⇒ Object

Date/time that the order should ship on



142
143
144
# File 'lib/ultracart_api/models/order_query.rb', line 142

def shipped_on_date_begin
  @shipped_on_date_begin
end

#shipped_on_date_end ⇒ Object

Date/time that the order should ship on



145
146
147
# File 'lib/ultracart_api/models/order_query.rb', line 145

def shipped_on_date_end
  @shipped_on_date_end
end

#state_region ⇒ Object

State for United States otherwise region or province for other countries



148
149
150
# File 'lib/ultracart_api/models/order_query.rb', line 148

def state_region
  @state_region
end

#storefront_host_name ⇒ Object

StoreFront host name associated with the order



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

def storefront_host_name
  @storefront_host_name
end

#total ⇒ Object

Total



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

def total
  @total
end

Class Method Details

.acceptable_attributes ⇒ Object

Returns all the JSON keys this model knows about



231
232
233
# File 'lib/ultracart_api/models/order_query.rb', line 231

def self.acceptable_attributes
  attribute_map.values
end

.attribute_map ⇒ Object

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



179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
# File 'lib/ultracart_api/models/order_query.rb', line 179

def self.attribute_map
  {
    :'card_bin' => :'card_bin',
    :'card_last4' => :'card_last4',
    :'cc_email' => :'cc_email',
    :'channel_partner_code' => :'channel_partner_code',
    :'channel_partner_order_id' => :'channel_partner_order_id',
    :'city' => :'city',
    :'company' => :'company',
    :'country_code' => :'country_code',
    :'creation_date_begin' => :'creation_date_begin',
    :'creation_date_end' => :'creation_date_end',
    :'current_stage' => :'current_stage',
    :'custom_field_1' => :'custom_field_1',
    :'custom_field_10' => :'custom_field_10',
    :'custom_field_2' => :'custom_field_2',
    :'custom_field_3' => :'custom_field_3',
    :'custom_field_4' => :'custom_field_4',
    :'custom_field_5' => :'custom_field_5',
    :'custom_field_6' => :'custom_field_6',
    :'custom_field_7' => :'custom_field_7',
    :'custom_field_8' => :'custom_field_8',
    :'custom_field_9' => :'custom_field_9',
    :'customer_profile_oid' => :'customer_profile_oid',
    :'email' => :'email',
    :'first_name' => :'first_name',
    :'item_id' => :'item_id',
    :'last_name' => :'last_name',
    :'order_id' => :'order_id',
    :'payment_date_begin' => :'payment_date_begin',
    :'payment_date_end' => :'payment_date_end',
    :'payment_method' => :'payment_method',
    :'payment_transaction_filters' => :'payment_transaction_filters',
    :'phone' => :'phone',
    :'postal_code' => :'postal_code',
    :'purchase_order_number' => :'purchase_order_number',
    :'query_target' => :'query_target',
    :'refund_date_begin' => :'refund_date_begin',
    :'refund_date_end' => :'refund_date_end',
    :'rma' => :'rma',
    :'screen_branding_theme_code' => :'screen_branding_theme_code',
    :'shipment_date_begin' => :'shipment_date_begin',
    :'shipment_date_end' => :'shipment_date_end',
    :'shipped_on_date_begin' => :'shipped_on_date_begin',
    :'shipped_on_date_end' => :'shipped_on_date_end',
    :'state_region' => :'state_region',
    :'storefront_host_name' => :'storefront_host_name',
    :'total' => :'total'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash) —

    Model attributes in the form of hash

Returns:

  • (Object) —

    Returns the model itself



822
823
824
# File 'lib/ultracart_api/models/order_query.rb', line 822

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

.openapi_nullable ⇒ Object

List of attributes with nullable: true



288
289
290
291
# File 'lib/ultracart_api/models/order_query.rb', line 288

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

.openapi_types ⇒ Object

Attribute type mapping.



236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
# File 'lib/ultracart_api/models/order_query.rb', line 236

def self.openapi_types
  {
    :'card_bin' => :'String',
    :'card_last4' => :'String',
    :'cc_email' => :'String',
    :'channel_partner_code' => :'String',
    :'channel_partner_order_id' => :'String',
    :'city' => :'String',
    :'company' => :'String',
    :'country_code' => :'String',
    :'creation_date_begin' => :'String',
    :'creation_date_end' => :'String',
    :'current_stage' => :'String',
    :'custom_field_1' => :'String',
    :'custom_field_10' => :'String',
    :'custom_field_2' => :'String',
    :'custom_field_3' => :'String',
    :'custom_field_4' => :'String',
    :'custom_field_5' => :'String',
    :'custom_field_6' => :'String',
    :'custom_field_7' => :'String',
    :'custom_field_8' => :'String',
    :'custom_field_9' => :'String',
    :'customer_profile_oid' => :'Integer',
    :'email' => :'String',
    :'first_name' => :'String',
    :'item_id' => :'String',
    :'last_name' => :'String',
    :'order_id' => :'String',
    :'payment_date_begin' => :'String',
    :'payment_date_end' => :'String',
    :'payment_method' => :'String',
    :'payment_transaction_filters' => :'Array<OrderQueryPaymentTransactionFilter>',
    :'phone' => :'String',
    :'postal_code' => :'String',
    :'purchase_order_number' => :'String',
    :'query_target' => :'String',
    :'refund_date_begin' => :'String',
    :'refund_date_end' => :'String',
    :'rma' => :'String',
    :'screen_branding_theme_code' => :'String',
    :'shipment_date_begin' => :'String',
    :'shipment_date_end' => :'String',
    :'shipped_on_date_begin' => :'String',
    :'shipped_on_date_end' => :'String',
    :'state_region' => :'String',
    :'storefront_host_name' => :'String',
    :'total' => :'Float'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object) —

    to be compared



756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
# File 'lib/ultracart_api/models/order_query.rb', line 756

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      card_bin == o.card_bin &&
      card_last4 == o.card_last4 &&
      cc_email == o.cc_email &&
      channel_partner_code == o.channel_partner_code &&
      channel_partner_order_id == o.channel_partner_order_id &&
      city == o.city &&
      company == o.company &&
      country_code == o.country_code &&
      creation_date_begin == o.creation_date_begin &&
      creation_date_end == o.creation_date_end &&
      current_stage == o.current_stage &&
      custom_field_1 == o.custom_field_1 &&
      custom_field_10 == o.custom_field_10 &&
      custom_field_2 == o.custom_field_2 &&
      custom_field_3 == o.custom_field_3 &&
      custom_field_4 == o.custom_field_4 &&
      custom_field_5 == o.custom_field_5 &&
      custom_field_6 == o.custom_field_6 &&
      custom_field_7 == o.custom_field_7 &&
      custom_field_8 == o.custom_field_8 &&
      custom_field_9 == o.custom_field_9 &&
      customer_profile_oid == o.customer_profile_oid &&
      email == o.email &&
      first_name == o.first_name &&
      item_id == o.item_id &&
      last_name == o.last_name &&
      order_id == o.order_id &&
      payment_date_begin == o.payment_date_begin &&
      payment_date_end == o.payment_date_end &&
      payment_method == o.payment_method &&
      payment_transaction_filters == o.payment_transaction_filters &&
      phone == o.phone &&
      postal_code == o.postal_code &&
      purchase_order_number == o.purchase_order_number &&
      query_target == o.query_target &&
      refund_date_begin == o.refund_date_begin &&
      refund_date_end == o.refund_date_end &&
      rma == o.rma &&
      screen_branding_theme_code == o.screen_branding_theme_code &&
      shipment_date_begin == o.shipment_date_begin &&
      shipment_date_end == o.shipment_date_end &&
      shipped_on_date_begin == o.shipped_on_date_begin &&
      shipped_on_date_end == o.shipped_on_date_end &&
      state_region == o.state_region &&
      storefront_host_name == o.storefront_host_name &&
      total == o.total
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string —

    type Data type

  • string —

    value Value to be deserialized

Returns:

  • (Object) —

    Deserialized data



853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
# File 'lib/ultracart_api/models/order_query.rb', line 853

def _deserialize(type, value)
  case type.to_sym
  when :Time
    Time.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :Boolean
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    # models (e.g. Pet) or oneOf
    klass = UltracartClient.const_get(type)
    klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object) —

    Any valid value

Returns:

  • (Hash) —

    Returns the value in the form of hash



924
925
926
927
928
929
930
931
932
933
934
935
936
# File 'lib/ultracart_api/models/order_query.rb', line 924

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash) —

    Model attributes in the form of hash

Returns:

  • (Object) —

    Returns the model itself



829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
# File 'lib/ultracart_api/models/order_query.rb', line 829

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  self.class.openapi_types.each_pair do |key, type|
    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
      self.send("#{key}=", nil)
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object) —

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


809
810
811
# File 'lib/ultracart_api/models/order_query.rb', line 809

def eql?(o)
  self == o
end

#hash ⇒ Integer

Calculates hash code according to all attributes.

Returns:

  • (Integer) —

    Hash code



815
816
817
# File 'lib/ultracart_api/models/order_query.rb', line 815

def hash
  [card_bin, card_last4, cc_email, channel_partner_code, channel_partner_order_id, city, company, country_code, creation_date_begin, creation_date_end, current_stage, custom_field_1, custom_field_10, custom_field_2, custom_field_3, custom_field_4, custom_field_5, custom_field_6, custom_field_7, custom_field_8, custom_field_9, customer_profile_oid, email, first_name, item_id, last_name, order_id, payment_date_begin, payment_date_end, payment_method, payment_transaction_filters, phone, postal_code, purchase_order_number, query_target, refund_date_begin, refund_date_end, rma, screen_branding_theme_code, shipment_date_begin, shipment_date_end, shipped_on_date_begin, shipped_on_date_end, state_region, storefront_host_name, total].hash
end

#list_invalid_properties ⇒ Object

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

Returns:

  • Array for valid properties with the reasons



497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
# File 'lib/ultracart_api/models/order_query.rb', line 497

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  invalid_properties
end

#to_body ⇒ Hash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash) —

    Returns the object in the form of hash



900
901
902
# File 'lib/ultracart_api/models/order_query.rb', line 900

def to_body
  to_hash
end

#to_hash ⇒ Hash

Returns the object in the form of hash

Returns:

  • (Hash) —

    Returns the object in the form of hash



906
907
908
909
910
911
912
913
914
915
916
917
918
# File 'lib/ultracart_api/models/order_query.rb', line 906

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#to_s ⇒ String

Returns the string representation of the object

Returns:

  • (String) —

    String presentation of the object



894
895
896
# File 'lib/ultracart_api/models/order_query.rb', line 894

def to_s
  to_hash.to_s
end

#valid? ⇒ Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean) —

    true if the model is valid



560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
# File 'lib/ultracart_api/models/order_query.rb', line 560

def valid?
  return false if !@card_bin.nil? && @card_bin.to_s.length > 6
  return false if !@card_last4.nil? && @card_last4.to_s.length > 4
  return false if !@cc_email.nil? && @cc_email.to_s.length > 100
  return false if !@city.nil? && @city.to_s.length > 32
  return false if !@company.nil? && @company.to_s.length > 50
  return false if !@country_code.nil? && @country_code.to_s.length > 2
  current_stage_validator = EnumAttributeValidator.new('String', ["Accounts Receivable", "Pending Clearance", "Fraud Review", "Rejected", "Shipping Department", "Completed Order", "Quote Request", "Quote Sent", "Least Cost Routing", "Unknown", "Hold"])
  return false unless current_stage_validator.valid?(@current_stage)
  return false if !@email.nil? && @email.to_s.length > 100
  return false if !@first_name.nil? && @first_name.to_s.length > 30
  return false if !@last_name.nil? && @last_name.to_s.length > 30
  payment_method_validator = EnumAttributeValidator.new('String', ["Affirm", "Amazon", "Amazon SC", "Cash", "Check", "COD", "Credit Card", "eCheck", "LoanHero", "Money Order", "PayPal", "Purchase Order", "Quote Request", "Unknown", "Wire Transfer", "Venmo", "Apple Pay", " Google Pay", "PayPal Fastlane"])
  return false unless payment_method_validator.valid?(@payment_method)
  return false if !@phone.nil? && @phone.to_s.length > 25
  return false if !@postal_code.nil? && @postal_code.to_s.length > 20
  query_target_validator = EnumAttributeValidator.new('String', ["origin", "cache"])
  return false unless query_target_validator.valid?(@query_target)
  return false if !@rma.nil? && @rma.to_s.length > 30
  return false if !@screen_branding_theme_code.nil? && @screen_branding_theme_code.to_s.length > 10
  return false if !@state_region.nil? && @state_region.to_s.length > 32
  true
end