ultracart_api 3.10.124 → 3.10.126

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 +461 -0
  4. data/docs/Report.md +17 -0
  5. data/docs/ReportAuth.md +11 -0
  6. data/docs/ReportAuthResponse.md +12 -0
  7. data/docs/ReportDataSet.md +22 -0
  8. data/docs/ReportDataSetColumn.md +8 -0
  9. data/docs/ReportDataSetPage.md +17 -0
  10. data/docs/ReportDataSetPageResponse.md +12 -0
  11. data/docs/ReportDataSetQuery.md +19 -0
  12. data/docs/ReportDataSetResponse.md +12 -0
  13. data/docs/ReportDataSetRow.md +8 -0
  14. data/docs/ReportDataSetSchema.md +9 -0
  15. data/docs/ReportDataSetSummary.md +14 -0
  16. data/docs/ReportDataSource.md +13 -0
  17. data/docs/ReportDataSourceSchema.md +10 -0
  18. data/docs/ReportExecuteQueriesRequest.md +14 -0
  19. data/docs/ReportFilter.md +13 -0
  20. data/docs/ReportFilterConnection.md +9 -0
  21. data/docs/ReportPage.md +11 -0
  22. data/docs/ReportPageVisualization.md +16 -0
  23. data/docs/ReportPageVisualizationDimension.md +14 -0
  24. data/docs/ReportPageVisualizationMetric.md +11 -0
  25. data/docs/ReportResponse.md +12 -0
  26. data/docs/ReportWebsocketEvent.md +9 -0
  27. data/docs/ReportsResponse.md +12 -0
  28. data/lib/ultracart_api/api/datawarehouse_api.rb +529 -0
  29. data/lib/ultracart_api/models/report.rb +307 -0
  30. data/lib/ultracart_api/models/report_auth.rb +212 -0
  31. data/lib/ultracart_api/models/report_auth_response.rb +221 -0
  32. data/lib/ultracart_api/models/report_data_set.rb +362 -0
  33. data/lib/ultracart_api/models/report_data_set_column.rb +184 -0
  34. data/lib/ultracart_api/models/report_data_set_page.rb +273 -0
  35. data/lib/ultracart_api/models/report_data_set_page_response.rb +221 -0
  36. data/lib/ultracart_api/models/report_data_set_query.rb +330 -0
  37. data/lib/ultracart_api/models/report_data_set_response.rb +221 -0
  38. data/lib/ultracart_api/models/report_data_set_row.rb +186 -0
  39. data/lib/ultracart_api/models/report_data_set_schema.rb +228 -0
  40. data/lib/ultracart_api/models/report_data_set_summary.rb +281 -0
  41. data/lib/ultracart_api/models/report_data_source.rb +232 -0
  42. data/lib/ultracart_api/models/report_data_source_schema.rb +238 -0
  43. data/lib/ultracart_api/models/report_execute_queries_request.rb +278 -0
  44. data/lib/ultracart_api/models/report_filter.rb +272 -0
  45. data/lib/ultracart_api/models/report_filter_connection.rb +193 -0
  46. data/lib/ultracart_api/models/report_page.rb +216 -0
  47. data/lib/ultracart_api/models/report_page_visualization.rb +299 -0
  48. data/lib/ultracart_api/models/report_page_visualization_dimension.rb +244 -0
  49. data/lib/ultracart_api/models/report_page_visualization_metric.rb +248 -0
  50. data/lib/ultracart_api/models/report_response.rb +221 -0
  51. data/lib/ultracart_api/models/report_websocket_event.rb +228 -0
  52. data/lib/ultracart_api/models/reports_response.rb +223 -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,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 ReportDataSource
17
+ attr_accessor :name
18
+
19
+ attr_accessor :partition_date_column
20
+
21
+ attr_accessor :partition_date_safety_days
22
+
23
+ # The partition date strategy, defaults to weekly sunday
24
+ attr_accessor :partition_date_strategy
25
+
26
+ attr_accessor :schema
27
+
28
+ attr_accessor :sql
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'name' => :'name',
34
+ :'partition_date_column' => :'partition_date_column',
35
+ :'partition_date_safety_days' => :'partition_date_safety_days',
36
+ :'partition_date_strategy' => :'partition_date_strategy',
37
+ :'schema' => :'schema',
38
+ :'sql' => :'sql'
39
+ }
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.swagger_types
44
+ {
45
+ :'name' => :'String',
46
+ :'partition_date_column' => :'String',
47
+ :'partition_date_safety_days' => :'Integer',
48
+ :'partition_date_strategy' => :'String',
49
+ :'schema' => :'Array<ReportDataSourceSchema>',
50
+ :'sql' => :'String'
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?(:'name')
63
+ self.name = attributes[:'name']
64
+ end
65
+
66
+ if attributes.has_key?(:'partition_date_column')
67
+ self.partition_date_column = attributes[:'partition_date_column']
68
+ end
69
+
70
+ if attributes.has_key?(:'partition_date_safety_days')
71
+ self.partition_date_safety_days = attributes[:'partition_date_safety_days']
72
+ end
73
+
74
+ if attributes.has_key?(:'partition_date_strategy')
75
+ self.partition_date_strategy = attributes[:'partition_date_strategy']
76
+ end
77
+
78
+ if attributes.has_key?(:'schema')
79
+ if (value = attributes[:'schema']).is_a?(Array)
80
+ self.schema = value
81
+ end
82
+ end
83
+
84
+ if attributes.has_key?(:'sql')
85
+ self.sql = attributes[:'sql']
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
+ name == o.name &&
108
+ partition_date_column == o.partition_date_column &&
109
+ partition_date_safety_days == o.partition_date_safety_days &&
110
+ partition_date_strategy == o.partition_date_strategy &&
111
+ schema == o.schema &&
112
+ sql == o.sql
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
+ [name, partition_date_column, partition_date_safety_days, partition_date_strategy, schema, sql].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
@@ -0,0 +1,238 @@
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 ReportDataSourceSchema
17
+ # Whether or not this column can be used as a dimension within a visualization
18
+ attr_accessor :dimension
19
+
20
+ attr_accessor :name
21
+
22
+ # Type of the column. Only supporting the allowed values. Any other types will be ignored.
23
+ attr_accessor :type
24
+
25
+ class EnumAttributeValidator
26
+ attr_reader :datatype
27
+ attr_reader :allowable_values
28
+
29
+ def initialize(datatype, allowable_values)
30
+ @allowable_values = allowable_values.map do |value|
31
+ case datatype.to_s
32
+ when /Integer/i
33
+ value.to_i
34
+ when /Float/i
35
+ value.to_f
36
+ else
37
+ value
38
+ end
39
+ end
40
+ end
41
+
42
+ def valid?(value)
43
+ !value || allowable_values.include?(value)
44
+ end
45
+ end
46
+
47
+ # Attribute mapping from ruby-style variable name to JSON key.
48
+ def self.attribute_map
49
+ {
50
+ :'dimension' => :'dimension',
51
+ :'name' => :'name',
52
+ :'type' => :'type'
53
+ }
54
+ end
55
+
56
+ # Attribute type mapping.
57
+ def self.swagger_types
58
+ {
59
+ :'dimension' => :'BOOLEAN',
60
+ :'name' => :'String',
61
+ :'type' => :'String'
62
+ }
63
+ end
64
+
65
+ # Initializes the object
66
+ # @param [Hash] attributes Model attributes in the form of hash
67
+ def initialize(attributes = {})
68
+ return unless attributes.is_a?(Hash)
69
+
70
+ # convert string to symbol for hash key
71
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
72
+
73
+ if attributes.has_key?(:'dimension')
74
+ self.dimension = attributes[:'dimension']
75
+ end
76
+
77
+ if attributes.has_key?(:'name')
78
+ self.name = attributes[:'name']
79
+ end
80
+
81
+ if attributes.has_key?(:'type')
82
+ self.type = attributes[:'type']
83
+ end
84
+ end
85
+
86
+ # Show invalid properties with the reasons. Usually used together with valid?
87
+ # @return Array for valid properties with the reasons
88
+ def list_invalid_properties
89
+ invalid_properties = Array.new
90
+ invalid_properties
91
+ end
92
+
93
+ # Check to see if the all the properties in the model are valid
94
+ # @return true if the model is valid
95
+ def valid?
96
+ type_validator = EnumAttributeValidator.new('String', ['BIGNUMERIC', 'BOOL', 'DATE', 'DATETIME', 'FLOAT64', 'INT64', 'JSON', 'NUMERIC', 'STRING', 'TIME', 'TIMESTAMP'])
97
+ return false unless type_validator.valid?(@type)
98
+ true
99
+ end
100
+
101
+ # Custom attribute writer method checking allowed values (enum).
102
+ # @param [Object] type Object to be assigned
103
+ def type=(type)
104
+ validator = EnumAttributeValidator.new('String', ['BIGNUMERIC', 'BOOL', 'DATE', 'DATETIME', 'FLOAT64', 'INT64', 'JSON', 'NUMERIC', 'STRING', 'TIME', 'TIMESTAMP'])
105
+ unless validator.valid?(type)
106
+ fail ArgumentError, 'invalid value for "type", must be one of #{validator.allowable_values}.'
107
+ end
108
+ @type = type
109
+ end
110
+
111
+ # Checks equality by comparing each attribute.
112
+ # @param [Object] Object to be compared
113
+ def ==(o)
114
+ return true if self.equal?(o)
115
+ self.class == o.class &&
116
+ dimension == o.dimension &&
117
+ name == o.name &&
118
+ type == o.type
119
+ end
120
+
121
+ # @see the `==` method
122
+ # @param [Object] Object to be compared
123
+ def eql?(o)
124
+ self == o
125
+ end
126
+
127
+ # Calculates hash code according to all attributes.
128
+ # @return [Fixnum] Hash code
129
+ def hash
130
+ [dimension, name, type].hash
131
+ end
132
+
133
+ # Builds the object from hash
134
+ # @param [Hash] attributes Model attributes in the form of hash
135
+ # @return [Object] Returns the model itself
136
+ def build_from_hash(attributes)
137
+ return nil unless attributes.is_a?(Hash)
138
+ self.class.swagger_types.each_pair do |key, type|
139
+ if type =~ /\AArray<(.*)>/i
140
+ # check to ensure the input is an array given that the attribute
141
+ # is documented as an array but the input is not
142
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
143
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
144
+ end
145
+ elsif !attributes[self.class.attribute_map[key]].nil?
146
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
147
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
148
+ end
149
+
150
+ self
151
+ end
152
+
153
+ # Deserializes the data based on type
154
+ # @param string type Data type
155
+ # @param string value Value to be deserialized
156
+ # @return [Object] Deserialized data
157
+ def _deserialize(type, value)
158
+ case type.to_sym
159
+ when :DateTime
160
+ DateTime.parse(value)
161
+ when :Date
162
+ Date.parse(value)
163
+ when :String
164
+ value.to_s
165
+ when :Integer
166
+ value.to_i
167
+ when :Float
168
+ value.to_f
169
+ when :BOOLEAN
170
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
171
+ true
172
+ else
173
+ false
174
+ end
175
+ when :Object
176
+ # generic object (usually a Hash), return directly
177
+ value
178
+ when /\AArray<(?<inner_type>.+)>\z/
179
+ inner_type = Regexp.last_match[:inner_type]
180
+ value.map { |v| _deserialize(inner_type, v) }
181
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
182
+ k_type = Regexp.last_match[:k_type]
183
+ v_type = Regexp.last_match[:v_type]
184
+ {}.tap do |hash|
185
+ value.each do |k, v|
186
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
187
+ end
188
+ end
189
+ else # model
190
+ temp_model = UltracartClient.const_get(type).new
191
+ temp_model.build_from_hash(value)
192
+ end
193
+ end
194
+
195
+ # Returns the string representation of the object
196
+ # @return [String] String presentation of the object
197
+ def to_s
198
+ to_hash.to_s
199
+ end
200
+
201
+ # to_body is an alias to to_hash (backward compatibility)
202
+ # @return [Hash] Returns the object in the form of hash
203
+ def to_body
204
+ to_hash
205
+ end
206
+
207
+ # Returns the object in the form of hash
208
+ # @return [Hash] Returns the object in the form of hash
209
+ def to_hash
210
+ hash = {}
211
+ self.class.attribute_map.each_pair do |attr, param|
212
+ value = self.send(attr)
213
+ next if value.nil?
214
+ hash[param] = _to_hash(value)
215
+ end
216
+ hash
217
+ end
218
+
219
+ # Outputs non-array value in the form of hash
220
+ # For object, use to_hash. Otherwise, just return the value
221
+ # @param [Object] value Any valid value
222
+ # @return [Hash] Returns the value in the form of hash
223
+ def _to_hash(value)
224
+ if value.is_a?(Array)
225
+ value.compact.map { |v| _to_hash(v) }
226
+ elsif value.is_a?(Hash)
227
+ {}.tap do |hash|
228
+ value.each { |k, v| hash[k] = _to_hash(v) }
229
+ end
230
+ elsif value.respond_to? :to_hash
231
+ value.to_hash
232
+ else
233
+ value
234
+ end
235
+ end
236
+
237
+ end
238
+ end