ultracart_api 3.1.47 → 3.1.48

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