ultracart_api 4.0.135 → 4.0.136

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 957070c75bab53ffcaec29cf1bea74ca2cfaa1b3e945d766662faa31d89155a9
4
- data.tar.gz: f8c2d6d4d3ab71f1910c8b97c172b0407c305501e9ce1336924a4b4da60efafd
3
+ metadata.gz: 4e0b1c8207b56878997ef2951b9e99fa9640b12d4bf71a7620940f131eceedb8
4
+ data.tar.gz: a3ea07efffdc1c617cbcee9a6f0508a408c05def0cc97c20169cc91f242551e5
5
5
  SHA512:
6
- metadata.gz: 93eddbcce4641a622f687671fc6e290ba01681219421cd62df36fd77b5ffaabe3105123dedfa2c3418e4925116f825b06c3e179426b5a8086892258a251b31e8
7
- data.tar.gz: 5eadc726d7dc3e19090cc04a73404aa256efa7eacbcc13cd7125e17cab61f42ed8db2d2269cf9ba3eeee894e9eaebd61ba5b40283cfdee162ccb9871adf56e90
6
+ metadata.gz: 16679dec7f81f930d30f1613e527e42074e81df3eada5ca41bfc5d5a721747bb83e9e526f3dbbe29bee9720f66ab96af6adc312758287d792932fa7c5f9adbbc
7
+ data.tar.gz: 5af8da953873bfa9a1f997483223f5cf719f8b3506c94e3bd2e112c7885ba0a36b6374ce094be91ccec3221a011c31f897c52cb303e5e8276d1239582780d16c
data/README.md CHANGED
@@ -7,7 +7,7 @@ UltraCart REST API Version 2
7
7
  This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
8
8
 
9
9
  - API version: 2.0.0
10
- - Package version: 4.0.135
10
+ - Package version: 4.0.136
11
11
  - Build package: org.openapitools.codegen.languages.RubyClientCodegen
12
12
  For more information, please visit [http://www.ultracart.com](http://www.ultracart.com)
13
13
 
@@ -24,16 +24,16 @@ gem build ultracart_api.gemspec
24
24
  Then either install the gem locally:
25
25
 
26
26
  ```shell
27
- gem install ./ultracart_api-4.0.135.gem
27
+ gem install ./ultracart_api-4.0.136.gem
28
28
  ```
29
29
 
30
- (for development, run `gem install --dev ./ultracart_api-4.0.135.gem` to install the development dependencies)
30
+ (for development, run `gem install --dev ./ultracart_api-4.0.136.gem` to install the development dependencies)
31
31
 
32
32
  or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
33
33
 
34
34
  Finally add this to the Gemfile:
35
35
 
36
- gem 'ultracart_api', '~> 4.0.135'
36
+ gem 'ultracart_api', '~> 4.0.136'
37
37
 
38
38
  ### Install from Git
39
39
 
@@ -1091,6 +1091,7 @@ Class | Method | HTTP request | Description
1091
1091
  - [UltracartClient::OrderQuery](docs/OrderQuery.md)
1092
1092
  - [UltracartClient::OrderQueryBatch](docs/OrderQueryBatch.md)
1093
1093
  - [UltracartClient::OrderQuote](docs/OrderQuote.md)
1094
+ - [UltracartClient::OrderReason](docs/OrderReason.md)
1094
1095
  - [UltracartClient::OrderRefundableResponse](docs/OrderRefundableResponse.md)
1095
1096
  - [UltracartClient::OrderReplacement](docs/OrderReplacement.md)
1096
1097
  - [UltracartClient::OrderReplacementItem](docs/OrderReplacementItem.md)
@@ -1310,6 +1311,7 @@ Not every change is committed to every SDK.
1310
1311
 
1311
1312
  | Version | Date | Comments |
1312
1313
  | --: | :-: | --- |
1314
+ | 4.0.136 | 02/20/2023 | refund reasons |
1313
1315
  | 4.0.135 | 02/17/2023 | convo api - smsUnsubscribeConversation method |
1314
1316
  | 4.0.134 | 02/15/2023 | added auto order sorting by next_shipment_dts |
1315
1317
  | 4.0.133 | 02/10/2023 | convo - add storefront_host_name to search request |
data/docs/Order.md CHANGED
@@ -33,7 +33,9 @@
33
33
  | **properties** | [**Array<OrderProperty>**](OrderProperty.md) | Properties, available only through update, not through insert due to the nature of how properties are handled internally | [optional] |
34
34
  | **quote** | [**OrderQuote**](OrderQuote.md) | | [optional] |
35
35
  | **refund_dts** | **String** | If the order was refunded, the date/time that the last refund occurred | [optional] |
36
+ | **refund_reason** | **String** | Refund reason code. This can only be written during a refund operation otherwise this field is read only. | [optional] |
36
37
  | **reject_dts** | **String** | If the order was rejected, the date/time that the rejection occurred | [optional] |
38
+ | **reject_reason** | **String** | Reject reason code. This can only be written during a reject operation otherwise this field is read only. | [optional] |
37
39
  | **salesforce** | [**OrderSalesforce**](OrderSalesforce.md) | | [optional] |
38
40
  | **shipping** | [**OrderShipping**](OrderShipping.md) | | [optional] |
39
41
  | **summary** | [**OrderSummary**](OrderSummary.md) | | [optional] |
@@ -76,7 +78,9 @@ instance = UltracartClient::Order.new(
76
78
  properties: null,
77
79
  quote: null,
78
80
  refund_dts: null,
81
+ refund_reason: null,
79
82
  reject_dts: null,
83
+ reject_reason: null,
80
84
  salesforce: null,
81
85
  shipping: null,
82
86
  summary: null,
data/docs/OrderItem.md CHANGED
@@ -47,6 +47,8 @@
47
47
  | **quantity** | **Float** | Quantity | [optional] |
48
48
  | **quantity_refunded** | **Float** | Quantity refunded on this item (read only except refund operation) | [optional] |
49
49
  | **quickbooks_class** | **String** | QuickBooks class | [optional] |
50
+ | **refund_reason** | **String** | Refund reason code. This can only be written during a refund operation otherwise this field is read only. | [optional] |
51
+ | **return_reason** | **String** | Return reason code. This can only be written during a refund operation otherwise this field is read only. | [optional] |
50
52
  | **ship_separately** | **Boolean** | True if this item ships in a separate box | [optional] |
51
53
  | **shipped_by_user** | **String** | Shipped by user | [optional] |
52
54
  | **shipped_dts** | **String** | Date/time that this item was marked shipped | [optional] |
@@ -113,6 +115,8 @@ instance = UltracartClient::OrderItem.new(
113
115
  quantity: null,
114
116
  quantity_refunded: null,
115
117
  quickbooks_class: null,
118
+ refund_reason: null,
119
+ return_reason: null,
116
120
  ship_separately: null,
117
121
  shipped_by_user: null,
118
122
  shipped_dts: null,
@@ -0,0 +1,22 @@
1
+ # UltracartClient::OrderReason
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **default_reason** | **Boolean** | Default reason | [optional] |
8
+ | **description** | **String** | Reason description. This is the friendly description of the reason that should be displayed to the user. | [optional] |
9
+ | **value** | **String** | Reason value. This is what should be submitted with a refund operation. | [optional] |
10
+
11
+ ## Example
12
+
13
+ ```ruby
14
+ require 'ultracart_api'
15
+
16
+ instance = UltracartClient::OrderReason.new(
17
+ default_reason: null,
18
+ description: null,
19
+ value: null
20
+ )
21
+ ```
22
+
@@ -5,7 +5,13 @@
5
5
  | Name | Type | Description | Notes |
6
6
  | ---- | ---- | ----------- | ----- |
7
7
  | **error** | [**Error**](Error.md) | | [optional] |
8
+ | **item_level_refund_reason_required** | **Boolean** | True if the item level refund reason is required | [optional] |
9
+ | **item_level_refund_reasons** | [**Array<OrderReason>**](OrderReason.md) | Reason codes available at the item level. | [optional] |
10
+ | **item_level_return_reasons** | [**Array<OrderReason>**](OrderReason.md) | Return codes available at the item level. | [optional] |
8
11
  | **metadata** | [**ResponseMetadata**](ResponseMetadata.md) | | [optional] |
12
+ | **order_level_refund_reason_required** | **Boolean** | True if the order level refund reason is required | [optional] |
13
+ | **order_level_refund_reasons** | [**Array<OrderReason>**](OrderReason.md) | Reason codes available at the order level. | [optional] |
14
+ | **order_level_reject_reasons** | [**Array<OrderReason>**](OrderReason.md) | Reject codes available at the order level. | [optional] |
9
15
  | **refundable** | **Boolean** | Whether the order is refundable or not. Null should be interpreted as false. | [optional] |
10
16
  | **success** | **Boolean** | Indicates if API call was successful | [optional] |
11
17
  | **warning** | [**Warning**](Warning.md) | | [optional] |
@@ -17,7 +23,13 @@ require 'ultracart_api'
17
23
 
18
24
  instance = UltracartClient::OrderRefundableResponse.new(
19
25
  error: null,
26
+ item_level_refund_reason_required: null,
27
+ item_level_refund_reasons: null,
28
+ item_level_return_reasons: null,
20
29
  metadata: null,
30
+ order_level_refund_reason_required: null,
31
+ order_level_refund_reasons: null,
32
+ order_level_reject_reasons: null,
21
33
  refundable: null,
22
34
  success: null,
23
35
  warning: null
@@ -85,9 +85,15 @@ module UltracartClient
85
85
  # If the order was refunded, the date/time that the last refund occurred
86
86
  attr_accessor :refund_dts
87
87
 
88
+ # Refund reason code. This can only be written during a refund operation otherwise this field is read only.
89
+ attr_accessor :refund_reason
90
+
88
91
  # If the order was rejected, the date/time that the rejection occurred
89
92
  attr_accessor :reject_dts
90
93
 
94
+ # Reject reason code. This can only be written during a reject operation otherwise this field is read only.
95
+ attr_accessor :reject_reason
96
+
91
97
  attr_accessor :salesforce
92
98
 
93
99
  attr_accessor :shipping
@@ -156,7 +162,9 @@ module UltracartClient
156
162
  :'properties' => :'properties',
157
163
  :'quote' => :'quote',
158
164
  :'refund_dts' => :'refund_dts',
165
+ :'refund_reason' => :'refund_reason',
159
166
  :'reject_dts' => :'reject_dts',
167
+ :'reject_reason' => :'reject_reason',
160
168
  :'salesforce' => :'salesforce',
161
169
  :'shipping' => :'shipping',
162
170
  :'summary' => :'summary',
@@ -203,7 +211,9 @@ module UltracartClient
203
211
  :'properties' => :'Array<OrderProperty>',
204
212
  :'quote' => :'OrderQuote',
205
213
  :'refund_dts' => :'String',
214
+ :'refund_reason' => :'String',
206
215
  :'reject_dts' => :'String',
216
+ :'reject_reason' => :'String',
207
217
  :'salesforce' => :'OrderSalesforce',
208
218
  :'shipping' => :'OrderShipping',
209
219
  :'summary' => :'OrderSummary',
@@ -358,10 +368,18 @@ module UltracartClient
358
368
  self.refund_dts = attributes[:'refund_dts']
359
369
  end
360
370
 
371
+ if attributes.key?(:'refund_reason')
372
+ self.refund_reason = attributes[:'refund_reason']
373
+ end
374
+
361
375
  if attributes.key?(:'reject_dts')
362
376
  self.reject_dts = attributes[:'reject_dts']
363
377
  end
364
378
 
379
+ if attributes.key?(:'reject_reason')
380
+ self.reject_reason = attributes[:'reject_reason']
381
+ end
382
+
365
383
  if attributes.key?(:'salesforce')
366
384
  self.salesforce = attributes[:'salesforce']
367
385
  end
@@ -480,7 +498,9 @@ module UltracartClient
480
498
  properties == o.properties &&
481
499
  quote == o.quote &&
482
500
  refund_dts == o.refund_dts &&
501
+ refund_reason == o.refund_reason &&
483
502
  reject_dts == o.reject_dts &&
503
+ reject_reason == o.reject_reason &&
484
504
  salesforce == o.salesforce &&
485
505
  shipping == o.shipping &&
486
506
  summary == o.summary &&
@@ -498,7 +518,7 @@ module UltracartClient
498
518
  # Calculates hash code according to all attributes.
499
519
  # @return [Integer] Hash code
500
520
  def hash
501
- [affiliates, auto_order, billing, buysafe, channel_partner, checkout, coupons, creation_dts, currency_code, current_stage, customer_profile, digital_order, edi, exchange_rate, fraud_score, gift, gift_certificate, internal, items, language_iso_code, linked_shipment, marketing, merchant_id, order_id, payment, point_of_sale, properties, quote, refund_dts, reject_dts, salesforce, shipping, summary, tags, taxes, utms].hash
521
+ [affiliates, auto_order, billing, buysafe, channel_partner, checkout, coupons, creation_dts, currency_code, current_stage, customer_profile, digital_order, edi, exchange_rate, fraud_score, gift, gift_certificate, internal, items, language_iso_code, linked_shipment, marketing, merchant_id, order_id, payment, point_of_sale, properties, quote, refund_dts, refund_reason, reject_dts, reject_reason, salesforce, shipping, summary, tags, taxes, utms].hash
502
522
  end
503
523
 
504
524
  # Builds the object from hash
@@ -137,6 +137,12 @@ module UltracartClient
137
137
  # QuickBooks class
138
138
  attr_accessor :quickbooks_class
139
139
 
140
+ # Refund reason code. This can only be written during a refund operation otherwise this field is read only.
141
+ attr_accessor :refund_reason
142
+
143
+ # Return reason code. This can only be written during a refund operation otherwise this field is read only.
144
+ attr_accessor :return_reason
145
+
140
146
  # True if this item ships in a separate box
141
147
  attr_accessor :ship_separately
142
148
 
@@ -247,6 +253,8 @@ module UltracartClient
247
253
  :'quantity' => :'quantity',
248
254
  :'quantity_refunded' => :'quantity_refunded',
249
255
  :'quickbooks_class' => :'quickbooks_class',
256
+ :'refund_reason' => :'refund_reason',
257
+ :'return_reason' => :'return_reason',
250
258
  :'ship_separately' => :'ship_separately',
251
259
  :'shipped_by_user' => :'shipped_by_user',
252
260
  :'shipped_dts' => :'shipped_dts',
@@ -317,6 +325,8 @@ module UltracartClient
317
325
  :'quantity' => :'Float',
318
326
  :'quantity_refunded' => :'Float',
319
327
  :'quickbooks_class' => :'String',
328
+ :'refund_reason' => :'String',
329
+ :'return_reason' => :'String',
320
330
  :'ship_separately' => :'Boolean',
321
331
  :'shipped_by_user' => :'String',
322
332
  :'shipped_dts' => :'String',
@@ -535,6 +545,14 @@ module UltracartClient
535
545
  self.quickbooks_class = attributes[:'quickbooks_class']
536
546
  end
537
547
 
548
+ if attributes.key?(:'refund_reason')
549
+ self.refund_reason = attributes[:'refund_reason']
550
+ end
551
+
552
+ if attributes.key?(:'return_reason')
553
+ self.return_reason = attributes[:'return_reason']
554
+ end
555
+
538
556
  if attributes.key?(:'ship_separately')
539
557
  self.ship_separately = attributes[:'ship_separately']
540
558
  end
@@ -780,6 +798,8 @@ module UltracartClient
780
798
  quantity == o.quantity &&
781
799
  quantity_refunded == o.quantity_refunded &&
782
800
  quickbooks_class == o.quickbooks_class &&
801
+ refund_reason == o.refund_reason &&
802
+ return_reason == o.return_reason &&
783
803
  ship_separately == o.ship_separately &&
784
804
  shipped_by_user == o.shipped_by_user &&
785
805
  shipped_dts == o.shipped_dts &&
@@ -807,7 +827,7 @@ module UltracartClient
807
827
  # Calculates hash code according to all attributes.
808
828
  # @return [Integer] Hash code
809
829
  def hash
810
- [accounting_code, activation_codes, arbitrary_unit_cost, auto_order_last_rebill_dts, auto_order_schedule, barcode, channel_partner_item_id, cogs, component_unit_value, cost, country_code_of_origin, customs_description, description, discount, discount_quantity, discount_shipping_weight, distribution_center_code, edi, exclude_coupon, free_shipping, hazmat, height, item_index, item_reference_oid, kit, kit_component, length, manufacturer_sku, max_days_time_in_transit, merchant_item_id, mix_and_match_group_name, mix_and_match_group_oid, no_shipping_discount, options, packed_by_user, parent_item_index, parent_merchant_item_id, perishable_class, pricing_tier_name, properties, quantity, quantity_refunded, quickbooks_class, ship_separately, shipped_by_user, shipped_dts, shipping_status, special_product_type, tags, tax_free, tax_product_type, taxable_cost, total_cost_with_discount, total_refunded, transmitted_to_distribution_center_dts, unit_cost_with_discount, upsell, weight, width].hash
830
+ [accounting_code, activation_codes, arbitrary_unit_cost, auto_order_last_rebill_dts, auto_order_schedule, barcode, channel_partner_item_id, cogs, component_unit_value, cost, country_code_of_origin, customs_description, description, discount, discount_quantity, discount_shipping_weight, distribution_center_code, edi, exclude_coupon, free_shipping, hazmat, height, item_index, item_reference_oid, kit, kit_component, length, manufacturer_sku, max_days_time_in_transit, merchant_item_id, mix_and_match_group_name, mix_and_match_group_oid, no_shipping_discount, options, packed_by_user, parent_item_index, parent_merchant_item_id, perishable_class, pricing_tier_name, properties, quantity, quantity_refunded, quickbooks_class, refund_reason, return_reason, ship_separately, shipped_by_user, shipped_dts, shipping_status, special_product_type, tags, tax_free, tax_product_type, taxable_cost, total_cost_with_discount, total_refunded, transmitted_to_distribution_center_dts, unit_cost_with_discount, upsell, weight, width].hash
811
831
  end
812
832
 
813
833
  # Builds the object from hash
@@ -0,0 +1,240 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.0.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module UltracartClient
17
+ class OrderReason
18
+ # Default reason
19
+ attr_accessor :default_reason
20
+
21
+ # Reason description. This is the friendly description of the reason that should be displayed to the user.
22
+ attr_accessor :description
23
+
24
+ # Reason value. This is what should be submitted with a refund operation.
25
+ attr_accessor :value
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'default_reason' => :'default_reason',
31
+ :'description' => :'description',
32
+ :'value' => :'value'
33
+ }
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'default_reason' => :'Boolean',
45
+ :'description' => :'String',
46
+ :'value' => :'String'
47
+ }
48
+ end
49
+
50
+ # List of attributes with nullable: true
51
+ def self.openapi_nullable
52
+ Set.new([
53
+ ])
54
+ end
55
+
56
+ # Initializes the object
57
+ # @param [Hash] attributes Model attributes in the form of hash
58
+ def initialize(attributes = {})
59
+ if (!attributes.is_a?(Hash))
60
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::OrderReason` initialize method"
61
+ end
62
+
63
+ # check to see if the attribute exists and convert string to symbol for hash key
64
+ attributes = attributes.each_with_object({}) { |(k, v), h|
65
+ if (!self.class.attribute_map.key?(k.to_sym))
66
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::OrderReason`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
67
+ end
68
+ h[k.to_sym] = v
69
+ }
70
+
71
+ if attributes.key?(:'default_reason')
72
+ self.default_reason = attributes[:'default_reason']
73
+ end
74
+
75
+ if attributes.key?(:'description')
76
+ self.description = attributes[:'description']
77
+ end
78
+
79
+ if attributes.key?(:'value')
80
+ self.value = attributes[:'value']
81
+ end
82
+ end
83
+
84
+ # Show invalid properties with the reasons. Usually used together with valid?
85
+ # @return Array for valid properties with the reasons
86
+ def list_invalid_properties
87
+ invalid_properties = Array.new
88
+ invalid_properties
89
+ end
90
+
91
+ # Check to see if the all the properties in the model are valid
92
+ # @return true if the model is valid
93
+ def valid?
94
+ true
95
+ end
96
+
97
+ # Checks equality by comparing each attribute.
98
+ # @param [Object] Object to be compared
99
+ def ==(o)
100
+ return true if self.equal?(o)
101
+ self.class == o.class &&
102
+ default_reason == o.default_reason &&
103
+ description == o.description &&
104
+ value == o.value
105
+ end
106
+
107
+ # @see the `==` method
108
+ # @param [Object] Object to be compared
109
+ def eql?(o)
110
+ self == o
111
+ end
112
+
113
+ # Calculates hash code according to all attributes.
114
+ # @return [Integer] Hash code
115
+ def hash
116
+ [default_reason, description, value].hash
117
+ end
118
+
119
+ # Builds the object from hash
120
+ # @param [Hash] attributes Model attributes in the form of hash
121
+ # @return [Object] Returns the model itself
122
+ def self.build_from_hash(attributes)
123
+ new.build_from_hash(attributes)
124
+ end
125
+
126
+ # Builds the object from hash
127
+ # @param [Hash] attributes Model attributes in the form of hash
128
+ # @return [Object] Returns the model itself
129
+ def build_from_hash(attributes)
130
+ return nil unless attributes.is_a?(Hash)
131
+ attributes = attributes.transform_keys(&:to_sym)
132
+ self.class.openapi_types.each_pair do |key, type|
133
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
134
+ self.send("#{key}=", nil)
135
+ elsif type =~ /\AArray<(.*)>/i
136
+ # check to ensure the input is an array given that the attribute
137
+ # is documented as an array but the input is not
138
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
139
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
140
+ end
141
+ elsif !attributes[self.class.attribute_map[key]].nil?
142
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
143
+ end
144
+ end
145
+
146
+ self
147
+ end
148
+
149
+ # Deserializes the data based on type
150
+ # @param string type Data type
151
+ # @param string value Value to be deserialized
152
+ # @return [Object] Deserialized data
153
+ def _deserialize(type, value)
154
+ case type.to_sym
155
+ when :Time
156
+ Time.parse(value)
157
+ when :Date
158
+ Date.parse(value)
159
+ when :String
160
+ value.to_s
161
+ when :Integer
162
+ value.to_i
163
+ when :Float
164
+ value.to_f
165
+ when :Boolean
166
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
167
+ true
168
+ else
169
+ false
170
+ end
171
+ when :Object
172
+ # generic object (usually a Hash), return directly
173
+ value
174
+ when /\AArray<(?<inner_type>.+)>\z/
175
+ inner_type = Regexp.last_match[:inner_type]
176
+ value.map { |v| _deserialize(inner_type, v) }
177
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
178
+ k_type = Regexp.last_match[:k_type]
179
+ v_type = Regexp.last_match[:v_type]
180
+ {}.tap do |hash|
181
+ value.each do |k, v|
182
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
183
+ end
184
+ end
185
+ else # model
186
+ # models (e.g. Pet) or oneOf
187
+ klass = UltracartClient.const_get(type)
188
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
189
+ end
190
+ end
191
+
192
+ # Returns the string representation of the object
193
+ # @return [String] String presentation of the object
194
+ def to_s
195
+ to_hash.to_s
196
+ end
197
+
198
+ # to_body is an alias to to_hash (backward compatibility)
199
+ # @return [Hash] Returns the object in the form of hash
200
+ def to_body
201
+ to_hash
202
+ end
203
+
204
+ # Returns the object in the form of hash
205
+ # @return [Hash] Returns the object in the form of hash
206
+ def to_hash
207
+ hash = {}
208
+ self.class.attribute_map.each_pair do |attr, param|
209
+ value = self.send(attr)
210
+ if value.nil?
211
+ is_nullable = self.class.openapi_nullable.include?(attr)
212
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
213
+ end
214
+
215
+ hash[param] = _to_hash(value)
216
+ end
217
+ hash
218
+ end
219
+
220
+ # Outputs non-array value in the form of hash
221
+ # For object, use to_hash. Otherwise, just return the value
222
+ # @param [Object] value Any valid value
223
+ # @return [Hash] Returns the value in the form of hash
224
+ def _to_hash(value)
225
+ if value.is_a?(Array)
226
+ value.compact.map { |v| _to_hash(v) }
227
+ elsif value.is_a?(Hash)
228
+ {}.tap do |hash|
229
+ value.each { |k, v| hash[k] = _to_hash(v) }
230
+ end
231
+ elsif value.respond_to? :to_hash
232
+ value.to_hash
233
+ else
234
+ value
235
+ end
236
+ end
237
+
238
+ end
239
+
240
+ end
@@ -17,8 +17,26 @@ module UltracartClient
17
17
  class OrderRefundableResponse
18
18
  attr_accessor :error
19
19
 
20
+ # True if the item level refund reason is required
21
+ attr_accessor :item_level_refund_reason_required
22
+
23
+ # Reason codes available at the item level.
24
+ attr_accessor :item_level_refund_reasons
25
+
26
+ # Return codes available at the item level.
27
+ attr_accessor :item_level_return_reasons
28
+
20
29
  attr_accessor :metadata
21
30
 
31
+ # True if the order level refund reason is required
32
+ attr_accessor :order_level_refund_reason_required
33
+
34
+ # Reason codes available at the order level.
35
+ attr_accessor :order_level_refund_reasons
36
+
37
+ # Reject codes available at the order level.
38
+ attr_accessor :order_level_reject_reasons
39
+
22
40
  # Whether the order is refundable or not. Null should be interpreted as false.
23
41
  attr_accessor :refundable
24
42
 
@@ -31,7 +49,13 @@ module UltracartClient
31
49
  def self.attribute_map
32
50
  {
33
51
  :'error' => :'error',
52
+ :'item_level_refund_reason_required' => :'item_level_refund_reason_required',
53
+ :'item_level_refund_reasons' => :'item_level_refund_reasons',
54
+ :'item_level_return_reasons' => :'item_level_return_reasons',
34
55
  :'metadata' => :'metadata',
56
+ :'order_level_refund_reason_required' => :'order_level_refund_reason_required',
57
+ :'order_level_refund_reasons' => :'order_level_refund_reasons',
58
+ :'order_level_reject_reasons' => :'order_level_reject_reasons',
35
59
  :'refundable' => :'refundable',
36
60
  :'success' => :'success',
37
61
  :'warning' => :'warning'
@@ -47,7 +71,13 @@ module UltracartClient
47
71
  def self.openapi_types
48
72
  {
49
73
  :'error' => :'Error',
74
+ :'item_level_refund_reason_required' => :'Boolean',
75
+ :'item_level_refund_reasons' => :'Array<OrderReason>',
76
+ :'item_level_return_reasons' => :'Array<OrderReason>',
50
77
  :'metadata' => :'ResponseMetadata',
78
+ :'order_level_refund_reason_required' => :'Boolean',
79
+ :'order_level_refund_reasons' => :'Array<OrderReason>',
80
+ :'order_level_reject_reasons' => :'Array<OrderReason>',
51
81
  :'refundable' => :'Boolean',
52
82
  :'success' => :'Boolean',
53
83
  :'warning' => :'Warning'
@@ -79,10 +109,42 @@ module UltracartClient
79
109
  self.error = attributes[:'error']
80
110
  end
81
111
 
112
+ if attributes.key?(:'item_level_refund_reason_required')
113
+ self.item_level_refund_reason_required = attributes[:'item_level_refund_reason_required']
114
+ end
115
+
116
+ if attributes.key?(:'item_level_refund_reasons')
117
+ if (value = attributes[:'item_level_refund_reasons']).is_a?(Array)
118
+ self.item_level_refund_reasons = value
119
+ end
120
+ end
121
+
122
+ if attributes.key?(:'item_level_return_reasons')
123
+ if (value = attributes[:'item_level_return_reasons']).is_a?(Array)
124
+ self.item_level_return_reasons = value
125
+ end
126
+ end
127
+
82
128
  if attributes.key?(:'metadata')
83
129
  self.metadata = attributes[:'metadata']
84
130
  end
85
131
 
132
+ if attributes.key?(:'order_level_refund_reason_required')
133
+ self.order_level_refund_reason_required = attributes[:'order_level_refund_reason_required']
134
+ end
135
+
136
+ if attributes.key?(:'order_level_refund_reasons')
137
+ if (value = attributes[:'order_level_refund_reasons']).is_a?(Array)
138
+ self.order_level_refund_reasons = value
139
+ end
140
+ end
141
+
142
+ if attributes.key?(:'order_level_reject_reasons')
143
+ if (value = attributes[:'order_level_reject_reasons']).is_a?(Array)
144
+ self.order_level_reject_reasons = value
145
+ end
146
+ end
147
+
86
148
  if attributes.key?(:'refundable')
87
149
  self.refundable = attributes[:'refundable']
88
150
  end
@@ -115,7 +177,13 @@ module UltracartClient
115
177
  return true if self.equal?(o)
116
178
  self.class == o.class &&
117
179
  error == o.error &&
180
+ item_level_refund_reason_required == o.item_level_refund_reason_required &&
181
+ item_level_refund_reasons == o.item_level_refund_reasons &&
182
+ item_level_return_reasons == o.item_level_return_reasons &&
118
183
  metadata == o.metadata &&
184
+ order_level_refund_reason_required == o.order_level_refund_reason_required &&
185
+ order_level_refund_reasons == o.order_level_refund_reasons &&
186
+ order_level_reject_reasons == o.order_level_reject_reasons &&
119
187
  refundable == o.refundable &&
120
188
  success == o.success &&
121
189
  warning == o.warning
@@ -130,7 +198,7 @@ module UltracartClient
130
198
  # Calculates hash code according to all attributes.
131
199
  # @return [Integer] Hash code
132
200
  def hash
133
- [error, metadata, refundable, success, warning].hash
201
+ [error, item_level_refund_reason_required, item_level_refund_reasons, item_level_return_reasons, metadata, order_level_refund_reason_required, order_level_refund_reasons, order_level_reject_reasons, refundable, success, warning].hash
134
202
  end
135
203
 
136
204
  # Builds the object from hash
@@ -11,5 +11,5 @@ OpenAPI Generator version: 6.0.1-SNAPSHOT
11
11
  =end
12
12
 
13
13
  module UltracartClient
14
- VERSION = '4.0.135'
14
+ VERSION = '4.0.136'
15
15
  end
data/lib/ultracart_api.rb CHANGED
@@ -609,6 +609,7 @@ require 'ultracart_api/models/order_property'
609
609
  require 'ultracart_api/models/order_query'
610
610
  require 'ultracart_api/models/order_query_batch'
611
611
  require 'ultracart_api/models/order_quote'
612
+ require 'ultracart_api/models/order_reason'
612
613
  require 'ultracart_api/models/order_refundable_response'
613
614
  require 'ultracart_api/models/order_replacement'
614
615
  require 'ultracart_api/models/order_replacement_item'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ultracart_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.135
4
+ version: 4.0.136
5
5
  platform: ruby
6
6
  authors:
7
7
  - UltraCart
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-02-17 00:00:00.000000000 Z
11
+ date: 2023-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -667,6 +667,7 @@ files:
667
667
  - docs/OrderQuery.md
668
668
  - docs/OrderQueryBatch.md
669
669
  - docs/OrderQuote.md
670
+ - docs/OrderReason.md
670
671
  - docs/OrderRefundableResponse.md
671
672
  - docs/OrderReplacement.md
672
673
  - docs/OrderReplacementItem.md
@@ -1434,6 +1435,7 @@ files:
1434
1435
  - lib/ultracart_api/models/order_query.rb
1435
1436
  - lib/ultracart_api/models/order_query_batch.rb
1436
1437
  - lib/ultracart_api/models/order_quote.rb
1438
+ - lib/ultracart_api/models/order_reason.rb
1437
1439
  - lib/ultracart_api/models/order_refundable_response.rb
1438
1440
  - lib/ultracart_api/models/order_replacement.rb
1439
1441
  - lib/ultracart_api/models/order_replacement_item.rb