ultracart_api 3.10.94 → 3.10.95

Sign up to get free protection for your applications and to get access to all the features.
@@ -142,6 +142,66 @@ module UltracartClient
142
142
  end
143
143
  return data, status_code, headers
144
144
  end
145
+ # Delete a ship to preference record for the channel partner.
146
+ # Delete a ship to preference record for the channel partner.
147
+ # @param channel_partner_oid
148
+ # @param channel_partner_ship_to_preference_oid
149
+ # @param [Hash] opts the optional parameters
150
+ # @return [nil]
151
+ def delete_channel_partner_ship_to_preference(channel_partner_oid, channel_partner_ship_to_preference_oid, opts = {})
152
+ delete_channel_partner_ship_to_preference_with_http_info(channel_partner_oid, channel_partner_ship_to_preference_oid, opts)
153
+ nil
154
+ end
155
+
156
+ # Delete a ship to preference record for the channel partner.
157
+ # Delete a ship to preference record for the channel partner.
158
+ # @param channel_partner_oid
159
+ # @param channel_partner_ship_to_preference_oid
160
+ # @param [Hash] opts the optional parameters
161
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
162
+ def delete_channel_partner_ship_to_preference_with_http_info(channel_partner_oid, channel_partner_ship_to_preference_oid, opts = {})
163
+ if @api_client.config.debugging
164
+ @api_client.config.logger.debug 'Calling API: ChannelPartnerApi.delete_channel_partner_ship_to_preference ...'
165
+ end
166
+ # verify the required parameter 'channel_partner_oid' is set
167
+ if @api_client.config.client_side_validation && channel_partner_oid.nil?
168
+ fail ArgumentError, "Missing the required parameter 'channel_partner_oid' when calling ChannelPartnerApi.delete_channel_partner_ship_to_preference"
169
+ end
170
+ # verify the required parameter 'channel_partner_ship_to_preference_oid' is set
171
+ if @api_client.config.client_side_validation && channel_partner_ship_to_preference_oid.nil?
172
+ fail ArgumentError, "Missing the required parameter 'channel_partner_ship_to_preference_oid' when calling ChannelPartnerApi.delete_channel_partner_ship_to_preference"
173
+ end
174
+ # resource path
175
+ local_var_path = '/channel_partner/channel_partners/{channel_partner_oid}/ship_to_preferences/{channel_partner_ship_to_preference_oid}'.sub('{' + 'channel_partner_oid' + '}', channel_partner_oid.to_s).sub('{' + 'channel_partner_ship_to_preference_oid' + '}', channel_partner_ship_to_preference_oid.to_s)
176
+
177
+ # query parameters
178
+ query_params = {}
179
+
180
+ # header parameters
181
+ header_params = {}
182
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
183
+ # HTTP header 'Accept' (if needed)
184
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
185
+ # HTTP header 'Content-Type'
186
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
187
+
188
+ # form parameters
189
+ form_params = {}
190
+
191
+ # http body (model)
192
+ post_body = nil
193
+ auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
194
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
195
+ :header_params => header_params,
196
+ :query_params => query_params,
197
+ :form_params => form_params,
198
+ :body => post_body,
199
+ :auth_names => auth_names)
200
+ if @api_client.config.debugging
201
+ @api_client.config.logger.debug "API called: ChannelPartnerApi#delete_channel_partner_ship_to_preference\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
202
+ end
203
+ return data, status_code, headers
204
+ end
145
205
  # Estimate shipping for channel partner order
146
206
  # Estimate shipping for order from a channel partner.
147
207
  # @param channel_partner_order Order needing shipping estimate
@@ -252,6 +312,171 @@ module UltracartClient
252
312
  end
253
313
  return data, status_code, headers
254
314
  end
315
+ # Retrieve the ship to preference associated with the channel partner and the specific id.
316
+ # Retrieve the ship to preference associated with the channel partner and the specific id.
317
+ # @param channel_partner_oid
318
+ # @param channel_partner_ship_to_preference_oid
319
+ # @param [Hash] opts the optional parameters
320
+ # @return [ChannelPartnerShipToPreferenceResponse]
321
+ def get_channel_partner_ship_to_preference(channel_partner_oid, channel_partner_ship_to_preference_oid, opts = {})
322
+ data, _status_code, _headers = get_channel_partner_ship_to_preference_with_http_info(channel_partner_oid, channel_partner_ship_to_preference_oid, opts)
323
+ data
324
+ end
325
+
326
+ # Retrieve the ship to preference associated with the channel partner and the specific id.
327
+ # Retrieve the ship to preference associated with the channel partner and the specific id.
328
+ # @param channel_partner_oid
329
+ # @param channel_partner_ship_to_preference_oid
330
+ # @param [Hash] opts the optional parameters
331
+ # @return [Array<(ChannelPartnerShipToPreferenceResponse, Fixnum, Hash)>] ChannelPartnerShipToPreferenceResponse data, response status code and response headers
332
+ def get_channel_partner_ship_to_preference_with_http_info(channel_partner_oid, channel_partner_ship_to_preference_oid, opts = {})
333
+ if @api_client.config.debugging
334
+ @api_client.config.logger.debug 'Calling API: ChannelPartnerApi.get_channel_partner_ship_to_preference ...'
335
+ end
336
+ # verify the required parameter 'channel_partner_oid' is set
337
+ if @api_client.config.client_side_validation && channel_partner_oid.nil?
338
+ fail ArgumentError, "Missing the required parameter 'channel_partner_oid' when calling ChannelPartnerApi.get_channel_partner_ship_to_preference"
339
+ end
340
+ # verify the required parameter 'channel_partner_ship_to_preference_oid' is set
341
+ if @api_client.config.client_side_validation && channel_partner_ship_to_preference_oid.nil?
342
+ fail ArgumentError, "Missing the required parameter 'channel_partner_ship_to_preference_oid' when calling ChannelPartnerApi.get_channel_partner_ship_to_preference"
343
+ end
344
+ # resource path
345
+ local_var_path = '/channel_partner/channel_partners/{channel_partner_oid}/ship_to_preferences/{channel_partner_ship_to_preference_oid}'.sub('{' + 'channel_partner_oid' + '}', channel_partner_oid.to_s).sub('{' + 'channel_partner_ship_to_preference_oid' + '}', channel_partner_ship_to_preference_oid.to_s)
346
+
347
+ # query parameters
348
+ query_params = {}
349
+
350
+ # header parameters
351
+ header_params = {}
352
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
353
+ # HTTP header 'Accept' (if needed)
354
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
355
+ # HTTP header 'Content-Type'
356
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
357
+
358
+ # form parameters
359
+ form_params = {}
360
+
361
+ # http body (model)
362
+ post_body = nil
363
+ auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
364
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
365
+ :header_params => header_params,
366
+ :query_params => query_params,
367
+ :form_params => form_params,
368
+ :body => post_body,
369
+ :auth_names => auth_names,
370
+ :return_type => 'ChannelPartnerShipToPreferenceResponse')
371
+ if @api_client.config.debugging
372
+ @api_client.config.logger.debug "API called: ChannelPartnerApi#get_channel_partner_ship_to_preference\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
373
+ end
374
+ return data, status_code, headers
375
+ end
376
+ # Retrieve the ship to preferences associated with the channel partner.
377
+ # Retrieve the ship to preferences associated with the channel partner.
378
+ # @param channel_partner_oid
379
+ # @param [Hash] opts the optional parameters
380
+ # @return [ChannelPartnerShipToPreferencesResponse]
381
+ def get_channel_partner_ship_to_preferences(channel_partner_oid, opts = {})
382
+ data, _status_code, _headers = get_channel_partner_ship_to_preferences_with_http_info(channel_partner_oid, opts)
383
+ data
384
+ end
385
+
386
+ # Retrieve the ship to preferences associated with the channel partner.
387
+ # Retrieve the ship to preferences associated with the channel partner.
388
+ # @param channel_partner_oid
389
+ # @param [Hash] opts the optional parameters
390
+ # @return [Array<(ChannelPartnerShipToPreferencesResponse, Fixnum, Hash)>] ChannelPartnerShipToPreferencesResponse data, response status code and response headers
391
+ def get_channel_partner_ship_to_preferences_with_http_info(channel_partner_oid, opts = {})
392
+ if @api_client.config.debugging
393
+ @api_client.config.logger.debug 'Calling API: ChannelPartnerApi.get_channel_partner_ship_to_preferences ...'
394
+ end
395
+ # verify the required parameter 'channel_partner_oid' is set
396
+ if @api_client.config.client_side_validation && channel_partner_oid.nil?
397
+ fail ArgumentError, "Missing the required parameter 'channel_partner_oid' when calling ChannelPartnerApi.get_channel_partner_ship_to_preferences"
398
+ end
399
+ # resource path
400
+ local_var_path = '/channel_partner/channel_partners/{channel_partner_oid}/ship_to_preferences'.sub('{' + 'channel_partner_oid' + '}', channel_partner_oid.to_s)
401
+
402
+ # query parameters
403
+ query_params = {}
404
+
405
+ # header parameters
406
+ header_params = {}
407
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
408
+ # HTTP header 'Accept' (if needed)
409
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
410
+ # HTTP header 'Content-Type'
411
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
412
+
413
+ # form parameters
414
+ form_params = {}
415
+
416
+ # http body (model)
417
+ post_body = nil
418
+ auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
419
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
420
+ :header_params => header_params,
421
+ :query_params => query_params,
422
+ :form_params => form_params,
423
+ :body => post_body,
424
+ :auth_names => auth_names,
425
+ :return_type => 'ChannelPartnerShipToPreferencesResponse')
426
+ if @api_client.config.debugging
427
+ @api_client.config.logger.debug "API called: ChannelPartnerApi#get_channel_partner_ship_to_preferences\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
428
+ end
429
+ return data, status_code, headers
430
+ end
431
+ # Retrieve the channel partners configured on the account.
432
+ # Retrieve the channel partners configured on the account.
433
+ # @param [Hash] opts the optional parameters
434
+ # @return [ChannelPartnersResponse]
435
+ def get_channel_partners(opts = {})
436
+ data, _status_code, _headers = get_channel_partners_with_http_info(opts)
437
+ data
438
+ end
439
+
440
+ # Retrieve the channel partners configured on the account.
441
+ # Retrieve the channel partners configured on the account.
442
+ # @param [Hash] opts the optional parameters
443
+ # @return [Array<(ChannelPartnersResponse, Fixnum, Hash)>] ChannelPartnersResponse data, response status code and response headers
444
+ def get_channel_partners_with_http_info(opts = {})
445
+ if @api_client.config.debugging
446
+ @api_client.config.logger.debug 'Calling API: ChannelPartnerApi.get_channel_partners ...'
447
+ end
448
+ # resource path
449
+ local_var_path = '/channel_partner/channel_partners'
450
+
451
+ # query parameters
452
+ query_params = {}
453
+
454
+ # header parameters
455
+ header_params = {}
456
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
457
+ # HTTP header 'Accept' (if needed)
458
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
459
+ # HTTP header 'Content-Type'
460
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
461
+
462
+ # form parameters
463
+ form_params = {}
464
+
465
+ # http body (model)
466
+ post_body = nil
467
+ auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
468
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
469
+ :header_params => header_params,
470
+ :query_params => query_params,
471
+ :form_params => form_params,
472
+ :body => post_body,
473
+ :auth_names => auth_names,
474
+ :return_type => 'ChannelPartnersResponse')
475
+ if @api_client.config.debugging
476
+ @api_client.config.logger.debug "API called: ChannelPartnerApi#get_channel_partners\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
477
+ end
478
+ return data, status_code, headers
479
+ end
255
480
  # Insert channel partner order
256
481
  # Insert order from a channel partner.
257
482
  # @param channel_partner_order Order to insert
@@ -307,5 +532,133 @@ module UltracartClient
307
532
  end
308
533
  return data, status_code, headers
309
534
  end
535
+ # Insert a ship to preference record for the channel partner.
536
+ # Insert a ship to preference record for the channel partner.
537
+ # @param channel_partner_oid
538
+ # @param ship_to_preference Ship to preference to create
539
+ # @param [Hash] opts the optional parameters
540
+ # @return [ChannelPartnerShipToPreferenceResponse]
541
+ def insert_channel_partner_ship_to_preference(channel_partner_oid, ship_to_preference, opts = {})
542
+ data, _status_code, _headers = insert_channel_partner_ship_to_preference_with_http_info(channel_partner_oid, ship_to_preference, opts)
543
+ data
544
+ end
545
+
546
+ # Insert a ship to preference record for the channel partner.
547
+ # Insert a ship to preference record for the channel partner.
548
+ # @param channel_partner_oid
549
+ # @param ship_to_preference Ship to preference to create
550
+ # @param [Hash] opts the optional parameters
551
+ # @return [Array<(ChannelPartnerShipToPreferenceResponse, Fixnum, Hash)>] ChannelPartnerShipToPreferenceResponse data, response status code and response headers
552
+ def insert_channel_partner_ship_to_preference_with_http_info(channel_partner_oid, ship_to_preference, opts = {})
553
+ if @api_client.config.debugging
554
+ @api_client.config.logger.debug 'Calling API: ChannelPartnerApi.insert_channel_partner_ship_to_preference ...'
555
+ end
556
+ # verify the required parameter 'channel_partner_oid' is set
557
+ if @api_client.config.client_side_validation && channel_partner_oid.nil?
558
+ fail ArgumentError, "Missing the required parameter 'channel_partner_oid' when calling ChannelPartnerApi.insert_channel_partner_ship_to_preference"
559
+ end
560
+ # verify the required parameter 'ship_to_preference' is set
561
+ if @api_client.config.client_side_validation && ship_to_preference.nil?
562
+ fail ArgumentError, "Missing the required parameter 'ship_to_preference' when calling ChannelPartnerApi.insert_channel_partner_ship_to_preference"
563
+ end
564
+ # resource path
565
+ local_var_path = '/channel_partner/channel_partners/{channel_partner_oid}/ship_to_preferences'.sub('{' + 'channel_partner_oid' + '}', channel_partner_oid.to_s)
566
+
567
+ # query parameters
568
+ query_params = {}
569
+
570
+ # header parameters
571
+ header_params = {}
572
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
573
+ # HTTP header 'Accept' (if needed)
574
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
575
+ # HTTP header 'Content-Type'
576
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
577
+
578
+ # form parameters
579
+ form_params = {}
580
+
581
+ # http body (model)
582
+ post_body = @api_client.object_to_http_body(ship_to_preference)
583
+ auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
584
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
585
+ :header_params => header_params,
586
+ :query_params => query_params,
587
+ :form_params => form_params,
588
+ :body => post_body,
589
+ :auth_names => auth_names,
590
+ :return_type => 'ChannelPartnerShipToPreferenceResponse')
591
+ if @api_client.config.debugging
592
+ @api_client.config.logger.debug "API called: ChannelPartnerApi#insert_channel_partner_ship_to_preference\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
593
+ end
594
+ return data, status_code, headers
595
+ end
596
+ # Update a ship to preference record for the channel partner.
597
+ # Update a ship to preference record for the channel partner.
598
+ # @param channel_partner_oid
599
+ # @param channel_partner_ship_to_preference_oid
600
+ # @param ship_to_preference Ship to preference to create
601
+ # @param [Hash] opts the optional parameters
602
+ # @return [ChannelPartnerShipToPreferenceResponse]
603
+ def update_channel_partner_ship_to_preference(channel_partner_oid, channel_partner_ship_to_preference_oid, ship_to_preference, opts = {})
604
+ data, _status_code, _headers = update_channel_partner_ship_to_preference_with_http_info(channel_partner_oid, channel_partner_ship_to_preference_oid, ship_to_preference, opts)
605
+ data
606
+ end
607
+
608
+ # Update a ship to preference record for the channel partner.
609
+ # Update a ship to preference record for the channel partner.
610
+ # @param channel_partner_oid
611
+ # @param channel_partner_ship_to_preference_oid
612
+ # @param ship_to_preference Ship to preference to create
613
+ # @param [Hash] opts the optional parameters
614
+ # @return [Array<(ChannelPartnerShipToPreferenceResponse, Fixnum, Hash)>] ChannelPartnerShipToPreferenceResponse data, response status code and response headers
615
+ def update_channel_partner_ship_to_preference_with_http_info(channel_partner_oid, channel_partner_ship_to_preference_oid, ship_to_preference, opts = {})
616
+ if @api_client.config.debugging
617
+ @api_client.config.logger.debug 'Calling API: ChannelPartnerApi.update_channel_partner_ship_to_preference ...'
618
+ end
619
+ # verify the required parameter 'channel_partner_oid' is set
620
+ if @api_client.config.client_side_validation && channel_partner_oid.nil?
621
+ fail ArgumentError, "Missing the required parameter 'channel_partner_oid' when calling ChannelPartnerApi.update_channel_partner_ship_to_preference"
622
+ end
623
+ # verify the required parameter 'channel_partner_ship_to_preference_oid' is set
624
+ if @api_client.config.client_side_validation && channel_partner_ship_to_preference_oid.nil?
625
+ fail ArgumentError, "Missing the required parameter 'channel_partner_ship_to_preference_oid' when calling ChannelPartnerApi.update_channel_partner_ship_to_preference"
626
+ end
627
+ # verify the required parameter 'ship_to_preference' is set
628
+ if @api_client.config.client_side_validation && ship_to_preference.nil?
629
+ fail ArgumentError, "Missing the required parameter 'ship_to_preference' when calling ChannelPartnerApi.update_channel_partner_ship_to_preference"
630
+ end
631
+ # resource path
632
+ local_var_path = '/channel_partner/channel_partners/{channel_partner_oid}/ship_to_preferences/{channel_partner_ship_to_preference_oid}'.sub('{' + 'channel_partner_oid' + '}', channel_partner_oid.to_s).sub('{' + 'channel_partner_ship_to_preference_oid' + '}', channel_partner_ship_to_preference_oid.to_s)
633
+
634
+ # query parameters
635
+ query_params = {}
636
+
637
+ # header parameters
638
+ header_params = {}
639
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
640
+ # HTTP header 'Accept' (if needed)
641
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
642
+ # HTTP header 'Content-Type'
643
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
644
+
645
+ # form parameters
646
+ form_params = {}
647
+
648
+ # http body (model)
649
+ post_body = @api_client.object_to_http_body(ship_to_preference)
650
+ auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
651
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
652
+ :header_params => header_params,
653
+ :query_params => query_params,
654
+ :form_params => form_params,
655
+ :body => post_body,
656
+ :auth_names => auth_names,
657
+ :return_type => 'ChannelPartnerShipToPreferenceResponse')
658
+ if @api_client.config.debugging
659
+ @api_client.config.logger.debug "API called: ChannelPartnerApi#update_channel_partner_ship_to_preference\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
660
+ end
661
+ return data, status_code, headers
662
+ end
310
663
  end
311
664
  end
@@ -0,0 +1,237 @@
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 ChannelPartnerShipToPreference
17
+ # Additional item ids to add as kit components to the order with a zero price.
18
+ attr_accessor :additional_kit_component_item_ids
19
+
20
+ # The channel partner object identifier this preference is associated with
21
+ attr_accessor :channel_partner_oid
22
+
23
+ # Object identifier for the ship to preference
24
+ attr_accessor :channel_partner_ship_to_preference_oid
25
+
26
+ # The merchant id that owns the channel partner
27
+ attr_accessor :merchant_id
28
+
29
+ # Alternate return policy to print on the packing slip.
30
+ attr_accessor :return_policy
31
+
32
+ # The ship to EDI code that the preferences are for
33
+ attr_accessor :ship_to_edi_code
34
+
35
+ # Attribute mapping from ruby-style variable name to JSON key.
36
+ def self.attribute_map
37
+ {
38
+ :'additional_kit_component_item_ids' => :'additional_kit_component_item_ids',
39
+ :'channel_partner_oid' => :'channel_partner_oid',
40
+ :'channel_partner_ship_to_preference_oid' => :'channel_partner_ship_to_preference_oid',
41
+ :'merchant_id' => :'merchant_id',
42
+ :'return_policy' => :'return_policy',
43
+ :'ship_to_edi_code' => :'ship_to_edi_code'
44
+ }
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.swagger_types
49
+ {
50
+ :'additional_kit_component_item_ids' => :'Array<String>',
51
+ :'channel_partner_oid' => :'Integer',
52
+ :'channel_partner_ship_to_preference_oid' => :'Integer',
53
+ :'merchant_id' => :'String',
54
+ :'return_policy' => :'String',
55
+ :'ship_to_edi_code' => :'String'
56
+ }
57
+ end
58
+
59
+ # Initializes the object
60
+ # @param [Hash] attributes Model attributes in the form of hash
61
+ def initialize(attributes = {})
62
+ return unless attributes.is_a?(Hash)
63
+
64
+ # convert string to symbol for hash key
65
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
66
+
67
+ if attributes.has_key?(:'additional_kit_component_item_ids')
68
+ if (value = attributes[:'additional_kit_component_item_ids']).is_a?(Array)
69
+ self.additional_kit_component_item_ids = value
70
+ end
71
+ end
72
+
73
+ if attributes.has_key?(:'channel_partner_oid')
74
+ self.channel_partner_oid = attributes[:'channel_partner_oid']
75
+ end
76
+
77
+ if attributes.has_key?(:'channel_partner_ship_to_preference_oid')
78
+ self.channel_partner_ship_to_preference_oid = attributes[:'channel_partner_ship_to_preference_oid']
79
+ end
80
+
81
+ if attributes.has_key?(:'merchant_id')
82
+ self.merchant_id = attributes[:'merchant_id']
83
+ end
84
+
85
+ if attributes.has_key?(:'return_policy')
86
+ self.return_policy = attributes[:'return_policy']
87
+ end
88
+
89
+ if attributes.has_key?(:'ship_to_edi_code')
90
+ self.ship_to_edi_code = attributes[:'ship_to_edi_code']
91
+ end
92
+ end
93
+
94
+ # Show invalid properties with the reasons. Usually used together with valid?
95
+ # @return Array for valid properties with the reasons
96
+ def list_invalid_properties
97
+ invalid_properties = Array.new
98
+ invalid_properties
99
+ end
100
+
101
+ # Check to see if the all the properties in the model are valid
102
+ # @return true if the model is valid
103
+ def valid?
104
+ true
105
+ end
106
+
107
+ # Checks equality by comparing each attribute.
108
+ # @param [Object] Object to be compared
109
+ def ==(o)
110
+ return true if self.equal?(o)
111
+ self.class == o.class &&
112
+ additional_kit_component_item_ids == o.additional_kit_component_item_ids &&
113
+ channel_partner_oid == o.channel_partner_oid &&
114
+ channel_partner_ship_to_preference_oid == o.channel_partner_ship_to_preference_oid &&
115
+ merchant_id == o.merchant_id &&
116
+ return_policy == o.return_policy &&
117
+ ship_to_edi_code == o.ship_to_edi_code
118
+ end
119
+
120
+ # @see the `==` method
121
+ # @param [Object] Object to be compared
122
+ def eql?(o)
123
+ self == o
124
+ end
125
+
126
+ # Calculates hash code according to all attributes.
127
+ # @return [Fixnum] Hash code
128
+ def hash
129
+ [additional_kit_component_item_ids, channel_partner_oid, channel_partner_ship_to_preference_oid, merchant_id, return_policy, ship_to_edi_code].hash
130
+ end
131
+
132
+ # Builds the object from hash
133
+ # @param [Hash] attributes Model attributes in the form of hash
134
+ # @return [Object] Returns the model itself
135
+ def build_from_hash(attributes)
136
+ return nil unless attributes.is_a?(Hash)
137
+ self.class.swagger_types.each_pair do |key, type|
138
+ if type =~ /\AArray<(.*)>/i
139
+ # check to ensure the input is an array given that the attribute
140
+ # is documented as an array but the input is not
141
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
142
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
143
+ end
144
+ elsif !attributes[self.class.attribute_map[key]].nil?
145
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
146
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
147
+ end
148
+
149
+ self
150
+ end
151
+
152
+ # Deserializes the data based on type
153
+ # @param string type Data type
154
+ # @param string value Value to be deserialized
155
+ # @return [Object] Deserialized data
156
+ def _deserialize(type, value)
157
+ case type.to_sym
158
+ when :DateTime
159
+ DateTime.parse(value)
160
+ when :Date
161
+ Date.parse(value)
162
+ when :String
163
+ value.to_s
164
+ when :Integer
165
+ value.to_i
166
+ when :Float
167
+ value.to_f
168
+ when :BOOLEAN
169
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
170
+ true
171
+ else
172
+ false
173
+ end
174
+ when :Object
175
+ # generic object (usually a Hash), return directly
176
+ value
177
+ when /\AArray<(?<inner_type>.+)>\z/
178
+ inner_type = Regexp.last_match[:inner_type]
179
+ value.map { |v| _deserialize(inner_type, v) }
180
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
181
+ k_type = Regexp.last_match[:k_type]
182
+ v_type = Regexp.last_match[:v_type]
183
+ {}.tap do |hash|
184
+ value.each do |k, v|
185
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
186
+ end
187
+ end
188
+ else # model
189
+ temp_model = UltracartClient.const_get(type).new
190
+ temp_model.build_from_hash(value)
191
+ end
192
+ end
193
+
194
+ # Returns the string representation of the object
195
+ # @return [String] String presentation of the object
196
+ def to_s
197
+ to_hash.to_s
198
+ end
199
+
200
+ # to_body is an alias to to_hash (backward compatibility)
201
+ # @return [Hash] Returns the object in the form of hash
202
+ def to_body
203
+ to_hash
204
+ end
205
+
206
+ # Returns the object in the form of hash
207
+ # @return [Hash] Returns the object in the form of hash
208
+ def to_hash
209
+ hash = {}
210
+ self.class.attribute_map.each_pair do |attr, param|
211
+ value = self.send(attr)
212
+ next if value.nil?
213
+ hash[param] = _to_hash(value)
214
+ end
215
+ hash
216
+ end
217
+
218
+ # Outputs non-array value in the form of hash
219
+ # For object, use to_hash. Otherwise, just return the value
220
+ # @param [Object] value Any valid value
221
+ # @return [Hash] Returns the value in the form of hash
222
+ def _to_hash(value)
223
+ if value.is_a?(Array)
224
+ value.compact.map { |v| _to_hash(v) }
225
+ elsif value.is_a?(Hash)
226
+ {}.tap do |hash|
227
+ value.each { |k, v| hash[k] = _to_hash(v) }
228
+ end
229
+ elsif value.respond_to? :to_hash
230
+ value.to_hash
231
+ else
232
+ value
233
+ end
234
+ end
235
+
236
+ end
237
+ end