ultracart_api 3.1.48 → 3.2.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -28,14 +28,19 @@ module UltracartClient
28
28
 
29
29
  attr_accessor :item_ipn_oid
30
30
 
31
+ # Date/time the integration log was created
31
32
  attr_accessor :log_dts
32
33
 
33
34
  attr_accessor :log_type
34
35
 
35
36
  attr_accessor :logger_id
36
37
 
38
+ attr_accessor :logger_name
39
+
37
40
  attr_accessor :logs
38
41
 
42
+ attr_accessor :omit_log_map
43
+
39
44
  attr_accessor :order_ids
40
45
 
41
46
  attr_accessor :pk
@@ -44,6 +49,8 @@ module UltracartClient
44
49
 
45
50
  attr_accessor :status
46
51
 
52
+ attr_accessor :status_code
53
+
47
54
  # Attribute mapping from ruby-style variable name to JSON key.
48
55
  def self.attribute_map
49
56
  {
@@ -57,11 +64,14 @@ module UltracartClient
57
64
  :'log_dts' => :'log_dts',
58
65
  :'log_type' => :'log_type',
59
66
  :'logger_id' => :'logger_id',
67
+ :'logger_name' => :'logger_name',
60
68
  :'logs' => :'logs',
69
+ :'omit_log_map' => :'omit_log_map',
61
70
  :'order_ids' => :'order_ids',
62
71
  :'pk' => :'pk',
63
72
  :'sk' => :'sk',
64
- :'status' => :'status'
73
+ :'status' => :'status',
74
+ :'status_code' => :'status_code'
65
75
  }
66
76
  end
67
77
 
@@ -78,11 +88,14 @@ module UltracartClient
78
88
  :'log_dts' => :'String',
79
89
  :'log_type' => :'String',
80
90
  :'logger_id' => :'String',
91
+ :'logger_name' => :'String',
81
92
  :'logs' => :'Array<IntegrationLogLog>',
93
+ :'omit_log_map' => :'BOOLEAN',
82
94
  :'order_ids' => :'Array<String>',
83
95
  :'pk' => :'String',
84
96
  :'sk' => :'String',
85
- :'status' => :'String'
97
+ :'status' => :'String',
98
+ :'status_code' => :'Integer'
86
99
  }
87
100
  end
88
101
 
@@ -136,12 +149,20 @@ module UltracartClient
136
149
  self.logger_id = attributes[:'logger_id']
137
150
  end
138
151
 
152
+ if attributes.has_key?(:'logger_name')
153
+ self.logger_name = attributes[:'logger_name']
154
+ end
155
+
139
156
  if attributes.has_key?(:'logs')
140
157
  if (value = attributes[:'logs']).is_a?(Array)
141
158
  self.logs = value
142
159
  end
143
160
  end
144
161
 
162
+ if attributes.has_key?(:'omit_log_map')
163
+ self.omit_log_map = attributes[:'omit_log_map']
164
+ end
165
+
145
166
  if attributes.has_key?(:'order_ids')
146
167
  if (value = attributes[:'order_ids']).is_a?(Array)
147
168
  self.order_ids = value
@@ -159,6 +180,10 @@ module UltracartClient
159
180
  if attributes.has_key?(:'status')
160
181
  self.status = attributes[:'status']
161
182
  end
183
+
184
+ if attributes.has_key?(:'status_code')
185
+ self.status_code = attributes[:'status_code']
186
+ end
162
187
  end
163
188
 
164
189
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -189,11 +214,14 @@ module UltracartClient
189
214
  log_dts == o.log_dts &&
190
215
  log_type == o.log_type &&
191
216
  logger_id == o.logger_id &&
217
+ logger_name == o.logger_name &&
192
218
  logs == o.logs &&
219
+ omit_log_map == o.omit_log_map &&
193
220
  order_ids == o.order_ids &&
194
221
  pk == o.pk &&
195
222
  sk == o.sk &&
196
- status == o.status
223
+ status == o.status &&
224
+ status_code == o.status_code
197
225
  end
198
226
 
199
227
  # @see the `==` method
@@ -205,7 +233,7 @@ module UltracartClient
205
233
  # Calculates hash code according to all attributes.
206
234
  # @return [Fixnum] Hash code
207
235
  def hash
208
- [action, direction, email, files, integration_log_oid, item_id, item_ipn_oid, log_dts, log_type, logger_id, logs, order_ids, pk, sk, status].hash
236
+ [action, direction, email, files, integration_log_oid, item_id, item_ipn_oid, log_dts, log_type, logger_id, logger_name, logs, omit_log_map, order_ids, pk, sk, status, status_code].hash
209
237
  end
210
238
 
211
239
  # Builds the object from hash
@@ -14,6 +14,8 @@ require 'date'
14
14
 
15
15
  module UltracartClient
16
16
  class IntegrationLogFile
17
+ attr_accessor :mime_type
18
+
17
19
  attr_accessor :name
18
20
 
19
21
  attr_accessor :size
@@ -23,6 +25,7 @@ module UltracartClient
23
25
  # Attribute mapping from ruby-style variable name to JSON key.
24
26
  def self.attribute_map
25
27
  {
28
+ :'mime_type' => :'mime_type',
26
29
  :'name' => :'name',
27
30
  :'size' => :'size',
28
31
  :'uuid' => :'uuid'
@@ -32,6 +35,7 @@ module UltracartClient
32
35
  # Attribute type mapping.
33
36
  def self.swagger_types
34
37
  {
38
+ :'mime_type' => :'String',
35
39
  :'name' => :'String',
36
40
  :'size' => :'Integer',
37
41
  :'uuid' => :'String'
@@ -46,6 +50,10 @@ module UltracartClient
46
50
  # convert string to symbol for hash key
47
51
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
48
52
 
53
+ if attributes.has_key?(:'mime_type')
54
+ self.mime_type = attributes[:'mime_type']
55
+ end
56
+
49
57
  if attributes.has_key?(:'name')
50
58
  self.name = attributes[:'name']
51
59
  end
@@ -77,6 +85,7 @@ module UltracartClient
77
85
  def ==(o)
78
86
  return true if self.equal?(o)
79
87
  self.class == o.class &&
88
+ mime_type == o.mime_type &&
80
89
  name == o.name &&
81
90
  size == o.size &&
82
91
  uuid == o.uuid
@@ -91,7 +100,7 @@ module UltracartClient
91
100
  # Calculates hash code according to all attributes.
92
101
  # @return [Fixnum] Hash code
93
102
  def hash
94
- [name, size, uuid].hash
103
+ [mime_type, name, size, uuid].hash
95
104
  end
96
105
 
97
106
  # Builds the object from hash
@@ -26,8 +26,16 @@ module UltracartClient
26
26
 
27
27
  attr_accessor :item_ipn_oids
28
28
 
29
+ # Maximum date/time log date/time
30
+ attr_accessor :log_dts_max
31
+
32
+ # Minimum date/time log date/time
33
+ attr_accessor :log_dts_min
34
+
29
35
  attr_accessor :log_types
30
36
 
37
+ attr_accessor :logger_names
38
+
31
39
  attr_accessor :order_ids
32
40
 
33
41
  attr_accessor :statuses
@@ -41,7 +49,10 @@ module UltracartClient
41
49
  :'file_names' => :'file_names',
42
50
  :'item_ids' => :'item_ids',
43
51
  :'item_ipn_oids' => :'item_ipn_oids',
52
+ :'log_dts_max' => :'log_dts_max',
53
+ :'log_dts_min' => :'log_dts_min',
44
54
  :'log_types' => :'log_types',
55
+ :'logger_names' => :'logger_names',
45
56
  :'order_ids' => :'order_ids',
46
57
  :'statuses' => :'statuses'
47
58
  }
@@ -56,7 +67,10 @@ module UltracartClient
56
67
  :'file_names' => :'Array<String>',
57
68
  :'item_ids' => :'Array<String>',
58
69
  :'item_ipn_oids' => :'Array<Integer>',
70
+ :'log_dts_max' => :'String',
71
+ :'log_dts_min' => :'String',
59
72
  :'log_types' => :'Array<String>',
73
+ :'logger_names' => :'Array<String>',
60
74
  :'order_ids' => :'Array<String>',
61
75
  :'statuses' => :'Array<String>'
62
76
  }
@@ -106,12 +120,26 @@ module UltracartClient
106
120
  end
107
121
  end
108
122
 
123
+ if attributes.has_key?(:'log_dts_max')
124
+ self.log_dts_max = attributes[:'log_dts_max']
125
+ end
126
+
127
+ if attributes.has_key?(:'log_dts_min')
128
+ self.log_dts_min = attributes[:'log_dts_min']
129
+ end
130
+
109
131
  if attributes.has_key?(:'log_types')
110
132
  if (value = attributes[:'log_types']).is_a?(Array)
111
133
  self.log_types = value
112
134
  end
113
135
  end
114
136
 
137
+ if attributes.has_key?(:'logger_names')
138
+ if (value = attributes[:'logger_names']).is_a?(Array)
139
+ self.logger_names = value
140
+ end
141
+ end
142
+
115
143
  if attributes.has_key?(:'order_ids')
116
144
  if (value = attributes[:'order_ids']).is_a?(Array)
117
145
  self.order_ids = value
@@ -149,7 +177,10 @@ module UltracartClient
149
177
  file_names == o.file_names &&
150
178
  item_ids == o.item_ids &&
151
179
  item_ipn_oids == o.item_ipn_oids &&
180
+ log_dts_max == o.log_dts_max &&
181
+ log_dts_min == o.log_dts_min &&
152
182
  log_types == o.log_types &&
183
+ logger_names == o.logger_names &&
153
184
  order_ids == o.order_ids &&
154
185
  statuses == o.statuses
155
186
  end
@@ -163,7 +194,7 @@ module UltracartClient
163
194
  # Calculates hash code according to all attributes.
164
195
  # @return [Fixnum] Hash code
165
196
  def hash
166
- [actions, directions, emails, file_names, item_ids, item_ipn_oids, log_types, order_ids, statuses].hash
197
+ [actions, directions, emails, file_names, item_ids, item_ipn_oids, log_dts_max, log_dts_min, log_types, logger_names, order_ids, statuses].hash
167
198
  end
168
199
 
169
200
  # Builds the object from hash
@@ -36,6 +36,8 @@ module UltracartClient
36
36
 
37
37
  attr_accessor :logger_id
38
38
 
39
+ attr_accessor :logger_name
40
+
39
41
  attr_accessor :order_ids
40
42
 
41
43
  attr_accessor :status
@@ -53,6 +55,7 @@ module UltracartClient
53
55
  :'log_dts_end' => :'log_dts_end',
54
56
  :'log_type' => :'log_type',
55
57
  :'logger_id' => :'logger_id',
58
+ :'logger_name' => :'logger_name',
56
59
  :'order_ids' => :'order_ids',
57
60
  :'status' => :'status'
58
61
  }
@@ -71,6 +74,7 @@ module UltracartClient
71
74
  :'log_dts_end' => :'String',
72
75
  :'log_type' => :'String',
73
76
  :'logger_id' => :'String',
77
+ :'logger_name' => :'String',
74
78
  :'order_ids' => :'Array<String>',
75
79
  :'status' => :'String'
76
80
  }
@@ -126,6 +130,10 @@ module UltracartClient
126
130
  self.logger_id = attributes[:'logger_id']
127
131
  end
128
132
 
133
+ if attributes.has_key?(:'logger_name')
134
+ self.logger_name = attributes[:'logger_name']
135
+ end
136
+
129
137
  if attributes.has_key?(:'order_ids')
130
138
  if (value = attributes[:'order_ids']).is_a?(Array)
131
139
  self.order_ids = value
@@ -165,6 +173,7 @@ module UltracartClient
165
173
  log_dts_end == o.log_dts_end &&
166
174
  log_type == o.log_type &&
167
175
  logger_id == o.logger_id &&
176
+ logger_name == o.logger_name &&
168
177
  order_ids == o.order_ids &&
169
178
  status == o.status
170
179
  end
@@ -178,7 +187,7 @@ module UltracartClient
178
187
  # Calculates hash code according to all attributes.
179
188
  # @return [Fixnum] Hash code
180
189
  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
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
182
191
  end
183
192
 
184
193
  # Builds the object from hash
@@ -0,0 +1,221 @@
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 IntegrationLogResponse
17
+ attr_accessor :error
18
+
19
+ attr_accessor :integration_log
20
+
21
+ attr_accessor :metadata
22
+
23
+ # Indicates if API call was successful
24
+ attr_accessor :success
25
+
26
+ attr_accessor :warning
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'error' => :'error',
32
+ :'integration_log' => :'integration_log',
33
+ :'metadata' => :'metadata',
34
+ :'success' => :'success',
35
+ :'warning' => :'warning'
36
+ }
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.swagger_types
41
+ {
42
+ :'error' => :'Error',
43
+ :'integration_log' => :'IntegrationLog',
44
+ :'metadata' => :'ResponseMetadata',
45
+ :'success' => :'BOOLEAN',
46
+ :'warning' => :'Warning'
47
+ }
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ return unless attributes.is_a?(Hash)
54
+
55
+ # convert string to symbol for hash key
56
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
57
+
58
+ if attributes.has_key?(:'error')
59
+ self.error = attributes[:'error']
60
+ end
61
+
62
+ if attributes.has_key?(:'integration_log')
63
+ self.integration_log = attributes[:'integration_log']
64
+ end
65
+
66
+ if attributes.has_key?(:'metadata')
67
+ self.metadata = attributes[:'metadata']
68
+ end
69
+
70
+ if attributes.has_key?(:'success')
71
+ self.success = attributes[:'success']
72
+ end
73
+
74
+ if attributes.has_key?(:'warning')
75
+ self.warning = attributes[:'warning']
76
+ end
77
+ end
78
+
79
+ # Show invalid properties with the reasons. Usually used together with valid?
80
+ # @return Array for valid properties with the reasons
81
+ def list_invalid_properties
82
+ invalid_properties = Array.new
83
+ invalid_properties
84
+ end
85
+
86
+ # Check to see if the all the properties in the model are valid
87
+ # @return true if the model is valid
88
+ def valid?
89
+ true
90
+ end
91
+
92
+ # Checks equality by comparing each attribute.
93
+ # @param [Object] Object to be compared
94
+ def ==(o)
95
+ return true if self.equal?(o)
96
+ self.class == o.class &&
97
+ error == o.error &&
98
+ integration_log == o.integration_log &&
99
+ metadata == o.metadata &&
100
+ success == o.success &&
101
+ warning == o.warning
102
+ end
103
+
104
+ # @see the `==` method
105
+ # @param [Object] Object to be compared
106
+ def eql?(o)
107
+ self == o
108
+ end
109
+
110
+ # Calculates hash code according to all attributes.
111
+ # @return [Fixnum] Hash code
112
+ def hash
113
+ [error, integration_log, metadata, success, warning].hash
114
+ end
115
+
116
+ # Builds the object from hash
117
+ # @param [Hash] attributes Model attributes in the form of hash
118
+ # @return [Object] Returns the model itself
119
+ def build_from_hash(attributes)
120
+ return nil unless attributes.is_a?(Hash)
121
+ self.class.swagger_types.each_pair do |key, type|
122
+ if type =~ /\AArray<(.*)>/i
123
+ # check to ensure the input is an array given that the attribute
124
+ # is documented as an array but the input is not
125
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
126
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
127
+ end
128
+ elsif !attributes[self.class.attribute_map[key]].nil?
129
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
130
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
131
+ end
132
+
133
+ self
134
+ end
135
+
136
+ # Deserializes the data based on type
137
+ # @param string type Data type
138
+ # @param string value Value to be deserialized
139
+ # @return [Object] Deserialized data
140
+ def _deserialize(type, value)
141
+ case type.to_sym
142
+ when :DateTime
143
+ DateTime.parse(value)
144
+ when :Date
145
+ Date.parse(value)
146
+ when :String
147
+ value.to_s
148
+ when :Integer
149
+ value.to_i
150
+ when :Float
151
+ value.to_f
152
+ when :BOOLEAN
153
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
154
+ true
155
+ else
156
+ false
157
+ end
158
+ when :Object
159
+ # generic object (usually a Hash), return directly
160
+ value
161
+ when /\AArray<(?<inner_type>.+)>\z/
162
+ inner_type = Regexp.last_match[:inner_type]
163
+ value.map { |v| _deserialize(inner_type, v) }
164
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
165
+ k_type = Regexp.last_match[:k_type]
166
+ v_type = Regexp.last_match[:v_type]
167
+ {}.tap do |hash|
168
+ value.each do |k, v|
169
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
170
+ end
171
+ end
172
+ else # model
173
+ temp_model = UltracartClient.const_get(type).new
174
+ temp_model.build_from_hash(value)
175
+ end
176
+ end
177
+
178
+ # Returns the string representation of the object
179
+ # @return [String] String presentation of the object
180
+ def to_s
181
+ to_hash.to_s
182
+ end
183
+
184
+ # to_body is an alias to to_hash (backward compatibility)
185
+ # @return [Hash] Returns the object in the form of hash
186
+ def to_body
187
+ to_hash
188
+ end
189
+
190
+ # Returns the object in the form of hash
191
+ # @return [Hash] Returns the object in the form of hash
192
+ def to_hash
193
+ hash = {}
194
+ self.class.attribute_map.each_pair do |attr, param|
195
+ value = self.send(attr)
196
+ next if value.nil?
197
+ hash[param] = _to_hash(value)
198
+ end
199
+ hash
200
+ end
201
+
202
+ # Outputs non-array value in the form of hash
203
+ # For object, use to_hash. Otherwise, just return the value
204
+ # @param [Object] value Any valid value
205
+ # @return [Hash] Returns the value in the form of hash
206
+ def _to_hash(value)
207
+ if value.is_a?(Array)
208
+ value.compact.map { |v| _to_hash(v) }
209
+ elsif value.is_a?(Hash)
210
+ {}.tap do |hash|
211
+ value.each { |k, v| hash[k] = _to_hash(v) }
212
+ end
213
+ elsif value.respond_to? :to_hash
214
+ value.to_hash
215
+ else
216
+ value
217
+ end
218
+ end
219
+
220
+ end
221
+ end