ultracart_api 4.0.141 → 4.0.143

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