ultracart_api 3.10.121 → 3.10.122

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6de46d470d6e12fa47eb7076e16b316a13766c9325959b408cfed550d2800a8a
4
- data.tar.gz: 92b12240cf0dff406859311ee91429803cff97b42678f4f07d749267363f3801
3
+ metadata.gz: 27fd0273e03c2cc30caa02a1cc540813c31cbd8724aabe14ee63c472277758af
4
+ data.tar.gz: cf3506a5d39c78397701eb152108bab7f2b99934d912b4f90915a32719a77e89
5
5
  SHA512:
6
- metadata.gz: e6267ee25dae10dec68398c12f860b6c6a1ea76ffba0b009e02fd6fb0c321b012d11888130e5b2aea0eb82057edcd905a37b2d897c7f6bc5b30e9b8e711b6d6c
7
- data.tar.gz: 50fdd8cb1b101f6e3c14d1a28048c31036fd2fb783932b4ec6791ea09694965e0f216cf2d093df0715baf59eabeda8dd040d2d6e10b31f2bd7b86e2acc55110f
6
+ metadata.gz: 4895417eef9c2e3654181f1c52c35b4cdefe3f5c440907067344e1345da2f44d53a729340b4324bd66393c88b26f76e1a4d04afdb3b3684d78c37cfd6ab94bea
7
+ data.tar.gz: 42c3090e07e4bc214984d3adb53fa687d2b48c00afd5fbe4614eb13e03a0e3260db5a2e97fd57a5e81512d0c0fd2f727d6f4f9ecb64dae06efadf28d7e6f24d5
data/README.md CHANGED
@@ -7,7 +7,7 @@ UltraCart REST API Version 2
7
7
  This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
8
8
 
9
9
  - API version: 2.0.0
10
- - Package version: 3.10.121
10
+ - Package version: 3.10.122
11
11
  - Build package: io.swagger.codegen.languages.RubyClientCodegen
12
12
  For more information, please visit [http://www.ultracart.com](http://www.ultracart.com)
13
13
 
@@ -24,15 +24,15 @@ gem build ultracart_api.gemspec
24
24
  Then either install the gem locally:
25
25
 
26
26
  ```shell
27
- gem install ./ultracart_api-3.10.121.gem
27
+ gem install ./ultracart_api-3.10.122.gem
28
28
  ```
29
- (for development, run `gem install --dev ./ultracart_api-3.10.121.gem` to install the development dependencies)
29
+ (for development, run `gem install --dev ./ultracart_api-3.10.122.gem` to install the development dependencies)
30
30
 
31
31
  or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
32
32
 
33
33
  Finally add this to the Gemfile:
34
34
 
35
- gem 'ultracart_api', '~> 3.10.121'
35
+ gem 'ultracart_api', '~> 3.10.122'
36
36
 
37
37
  ### Install from Git
38
38
 
@@ -254,6 +254,7 @@ Class | Method | HTTP request | Description
254
254
  *UltracartClient::OrderApi* | [**get_accounts_receivable_retry_stats**](docs/OrderApi.md#get_accounts_receivable_retry_stats) | **GET** /order/accountsReceivableRetryConfig/stats | Retrieve A/R Retry Statistics
255
255
  *UltracartClient::OrderApi* | [**get_order**](docs/OrderApi.md#get_order) | **GET** /order/orders/{order_id} | Retrieve an order
256
256
  *UltracartClient::OrderApi* | [**get_order_by_token**](docs/OrderApi.md#get_order_by_token) | **POST** /order/orders/token | Retrieve an order using a token
257
+ *UltracartClient::OrderApi* | [**get_order_edi_documents**](docs/OrderApi.md#get_order_edi_documents) | **GET** /order/orders/{order_id}/edi | Retrieve EDI documents associated with this order.
257
258
  *UltracartClient::OrderApi* | [**get_orders**](docs/OrderApi.md#get_orders) | **GET** /order/orders | Retrieve orders
258
259
  *UltracartClient::OrderApi* | [**get_orders_batch**](docs/OrderApi.md#get_orders_batch) | **POST** /order/orders/batch | Retrieve order batch
259
260
  *UltracartClient::OrderApi* | [**get_orders_by_query**](docs/OrderApi.md#get_orders_by_query) | **POST** /order/orders/query | Retrieve orders by query
@@ -1054,6 +1055,8 @@ Class | Method | HTTP request | Description
1054
1055
  - [UltracartClient::OrderDigitalItem](docs/OrderDigitalItem.md)
1055
1056
  - [UltracartClient::OrderDigitalOrder](docs/OrderDigitalOrder.md)
1056
1057
  - [UltracartClient::OrderEdi](docs/OrderEdi.md)
1058
+ - [UltracartClient::OrderEdiDocument](docs/OrderEdiDocument.md)
1059
+ - [UltracartClient::OrderEdiDocumentsResponse](docs/OrderEdiDocumentsResponse.md)
1057
1060
  - [UltracartClient::OrderFormat](docs/OrderFormat.md)
1058
1061
  - [UltracartClient::OrderFormatResponse](docs/OrderFormatResponse.md)
1059
1062
  - [UltracartClient::OrderFraudScore](docs/OrderFraudScore.md)
@@ -1304,6 +1307,7 @@ Not every change is committed to every SDK.
1304
1307
 
1305
1308
  | Version | Date | Comments |
1306
1309
  | --: | :-: | --- |
1310
+ | 3.10.122 | 03/14/2023 | order.getOrderEdiDocuments |
1307
1311
  | 3.10.121 | 03/01/2023 | convo - add sentiment record to conversation obj |
1308
1312
  | 3.10.120 | 02/22/2023 | convo - customer initiated flag on engagement |
1309
1313
  | 3.10.119 | 02/20/2023 | refund reasons |
data/docs/OrderApi.md CHANGED
@@ -17,6 +17,7 @@ Method | HTTP request | Description
17
17
  [**get_accounts_receivable_retry_stats**](OrderApi.md#get_accounts_receivable_retry_stats) | **GET** /order/accountsReceivableRetryConfig/stats | Retrieve A/R Retry Statistics
18
18
  [**get_order**](OrderApi.md#get_order) | **GET** /order/orders/{order_id} | Retrieve an order
19
19
  [**get_order_by_token**](OrderApi.md#get_order_by_token) | **POST** /order/orders/token | Retrieve an order using a token
20
+ [**get_order_edi_documents**](OrderApi.md#get_order_edi_documents) | **GET** /order/orders/{order_id}/edi | Retrieve EDI documents associated with this order.
20
21
  [**get_orders**](OrderApi.md#get_orders) | **GET** /order/orders | Retrieve orders
21
22
  [**get_orders_batch**](OrderApi.md#get_orders_batch) | **POST** /order/orders/batch | Retrieve order batch
22
23
  [**get_orders_by_query**](OrderApi.md#get_orders_by_query) | **POST** /order/orders/query | Retrieve orders by query
@@ -699,6 +700,56 @@ Name | Type | Description | Notes
699
700
 
700
701
 
701
702
 
703
+ # **get_order_edi_documents**
704
+ > OrderEdiDocumentsResponse get_order_edi_documents(order_id)
705
+
706
+ Retrieve EDI documents associated with this order.
707
+
708
+ Retrieve EDI documents associated with this order.
709
+
710
+ ### Example
711
+ ```ruby
712
+ # load the gem
713
+ require 'ultracart_api'
714
+
715
+ # Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
716
+ simple_key = '109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00'
717
+ api_instance = UltracartClient::OrderApi.new_using_api_key(simple_key, false, false)
718
+
719
+
720
+ order_id = 'order_id_example' # String | The order id to retrieve EDI documents for.
721
+
722
+
723
+ begin
724
+ #Retrieve EDI documents associated with this order.
725
+ result = api_instance.get_order_edi_documents(order_id)
726
+ p result
727
+ rescue UltracartClient::ApiError => e
728
+ puts "Exception when calling OrderApi->get_order_edi_documents: #{e}"
729
+ end
730
+ ```
731
+
732
+ ### Parameters
733
+
734
+ Name | Type | Description | Notes
735
+ ------------- | ------------- | ------------- | -------------
736
+ **order_id** | **String**| The order id to retrieve EDI documents for. |
737
+
738
+ ### Return type
739
+
740
+ [**OrderEdiDocumentsResponse**](OrderEdiDocumentsResponse.md)
741
+
742
+ ### Authorization
743
+
744
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
745
+
746
+ ### HTTP request headers
747
+
748
+ - **Content-Type**: application/json; charset=UTF-8
749
+ - **Accept**: application/json
750
+
751
+
752
+
702
753
  # **get_orders**
703
754
  > OrdersResponse get_orders(opts)
704
755
 
@@ -0,0 +1,21 @@
1
+ # UltracartClient::OrderEdiDocument
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **direction** | **String** | Direction the document flowed | [optional]
7
+ **doc_dts** | **String** | Date/time the document was created/received | [optional]
8
+ **document** | **String** | | [optional]
9
+ **document_type_description** | **String** | | [optional]
10
+ **document_type_number** | **Integer** | | [optional]
11
+ **external_id** | **String** | | [optional]
12
+ **functional_acknowledgement** | **String** | | [optional]
13
+ **functional_acknowledgement_dts** | **String** | | [optional]
14
+ **functional_acknowledgement_pending** | **BOOLEAN** | | [optional]
15
+ **group_control_number** | **Integer** | | [optional]
16
+ **internal_id** | **String** | | [optional]
17
+ **merchant_id** | **String** | | [optional]
18
+ **order_id** | **String** | | [optional]
19
+ **test_mode** | **BOOLEAN** | | [optional]
20
+
21
+
@@ -0,0 +1,12 @@
1
+ # UltracartClient::OrderEdiDocumentsResponse
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **edi_documents** | [**Array<OrderEdiDocument>**](OrderEdiDocument.md) | edi_documents | [optional]
7
+ **error** | [**Error**](Error.md) | | [optional]
8
+ **metadata** | [**ResponseMetadata**](ResponseMetadata.md) | | [optional]
9
+ **success** | **BOOLEAN** | Indicates if API call was successful | [optional]
10
+ **warning** | [**Warning**](Warning.md) | | [optional]
11
+
12
+
@@ -767,6 +767,61 @@ module UltracartClient
767
767
  end
768
768
  return data, status_code, headers
769
769
  end
770
+ # Retrieve EDI documents associated with this order.
771
+ # Retrieve EDI documents associated with this order.
772
+ # @param order_id The order id to retrieve EDI documents for.
773
+ # @param [Hash] opts the optional parameters
774
+ # @return [OrderEdiDocumentsResponse]
775
+ def get_order_edi_documents(order_id, opts = {})
776
+ data, _status_code, _headers = get_order_edi_documents_with_http_info(order_id, opts)
777
+ data
778
+ end
779
+
780
+ # Retrieve EDI documents associated with this order.
781
+ # Retrieve EDI documents associated with this order.
782
+ # @param order_id The order id to retrieve EDI documents for.
783
+ # @param [Hash] opts the optional parameters
784
+ # @return [Array<(OrderEdiDocumentsResponse, Fixnum, Hash)>] OrderEdiDocumentsResponse data, response status code and response headers
785
+ def get_order_edi_documents_with_http_info(order_id, opts = {})
786
+ if @api_client.config.debugging
787
+ @api_client.config.logger.debug 'Calling API: OrderApi.get_order_edi_documents ...'
788
+ end
789
+ # verify the required parameter 'order_id' is set
790
+ if @api_client.config.client_side_validation && order_id.nil?
791
+ fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.get_order_edi_documents"
792
+ end
793
+ # resource path
794
+ local_var_path = '/order/orders/{order_id}/edi'.sub('{' + 'order_id' + '}', order_id.to_s)
795
+
796
+ # query parameters
797
+ query_params = {}
798
+
799
+ # header parameters
800
+ header_params = {}
801
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
802
+ # HTTP header 'Accept' (if needed)
803
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
804
+ # HTTP header 'Content-Type'
805
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=UTF-8'])
806
+
807
+ # form parameters
808
+ form_params = {}
809
+
810
+ # http body (model)
811
+ post_body = nil
812
+ auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
813
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
814
+ :header_params => header_params,
815
+ :query_params => query_params,
816
+ :form_params => form_params,
817
+ :body => post_body,
818
+ :auth_names => auth_names,
819
+ :return_type => 'OrderEdiDocumentsResponse')
820
+ if @api_client.config.debugging
821
+ @api_client.config.logger.debug "API called: OrderApi#get_order_edi_documents\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
822
+ end
823
+ return data, status_code, headers
824
+ end
770
825
  # Retrieve orders
771
826
  # Retrieves a group of orders from the account. If no parameters are specified, the API call will fail with a bad request error. Always specify some parameters to limit the scope of the orders returned to ones you are truly interested in. You will need to make multiple API calls in order to retrieve the entire result set since this API performs result set pagination.
772
827
  # @param [Hash] opts the optional parameters
@@ -0,0 +1,337 @@
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 OrderEdiDocument
17
+ # Direction the document flowed
18
+ attr_accessor :direction
19
+
20
+ # Date/time the document was created/received
21
+ attr_accessor :doc_dts
22
+
23
+ attr_accessor :document
24
+
25
+ attr_accessor :document_type_description
26
+
27
+ attr_accessor :document_type_number
28
+
29
+ attr_accessor :external_id
30
+
31
+ attr_accessor :functional_acknowledgement
32
+
33
+ attr_accessor :functional_acknowledgement_dts
34
+
35
+ attr_accessor :functional_acknowledgement_pending
36
+
37
+ attr_accessor :group_control_number
38
+
39
+ attr_accessor :internal_id
40
+
41
+ attr_accessor :merchant_id
42
+
43
+ attr_accessor :order_id
44
+
45
+ attr_accessor :test_mode
46
+
47
+ class EnumAttributeValidator
48
+ attr_reader :datatype
49
+ attr_reader :allowable_values
50
+
51
+ def initialize(datatype, allowable_values)
52
+ @allowable_values = allowable_values.map do |value|
53
+ case datatype.to_s
54
+ when /Integer/i
55
+ value.to_i
56
+ when /Float/i
57
+ value.to_f
58
+ else
59
+ value
60
+ end
61
+ end
62
+ end
63
+
64
+ def valid?(value)
65
+ !value || allowable_values.include?(value)
66
+ end
67
+ end
68
+
69
+ # Attribute mapping from ruby-style variable name to JSON key.
70
+ def self.attribute_map
71
+ {
72
+ :'direction' => :'direction',
73
+ :'doc_dts' => :'doc_dts',
74
+ :'document' => :'document',
75
+ :'document_type_description' => :'document_type_description',
76
+ :'document_type_number' => :'document_type_number',
77
+ :'external_id' => :'external_id',
78
+ :'functional_acknowledgement' => :'functional_acknowledgement',
79
+ :'functional_acknowledgement_dts' => :'functional_acknowledgement_dts',
80
+ :'functional_acknowledgement_pending' => :'functional_acknowledgement_pending',
81
+ :'group_control_number' => :'group_control_number',
82
+ :'internal_id' => :'internal_id',
83
+ :'merchant_id' => :'merchant_id',
84
+ :'order_id' => :'order_id',
85
+ :'test_mode' => :'test_mode'
86
+ }
87
+ end
88
+
89
+ # Attribute type mapping.
90
+ def self.swagger_types
91
+ {
92
+ :'direction' => :'String',
93
+ :'doc_dts' => :'String',
94
+ :'document' => :'String',
95
+ :'document_type_description' => :'String',
96
+ :'document_type_number' => :'Integer',
97
+ :'external_id' => :'String',
98
+ :'functional_acknowledgement' => :'String',
99
+ :'functional_acknowledgement_dts' => :'String',
100
+ :'functional_acknowledgement_pending' => :'BOOLEAN',
101
+ :'group_control_number' => :'Integer',
102
+ :'internal_id' => :'String',
103
+ :'merchant_id' => :'String',
104
+ :'order_id' => :'String',
105
+ :'test_mode' => :'BOOLEAN'
106
+ }
107
+ end
108
+
109
+ # Initializes the object
110
+ # @param [Hash] attributes Model attributes in the form of hash
111
+ def initialize(attributes = {})
112
+ return unless attributes.is_a?(Hash)
113
+
114
+ # convert string to symbol for hash key
115
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
116
+
117
+ if attributes.has_key?(:'direction')
118
+ self.direction = attributes[:'direction']
119
+ end
120
+
121
+ if attributes.has_key?(:'doc_dts')
122
+ self.doc_dts = attributes[:'doc_dts']
123
+ end
124
+
125
+ if attributes.has_key?(:'document')
126
+ self.document = attributes[:'document']
127
+ end
128
+
129
+ if attributes.has_key?(:'document_type_description')
130
+ self.document_type_description = attributes[:'document_type_description']
131
+ end
132
+
133
+ if attributes.has_key?(:'document_type_number')
134
+ self.document_type_number = attributes[:'document_type_number']
135
+ end
136
+
137
+ if attributes.has_key?(:'external_id')
138
+ self.external_id = attributes[:'external_id']
139
+ end
140
+
141
+ if attributes.has_key?(:'functional_acknowledgement')
142
+ self.functional_acknowledgement = attributes[:'functional_acknowledgement']
143
+ end
144
+
145
+ if attributes.has_key?(:'functional_acknowledgement_dts')
146
+ self.functional_acknowledgement_dts = attributes[:'functional_acknowledgement_dts']
147
+ end
148
+
149
+ if attributes.has_key?(:'functional_acknowledgement_pending')
150
+ self.functional_acknowledgement_pending = attributes[:'functional_acknowledgement_pending']
151
+ end
152
+
153
+ if attributes.has_key?(:'group_control_number')
154
+ self.group_control_number = attributes[:'group_control_number']
155
+ end
156
+
157
+ if attributes.has_key?(:'internal_id')
158
+ self.internal_id = attributes[:'internal_id']
159
+ end
160
+
161
+ if attributes.has_key?(:'merchant_id')
162
+ self.merchant_id = attributes[:'merchant_id']
163
+ end
164
+
165
+ if attributes.has_key?(:'order_id')
166
+ self.order_id = attributes[:'order_id']
167
+ end
168
+
169
+ if attributes.has_key?(:'test_mode')
170
+ self.test_mode = attributes[:'test_mode']
171
+ end
172
+ end
173
+
174
+ # Show invalid properties with the reasons. Usually used together with valid?
175
+ # @return Array for valid properties with the reasons
176
+ def list_invalid_properties
177
+ invalid_properties = Array.new
178
+ invalid_properties
179
+ end
180
+
181
+ # Check to see if the all the properties in the model are valid
182
+ # @return true if the model is valid
183
+ def valid?
184
+ direction_validator = EnumAttributeValidator.new('String', ['inbound', 'outbound'])
185
+ return false unless direction_validator.valid?(@direction)
186
+ true
187
+ end
188
+
189
+ # Custom attribute writer method checking allowed values (enum).
190
+ # @param [Object] direction Object to be assigned
191
+ def direction=(direction)
192
+ validator = EnumAttributeValidator.new('String', ['inbound', 'outbound'])
193
+ unless validator.valid?(direction)
194
+ fail ArgumentError, 'invalid value for "direction", must be one of #{validator.allowable_values}.'
195
+ end
196
+ @direction = direction
197
+ end
198
+
199
+ # Checks equality by comparing each attribute.
200
+ # @param [Object] Object to be compared
201
+ def ==(o)
202
+ return true if self.equal?(o)
203
+ self.class == o.class &&
204
+ direction == o.direction &&
205
+ doc_dts == o.doc_dts &&
206
+ document == o.document &&
207
+ document_type_description == o.document_type_description &&
208
+ document_type_number == o.document_type_number &&
209
+ external_id == o.external_id &&
210
+ functional_acknowledgement == o.functional_acknowledgement &&
211
+ functional_acknowledgement_dts == o.functional_acknowledgement_dts &&
212
+ functional_acknowledgement_pending == o.functional_acknowledgement_pending &&
213
+ group_control_number == o.group_control_number &&
214
+ internal_id == o.internal_id &&
215
+ merchant_id == o.merchant_id &&
216
+ order_id == o.order_id &&
217
+ test_mode == o.test_mode
218
+ end
219
+
220
+ # @see the `==` method
221
+ # @param [Object] Object to be compared
222
+ def eql?(o)
223
+ self == o
224
+ end
225
+
226
+ # Calculates hash code according to all attributes.
227
+ # @return [Fixnum] Hash code
228
+ def hash
229
+ [direction, doc_dts, document, document_type_description, document_type_number, external_id, functional_acknowledgement, functional_acknowledgement_dts, functional_acknowledgement_pending, group_control_number, internal_id, merchant_id, order_id, test_mode].hash
230
+ end
231
+
232
+ # Builds the object from hash
233
+ # @param [Hash] attributes Model attributes in the form of hash
234
+ # @return [Object] Returns the model itself
235
+ def build_from_hash(attributes)
236
+ return nil unless attributes.is_a?(Hash)
237
+ self.class.swagger_types.each_pair do |key, type|
238
+ if type =~ /\AArray<(.*)>/i
239
+ # check to ensure the input is an array given that the attribute
240
+ # is documented as an array but the input is not
241
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
242
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
243
+ end
244
+ elsif !attributes[self.class.attribute_map[key]].nil?
245
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
246
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
247
+ end
248
+
249
+ self
250
+ end
251
+
252
+ # Deserializes the data based on type
253
+ # @param string type Data type
254
+ # @param string value Value to be deserialized
255
+ # @return [Object] Deserialized data
256
+ def _deserialize(type, value)
257
+ case type.to_sym
258
+ when :DateTime
259
+ DateTime.parse(value)
260
+ when :Date
261
+ Date.parse(value)
262
+ when :String
263
+ value.to_s
264
+ when :Integer
265
+ value.to_i
266
+ when :Float
267
+ value.to_f
268
+ when :BOOLEAN
269
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
270
+ true
271
+ else
272
+ false
273
+ end
274
+ when :Object
275
+ # generic object (usually a Hash), return directly
276
+ value
277
+ when /\AArray<(?<inner_type>.+)>\z/
278
+ inner_type = Regexp.last_match[:inner_type]
279
+ value.map { |v| _deserialize(inner_type, v) }
280
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
281
+ k_type = Regexp.last_match[:k_type]
282
+ v_type = Regexp.last_match[:v_type]
283
+ {}.tap do |hash|
284
+ value.each do |k, v|
285
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
286
+ end
287
+ end
288
+ else # model
289
+ temp_model = UltracartClient.const_get(type).new
290
+ temp_model.build_from_hash(value)
291
+ end
292
+ end
293
+
294
+ # Returns the string representation of the object
295
+ # @return [String] String presentation of the object
296
+ def to_s
297
+ to_hash.to_s
298
+ end
299
+
300
+ # to_body is an alias to to_hash (backward compatibility)
301
+ # @return [Hash] Returns the object in the form of hash
302
+ def to_body
303
+ to_hash
304
+ end
305
+
306
+ # Returns the object in the form of hash
307
+ # @return [Hash] Returns the object in the form of hash
308
+ def to_hash
309
+ hash = {}
310
+ self.class.attribute_map.each_pair do |attr, param|
311
+ value = self.send(attr)
312
+ next if value.nil?
313
+ hash[param] = _to_hash(value)
314
+ end
315
+ hash
316
+ end
317
+
318
+ # Outputs non-array value in the form of hash
319
+ # For object, use to_hash. Otherwise, just return the value
320
+ # @param [Object] value Any valid value
321
+ # @return [Hash] Returns the value in the form of hash
322
+ def _to_hash(value)
323
+ if value.is_a?(Array)
324
+ value.compact.map { |v| _to_hash(v) }
325
+ elsif value.is_a?(Hash)
326
+ {}.tap do |hash|
327
+ value.each { |k, v| hash[k] = _to_hash(v) }
328
+ end
329
+ elsif value.respond_to? :to_hash
330
+ value.to_hash
331
+ else
332
+ value
333
+ end
334
+ end
335
+
336
+ end
337
+ end
@@ -0,0 +1,224 @@
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 OrderEdiDocumentsResponse
17
+ # edi_documents
18
+ attr_accessor :edi_documents
19
+
20
+ attr_accessor :error
21
+
22
+ attr_accessor :metadata
23
+
24
+ # Indicates if API call was successful
25
+ attr_accessor :success
26
+
27
+ attr_accessor :warning
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'edi_documents' => :'ediDocuments',
33
+ :'error' => :'error',
34
+ :'metadata' => :'metadata',
35
+ :'success' => :'success',
36
+ :'warning' => :'warning'
37
+ }
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.swagger_types
42
+ {
43
+ :'edi_documents' => :'Array<OrderEdiDocument>',
44
+ :'error' => :'Error',
45
+ :'metadata' => :'ResponseMetadata',
46
+ :'success' => :'BOOLEAN',
47
+ :'warning' => :'Warning'
48
+ }
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ return unless attributes.is_a?(Hash)
55
+
56
+ # convert string to symbol for hash key
57
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
58
+
59
+ if attributes.has_key?(:'ediDocuments')
60
+ if (value = attributes[:'ediDocuments']).is_a?(Array)
61
+ self.edi_documents = value
62
+ end
63
+ end
64
+
65
+ if attributes.has_key?(:'error')
66
+ self.error = attributes[:'error']
67
+ end
68
+
69
+ if attributes.has_key?(:'metadata')
70
+ self.metadata = attributes[:'metadata']
71
+ end
72
+
73
+ if attributes.has_key?(:'success')
74
+ self.success = attributes[:'success']
75
+ end
76
+
77
+ if attributes.has_key?(:'warning')
78
+ self.warning = attributes[:'warning']
79
+ end
80
+ end
81
+
82
+ # Show invalid properties with the reasons. Usually used together with valid?
83
+ # @return Array for valid properties with the reasons
84
+ def list_invalid_properties
85
+ invalid_properties = Array.new
86
+ invalid_properties
87
+ end
88
+
89
+ # Check to see if the all the properties in the model are valid
90
+ # @return true if the model is valid
91
+ def valid?
92
+ true
93
+ end
94
+
95
+ # Checks equality by comparing each attribute.
96
+ # @param [Object] Object to be compared
97
+ def ==(o)
98
+ return true if self.equal?(o)
99
+ self.class == o.class &&
100
+ edi_documents == o.edi_documents &&
101
+ error == o.error &&
102
+ metadata == o.metadata &&
103
+ success == o.success &&
104
+ warning == o.warning
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 [Fixnum] Hash code
115
+ def hash
116
+ [edi_documents, error, metadata, success, warning].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 build_from_hash(attributes)
123
+ return nil unless attributes.is_a?(Hash)
124
+ self.class.swagger_types.each_pair do |key, type|
125
+ if type =~ /\AArray<(.*)>/i
126
+ # check to ensure the input is an array given that the attribute
127
+ # is documented as an array but the input is not
128
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
129
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
130
+ end
131
+ elsif !attributes[self.class.attribute_map[key]].nil?
132
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
133
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
134
+ end
135
+
136
+ self
137
+ end
138
+
139
+ # Deserializes the data based on type
140
+ # @param string type Data type
141
+ # @param string value Value to be deserialized
142
+ # @return [Object] Deserialized data
143
+ def _deserialize(type, value)
144
+ case type.to_sym
145
+ when :DateTime
146
+ DateTime.parse(value)
147
+ when :Date
148
+ Date.parse(value)
149
+ when :String
150
+ value.to_s
151
+ when :Integer
152
+ value.to_i
153
+ when :Float
154
+ value.to_f
155
+ when :BOOLEAN
156
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
157
+ true
158
+ else
159
+ false
160
+ end
161
+ when :Object
162
+ # generic object (usually a Hash), return directly
163
+ value
164
+ when /\AArray<(?<inner_type>.+)>\z/
165
+ inner_type = Regexp.last_match[:inner_type]
166
+ value.map { |v| _deserialize(inner_type, v) }
167
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
168
+ k_type = Regexp.last_match[:k_type]
169
+ v_type = Regexp.last_match[:v_type]
170
+ {}.tap do |hash|
171
+ value.each do |k, v|
172
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
173
+ end
174
+ end
175
+ else # model
176
+ temp_model = UltracartClient.const_get(type).new
177
+ temp_model.build_from_hash(value)
178
+ end
179
+ end
180
+
181
+ # Returns the string representation of the object
182
+ # @return [String] String presentation of the object
183
+ def to_s
184
+ to_hash.to_s
185
+ end
186
+
187
+ # to_body is an alias to to_hash (backward compatibility)
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_body
190
+ to_hash
191
+ end
192
+
193
+ # Returns the object in the form of hash
194
+ # @return [Hash] Returns the object in the form of hash
195
+ def to_hash
196
+ hash = {}
197
+ self.class.attribute_map.each_pair do |attr, param|
198
+ value = self.send(attr)
199
+ next if value.nil?
200
+ hash[param] = _to_hash(value)
201
+ end
202
+ hash
203
+ end
204
+
205
+ # Outputs non-array value in the form of hash
206
+ # For object, use to_hash. Otherwise, just return the value
207
+ # @param [Object] value Any valid value
208
+ # @return [Hash] Returns the value in the form of hash
209
+ def _to_hash(value)
210
+ if value.is_a?(Array)
211
+ value.compact.map { |v| _to_hash(v) }
212
+ elsif value.is_a?(Hash)
213
+ {}.tap do |hash|
214
+ value.each { |k, v| hash[k] = _to_hash(v) }
215
+ end
216
+ elsif value.respond_to? :to_hash
217
+ value.to_hash
218
+ else
219
+ value
220
+ end
221
+ end
222
+
223
+ end
224
+ end
@@ -11,5 +11,5 @@ Swagger Codegen version: 2.4.15-SNAPSHOT
11
11
  =end
12
12
 
13
13
  module UltracartClient
14
- VERSION = '3.10.121'
14
+ VERSION = '3.10.122'
15
15
  end
data/lib/ultracart_api.rb CHANGED
@@ -578,6 +578,8 @@ require 'ultracart_api/models/order_coupon'
578
578
  require 'ultracart_api/models/order_digital_item'
579
579
  require 'ultracart_api/models/order_digital_order'
580
580
  require 'ultracart_api/models/order_edi'
581
+ require 'ultracart_api/models/order_edi_document'
582
+ require 'ultracart_api/models/order_edi_documents_response'
581
583
  require 'ultracart_api/models/order_format'
582
584
  require 'ultracart_api/models/order_format_response'
583
585
  require 'ultracart_api/models/order_fraud_score'
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: 3.10.121
4
+ version: 3.10.122
5
5
  platform: ruby
6
6
  authors:
7
7
  - UltraCart
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-01 00:00:00.000000000 Z
11
+ date: 2023-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -796,6 +796,8 @@ files:
796
796
  - docs/OrderDigitalItem.md
797
797
  - docs/OrderDigitalOrder.md
798
798
  - docs/OrderEdi.md
799
+ - docs/OrderEdiDocument.md
800
+ - docs/OrderEdiDocumentsResponse.md
799
801
  - docs/OrderFormat.md
800
802
  - docs/OrderFormatResponse.md
801
803
  - docs/OrderFraudScore.md
@@ -1566,6 +1568,8 @@ files:
1566
1568
  - lib/ultracart_api/models/order_digital_item.rb
1567
1569
  - lib/ultracart_api/models/order_digital_order.rb
1568
1570
  - lib/ultracart_api/models/order_edi.rb
1571
+ - lib/ultracart_api/models/order_edi_document.rb
1572
+ - lib/ultracart_api/models/order_edi_documents_response.rb
1569
1573
  - lib/ultracart_api/models/order_format.rb
1570
1574
  - lib/ultracart_api/models/order_format_response.rb
1571
1575
  - lib/ultracart_api/models/order_fraud_score.rb