ultracart_api 3.1.46 → 3.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,298 @@
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 IntegrationLogQueryRequest
17
+ attr_accessor :action
18
+
19
+ attr_accessor :direction
20
+
21
+ attr_accessor :email
22
+
23
+ attr_accessor :file_names
24
+
25
+ attr_accessor :item_id
26
+
27
+ attr_accessor :item_ipn_oid
28
+
29
+ # Log date/time begin
30
+ attr_accessor :log_dts_begin
31
+
32
+ # Log date/time end
33
+ attr_accessor :log_dts_end
34
+
35
+ attr_accessor :log_type
36
+
37
+ attr_accessor :logger_id
38
+
39
+ attr_accessor :logger_name
40
+
41
+ attr_accessor :order_ids
42
+
43
+ attr_accessor :status
44
+
45
+ # Attribute mapping from ruby-style variable name to JSON key.
46
+ def self.attribute_map
47
+ {
48
+ :'action' => :'action',
49
+ :'direction' => :'direction',
50
+ :'email' => :'email',
51
+ :'file_names' => :'file_names',
52
+ :'item_id' => :'item_id',
53
+ :'item_ipn_oid' => :'item_ipn_oid',
54
+ :'log_dts_begin' => :'log_dts_begin',
55
+ :'log_dts_end' => :'log_dts_end',
56
+ :'log_type' => :'log_type',
57
+ :'logger_id' => :'logger_id',
58
+ :'logger_name' => :'logger_name',
59
+ :'order_ids' => :'order_ids',
60
+ :'status' => :'status'
61
+ }
62
+ end
63
+
64
+ # Attribute type mapping.
65
+ def self.swagger_types
66
+ {
67
+ :'action' => :'String',
68
+ :'direction' => :'String',
69
+ :'email' => :'String',
70
+ :'file_names' => :'Array<String>',
71
+ :'item_id' => :'String',
72
+ :'item_ipn_oid' => :'Integer',
73
+ :'log_dts_begin' => :'String',
74
+ :'log_dts_end' => :'String',
75
+ :'log_type' => :'String',
76
+ :'logger_id' => :'String',
77
+ :'logger_name' => :'String',
78
+ :'order_ids' => :'Array<String>',
79
+ :'status' => :'String'
80
+ }
81
+ end
82
+
83
+ # Initializes the object
84
+ # @param [Hash] attributes Model attributes in the form of hash
85
+ def initialize(attributes = {})
86
+ return unless attributes.is_a?(Hash)
87
+
88
+ # convert string to symbol for hash key
89
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
90
+
91
+ if attributes.has_key?(:'action')
92
+ self.action = attributes[:'action']
93
+ end
94
+
95
+ if attributes.has_key?(:'direction')
96
+ self.direction = attributes[:'direction']
97
+ end
98
+
99
+ if attributes.has_key?(:'email')
100
+ self.email = attributes[:'email']
101
+ end
102
+
103
+ if attributes.has_key?(:'file_names')
104
+ if (value = attributes[:'file_names']).is_a?(Array)
105
+ self.file_names = value
106
+ end
107
+ end
108
+
109
+ if attributes.has_key?(:'item_id')
110
+ self.item_id = attributes[:'item_id']
111
+ end
112
+
113
+ if attributes.has_key?(:'item_ipn_oid')
114
+ self.item_ipn_oid = attributes[:'item_ipn_oid']
115
+ end
116
+
117
+ if attributes.has_key?(:'log_dts_begin')
118
+ self.log_dts_begin = attributes[:'log_dts_begin']
119
+ end
120
+
121
+ if attributes.has_key?(:'log_dts_end')
122
+ self.log_dts_end = attributes[:'log_dts_end']
123
+ end
124
+
125
+ if attributes.has_key?(:'log_type')
126
+ self.log_type = attributes[:'log_type']
127
+ end
128
+
129
+ if attributes.has_key?(:'logger_id')
130
+ self.logger_id = attributes[:'logger_id']
131
+ end
132
+
133
+ if attributes.has_key?(:'logger_name')
134
+ self.logger_name = attributes[:'logger_name']
135
+ end
136
+
137
+ if attributes.has_key?(:'order_ids')
138
+ if (value = attributes[:'order_ids']).is_a?(Array)
139
+ self.order_ids = value
140
+ end
141
+ end
142
+
143
+ if attributes.has_key?(:'status')
144
+ self.status = attributes[:'status']
145
+ end
146
+ end
147
+
148
+ # Show invalid properties with the reasons. Usually used together with valid?
149
+ # @return Array for valid properties with the reasons
150
+ def list_invalid_properties
151
+ invalid_properties = Array.new
152
+ invalid_properties
153
+ end
154
+
155
+ # Check to see if the all the properties in the model are valid
156
+ # @return true if the model is valid
157
+ def valid?
158
+ true
159
+ end
160
+
161
+ # Checks equality by comparing each attribute.
162
+ # @param [Object] Object to be compared
163
+ def ==(o)
164
+ return true if self.equal?(o)
165
+ self.class == o.class &&
166
+ action == o.action &&
167
+ direction == o.direction &&
168
+ email == o.email &&
169
+ file_names == o.file_names &&
170
+ item_id == o.item_id &&
171
+ item_ipn_oid == o.item_ipn_oid &&
172
+ log_dts_begin == o.log_dts_begin &&
173
+ log_dts_end == o.log_dts_end &&
174
+ log_type == o.log_type &&
175
+ logger_id == o.logger_id &&
176
+ logger_name == o.logger_name &&
177
+ order_ids == o.order_ids &&
178
+ status == o.status
179
+ end
180
+
181
+ # @see the `==` method
182
+ # @param [Object] Object to be compared
183
+ def eql?(o)
184
+ self == o
185
+ end
186
+
187
+ # Calculates hash code according to all attributes.
188
+ # @return [Fixnum] Hash code
189
+ def hash
190
+ [action, direction, email, file_names, item_id, item_ipn_oid, log_dts_begin, log_dts_end, log_type, logger_id, logger_name, order_ids, status].hash
191
+ end
192
+
193
+ # Builds the object from hash
194
+ # @param [Hash] attributes Model attributes in the form of hash
195
+ # @return [Object] Returns the model itself
196
+ def build_from_hash(attributes)
197
+ return nil unless attributes.is_a?(Hash)
198
+ self.class.swagger_types.each_pair do |key, type|
199
+ if type =~ /\AArray<(.*)>/i
200
+ # check to ensure the input is an array given that the attribute
201
+ # is documented as an array but the input is not
202
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
203
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
204
+ end
205
+ elsif !attributes[self.class.attribute_map[key]].nil?
206
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
207
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
208
+ end
209
+
210
+ self
211
+ end
212
+
213
+ # Deserializes the data based on type
214
+ # @param string type Data type
215
+ # @param string value Value to be deserialized
216
+ # @return [Object] Deserialized data
217
+ def _deserialize(type, value)
218
+ case type.to_sym
219
+ when :DateTime
220
+ DateTime.parse(value)
221
+ when :Date
222
+ Date.parse(value)
223
+ when :String
224
+ value.to_s
225
+ when :Integer
226
+ value.to_i
227
+ when :Float
228
+ value.to_f
229
+ when :BOOLEAN
230
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
231
+ true
232
+ else
233
+ false
234
+ end
235
+ when :Object
236
+ # generic object (usually a Hash), return directly
237
+ value
238
+ when /\AArray<(?<inner_type>.+)>\z/
239
+ inner_type = Regexp.last_match[:inner_type]
240
+ value.map { |v| _deserialize(inner_type, v) }
241
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
242
+ k_type = Regexp.last_match[:k_type]
243
+ v_type = Regexp.last_match[:v_type]
244
+ {}.tap do |hash|
245
+ value.each do |k, v|
246
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
247
+ end
248
+ end
249
+ else # model
250
+ temp_model = UltracartClient.const_get(type).new
251
+ temp_model.build_from_hash(value)
252
+ end
253
+ end
254
+
255
+ # Returns the string representation of the object
256
+ # @return [String] String presentation of the object
257
+ def to_s
258
+ to_hash.to_s
259
+ end
260
+
261
+ # to_body is an alias to to_hash (backward compatibility)
262
+ # @return [Hash] Returns the object in the form of hash
263
+ def to_body
264
+ to_hash
265
+ end
266
+
267
+ # Returns the object in the form of hash
268
+ # @return [Hash] Returns the object in the form of hash
269
+ def to_hash
270
+ hash = {}
271
+ self.class.attribute_map.each_pair do |attr, param|
272
+ value = self.send(attr)
273
+ next if value.nil?
274
+ hash[param] = _to_hash(value)
275
+ end
276
+ hash
277
+ end
278
+
279
+ # Outputs non-array value in the form of hash
280
+ # For object, use to_hash. Otherwise, just return the value
281
+ # @param [Object] value Any valid value
282
+ # @return [Hash] Returns the value in the form of hash
283
+ def _to_hash(value)
284
+ if value.is_a?(Array)
285
+ value.compact.map { |v| _to_hash(v) }
286
+ elsif value.is_a?(Hash)
287
+ {}.tap do |hash|
288
+ value.each { |k, v| hash[k] = _to_hash(v) }
289
+ end
290
+ elsif value.respond_to? :to_hash
291
+ value.to_hash
292
+ else
293
+ value
294
+ end
295
+ end
296
+
297
+ end
298
+ end
@@ -0,0 +1,232 @@
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 IntegrationLogQueryResponse
17
+ attr_accessor :error
18
+
19
+ attr_accessor :filter_values
20
+
21
+ attr_accessor :integration_logs
22
+
23
+ attr_accessor :metadata
24
+
25
+ # Indicates if API call was successful
26
+ attr_accessor :success
27
+
28
+ attr_accessor :warning
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'error' => :'error',
34
+ :'filter_values' => :'filter_values',
35
+ :'integration_logs' => :'integration_logs',
36
+ :'metadata' => :'metadata',
37
+ :'success' => :'success',
38
+ :'warning' => :'warning'
39
+ }
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.swagger_types
44
+ {
45
+ :'error' => :'Error',
46
+ :'filter_values' => :'IntegrationLogQueryFilterValues',
47
+ :'integration_logs' => :'Array<IntegrationLog>',
48
+ :'metadata' => :'ResponseMetadata',
49
+ :'success' => :'BOOLEAN',
50
+ :'warning' => :'Warning'
51
+ }
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ return unless attributes.is_a?(Hash)
58
+
59
+ # convert string to symbol for hash key
60
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
61
+
62
+ if attributes.has_key?(:'error')
63
+ self.error = attributes[:'error']
64
+ end
65
+
66
+ if attributes.has_key?(:'filter_values')
67
+ self.filter_values = attributes[:'filter_values']
68
+ end
69
+
70
+ if attributes.has_key?(:'integration_logs')
71
+ if (value = attributes[:'integration_logs']).is_a?(Array)
72
+ self.integration_logs = value
73
+ end
74
+ end
75
+
76
+ if attributes.has_key?(:'metadata')
77
+ self.metadata = attributes[:'metadata']
78
+ end
79
+
80
+ if attributes.has_key?(:'success')
81
+ self.success = attributes[:'success']
82
+ end
83
+
84
+ if attributes.has_key?(:'warning')
85
+ self.warning = attributes[:'warning']
86
+ end
87
+ end
88
+
89
+ # Show invalid properties with the reasons. Usually used together with valid?
90
+ # @return Array for valid properties with the reasons
91
+ def list_invalid_properties
92
+ invalid_properties = Array.new
93
+ invalid_properties
94
+ end
95
+
96
+ # Check to see if the all the properties in the model are valid
97
+ # @return true if the model is valid
98
+ def valid?
99
+ true
100
+ end
101
+
102
+ # Checks equality by comparing each attribute.
103
+ # @param [Object] Object to be compared
104
+ def ==(o)
105
+ return true if self.equal?(o)
106
+ self.class == o.class &&
107
+ error == o.error &&
108
+ filter_values == o.filter_values &&
109
+ integration_logs == o.integration_logs &&
110
+ metadata == o.metadata &&
111
+ success == o.success &&
112
+ warning == o.warning
113
+ end
114
+
115
+ # @see the `==` method
116
+ # @param [Object] Object to be compared
117
+ def eql?(o)
118
+ self == o
119
+ end
120
+
121
+ # Calculates hash code according to all attributes.
122
+ # @return [Fixnum] Hash code
123
+ def hash
124
+ [error, filter_values, integration_logs, metadata, success, warning].hash
125
+ end
126
+
127
+ # Builds the object from hash
128
+ # @param [Hash] attributes Model attributes in the form of hash
129
+ # @return [Object] Returns the model itself
130
+ def build_from_hash(attributes)
131
+ return nil unless attributes.is_a?(Hash)
132
+ self.class.swagger_types.each_pair do |key, type|
133
+ if type =~ /\AArray<(.*)>/i
134
+ # check to ensure the input is an array given that the attribute
135
+ # is documented as an array but the input is not
136
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
137
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
138
+ end
139
+ elsif !attributes[self.class.attribute_map[key]].nil?
140
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
141
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
142
+ end
143
+
144
+ self
145
+ end
146
+
147
+ # Deserializes the data based on type
148
+ # @param string type Data type
149
+ # @param string value Value to be deserialized
150
+ # @return [Object] Deserialized data
151
+ def _deserialize(type, value)
152
+ case type.to_sym
153
+ when :DateTime
154
+ DateTime.parse(value)
155
+ when :Date
156
+ Date.parse(value)
157
+ when :String
158
+ value.to_s
159
+ when :Integer
160
+ value.to_i
161
+ when :Float
162
+ value.to_f
163
+ when :BOOLEAN
164
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
165
+ true
166
+ else
167
+ false
168
+ end
169
+ when :Object
170
+ # generic object (usually a Hash), return directly
171
+ value
172
+ when /\AArray<(?<inner_type>.+)>\z/
173
+ inner_type = Regexp.last_match[:inner_type]
174
+ value.map { |v| _deserialize(inner_type, v) }
175
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
176
+ k_type = Regexp.last_match[:k_type]
177
+ v_type = Regexp.last_match[:v_type]
178
+ {}.tap do |hash|
179
+ value.each do |k, v|
180
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
181
+ end
182
+ end
183
+ else # model
184
+ temp_model = UltracartClient.const_get(type).new
185
+ temp_model.build_from_hash(value)
186
+ end
187
+ end
188
+
189
+ # Returns the string representation of the object
190
+ # @return [String] String presentation of the object
191
+ def to_s
192
+ to_hash.to_s
193
+ end
194
+
195
+ # to_body is an alias to to_hash (backward compatibility)
196
+ # @return [Hash] Returns the object in the form of hash
197
+ def to_body
198
+ to_hash
199
+ end
200
+
201
+ # Returns the object in the form of hash
202
+ # @return [Hash] Returns the object in the form of hash
203
+ def to_hash
204
+ hash = {}
205
+ self.class.attribute_map.each_pair do |attr, param|
206
+ value = self.send(attr)
207
+ next if value.nil?
208
+ hash[param] = _to_hash(value)
209
+ end
210
+ hash
211
+ end
212
+
213
+ # Outputs non-array value in the form of hash
214
+ # For object, use to_hash. Otherwise, just return the value
215
+ # @param [Object] value Any valid value
216
+ # @return [Hash] Returns the value in the form of hash
217
+ def _to_hash(value)
218
+ if value.is_a?(Array)
219
+ value.compact.map { |v| _to_hash(v) }
220
+ elsif value.is_a?(Hash)
221
+ {}.tap do |hash|
222
+ value.each { |k, v| hash[k] = _to_hash(v) }
223
+ end
224
+ elsif value.respond_to? :to_hash
225
+ value.to_hash
226
+ else
227
+ value
228
+ end
229
+ end
230
+
231
+ end
232
+ end