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.
- checksums.yaml +4 -4
- data/README.md +37 -4
- data/docs/DatawarehouseApi.md +651 -0
- data/docs/OrderRefundableResponse.md +2 -0
- data/docs/Report.md +36 -0
- data/docs/ReportAuth.md +24 -0
- data/docs/ReportAuthResponse.md +26 -0
- data/docs/ReportDataSet.md +46 -0
- data/docs/ReportDataSetColumn.md +18 -0
- data/docs/ReportDataSetPage.md +36 -0
- data/docs/ReportDataSetPageResponse.md +26 -0
- data/docs/ReportDataSetQuery.md +40 -0
- data/docs/ReportDataSetResponse.md +26 -0
- data/docs/ReportDataSetRow.md +18 -0
- data/docs/ReportDataSetSchema.md +20 -0
- data/docs/ReportDataSource.md +28 -0
- data/docs/ReportDataSourceSchema.md +22 -0
- data/docs/ReportExecuteQueriesRequest.md +30 -0
- data/docs/ReportFilter.md +28 -0
- data/docs/ReportFilterConnection.md +20 -0
- data/docs/ReportPage.md +24 -0
- data/docs/ReportPageVisualization.md +34 -0
- data/docs/ReportPageVisualizationDimension.md +30 -0
- data/docs/ReportPageVisualizationMetric.md +24 -0
- data/docs/ReportResponse.md +26 -0
- data/docs/ReportsResponse.md +26 -0
- data/lib/ultracart_api/api/datawarehouse_api.rb +626 -0
- data/lib/ultracart_api/models/order_refundable_response.rb +11 -1
- data/lib/ultracart_api/models/report.rb +342 -0
- data/lib/ultracart_api/models/report_auth.rb +247 -0
- data/lib/ultracart_api/models/report_auth_response.rb +256 -0
- data/lib/ultracart_api/models/report_data_set.rb +397 -0
- data/lib/ultracart_api/models/report_data_set_column.rb +219 -0
- data/lib/ultracart_api/models/report_data_set_page.rb +308 -0
- data/lib/ultracart_api/models/report_data_set_page_response.rb +256 -0
- data/lib/ultracart_api/models/report_data_set_query.rb +365 -0
- data/lib/ultracart_api/models/report_data_set_response.rb +256 -0
- data/lib/ultracart_api/models/report_data_set_row.rb +221 -0
- data/lib/ultracart_api/models/report_data_set_schema.rb +263 -0
- data/lib/ultracart_api/models/report_data_source.rb +267 -0
- data/lib/ultracart_api/models/report_data_source_schema.rb +273 -0
- data/lib/ultracart_api/models/report_execute_queries_request.rb +313 -0
- data/lib/ultracart_api/models/report_filter.rb +307 -0
- data/lib/ultracart_api/models/report_filter_connection.rb +228 -0
- data/lib/ultracart_api/models/report_page.rb +251 -0
- data/lib/ultracart_api/models/report_page_visualization.rb +334 -0
- data/lib/ultracart_api/models/report_page_visualization_dimension.rb +279 -0
- data/lib/ultracart_api/models/report_page_visualization_metric.rb +283 -0
- data/lib/ultracart_api/models/report_response.rb +256 -0
- data/lib/ultracart_api/models/reports_response.rb +258 -0
- data/lib/ultracart_api/version.rb +1 -1
- data/lib/ultracart_api.rb +23 -0
- metadata +48 -2
@@ -0,0 +1,256 @@
|
|
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 ReportDataSetPageResponse
|
18
|
+
attr_accessor :error
|
19
|
+
|
20
|
+
attr_accessor :metadata
|
21
|
+
|
22
|
+
attr_accessor :page
|
23
|
+
|
24
|
+
# Indicates if API call was successful
|
25
|
+
attr_accessor :success
|
26
|
+
|
27
|
+
attr_accessor :warning
|
28
|
+
|
29
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
30
|
+
def self.attribute_map
|
31
|
+
{
|
32
|
+
:'error' => :'error',
|
33
|
+
:'metadata' => :'metadata',
|
34
|
+
:'page' => :'page',
|
35
|
+
:'success' => :'success',
|
36
|
+
:'warning' => :'warning'
|
37
|
+
}
|
38
|
+
end
|
39
|
+
|
40
|
+
# Returns all the JSON keys this model knows about
|
41
|
+
def self.acceptable_attributes
|
42
|
+
attribute_map.values
|
43
|
+
end
|
44
|
+
|
45
|
+
# Attribute type mapping.
|
46
|
+
def self.openapi_types
|
47
|
+
{
|
48
|
+
:'error' => :'Error',
|
49
|
+
:'metadata' => :'ResponseMetadata',
|
50
|
+
:'page' => :'ReportDataSetPage',
|
51
|
+
:'success' => :'Boolean',
|
52
|
+
:'warning' => :'Warning'
|
53
|
+
}
|
54
|
+
end
|
55
|
+
|
56
|
+
# List of attributes with nullable: true
|
57
|
+
def self.openapi_nullable
|
58
|
+
Set.new([
|
59
|
+
])
|
60
|
+
end
|
61
|
+
|
62
|
+
# Initializes the object
|
63
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
64
|
+
def initialize(attributes = {})
|
65
|
+
if (!attributes.is_a?(Hash))
|
66
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::ReportDataSetPageResponse` initialize method"
|
67
|
+
end
|
68
|
+
|
69
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
70
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
71
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
72
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::ReportDataSetPageResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
73
|
+
end
|
74
|
+
h[k.to_sym] = v
|
75
|
+
}
|
76
|
+
|
77
|
+
if attributes.key?(:'error')
|
78
|
+
self.error = attributes[:'error']
|
79
|
+
end
|
80
|
+
|
81
|
+
if attributes.key?(:'metadata')
|
82
|
+
self.metadata = attributes[:'metadata']
|
83
|
+
end
|
84
|
+
|
85
|
+
if attributes.key?(:'page')
|
86
|
+
self.page = attributes[:'page']
|
87
|
+
end
|
88
|
+
|
89
|
+
if attributes.key?(:'success')
|
90
|
+
self.success = attributes[:'success']
|
91
|
+
end
|
92
|
+
|
93
|
+
if attributes.key?(:'warning')
|
94
|
+
self.warning = attributes[:'warning']
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
99
|
+
# @return Array for valid properties with the reasons
|
100
|
+
def list_invalid_properties
|
101
|
+
invalid_properties = Array.new
|
102
|
+
invalid_properties
|
103
|
+
end
|
104
|
+
|
105
|
+
# Check to see if the all the properties in the model are valid
|
106
|
+
# @return true if the model is valid
|
107
|
+
def valid?
|
108
|
+
true
|
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
|
+
error == o.error &&
|
117
|
+
metadata == o.metadata &&
|
118
|
+
page == o.page &&
|
119
|
+
success == o.success &&
|
120
|
+
warning == o.warning
|
121
|
+
end
|
122
|
+
|
123
|
+
# @see the `==` method
|
124
|
+
# @param [Object] Object to be compared
|
125
|
+
def eql?(o)
|
126
|
+
self == o
|
127
|
+
end
|
128
|
+
|
129
|
+
# Calculates hash code according to all attributes.
|
130
|
+
# @return [Integer] Hash code
|
131
|
+
def hash
|
132
|
+
[error, metadata, page, success, warning].hash
|
133
|
+
end
|
134
|
+
|
135
|
+
# Builds the object from hash
|
136
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
137
|
+
# @return [Object] Returns the model itself
|
138
|
+
def self.build_from_hash(attributes)
|
139
|
+
new.build_from_hash(attributes)
|
140
|
+
end
|
141
|
+
|
142
|
+
# Builds the object from hash
|
143
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
144
|
+
# @return [Object] Returns the model itself
|
145
|
+
def build_from_hash(attributes)
|
146
|
+
return nil unless attributes.is_a?(Hash)
|
147
|
+
attributes = attributes.transform_keys(&:to_sym)
|
148
|
+
self.class.openapi_types.each_pair do |key, type|
|
149
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
150
|
+
self.send("#{key}=", nil)
|
151
|
+
elsif type =~ /\AArray<(.*)>/i
|
152
|
+
# check to ensure the input is an array given that the attribute
|
153
|
+
# is documented as an array but the input is not
|
154
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
155
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
156
|
+
end
|
157
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
158
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
159
|
+
end
|
160
|
+
end
|
161
|
+
|
162
|
+
self
|
163
|
+
end
|
164
|
+
|
165
|
+
# Deserializes the data based on type
|
166
|
+
# @param string type Data type
|
167
|
+
# @param string value Value to be deserialized
|
168
|
+
# @return [Object] Deserialized data
|
169
|
+
def _deserialize(type, value)
|
170
|
+
case type.to_sym
|
171
|
+
when :Time
|
172
|
+
Time.parse(value)
|
173
|
+
when :Date
|
174
|
+
Date.parse(value)
|
175
|
+
when :String
|
176
|
+
value.to_s
|
177
|
+
when :Integer
|
178
|
+
value.to_i
|
179
|
+
when :Float
|
180
|
+
value.to_f
|
181
|
+
when :Boolean
|
182
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
183
|
+
true
|
184
|
+
else
|
185
|
+
false
|
186
|
+
end
|
187
|
+
when :Object
|
188
|
+
# generic object (usually a Hash), return directly
|
189
|
+
value
|
190
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
191
|
+
inner_type = Regexp.last_match[:inner_type]
|
192
|
+
value.map { |v| _deserialize(inner_type, v) }
|
193
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
194
|
+
k_type = Regexp.last_match[:k_type]
|
195
|
+
v_type = Regexp.last_match[:v_type]
|
196
|
+
{}.tap do |hash|
|
197
|
+
value.each do |k, v|
|
198
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
199
|
+
end
|
200
|
+
end
|
201
|
+
else # model
|
202
|
+
# models (e.g. Pet) or oneOf
|
203
|
+
klass = UltracartClient.const_get(type)
|
204
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
205
|
+
end
|
206
|
+
end
|
207
|
+
|
208
|
+
# Returns the string representation of the object
|
209
|
+
# @return [String] String presentation of the object
|
210
|
+
def to_s
|
211
|
+
to_hash.to_s
|
212
|
+
end
|
213
|
+
|
214
|
+
# to_body is an alias to to_hash (backward compatibility)
|
215
|
+
# @return [Hash] Returns the object in the form of hash
|
216
|
+
def to_body
|
217
|
+
to_hash
|
218
|
+
end
|
219
|
+
|
220
|
+
# Returns the object in the form of hash
|
221
|
+
# @return [Hash] Returns the object in the form of hash
|
222
|
+
def to_hash
|
223
|
+
hash = {}
|
224
|
+
self.class.attribute_map.each_pair do |attr, param|
|
225
|
+
value = self.send(attr)
|
226
|
+
if value.nil?
|
227
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
228
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
229
|
+
end
|
230
|
+
|
231
|
+
hash[param] = _to_hash(value)
|
232
|
+
end
|
233
|
+
hash
|
234
|
+
end
|
235
|
+
|
236
|
+
# Outputs non-array value in the form of hash
|
237
|
+
# For object, use to_hash. Otherwise, just return the value
|
238
|
+
# @param [Object] value Any valid value
|
239
|
+
# @return [Hash] Returns the value in the form of hash
|
240
|
+
def _to_hash(value)
|
241
|
+
if value.is_a?(Array)
|
242
|
+
value.compact.map { |v| _to_hash(v) }
|
243
|
+
elsif value.is_a?(Hash)
|
244
|
+
{}.tap do |hash|
|
245
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
246
|
+
end
|
247
|
+
elsif value.respond_to? :to_hash
|
248
|
+
value.to_hash
|
249
|
+
else
|
250
|
+
value
|
251
|
+
end
|
252
|
+
end
|
253
|
+
|
254
|
+
end
|
255
|
+
|
256
|
+
end
|
@@ -0,0 +1,365 @@
|
|
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 ReportDataSetQuery
|
18
|
+
# True if a date range filter is provided with comparison date ranges and two results should be returned for the query.
|
19
|
+
attr_accessor :comparison_results
|
20
|
+
|
21
|
+
# A unique identifier assigned to the data set query that is returned.
|
22
|
+
attr_accessor :data_set_query_uuid
|
23
|
+
|
24
|
+
attr_accessor :data_source
|
25
|
+
|
26
|
+
attr_accessor :dimensions
|
27
|
+
|
28
|
+
attr_accessor :filter
|
29
|
+
|
30
|
+
# An identifier that can be used to help match up the returned data set
|
31
|
+
attr_accessor :for_object_id
|
32
|
+
|
33
|
+
# The type of object this data set is for
|
34
|
+
attr_accessor :for_object_type
|
35
|
+
|
36
|
+
attr_accessor :metrics
|
37
|
+
|
38
|
+
# Result set page size. The default value is 200 records. Max is 10000.
|
39
|
+
attr_accessor :page_size
|
40
|
+
|
41
|
+
attr_accessor :selected_filters
|
42
|
+
|
43
|
+
# True if the 15 minute cache should be skipped.
|
44
|
+
attr_accessor :skip_cache
|
45
|
+
|
46
|
+
# Any other data that needs to be returned with the response to help the UI
|
47
|
+
attr_accessor :user_data
|
48
|
+
|
49
|
+
class EnumAttributeValidator
|
50
|
+
attr_reader :datatype
|
51
|
+
attr_reader :allowable_values
|
52
|
+
|
53
|
+
def initialize(datatype, allowable_values)
|
54
|
+
@allowable_values = allowable_values.map do |value|
|
55
|
+
case datatype.to_s
|
56
|
+
when /Integer/i
|
57
|
+
value.to_i
|
58
|
+
when /Float/i
|
59
|
+
value.to_f
|
60
|
+
else
|
61
|
+
value
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
def valid?(value)
|
67
|
+
!value || allowable_values.include?(value)
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
72
|
+
def self.attribute_map
|
73
|
+
{
|
74
|
+
:'comparison_results' => :'comparison_results',
|
75
|
+
:'data_set_query_uuid' => :'data_set_query_uuid',
|
76
|
+
:'data_source' => :'data_source',
|
77
|
+
:'dimensions' => :'dimensions',
|
78
|
+
:'filter' => :'filter',
|
79
|
+
:'for_object_id' => :'for_object_id',
|
80
|
+
:'for_object_type' => :'for_object_type',
|
81
|
+
:'metrics' => :'metrics',
|
82
|
+
:'page_size' => :'page_size',
|
83
|
+
:'selected_filters' => :'selected_filters',
|
84
|
+
:'skip_cache' => :'skip_cache',
|
85
|
+
:'user_data' => :'user_data'
|
86
|
+
}
|
87
|
+
end
|
88
|
+
|
89
|
+
# Returns all the JSON keys this model knows about
|
90
|
+
def self.acceptable_attributes
|
91
|
+
attribute_map.values
|
92
|
+
end
|
93
|
+
|
94
|
+
# Attribute type mapping.
|
95
|
+
def self.openapi_types
|
96
|
+
{
|
97
|
+
:'comparison_results' => :'Boolean',
|
98
|
+
:'data_set_query_uuid' => :'String',
|
99
|
+
:'data_source' => :'ReportDataSource',
|
100
|
+
:'dimensions' => :'Array<ReportPageVisualizationDimension>',
|
101
|
+
:'filter' => :'ReportFilter',
|
102
|
+
:'for_object_id' => :'String',
|
103
|
+
:'for_object_type' => :'String',
|
104
|
+
:'metrics' => :'Array<ReportPageVisualizationMetric>',
|
105
|
+
:'page_size' => :'Integer',
|
106
|
+
:'selected_filters' => :'Array<ReportFilter>',
|
107
|
+
:'skip_cache' => :'Boolean',
|
108
|
+
:'user_data' => :'String'
|
109
|
+
}
|
110
|
+
end
|
111
|
+
|
112
|
+
# List of attributes with nullable: true
|
113
|
+
def self.openapi_nullable
|
114
|
+
Set.new([
|
115
|
+
])
|
116
|
+
end
|
117
|
+
|
118
|
+
# Initializes the object
|
119
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
120
|
+
def initialize(attributes = {})
|
121
|
+
if (!attributes.is_a?(Hash))
|
122
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::ReportDataSetQuery` initialize method"
|
123
|
+
end
|
124
|
+
|
125
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
126
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
127
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
128
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::ReportDataSetQuery`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
129
|
+
end
|
130
|
+
h[k.to_sym] = v
|
131
|
+
}
|
132
|
+
|
133
|
+
if attributes.key?(:'comparison_results')
|
134
|
+
self.comparison_results = attributes[:'comparison_results']
|
135
|
+
end
|
136
|
+
|
137
|
+
if attributes.key?(:'data_set_query_uuid')
|
138
|
+
self.data_set_query_uuid = attributes[:'data_set_query_uuid']
|
139
|
+
end
|
140
|
+
|
141
|
+
if attributes.key?(:'data_source')
|
142
|
+
self.data_source = attributes[:'data_source']
|
143
|
+
end
|
144
|
+
|
145
|
+
if attributes.key?(:'dimensions')
|
146
|
+
if (value = attributes[:'dimensions']).is_a?(Array)
|
147
|
+
self.dimensions = value
|
148
|
+
end
|
149
|
+
end
|
150
|
+
|
151
|
+
if attributes.key?(:'filter')
|
152
|
+
self.filter = attributes[:'filter']
|
153
|
+
end
|
154
|
+
|
155
|
+
if attributes.key?(:'for_object_id')
|
156
|
+
self.for_object_id = attributes[:'for_object_id']
|
157
|
+
end
|
158
|
+
|
159
|
+
if attributes.key?(:'for_object_type')
|
160
|
+
self.for_object_type = attributes[:'for_object_type']
|
161
|
+
end
|
162
|
+
|
163
|
+
if attributes.key?(:'metrics')
|
164
|
+
if (value = attributes[:'metrics']).is_a?(Array)
|
165
|
+
self.metrics = value
|
166
|
+
end
|
167
|
+
end
|
168
|
+
|
169
|
+
if attributes.key?(:'page_size')
|
170
|
+
self.page_size = attributes[:'page_size']
|
171
|
+
end
|
172
|
+
|
173
|
+
if attributes.key?(:'selected_filters')
|
174
|
+
if (value = attributes[:'selected_filters']).is_a?(Array)
|
175
|
+
self.selected_filters = value
|
176
|
+
end
|
177
|
+
end
|
178
|
+
|
179
|
+
if attributes.key?(:'skip_cache')
|
180
|
+
self.skip_cache = attributes[:'skip_cache']
|
181
|
+
end
|
182
|
+
|
183
|
+
if attributes.key?(:'user_data')
|
184
|
+
self.user_data = attributes[:'user_data']
|
185
|
+
end
|
186
|
+
end
|
187
|
+
|
188
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
189
|
+
# @return Array for valid properties with the reasons
|
190
|
+
def list_invalid_properties
|
191
|
+
invalid_properties = Array.new
|
192
|
+
invalid_properties
|
193
|
+
end
|
194
|
+
|
195
|
+
# Check to see if the all the properties in the model are valid
|
196
|
+
# @return true if the model is valid
|
197
|
+
def valid?
|
198
|
+
for_object_type_validator = EnumAttributeValidator.new('String', ["schema", "filter", "visualization"])
|
199
|
+
return false unless for_object_type_validator.valid?(@for_object_type)
|
200
|
+
true
|
201
|
+
end
|
202
|
+
|
203
|
+
# Custom attribute writer method checking allowed values (enum).
|
204
|
+
# @param [Object] for_object_type Object to be assigned
|
205
|
+
def for_object_type=(for_object_type)
|
206
|
+
validator = EnumAttributeValidator.new('String', ["schema", "filter", "visualization"])
|
207
|
+
unless validator.valid?(for_object_type)
|
208
|
+
fail ArgumentError, "invalid value for \"for_object_type\", must be one of #{validator.allowable_values}."
|
209
|
+
end
|
210
|
+
@for_object_type = for_object_type
|
211
|
+
end
|
212
|
+
|
213
|
+
# Checks equality by comparing each attribute.
|
214
|
+
# @param [Object] Object to be compared
|
215
|
+
def ==(o)
|
216
|
+
return true if self.equal?(o)
|
217
|
+
self.class == o.class &&
|
218
|
+
comparison_results == o.comparison_results &&
|
219
|
+
data_set_query_uuid == o.data_set_query_uuid &&
|
220
|
+
data_source == o.data_source &&
|
221
|
+
dimensions == o.dimensions &&
|
222
|
+
filter == o.filter &&
|
223
|
+
for_object_id == o.for_object_id &&
|
224
|
+
for_object_type == o.for_object_type &&
|
225
|
+
metrics == o.metrics &&
|
226
|
+
page_size == o.page_size &&
|
227
|
+
selected_filters == o.selected_filters &&
|
228
|
+
skip_cache == o.skip_cache &&
|
229
|
+
user_data == o.user_data
|
230
|
+
end
|
231
|
+
|
232
|
+
# @see the `==` method
|
233
|
+
# @param [Object] Object to be compared
|
234
|
+
def eql?(o)
|
235
|
+
self == o
|
236
|
+
end
|
237
|
+
|
238
|
+
# Calculates hash code according to all attributes.
|
239
|
+
# @return [Integer] Hash code
|
240
|
+
def hash
|
241
|
+
[comparison_results, data_set_query_uuid, data_source, dimensions, filter, for_object_id, for_object_type, metrics, page_size, selected_filters, skip_cache, user_data].hash
|
242
|
+
end
|
243
|
+
|
244
|
+
# Builds the object from hash
|
245
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
246
|
+
# @return [Object] Returns the model itself
|
247
|
+
def self.build_from_hash(attributes)
|
248
|
+
new.build_from_hash(attributes)
|
249
|
+
end
|
250
|
+
|
251
|
+
# Builds the object from hash
|
252
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
253
|
+
# @return [Object] Returns the model itself
|
254
|
+
def build_from_hash(attributes)
|
255
|
+
return nil unless attributes.is_a?(Hash)
|
256
|
+
attributes = attributes.transform_keys(&:to_sym)
|
257
|
+
self.class.openapi_types.each_pair do |key, type|
|
258
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
259
|
+
self.send("#{key}=", nil)
|
260
|
+
elsif type =~ /\AArray<(.*)>/i
|
261
|
+
# check to ensure the input is an array given that the attribute
|
262
|
+
# is documented as an array but the input is not
|
263
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
264
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
265
|
+
end
|
266
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
267
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
268
|
+
end
|
269
|
+
end
|
270
|
+
|
271
|
+
self
|
272
|
+
end
|
273
|
+
|
274
|
+
# Deserializes the data based on type
|
275
|
+
# @param string type Data type
|
276
|
+
# @param string value Value to be deserialized
|
277
|
+
# @return [Object] Deserialized data
|
278
|
+
def _deserialize(type, value)
|
279
|
+
case type.to_sym
|
280
|
+
when :Time
|
281
|
+
Time.parse(value)
|
282
|
+
when :Date
|
283
|
+
Date.parse(value)
|
284
|
+
when :String
|
285
|
+
value.to_s
|
286
|
+
when :Integer
|
287
|
+
value.to_i
|
288
|
+
when :Float
|
289
|
+
value.to_f
|
290
|
+
when :Boolean
|
291
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
292
|
+
true
|
293
|
+
else
|
294
|
+
false
|
295
|
+
end
|
296
|
+
when :Object
|
297
|
+
# generic object (usually a Hash), return directly
|
298
|
+
value
|
299
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
300
|
+
inner_type = Regexp.last_match[:inner_type]
|
301
|
+
value.map { |v| _deserialize(inner_type, v) }
|
302
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
303
|
+
k_type = Regexp.last_match[:k_type]
|
304
|
+
v_type = Regexp.last_match[:v_type]
|
305
|
+
{}.tap do |hash|
|
306
|
+
value.each do |k, v|
|
307
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
308
|
+
end
|
309
|
+
end
|
310
|
+
else # model
|
311
|
+
# models (e.g. Pet) or oneOf
|
312
|
+
klass = UltracartClient.const_get(type)
|
313
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
314
|
+
end
|
315
|
+
end
|
316
|
+
|
317
|
+
# Returns the string representation of the object
|
318
|
+
# @return [String] String presentation of the object
|
319
|
+
def to_s
|
320
|
+
to_hash.to_s
|
321
|
+
end
|
322
|
+
|
323
|
+
# to_body is an alias to to_hash (backward compatibility)
|
324
|
+
# @return [Hash] Returns the object in the form of hash
|
325
|
+
def to_body
|
326
|
+
to_hash
|
327
|
+
end
|
328
|
+
|
329
|
+
# Returns the object in the form of hash
|
330
|
+
# @return [Hash] Returns the object in the form of hash
|
331
|
+
def to_hash
|
332
|
+
hash = {}
|
333
|
+
self.class.attribute_map.each_pair do |attr, param|
|
334
|
+
value = self.send(attr)
|
335
|
+
if value.nil?
|
336
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
337
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
338
|
+
end
|
339
|
+
|
340
|
+
hash[param] = _to_hash(value)
|
341
|
+
end
|
342
|
+
hash
|
343
|
+
end
|
344
|
+
|
345
|
+
# Outputs non-array value in the form of hash
|
346
|
+
# For object, use to_hash. Otherwise, just return the value
|
347
|
+
# @param [Object] value Any valid value
|
348
|
+
# @return [Hash] Returns the value in the form of hash
|
349
|
+
def _to_hash(value)
|
350
|
+
if value.is_a?(Array)
|
351
|
+
value.compact.map { |v| _to_hash(v) }
|
352
|
+
elsif value.is_a?(Hash)
|
353
|
+
{}.tap do |hash|
|
354
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
355
|
+
end
|
356
|
+
elsif value.respond_to? :to_hash
|
357
|
+
value.to_hash
|
358
|
+
else
|
359
|
+
value
|
360
|
+
end
|
361
|
+
end
|
362
|
+
|
363
|
+
end
|
364
|
+
|
365
|
+
end
|