ultracart_api 4.0.143 → 4.0.145
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +11 -5
- data/docs/AccountsReceivableRetryConfig.md +2 -0
- data/docs/AccountsReceivableRetryTransactionReject.md +20 -0
- data/docs/DatawarehouseApi.md +72 -0
- data/docs/Experiment.md +10 -0
- data/docs/ReportDryRunQueriesRequest.md +28 -0
- data/docs/ReportDryRunQueriesResponse.md +18 -0
- data/docs/ReportDryRunQueryResult.md +20 -0
- data/docs/ReportWebsocketEvent.md +1 -1
- data/lib/ultracart_api/api/datawarehouse_api.rb +69 -0
- data/lib/ultracart_api/models/accounts_receivable_retry_config.rb +13 -1
- data/lib/ultracart_api/models/accounts_receivable_retry_transaction_reject.rb +230 -0
- data/lib/ultracart_api/models/experiment.rb +63 -1
- data/lib/ultracart_api/models/report_dry_run_queries_request.rb +266 -0
- data/lib/ultracart_api/models/report_dry_run_queries_response.rb +221 -0
- data/lib/ultracart_api/models/{report_data_set_summary.rb → report_dry_run_query_result.rb} +10 -98
- data/lib/ultracart_api/models/report_websocket_event.rb +1 -1
- data/lib/ultracart_api/version.rb +1 -1
- data/lib/ultracart_api.rb +4 -1
- metadata +10 -4
- data/docs/ReportDataSetSummary.md +0 -30
@@ -45,9 +45,24 @@ module UltracartClient
|
|
45
45
|
# Objective parameter (such as event name) that is being optimized
|
46
46
|
attr_accessor :objective_parameter
|
47
47
|
|
48
|
+
# The current iteration of the OpenAI related experiment
|
49
|
+
attr_accessor :openai_current_iteration
|
50
|
+
|
51
|
+
# The type of OpenAI element being experimented on
|
52
|
+
attr_accessor :openai_element_type
|
53
|
+
|
54
|
+
# The type of OpenAI model used
|
55
|
+
attr_accessor :openai_model
|
56
|
+
|
57
|
+
# The total number of iterations to perform on the experiment
|
58
|
+
attr_accessor :openai_total_iterations
|
59
|
+
|
48
60
|
# Type of optimization
|
49
61
|
attr_accessor :optimization_type
|
50
62
|
|
63
|
+
# Statistics p-value for the experiment
|
64
|
+
attr_accessor :p_value
|
65
|
+
|
51
66
|
# Total number of sessions in the experiment
|
52
67
|
attr_accessor :session_count
|
53
68
|
|
@@ -104,7 +119,12 @@ module UltracartClient
|
|
104
119
|
:'notes' => :'notes',
|
105
120
|
:'objective' => :'objective',
|
106
121
|
:'objective_parameter' => :'objective_parameter',
|
122
|
+
:'openai_current_iteration' => :'openai_current_iteration',
|
123
|
+
:'openai_element_type' => :'openai_element_type',
|
124
|
+
:'openai_model' => :'openai_model',
|
125
|
+
:'openai_total_iterations' => :'openai_total_iterations',
|
107
126
|
:'optimization_type' => :'optimization_type',
|
127
|
+
:'p_value' => :'p_value',
|
108
128
|
:'session_count' => :'session_count',
|
109
129
|
:'start_dts' => :'start_dts',
|
110
130
|
:'status' => :'status',
|
@@ -133,7 +153,12 @@ module UltracartClient
|
|
133
153
|
:'notes' => :'String',
|
134
154
|
:'objective' => :'String',
|
135
155
|
:'objective_parameter' => :'String',
|
156
|
+
:'openai_current_iteration' => :'Integer',
|
157
|
+
:'openai_element_type' => :'String',
|
158
|
+
:'openai_model' => :'String',
|
159
|
+
:'openai_total_iterations' => :'Integer',
|
136
160
|
:'optimization_type' => :'String',
|
161
|
+
:'p_value' => :'Float',
|
137
162
|
:'session_count' => :'Integer',
|
138
163
|
:'start_dts' => :'String',
|
139
164
|
:'status' => :'String',
|
@@ -205,10 +230,30 @@ module UltracartClient
|
|
205
230
|
self.objective_parameter = attributes[:'objective_parameter']
|
206
231
|
end
|
207
232
|
|
233
|
+
if attributes.key?(:'openai_current_iteration')
|
234
|
+
self.openai_current_iteration = attributes[:'openai_current_iteration']
|
235
|
+
end
|
236
|
+
|
237
|
+
if attributes.key?(:'openai_element_type')
|
238
|
+
self.openai_element_type = attributes[:'openai_element_type']
|
239
|
+
end
|
240
|
+
|
241
|
+
if attributes.key?(:'openai_model')
|
242
|
+
self.openai_model = attributes[:'openai_model']
|
243
|
+
end
|
244
|
+
|
245
|
+
if attributes.key?(:'openai_total_iterations')
|
246
|
+
self.openai_total_iterations = attributes[:'openai_total_iterations']
|
247
|
+
end
|
248
|
+
|
208
249
|
if attributes.key?(:'optimization_type')
|
209
250
|
self.optimization_type = attributes[:'optimization_type']
|
210
251
|
end
|
211
252
|
|
253
|
+
if attributes.key?(:'p_value')
|
254
|
+
self.p_value = attributes[:'p_value']
|
255
|
+
end
|
256
|
+
|
212
257
|
if attributes.key?(:'session_count')
|
213
258
|
self.session_count = attributes[:'session_count']
|
214
259
|
end
|
@@ -250,11 +295,23 @@ module UltracartClient
|
|
250
295
|
# Check to see if the all the properties in the model are valid
|
251
296
|
# @return true if the model is valid
|
252
297
|
def valid?
|
298
|
+
openai_element_type_validator = EnumAttributeValidator.new('String', ["headline", "text", "textblock"])
|
299
|
+
return false unless openai_element_type_validator.valid?(@openai_element_type)
|
253
300
|
status_validator = EnumAttributeValidator.new('String', ["Running", "Ended", "Deleted"])
|
254
301
|
return false unless status_validator.valid?(@status)
|
255
302
|
true
|
256
303
|
end
|
257
304
|
|
305
|
+
# Custom attribute writer method checking allowed values (enum).
|
306
|
+
# @param [Object] openai_element_type Object to be assigned
|
307
|
+
def openai_element_type=(openai_element_type)
|
308
|
+
validator = EnumAttributeValidator.new('String', ["headline", "text", "textblock"])
|
309
|
+
unless validator.valid?(openai_element_type)
|
310
|
+
fail ArgumentError, "invalid value for \"openai_element_type\", must be one of #{validator.allowable_values}."
|
311
|
+
end
|
312
|
+
@openai_element_type = openai_element_type
|
313
|
+
end
|
314
|
+
|
258
315
|
# Custom attribute writer method checking allowed values (enum).
|
259
316
|
# @param [Object] status Object to be assigned
|
260
317
|
def status=(status)
|
@@ -280,7 +337,12 @@ module UltracartClient
|
|
280
337
|
notes == o.notes &&
|
281
338
|
objective == o.objective &&
|
282
339
|
objective_parameter == o.objective_parameter &&
|
340
|
+
openai_current_iteration == o.openai_current_iteration &&
|
341
|
+
openai_element_type == o.openai_element_type &&
|
342
|
+
openai_model == o.openai_model &&
|
343
|
+
openai_total_iterations == o.openai_total_iterations &&
|
283
344
|
optimization_type == o.optimization_type &&
|
345
|
+
p_value == o.p_value &&
|
284
346
|
session_count == o.session_count &&
|
285
347
|
start_dts == o.start_dts &&
|
286
348
|
status == o.status &&
|
@@ -299,7 +361,7 @@ module UltracartClient
|
|
299
361
|
# Calculates hash code according to all attributes.
|
300
362
|
# @return [Integer] Hash code
|
301
363
|
def hash
|
302
|
-
[container_id, duration_days, end_dts, equal_weighting, experiment_type, id, name, notes, objective, objective_parameter, optimization_type, session_count, start_dts, status, storefront_experiment_oid, storefront_oid, uri, variations].hash
|
364
|
+
[container_id, duration_days, end_dts, equal_weighting, experiment_type, id, name, notes, objective, objective_parameter, openai_current_iteration, openai_element_type, openai_model, openai_total_iterations, optimization_type, p_value, session_count, start_dts, status, storefront_experiment_oid, storefront_oid, uri, variations].hash
|
303
365
|
end
|
304
366
|
|
305
367
|
# Builds the object from hash
|
@@ -0,0 +1,266 @@
|
|
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 ReportDryRunQueriesRequest
|
18
|
+
attr_accessor :connection_id
|
19
|
+
|
20
|
+
attr_accessor :default_dataset_id
|
21
|
+
|
22
|
+
attr_accessor :default_project_id
|
23
|
+
|
24
|
+
attr_accessor :merchant_id
|
25
|
+
|
26
|
+
attr_accessor :queries
|
27
|
+
|
28
|
+
attr_accessor :security_level
|
29
|
+
|
30
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
31
|
+
def self.attribute_map
|
32
|
+
{
|
33
|
+
:'connection_id' => :'connection_id',
|
34
|
+
:'default_dataset_id' => :'default_dataset_id',
|
35
|
+
:'default_project_id' => :'default_project_id',
|
36
|
+
:'merchant_id' => :'merchant_id',
|
37
|
+
:'queries' => :'queries',
|
38
|
+
:'security_level' => :'security_level'
|
39
|
+
}
|
40
|
+
end
|
41
|
+
|
42
|
+
# Returns all the JSON keys this model knows about
|
43
|
+
def self.acceptable_attributes
|
44
|
+
attribute_map.values
|
45
|
+
end
|
46
|
+
|
47
|
+
# Attribute type mapping.
|
48
|
+
def self.openapi_types
|
49
|
+
{
|
50
|
+
:'connection_id' => :'String',
|
51
|
+
:'default_dataset_id' => :'String',
|
52
|
+
:'default_project_id' => :'String',
|
53
|
+
:'merchant_id' => :'String',
|
54
|
+
:'queries' => :'Array<ReportDataSetQuery>',
|
55
|
+
:'security_level' => :'String'
|
56
|
+
}
|
57
|
+
end
|
58
|
+
|
59
|
+
# List of attributes with nullable: true
|
60
|
+
def self.openapi_nullable
|
61
|
+
Set.new([
|
62
|
+
])
|
63
|
+
end
|
64
|
+
|
65
|
+
# Initializes the object
|
66
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
67
|
+
def initialize(attributes = {})
|
68
|
+
if (!attributes.is_a?(Hash))
|
69
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::ReportDryRunQueriesRequest` initialize method"
|
70
|
+
end
|
71
|
+
|
72
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
73
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
74
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
75
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::ReportDryRunQueriesRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
76
|
+
end
|
77
|
+
h[k.to_sym] = v
|
78
|
+
}
|
79
|
+
|
80
|
+
if attributes.key?(:'connection_id')
|
81
|
+
self.connection_id = attributes[:'connection_id']
|
82
|
+
end
|
83
|
+
|
84
|
+
if attributes.key?(:'default_dataset_id')
|
85
|
+
self.default_dataset_id = attributes[:'default_dataset_id']
|
86
|
+
end
|
87
|
+
|
88
|
+
if attributes.key?(:'default_project_id')
|
89
|
+
self.default_project_id = attributes[:'default_project_id']
|
90
|
+
end
|
91
|
+
|
92
|
+
if attributes.key?(:'merchant_id')
|
93
|
+
self.merchant_id = attributes[:'merchant_id']
|
94
|
+
end
|
95
|
+
|
96
|
+
if attributes.key?(:'queries')
|
97
|
+
if (value = attributes[:'queries']).is_a?(Array)
|
98
|
+
self.queries = value
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
if attributes.key?(:'security_level')
|
103
|
+
self.security_level = attributes[:'security_level']
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
108
|
+
# @return Array for valid properties with the reasons
|
109
|
+
def list_invalid_properties
|
110
|
+
invalid_properties = Array.new
|
111
|
+
invalid_properties
|
112
|
+
end
|
113
|
+
|
114
|
+
# Check to see if the all the properties in the model are valid
|
115
|
+
# @return true if the model is valid
|
116
|
+
def valid?
|
117
|
+
true
|
118
|
+
end
|
119
|
+
|
120
|
+
# Checks equality by comparing each attribute.
|
121
|
+
# @param [Object] Object to be compared
|
122
|
+
def ==(o)
|
123
|
+
return true if self.equal?(o)
|
124
|
+
self.class == o.class &&
|
125
|
+
connection_id == o.connection_id &&
|
126
|
+
default_dataset_id == o.default_dataset_id &&
|
127
|
+
default_project_id == o.default_project_id &&
|
128
|
+
merchant_id == o.merchant_id &&
|
129
|
+
queries == o.queries &&
|
130
|
+
security_level == o.security_level
|
131
|
+
end
|
132
|
+
|
133
|
+
# @see the `==` method
|
134
|
+
# @param [Object] Object to be compared
|
135
|
+
def eql?(o)
|
136
|
+
self == o
|
137
|
+
end
|
138
|
+
|
139
|
+
# Calculates hash code according to all attributes.
|
140
|
+
# @return [Integer] Hash code
|
141
|
+
def hash
|
142
|
+
[connection_id, default_dataset_id, default_project_id, merchant_id, queries, security_level].hash
|
143
|
+
end
|
144
|
+
|
145
|
+
# Builds the object from hash
|
146
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
147
|
+
# @return [Object] Returns the model itself
|
148
|
+
def self.build_from_hash(attributes)
|
149
|
+
new.build_from_hash(attributes)
|
150
|
+
end
|
151
|
+
|
152
|
+
# Builds the object from hash
|
153
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
154
|
+
# @return [Object] Returns the model itself
|
155
|
+
def build_from_hash(attributes)
|
156
|
+
return nil unless attributes.is_a?(Hash)
|
157
|
+
attributes = attributes.transform_keys(&:to_sym)
|
158
|
+
self.class.openapi_types.each_pair do |key, type|
|
159
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
160
|
+
self.send("#{key}=", nil)
|
161
|
+
elsif type =~ /\AArray<(.*)>/i
|
162
|
+
# check to ensure the input is an array given that the attribute
|
163
|
+
# is documented as an array but the input is not
|
164
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
165
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
166
|
+
end
|
167
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
168
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
169
|
+
end
|
170
|
+
end
|
171
|
+
|
172
|
+
self
|
173
|
+
end
|
174
|
+
|
175
|
+
# Deserializes the data based on type
|
176
|
+
# @param string type Data type
|
177
|
+
# @param string value Value to be deserialized
|
178
|
+
# @return [Object] Deserialized data
|
179
|
+
def _deserialize(type, value)
|
180
|
+
case type.to_sym
|
181
|
+
when :Time
|
182
|
+
Time.parse(value)
|
183
|
+
when :Date
|
184
|
+
Date.parse(value)
|
185
|
+
when :String
|
186
|
+
value.to_s
|
187
|
+
when :Integer
|
188
|
+
value.to_i
|
189
|
+
when :Float
|
190
|
+
value.to_f
|
191
|
+
when :Boolean
|
192
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
193
|
+
true
|
194
|
+
else
|
195
|
+
false
|
196
|
+
end
|
197
|
+
when :Object
|
198
|
+
# generic object (usually a Hash), return directly
|
199
|
+
value
|
200
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
201
|
+
inner_type = Regexp.last_match[:inner_type]
|
202
|
+
value.map { |v| _deserialize(inner_type, v) }
|
203
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
204
|
+
k_type = Regexp.last_match[:k_type]
|
205
|
+
v_type = Regexp.last_match[:v_type]
|
206
|
+
{}.tap do |hash|
|
207
|
+
value.each do |k, v|
|
208
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
209
|
+
end
|
210
|
+
end
|
211
|
+
else # model
|
212
|
+
# models (e.g. Pet) or oneOf
|
213
|
+
klass = UltracartClient.const_get(type)
|
214
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
215
|
+
end
|
216
|
+
end
|
217
|
+
|
218
|
+
# Returns the string representation of the object
|
219
|
+
# @return [String] String presentation of the object
|
220
|
+
def to_s
|
221
|
+
to_hash.to_s
|
222
|
+
end
|
223
|
+
|
224
|
+
# to_body is an alias to to_hash (backward compatibility)
|
225
|
+
# @return [Hash] Returns the object in the form of hash
|
226
|
+
def to_body
|
227
|
+
to_hash
|
228
|
+
end
|
229
|
+
|
230
|
+
# Returns the object in the form of hash
|
231
|
+
# @return [Hash] Returns the object in the form of hash
|
232
|
+
def to_hash
|
233
|
+
hash = {}
|
234
|
+
self.class.attribute_map.each_pair do |attr, param|
|
235
|
+
value = self.send(attr)
|
236
|
+
if value.nil?
|
237
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
238
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
239
|
+
end
|
240
|
+
|
241
|
+
hash[param] = _to_hash(value)
|
242
|
+
end
|
243
|
+
hash
|
244
|
+
end
|
245
|
+
|
246
|
+
# Outputs non-array value in the form of hash
|
247
|
+
# For object, use to_hash. Otherwise, just return the value
|
248
|
+
# @param [Object] value Any valid value
|
249
|
+
# @return [Hash] Returns the value in the form of hash
|
250
|
+
def _to_hash(value)
|
251
|
+
if value.is_a?(Array)
|
252
|
+
value.compact.map { |v| _to_hash(v) }
|
253
|
+
elsif value.is_a?(Hash)
|
254
|
+
{}.tap do |hash|
|
255
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
256
|
+
end
|
257
|
+
elsif value.respond_to? :to_hash
|
258
|
+
value.to_hash
|
259
|
+
else
|
260
|
+
value
|
261
|
+
end
|
262
|
+
end
|
263
|
+
|
264
|
+
end
|
265
|
+
|
266
|
+
end
|
@@ -0,0 +1,221 @@
|
|
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 ReportDryRunQueriesResponse
|
18
|
+
attr_accessor :dry_run_query_results
|
19
|
+
|
20
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
21
|
+
def self.attribute_map
|
22
|
+
{
|
23
|
+
:'dry_run_query_results' => :'dry_run_query_results'
|
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
|
+
:'dry_run_query_results' => :'Array<ReportDryRunQueryResult>'
|
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::ReportDryRunQueriesResponse` 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::ReportDryRunQueriesResponse`. 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?(:'dry_run_query_results')
|
61
|
+
if (value = attributes[:'dry_run_query_results']).is_a?(Array)
|
62
|
+
self.dry_run_query_results = value
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
68
|
+
# @return Array for valid properties with the reasons
|
69
|
+
def list_invalid_properties
|
70
|
+
invalid_properties = Array.new
|
71
|
+
invalid_properties
|
72
|
+
end
|
73
|
+
|
74
|
+
# Check to see if the all the properties in the model are valid
|
75
|
+
# @return true if the model is valid
|
76
|
+
def valid?
|
77
|
+
true
|
78
|
+
end
|
79
|
+
|
80
|
+
# Checks equality by comparing each attribute.
|
81
|
+
# @param [Object] Object to be compared
|
82
|
+
def ==(o)
|
83
|
+
return true if self.equal?(o)
|
84
|
+
self.class == o.class &&
|
85
|
+
dry_run_query_results == o.dry_run_query_results
|
86
|
+
end
|
87
|
+
|
88
|
+
# @see the `==` method
|
89
|
+
# @param [Object] Object to be compared
|
90
|
+
def eql?(o)
|
91
|
+
self == o
|
92
|
+
end
|
93
|
+
|
94
|
+
# Calculates hash code according to all attributes.
|
95
|
+
# @return [Integer] Hash code
|
96
|
+
def hash
|
97
|
+
[dry_run_query_results].hash
|
98
|
+
end
|
99
|
+
|
100
|
+
# Builds the object from hash
|
101
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
102
|
+
# @return [Object] Returns the model itself
|
103
|
+
def self.build_from_hash(attributes)
|
104
|
+
new.build_from_hash(attributes)
|
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 build_from_hash(attributes)
|
111
|
+
return nil unless attributes.is_a?(Hash)
|
112
|
+
attributes = attributes.transform_keys(&:to_sym)
|
113
|
+
self.class.openapi_types.each_pair do |key, type|
|
114
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
115
|
+
self.send("#{key}=", nil)
|
116
|
+
elsif type =~ /\AArray<(.*)>/i
|
117
|
+
# check to ensure the input is an array given that the attribute
|
118
|
+
# is documented as an array but the input is not
|
119
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
120
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
121
|
+
end
|
122
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
123
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
self
|
128
|
+
end
|
129
|
+
|
130
|
+
# Deserializes the data based on type
|
131
|
+
# @param string type Data type
|
132
|
+
# @param string value Value to be deserialized
|
133
|
+
# @return [Object] Deserialized data
|
134
|
+
def _deserialize(type, value)
|
135
|
+
case type.to_sym
|
136
|
+
when :Time
|
137
|
+
Time.parse(value)
|
138
|
+
when :Date
|
139
|
+
Date.parse(value)
|
140
|
+
when :String
|
141
|
+
value.to_s
|
142
|
+
when :Integer
|
143
|
+
value.to_i
|
144
|
+
when :Float
|
145
|
+
value.to_f
|
146
|
+
when :Boolean
|
147
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
148
|
+
true
|
149
|
+
else
|
150
|
+
false
|
151
|
+
end
|
152
|
+
when :Object
|
153
|
+
# generic object (usually a Hash), return directly
|
154
|
+
value
|
155
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
156
|
+
inner_type = Regexp.last_match[:inner_type]
|
157
|
+
value.map { |v| _deserialize(inner_type, v) }
|
158
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
159
|
+
k_type = Regexp.last_match[:k_type]
|
160
|
+
v_type = Regexp.last_match[:v_type]
|
161
|
+
{}.tap do |hash|
|
162
|
+
value.each do |k, v|
|
163
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
164
|
+
end
|
165
|
+
end
|
166
|
+
else # model
|
167
|
+
# models (e.g. Pet) or oneOf
|
168
|
+
klass = UltracartClient.const_get(type)
|
169
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
173
|
+
# Returns the string representation of the object
|
174
|
+
# @return [String] String presentation of the object
|
175
|
+
def to_s
|
176
|
+
to_hash.to_s
|
177
|
+
end
|
178
|
+
|
179
|
+
# to_body is an alias to to_hash (backward compatibility)
|
180
|
+
# @return [Hash] Returns the object in the form of hash
|
181
|
+
def to_body
|
182
|
+
to_hash
|
183
|
+
end
|
184
|
+
|
185
|
+
# Returns the object in the form of hash
|
186
|
+
# @return [Hash] Returns the object in the form of hash
|
187
|
+
def to_hash
|
188
|
+
hash = {}
|
189
|
+
self.class.attribute_map.each_pair do |attr, param|
|
190
|
+
value = self.send(attr)
|
191
|
+
if value.nil?
|
192
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
193
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
194
|
+
end
|
195
|
+
|
196
|
+
hash[param] = _to_hash(value)
|
197
|
+
end
|
198
|
+
hash
|
199
|
+
end
|
200
|
+
|
201
|
+
# Outputs non-array value in the form of hash
|
202
|
+
# For object, use to_hash. Otherwise, just return the value
|
203
|
+
# @param [Object] value Any valid value
|
204
|
+
# @return [Hash] Returns the value in the form of hash
|
205
|
+
def _to_hash(value)
|
206
|
+
if value.is_a?(Array)
|
207
|
+
value.compact.map { |v| _to_hash(v) }
|
208
|
+
elsif value.is_a?(Hash)
|
209
|
+
{}.tap do |hash|
|
210
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
211
|
+
end
|
212
|
+
elsif value.respond_to? :to_hash
|
213
|
+
value.to_hash
|
214
|
+
else
|
215
|
+
value
|
216
|
+
end
|
217
|
+
end
|
218
|
+
|
219
|
+
end
|
220
|
+
|
221
|
+
end
|