ultracart_api 4.0.140 → 4.0.142

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +37 -4
  3. data/docs/DatawarehouseApi.md +651 -0
  4. data/docs/OrderRefundableResponse.md +2 -0
  5. data/docs/Report.md +36 -0
  6. data/docs/ReportAuth.md +24 -0
  7. data/docs/ReportAuthResponse.md +26 -0
  8. data/docs/ReportDataSet.md +46 -0
  9. data/docs/ReportDataSetColumn.md +18 -0
  10. data/docs/ReportDataSetPage.md +36 -0
  11. data/docs/ReportDataSetPageResponse.md +26 -0
  12. data/docs/ReportDataSetQuery.md +40 -0
  13. data/docs/ReportDataSetResponse.md +26 -0
  14. data/docs/ReportDataSetRow.md +18 -0
  15. data/docs/ReportDataSetSchema.md +20 -0
  16. data/docs/ReportDataSource.md +28 -0
  17. data/docs/ReportDataSourceSchema.md +22 -0
  18. data/docs/ReportExecuteQueriesRequest.md +30 -0
  19. data/docs/ReportFilter.md +28 -0
  20. data/docs/ReportFilterConnection.md +20 -0
  21. data/docs/ReportPage.md +24 -0
  22. data/docs/ReportPageVisualization.md +34 -0
  23. data/docs/ReportPageVisualizationDimension.md +30 -0
  24. data/docs/ReportPageVisualizationMetric.md +24 -0
  25. data/docs/ReportResponse.md +26 -0
  26. data/docs/ReportsResponse.md +26 -0
  27. data/lib/ultracart_api/api/datawarehouse_api.rb +626 -0
  28. data/lib/ultracart_api/models/order_refundable_response.rb +11 -1
  29. data/lib/ultracart_api/models/report.rb +342 -0
  30. data/lib/ultracart_api/models/report_auth.rb +247 -0
  31. data/lib/ultracart_api/models/report_auth_response.rb +256 -0
  32. data/lib/ultracart_api/models/report_data_set.rb +397 -0
  33. data/lib/ultracart_api/models/report_data_set_column.rb +219 -0
  34. data/lib/ultracart_api/models/report_data_set_page.rb +308 -0
  35. data/lib/ultracart_api/models/report_data_set_page_response.rb +256 -0
  36. data/lib/ultracart_api/models/report_data_set_query.rb +365 -0
  37. data/lib/ultracart_api/models/report_data_set_response.rb +256 -0
  38. data/lib/ultracart_api/models/report_data_set_row.rb +221 -0
  39. data/lib/ultracart_api/models/report_data_set_schema.rb +263 -0
  40. data/lib/ultracart_api/models/report_data_source.rb +267 -0
  41. data/lib/ultracart_api/models/report_data_source_schema.rb +273 -0
  42. data/lib/ultracart_api/models/report_execute_queries_request.rb +313 -0
  43. data/lib/ultracart_api/models/report_filter.rb +307 -0
  44. data/lib/ultracart_api/models/report_filter_connection.rb +228 -0
  45. data/lib/ultracart_api/models/report_page.rb +251 -0
  46. data/lib/ultracart_api/models/report_page_visualization.rb +334 -0
  47. data/lib/ultracart_api/models/report_page_visualization_dimension.rb +279 -0
  48. data/lib/ultracart_api/models/report_page_visualization_metric.rb +283 -0
  49. data/lib/ultracart_api/models/report_response.rb +256 -0
  50. data/lib/ultracart_api/models/reports_response.rb +258 -0
  51. data/lib/ultracart_api/version.rb +1 -1
  52. data/lib/ultracart_api.rb +23 -0
  53. metadata +48 -2
@@ -0,0 +1,307 @@
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 ReportFilter
18
+ # How this filter connects to the data sources and columns
19
+ attr_accessor :connections
20
+
21
+ attr_accessor :name
22
+
23
+ # The timezone that the date range is querying on.
24
+ attr_accessor :timezone
25
+
26
+ # Type of filter
27
+ attr_accessor :type
28
+
29
+ # Unique UUID assigned to the filter. Assists when returning values that the filter can use.
30
+ attr_accessor :uuid
31
+
32
+ # The selected values for the filter. When used, some type conversion will need to occur.
33
+ attr_accessor :values
34
+
35
+ class EnumAttributeValidator
36
+ attr_reader :datatype
37
+ attr_reader :allowable_values
38
+
39
+ def initialize(datatype, allowable_values)
40
+ @allowable_values = allowable_values.map do |value|
41
+ case datatype.to_s
42
+ when /Integer/i
43
+ value.to_i
44
+ when /Float/i
45
+ value.to_f
46
+ else
47
+ value
48
+ end
49
+ end
50
+ end
51
+
52
+ def valid?(value)
53
+ !value || allowable_values.include?(value)
54
+ end
55
+ end
56
+
57
+ # Attribute mapping from ruby-style variable name to JSON key.
58
+ def self.attribute_map
59
+ {
60
+ :'connections' => :'connections',
61
+ :'name' => :'name',
62
+ :'timezone' => :'timezone',
63
+ :'type' => :'type',
64
+ :'uuid' => :'uuid',
65
+ :'values' => :'values'
66
+ }
67
+ end
68
+
69
+ # Returns all the JSON keys this model knows about
70
+ def self.acceptable_attributes
71
+ attribute_map.values
72
+ end
73
+
74
+ # Attribute type mapping.
75
+ def self.openapi_types
76
+ {
77
+ :'connections' => :'Array<ReportFilterConnection>',
78
+ :'name' => :'String',
79
+ :'timezone' => :'String',
80
+ :'type' => :'String',
81
+ :'uuid' => :'String',
82
+ :'values' => :'Array<String>'
83
+ }
84
+ end
85
+
86
+ # List of attributes with nullable: true
87
+ def self.openapi_nullable
88
+ Set.new([
89
+ ])
90
+ end
91
+
92
+ # Initializes the object
93
+ # @param [Hash] attributes Model attributes in the form of hash
94
+ def initialize(attributes = {})
95
+ if (!attributes.is_a?(Hash))
96
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::ReportFilter` initialize method"
97
+ end
98
+
99
+ # check to see if the attribute exists and convert string to symbol for hash key
100
+ attributes = attributes.each_with_object({}) { |(k, v), h|
101
+ if (!self.class.attribute_map.key?(k.to_sym))
102
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::ReportFilter`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
103
+ end
104
+ h[k.to_sym] = v
105
+ }
106
+
107
+ if attributes.key?(:'connections')
108
+ if (value = attributes[:'connections']).is_a?(Array)
109
+ self.connections = value
110
+ end
111
+ end
112
+
113
+ if attributes.key?(:'name')
114
+ self.name = attributes[:'name']
115
+ end
116
+
117
+ if attributes.key?(:'timezone')
118
+ self.timezone = attributes[:'timezone']
119
+ end
120
+
121
+ if attributes.key?(:'type')
122
+ self.type = attributes[:'type']
123
+ end
124
+
125
+ if attributes.key?(:'uuid')
126
+ self.uuid = attributes[:'uuid']
127
+ end
128
+
129
+ if attributes.key?(:'values')
130
+ if (value = attributes[:'values']).is_a?(Array)
131
+ self.values = value
132
+ end
133
+ end
134
+ end
135
+
136
+ # Show invalid properties with the reasons. Usually used together with valid?
137
+ # @return Array for valid properties with the reasons
138
+ def list_invalid_properties
139
+ invalid_properties = Array.new
140
+ invalid_properties
141
+ end
142
+
143
+ # Check to see if the all the properties in the model are valid
144
+ # @return true if the model is valid
145
+ def valid?
146
+ type_validator = EnumAttributeValidator.new('String', ["date range", "date comparison", "single value", "multiple values"])
147
+ return false unless type_validator.valid?(@type)
148
+ true
149
+ end
150
+
151
+ # Custom attribute writer method checking allowed values (enum).
152
+ # @param [Object] type Object to be assigned
153
+ def type=(type)
154
+ validator = EnumAttributeValidator.new('String', ["date range", "date comparison", "single value", "multiple values"])
155
+ unless validator.valid?(type)
156
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
157
+ end
158
+ @type = type
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
+ connections == o.connections &&
167
+ name == o.name &&
168
+ timezone == o.timezone &&
169
+ type == o.type &&
170
+ uuid == o.uuid &&
171
+ values == o.values
172
+ end
173
+
174
+ # @see the `==` method
175
+ # @param [Object] Object to be compared
176
+ def eql?(o)
177
+ self == o
178
+ end
179
+
180
+ # Calculates hash code according to all attributes.
181
+ # @return [Integer] Hash code
182
+ def hash
183
+ [connections, name, timezone, type, uuid, values].hash
184
+ end
185
+
186
+ # Builds the object from hash
187
+ # @param [Hash] attributes Model attributes in the form of hash
188
+ # @return [Object] Returns the model itself
189
+ def self.build_from_hash(attributes)
190
+ new.build_from_hash(attributes)
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
+ attributes = attributes.transform_keys(&:to_sym)
199
+ self.class.openapi_types.each_pair do |key, type|
200
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
201
+ self.send("#{key}=", nil)
202
+ elsif type =~ /\AArray<(.*)>/i
203
+ # check to ensure the input is an array given that the attribute
204
+ # is documented as an array but the input is not
205
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
206
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
207
+ end
208
+ elsif !attributes[self.class.attribute_map[key]].nil?
209
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
210
+ end
211
+ end
212
+
213
+ self
214
+ end
215
+
216
+ # Deserializes the data based on type
217
+ # @param string type Data type
218
+ # @param string value Value to be deserialized
219
+ # @return [Object] Deserialized data
220
+ def _deserialize(type, value)
221
+ case type.to_sym
222
+ when :Time
223
+ Time.parse(value)
224
+ when :Date
225
+ Date.parse(value)
226
+ when :String
227
+ value.to_s
228
+ when :Integer
229
+ value.to_i
230
+ when :Float
231
+ value.to_f
232
+ when :Boolean
233
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
234
+ true
235
+ else
236
+ false
237
+ end
238
+ when :Object
239
+ # generic object (usually a Hash), return directly
240
+ value
241
+ when /\AArray<(?<inner_type>.+)>\z/
242
+ inner_type = Regexp.last_match[:inner_type]
243
+ value.map { |v| _deserialize(inner_type, v) }
244
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
245
+ k_type = Regexp.last_match[:k_type]
246
+ v_type = Regexp.last_match[:v_type]
247
+ {}.tap do |hash|
248
+ value.each do |k, v|
249
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
250
+ end
251
+ end
252
+ else # model
253
+ # models (e.g. Pet) or oneOf
254
+ klass = UltracartClient.const_get(type)
255
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
256
+ end
257
+ end
258
+
259
+ # Returns the string representation of the object
260
+ # @return [String] String presentation of the object
261
+ def to_s
262
+ to_hash.to_s
263
+ end
264
+
265
+ # to_body is an alias to to_hash (backward compatibility)
266
+ # @return [Hash] Returns the object in the form of hash
267
+ def to_body
268
+ to_hash
269
+ end
270
+
271
+ # Returns the object in the form of hash
272
+ # @return [Hash] Returns the object in the form of hash
273
+ def to_hash
274
+ hash = {}
275
+ self.class.attribute_map.each_pair do |attr, param|
276
+ value = self.send(attr)
277
+ if value.nil?
278
+ is_nullable = self.class.openapi_nullable.include?(attr)
279
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
280
+ end
281
+
282
+ hash[param] = _to_hash(value)
283
+ end
284
+ hash
285
+ end
286
+
287
+ # Outputs non-array value in the form of hash
288
+ # For object, use to_hash. Otherwise, just return the value
289
+ # @param [Object] value Any valid value
290
+ # @return [Hash] Returns the value in the form of hash
291
+ def _to_hash(value)
292
+ if value.is_a?(Array)
293
+ value.compact.map { |v| _to_hash(v) }
294
+ elsif value.is_a?(Hash)
295
+ {}.tap do |hash|
296
+ value.each { |k, v| hash[k] = _to_hash(v) }
297
+ end
298
+ elsif value.respond_to? :to_hash
299
+ value.to_hash
300
+ else
301
+ value
302
+ end
303
+ end
304
+
305
+ end
306
+
307
+ end
@@ -0,0 +1,228 @@
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 ReportFilterConnection
18
+ attr_accessor :column
19
+
20
+ attr_accessor :data_source_name
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'column' => :'column',
26
+ :'data_source_name' => :'data_source_name'
27
+ }
28
+ end
29
+
30
+ # Returns all the JSON keys this model knows about
31
+ def self.acceptable_attributes
32
+ attribute_map.values
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ def self.openapi_types
37
+ {
38
+ :'column' => :'String',
39
+ :'data_source_name' => :'String'
40
+ }
41
+ end
42
+
43
+ # List of attributes with nullable: true
44
+ def self.openapi_nullable
45
+ Set.new([
46
+ ])
47
+ end
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ def initialize(attributes = {})
52
+ if (!attributes.is_a?(Hash))
53
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::ReportFilterConnection` initialize method"
54
+ end
55
+
56
+ # check to see if the attribute exists and convert string to symbol for hash key
57
+ attributes = attributes.each_with_object({}) { |(k, v), h|
58
+ if (!self.class.attribute_map.key?(k.to_sym))
59
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::ReportFilterConnection`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
60
+ end
61
+ h[k.to_sym] = v
62
+ }
63
+
64
+ if attributes.key?(:'column')
65
+ self.column = attributes[:'column']
66
+ end
67
+
68
+ if attributes.key?(:'data_source_name')
69
+ self.data_source_name = attributes[:'data_source_name']
70
+ end
71
+ end
72
+
73
+ # Show invalid properties with the reasons. Usually used together with valid?
74
+ # @return Array for valid properties with the reasons
75
+ def list_invalid_properties
76
+ invalid_properties = Array.new
77
+ invalid_properties
78
+ end
79
+
80
+ # Check to see if the all the properties in the model are valid
81
+ # @return true if the model is valid
82
+ def valid?
83
+ true
84
+ end
85
+
86
+ # Checks equality by comparing each attribute.
87
+ # @param [Object] Object to be compared
88
+ def ==(o)
89
+ return true if self.equal?(o)
90
+ self.class == o.class &&
91
+ column == o.column &&
92
+ data_source_name == o.data_source_name
93
+ end
94
+
95
+ # @see the `==` method
96
+ # @param [Object] Object to be compared
97
+ def eql?(o)
98
+ self == o
99
+ end
100
+
101
+ # Calculates hash code according to all attributes.
102
+ # @return [Integer] Hash code
103
+ def hash
104
+ [column, data_source_name].hash
105
+ end
106
+
107
+ # Builds the object from hash
108
+ # @param [Hash] attributes Model attributes in the form of hash
109
+ # @return [Object] Returns the model itself
110
+ def self.build_from_hash(attributes)
111
+ new.build_from_hash(attributes)
112
+ end
113
+
114
+ # Builds the object from hash
115
+ # @param [Hash] attributes Model attributes in the form of hash
116
+ # @return [Object] Returns the model itself
117
+ def build_from_hash(attributes)
118
+ return nil unless attributes.is_a?(Hash)
119
+ attributes = attributes.transform_keys(&:to_sym)
120
+ self.class.openapi_types.each_pair do |key, type|
121
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
122
+ self.send("#{key}=", nil)
123
+ elsif type =~ /\AArray<(.*)>/i
124
+ # check to ensure the input is an array given that the attribute
125
+ # is documented as an array but the input is not
126
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
127
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
128
+ end
129
+ elsif !attributes[self.class.attribute_map[key]].nil?
130
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
131
+ end
132
+ end
133
+
134
+ self
135
+ end
136
+
137
+ # Deserializes the data based on type
138
+ # @param string type Data type
139
+ # @param string value Value to be deserialized
140
+ # @return [Object] Deserialized data
141
+ def _deserialize(type, value)
142
+ case type.to_sym
143
+ when :Time
144
+ Time.parse(value)
145
+ when :Date
146
+ Date.parse(value)
147
+ when :String
148
+ value.to_s
149
+ when :Integer
150
+ value.to_i
151
+ when :Float
152
+ value.to_f
153
+ when :Boolean
154
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
155
+ true
156
+ else
157
+ false
158
+ end
159
+ when :Object
160
+ # generic object (usually a Hash), return directly
161
+ value
162
+ when /\AArray<(?<inner_type>.+)>\z/
163
+ inner_type = Regexp.last_match[:inner_type]
164
+ value.map { |v| _deserialize(inner_type, v) }
165
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
166
+ k_type = Regexp.last_match[:k_type]
167
+ v_type = Regexp.last_match[:v_type]
168
+ {}.tap do |hash|
169
+ value.each do |k, v|
170
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
171
+ end
172
+ end
173
+ else # model
174
+ # models (e.g. Pet) or oneOf
175
+ klass = UltracartClient.const_get(type)
176
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
177
+ end
178
+ end
179
+
180
+ # Returns the string representation of the object
181
+ # @return [String] String presentation of the object
182
+ def to_s
183
+ to_hash.to_s
184
+ end
185
+
186
+ # to_body is an alias to to_hash (backward compatibility)
187
+ # @return [Hash] Returns the object in the form of hash
188
+ def to_body
189
+ to_hash
190
+ end
191
+
192
+ # Returns the object in the form of hash
193
+ # @return [Hash] Returns the object in the form of hash
194
+ def to_hash
195
+ hash = {}
196
+ self.class.attribute_map.each_pair do |attr, param|
197
+ value = self.send(attr)
198
+ if value.nil?
199
+ is_nullable = self.class.openapi_nullable.include?(attr)
200
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
201
+ end
202
+
203
+ hash[param] = _to_hash(value)
204
+ end
205
+ hash
206
+ end
207
+
208
+ # Outputs non-array value in the form of hash
209
+ # For object, use to_hash. Otherwise, just return the value
210
+ # @param [Object] value Any valid value
211
+ # @return [Hash] Returns the value in the form of hash
212
+ def _to_hash(value)
213
+ if value.is_a?(Array)
214
+ value.compact.map { |v| _to_hash(v) }
215
+ elsif value.is_a?(Hash)
216
+ {}.tap do |hash|
217
+ value.each { |k, v| hash[k] = _to_hash(v) }
218
+ end
219
+ elsif value.respond_to? :to_hash
220
+ value.to_hash
221
+ else
222
+ value
223
+ end
224
+ end
225
+
226
+ end
227
+
228
+ end