postfinancecheckout-ruby-sdk 3.1.4 → 3.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +4 -4
  3. data/README.md +3 -1
  4. data/lib/postfinancecheckout-ruby-sdk/api/analytics_query_service_api.rb +381 -0
  5. data/lib/postfinancecheckout-ruby-sdk/api_client.rb +12 -0
  6. data/lib/postfinancecheckout-ruby-sdk/configuration.rb +4 -1
  7. data/lib/postfinancecheckout-ruby-sdk/models/analytics_query.rb +272 -0
  8. data/lib/postfinancecheckout-ruby-sdk/models/analytics_query_execution.rb +293 -0
  9. data/lib/postfinancecheckout-ruby-sdk/models/analytics_query_execution_state.rb +37 -0
  10. data/lib/postfinancecheckout-ruby-sdk/models/analytics_query_result_batch.rb +225 -0
  11. data/lib/postfinancecheckout-ruby-sdk/models/analytics_schema_column.rb +263 -0
  12. data/lib/postfinancecheckout-ruby-sdk/models/analytics_schema_table.rb +215 -0
  13. data/lib/postfinancecheckout-ruby-sdk/models/rendered_document.rb +17 -5
  14. data/lib/postfinancecheckout-ruby-sdk/models/rendered_terminal_receipt.rb +17 -5
  15. data/lib/postfinancecheckout-ruby-sdk/models/rendered_terminal_transaction_summary.rb +17 -5
  16. data/lib/postfinancecheckout-ruby-sdk/models/transaction_completion.rb +26 -1
  17. data/lib/postfinancecheckout-ruby-sdk/models/transaction_completion_request.rb +26 -1
  18. data/lib/postfinancecheckout-ruby-sdk/version.rb +1 -1
  19. data/lib/postfinancecheckout-ruby-sdk.rb +7 -0
  20. data/test/condition_type_service_test.rb +1 -0
  21. data/test/transaction_create_service_test.rb +1 -0
  22. data/test/transaction_payment_page_service_test.rb +1 -0
  23. data/vendor/bundle/ruby/2.4.0/cache/addressable-2.8.1.gem +0 -0
  24. data/vendor/bundle/ruby/2.4.0/extensions/x86_64-linux/2.4.0/ffi-1.15.5/gem_make.out +2 -2
  25. data/vendor/bundle/ruby/2.4.0/extensions/x86_64-linux/2.4.0/json-2.6.2/gem_make.out +1 -1
  26. data/vendor/bundle/ruby/2.4.0/extensions/x86_64-linux/2.4.0/json-2.6.2/mkmf.log +1 -1
  27. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/CHANGELOG.md +16 -0
  28. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/Gemfile +4 -2
  29. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/LICENSE.txt +0 -0
  30. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/README.md +0 -0
  31. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/Rakefile +0 -0
  32. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/data/unicode.data +0 -0
  33. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/lib/addressable/idna/native.rb +0 -1
  34. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/lib/addressable/idna/pure.rb +0 -1
  35. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/lib/addressable/idna.rb +0 -1
  36. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/lib/addressable/template.rb +3 -4
  37. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/lib/addressable/uri.rb +57 -53
  38. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/lib/addressable/version.rb +1 -2
  39. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/lib/addressable.rb +0 -0
  40. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/spec/addressable/idna_spec.rb +0 -1
  41. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/spec/addressable/net_http_compat_spec.rb +0 -1
  42. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/spec/addressable/security_spec.rb +0 -1
  43. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/spec/addressable/template_spec.rb +9 -1
  44. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/spec/addressable/uri_spec.rb +81 -1
  45. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/spec/spec_helper.rb +0 -0
  46. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/tasks/clobber.rake +0 -0
  47. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/tasks/gem.rake +5 -2
  48. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/tasks/git.rake +0 -0
  49. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/tasks/metrics.rake +0 -0
  50. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/tasks/profile.rake +0 -0
  51. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/tasks/rspec.rake +0 -0
  52. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/tasks/yard.rake +0 -0
  53. data/vendor/bundle/ruby/2.4.0/gems/ffi-1.15.5/ext/ffi_c/Makefile +3 -3
  54. data/vendor/bundle/ruby/2.4.0/gems/json-2.6.2/ext/json/Makefile +2 -2
  55. data/vendor/bundle/ruby/2.4.0/gems/json-2.6.2/ext/json/ext/generator/Makefile +2 -2
  56. data/vendor/bundle/ruby/2.4.0/gems/json-2.6.2/ext/json/ext/parser/Makefile +2 -2
  57. data/vendor/bundle/ruby/2.4.0/specifications/{addressable-2.8.0.gemspec → addressable-2.8.1.gemspec} +8 -7
  58. metadata +37 -31
  59. data/vendor/bundle/ruby/2.4.0/cache/addressable-2.8.0.gem +0 -0
  60. data/vendor/bundle/ruby/2.4.0/gems/addressable-2.8.0/addressable.gemspec +0 -37
@@ -0,0 +1,272 @@
1
+ =begin
2
+ The PostFinance Checkout API allows an easy interaction with the PostFinance Checkout web service.
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+
16
+ =end
17
+
18
+ require 'date'
19
+
20
+ module PostFinanceCheckout
21
+ # Represents a query to be submitted for execution in Analytics.
22
+ class AnalyticsQuery
23
+ # The mandatory ID of an account in which the query shall be executed. Must be a valid account ID greater than 0.
24
+ attr_accessor :account_id
25
+
26
+ # A client generated nonce which uniquely identifies the query to be executed. Subsequent submissions with the same external ID will not re-execute the query but instead return the existing execution with that ID. Either the External ID or a Maximal Cache Age greater than 0 must be specified. If both are specified the External ID will have precedence and the Maximal Cache Age will be ignored.
27
+ attr_accessor :external_id
28
+
29
+ # The maximal age in minutes of cached query executions to return. If an equivalent query execution with the same Query String, Account ID and Spaces parameters not older than the specified age is already available that execution will be returned instead of a newly started execution. Set to 0 or null (and set a unique, previously unused External ID) to force a new query execution irrespective of previous executions. Either the External ID or a Cache Duration greater than 0 must be specified. If both are specified, the External ID will be preferred (and the Maximal Cache Age ignored).
30
+ attr_accessor :max_cache_age
31
+
32
+ # The SQL statement which is being submitted for execution. Must be a valid PrestoDB/Athena SQL statement.
33
+ attr_accessor :query_string
34
+
35
+ # The maximal amount of scanned data that this query is allowed to scan. After this limit is reached query will be canceled by the system.
36
+ attr_accessor :scanned_data_limit
37
+
38
+ # The IDs of the spaces in which the query shall be executed. At most 5 space IDs may be specified. All specified spaces must be owned by the account specified by the accountId property. The spaces property may be missing or empty to query all spaces of the specified account.
39
+ attr_accessor :space_ids
40
+
41
+ # Attribute mapping from ruby-style variable name to JSON key.
42
+ def self.attribute_map
43
+ {
44
+ :'account_id' => :'accountId',
45
+ :'external_id' => :'externalId',
46
+ :'max_cache_age' => :'maxCacheAge',
47
+ :'query_string' => :'queryString',
48
+ :'scanned_data_limit' => :'scannedDataLimit',
49
+ :'space_ids' => :'spaceIds'
50
+ }
51
+ end
52
+
53
+ # Attribute type mapping.
54
+ def self.swagger_types
55
+ {
56
+ :'account_id' => :'Integer',
57
+ :'external_id' => :'String',
58
+ :'max_cache_age' => :'Integer',
59
+ :'query_string' => :'String',
60
+ :'scanned_data_limit' => :'Float',
61
+ :'space_ids' => :'Array<Integer>'
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?(:'accountId')
74
+ self.account_id = attributes[:'accountId']
75
+ end
76
+
77
+ if attributes.has_key?(:'externalId')
78
+ self.external_id = attributes[:'externalId']
79
+ end
80
+
81
+ if attributes.has_key?(:'maxCacheAge')
82
+ self.max_cache_age = attributes[:'maxCacheAge']
83
+ end
84
+
85
+ if attributes.has_key?(:'queryString')
86
+ self.query_string = attributes[:'queryString']
87
+ end
88
+
89
+ if attributes.has_key?(:'scannedDataLimit')
90
+ self.scanned_data_limit = attributes[:'scannedDataLimit']
91
+ end
92
+
93
+ if attributes.has_key?(:'spaceIds')
94
+ if (value = attributes[:'spaceIds']).is_a?(Array)
95
+ self.space_ids = value
96
+ end
97
+ end
98
+ end
99
+
100
+ # Show invalid properties with the reasons. Usually used together with valid?
101
+ # @return Array for valid properties with the reasons
102
+ def list_invalid_properties
103
+ invalid_properties = Array.new
104
+ if @account_id.nil?
105
+ invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
106
+ end
107
+
108
+ if !@query_string.nil? && @query_string.to_s.length > 4096
109
+ invalid_properties.push('invalid value for "query_string", the character length must be smaller than or equal to 4096.')
110
+ end
111
+
112
+ if !@query_string.nil? && @query_string.to_s.length < 1
113
+ invalid_properties.push('invalid value for "query_string", the character length must be great than or equal to 1.')
114
+ end
115
+
116
+ invalid_properties
117
+ end
118
+
119
+ # Check to see if the all the properties in the model are valid
120
+ # @return true if the model is valid
121
+ def valid?
122
+ return false if @account_id.nil?
123
+ return false if !@query_string.nil? && @query_string.to_s.length > 4096
124
+ return false if !@query_string.nil? && @query_string.to_s.length < 1
125
+ true
126
+ end
127
+
128
+ # Custom attribute writer method with validation
129
+ # @param [Object] query_string Value to be assigned
130
+ def query_string=(query_string)
131
+ if !query_string.nil? && query_string.to_s.length > 4096
132
+ fail ArgumentError, 'invalid value for "query_string", the character length must be smaller than or equal to 4096.'
133
+ end
134
+
135
+ if !query_string.nil? && query_string.to_s.length < 1
136
+ fail ArgumentError, 'invalid value for "query_string", the character length must be great than or equal to 1.'
137
+ end
138
+
139
+ @query_string = query_string
140
+ end
141
+
142
+ # Checks equality by comparing each attribute.
143
+ # @param [Object] Object to be compared
144
+ def ==(o)
145
+ return true if self.equal?(o)
146
+ self.class == o.class &&
147
+ account_id == o.account_id &&
148
+ external_id == o.external_id &&
149
+ max_cache_age == o.max_cache_age &&
150
+ query_string == o.query_string &&
151
+ scanned_data_limit == o.scanned_data_limit &&
152
+ space_ids == o.space_ids
153
+ end
154
+
155
+ # @see the `==` method
156
+ # @param [Object] Object to be compared
157
+ def eql?(o)
158
+ self == o
159
+ end
160
+
161
+ # Calculates hash code according to all attributes.
162
+ # @return [Fixnum] Hash code
163
+ def hash
164
+ [account_id, external_id, max_cache_age, query_string, scanned_data_limit, space_ids].hash
165
+ end
166
+
167
+ # Builds the object from hash
168
+ # @param [Hash] attributes Model attributes in the form of hash
169
+ # @return [Object] Returns the model itself
170
+ def build_from_hash(attributes)
171
+ return nil unless attributes.is_a?(Hash)
172
+ self.class.swagger_types.each_pair do |key, type|
173
+ if type =~ /\AArray<(.*)>/i
174
+ # check to ensure the input is an array given that the attribute
175
+ # is documented as an array but the input is not
176
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
177
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
178
+ end
179
+ elsif !attributes[self.class.attribute_map[key]].nil?
180
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
181
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
182
+ end
183
+
184
+ self
185
+ end
186
+
187
+ # Deserializes the data based on type
188
+ # @param string type Data type
189
+ # @param string value Value to be deserialized
190
+ # @return [Object] Deserialized data
191
+ def _deserialize(type, value)
192
+ case type.to_sym
193
+ when :DateTime
194
+ DateTime.parse(value)
195
+ when :Date
196
+ Date.parse(value)
197
+ when :String
198
+ value.to_s
199
+ when :Integer
200
+ value.to_i
201
+ when :Float
202
+ value.to_f
203
+ when :BOOLEAN
204
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
205
+ true
206
+ else
207
+ false
208
+ end
209
+ when :Object
210
+ # generic object (usually a Hash), return directly
211
+ value
212
+ when /\AArray<(?<inner_type>.+)>\z/
213
+ inner_type = Regexp.last_match[:inner_type]
214
+ value.map { |v| _deserialize(inner_type, v) }
215
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
216
+ k_type = Regexp.last_match[:k_type]
217
+ v_type = Regexp.last_match[:v_type]
218
+ {}.tap do |hash|
219
+ value.each do |k, v|
220
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
221
+ end
222
+ end
223
+ else # model
224
+ temp_model = PostFinanceCheckout.const_get(type).new
225
+ temp_model.build_from_hash(value)
226
+ end
227
+ end
228
+
229
+ # Returns the string representation of the object
230
+ # @return [String] String presentation of the object
231
+ def to_s
232
+ to_hash.to_s
233
+ end
234
+
235
+ # to_body is an alias to to_hash (backward compatibility)
236
+ # @return [Hash] Returns the object in the form of hash
237
+ def to_body
238
+ to_hash
239
+ end
240
+
241
+ # Returns the object in the form of hash
242
+ # @return [Hash] Returns the object in the form of hash
243
+ def to_hash
244
+ hash = {}
245
+ self.class.attribute_map.each_pair do |attr, param|
246
+ value = self.send(attr)
247
+ next if value.nil?
248
+ hash[param] = _to_hash(value)
249
+ end
250
+ hash
251
+ end
252
+
253
+ # Outputs non-array value in the form of hash
254
+ # For object, use to_hash. Otherwise, just return the value
255
+ # @param [Object] value Any valid value
256
+ # @return [Hash] Returns the value in the form of hash
257
+ def _to_hash(value)
258
+ if value.is_a?(Array)
259
+ value.compact.map{ |v| _to_hash(v) }
260
+ elsif value.is_a?(Hash)
261
+ {}.tap do |hash|
262
+ value.each { |k, v| hash[k] = _to_hash(v) }
263
+ end
264
+ elsif value.respond_to? :to_hash
265
+ value.to_hash
266
+ else
267
+ value
268
+ end
269
+ end
270
+
271
+ end
272
+ end
@@ -0,0 +1,293 @@
1
+ =begin
2
+ The PostFinance Checkout API allows an easy interaction with the PostFinance Checkout web service.
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+
16
+ =end
17
+
18
+ require 'date'
19
+
20
+ module PostFinanceCheckout
21
+ # Represents the execution of a query which has been submitted to Analytics.
22
+ class AnalyticsQueryExecution
23
+ # The account in which the query has been executed.
24
+ attr_accessor :account
25
+
26
+ # The External ID of the query if one had been specified; otherwise null.
27
+ attr_accessor :external_id
28
+
29
+ # The reason of the failure if and only if the query has failed, otherwise null.
30
+ attr_accessor :failure_reason
31
+
32
+ # The ID is the primary key of the entity. The ID identifies the entity uniquely.
33
+ attr_accessor :id
34
+
35
+ # The time at which processing of the query has finished (either successfully or by failure or by cancelation). Will be null if the query execution has not finished yet.
36
+ attr_accessor :processing_end_time
37
+
38
+ # The time at which processing of the query has started (never null).
39
+ attr_accessor :processing_start_time
40
+
41
+ # The SQL statement which has been submitted for execution.
42
+ attr_accessor :query_string
43
+
44
+ # The amount of data scanned while processing the query (in GB). (Note that this amount may increase over time while the query is still being processed and not finished yet.)
45
+ attr_accessor :scanned_data_in_gb
46
+
47
+ # The maximal amount of scanned data that this query is allowed to scan. After this limit is reached query will be canceled by the system.
48
+ attr_accessor :scanned_data_limit
49
+
50
+ # The spaces in which the query has been executed. May be empty if all spaces of the specified account have been queried.
51
+ attr_accessor :spaces
52
+
53
+ # The current state of the query execution.
54
+ attr_accessor :state
55
+
56
+ # Attribute mapping from ruby-style variable name to JSON key.
57
+ def self.attribute_map
58
+ {
59
+ :'account' => :'account',
60
+ :'external_id' => :'externalId',
61
+ :'failure_reason' => :'failureReason',
62
+ :'id' => :'id',
63
+ :'processing_end_time' => :'processingEndTime',
64
+ :'processing_start_time' => :'processingStartTime',
65
+ :'query_string' => :'queryString',
66
+ :'scanned_data_in_gb' => :'scannedDataInGb',
67
+ :'scanned_data_limit' => :'scannedDataLimit',
68
+ :'spaces' => :'spaces',
69
+ :'state' => :'state'
70
+ }
71
+ end
72
+
73
+ # Attribute type mapping.
74
+ def self.swagger_types
75
+ {
76
+ :'account' => :'Integer',
77
+ :'external_id' => :'String',
78
+ :'failure_reason' => :'FailureReason',
79
+ :'id' => :'Integer',
80
+ :'processing_end_time' => :'DateTime',
81
+ :'processing_start_time' => :'DateTime',
82
+ :'query_string' => :'String',
83
+ :'scanned_data_in_gb' => :'Float',
84
+ :'scanned_data_limit' => :'Float',
85
+ :'spaces' => :'Array<Integer>',
86
+ :'state' => :'AnalyticsQueryExecutionState'
87
+ }
88
+ end
89
+
90
+ # Initializes the object
91
+ # @param [Hash] attributes Model attributes in the form of hash
92
+ def initialize(attributes = {})
93
+ return unless attributes.is_a?(Hash)
94
+
95
+ # convert string to symbol for hash key
96
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
97
+
98
+ if attributes.has_key?(:'account')
99
+ self.account = attributes[:'account']
100
+ end
101
+
102
+ if attributes.has_key?(:'externalId')
103
+ self.external_id = attributes[:'externalId']
104
+ end
105
+
106
+ if attributes.has_key?(:'failureReason')
107
+ self.failure_reason = attributes[:'failureReason']
108
+ end
109
+
110
+ if attributes.has_key?(:'id')
111
+ self.id = attributes[:'id']
112
+ end
113
+
114
+ if attributes.has_key?(:'processingEndTime')
115
+ self.processing_end_time = attributes[:'processingEndTime']
116
+ end
117
+
118
+ if attributes.has_key?(:'processingStartTime')
119
+ self.processing_start_time = attributes[:'processingStartTime']
120
+ end
121
+
122
+ if attributes.has_key?(:'queryString')
123
+ self.query_string = attributes[:'queryString']
124
+ end
125
+
126
+ if attributes.has_key?(:'scannedDataInGb')
127
+ self.scanned_data_in_gb = attributes[:'scannedDataInGb']
128
+ end
129
+
130
+ if attributes.has_key?(:'scannedDataLimit')
131
+ self.scanned_data_limit = attributes[:'scannedDataLimit']
132
+ end
133
+
134
+ if attributes.has_key?(:'spaces')
135
+ if (value = attributes[:'spaces']).is_a?(Array)
136
+ self.spaces = value
137
+ end
138
+ end
139
+
140
+ if attributes.has_key?(:'state')
141
+ self.state = attributes[:'state']
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
+ account == o.account &&
164
+ external_id == o.external_id &&
165
+ failure_reason == o.failure_reason &&
166
+ id == o.id &&
167
+ processing_end_time == o.processing_end_time &&
168
+ processing_start_time == o.processing_start_time &&
169
+ query_string == o.query_string &&
170
+ scanned_data_in_gb == o.scanned_data_in_gb &&
171
+ scanned_data_limit == o.scanned_data_limit &&
172
+ spaces == o.spaces &&
173
+ state == o.state
174
+ end
175
+
176
+ # @see the `==` method
177
+ # @param [Object] Object to be compared
178
+ def eql?(o)
179
+ self == o
180
+ end
181
+
182
+ # Calculates hash code according to all attributes.
183
+ # @return [Fixnum] Hash code
184
+ def hash
185
+ [account, external_id, failure_reason, id, processing_end_time, processing_start_time, query_string, scanned_data_in_gb, scanned_data_limit, spaces, state].hash
186
+ end
187
+
188
+ # Builds the object from hash
189
+ # @param [Hash] attributes Model attributes in the form of hash
190
+ # @return [Object] Returns the model itself
191
+ def build_from_hash(attributes)
192
+ return nil unless attributes.is_a?(Hash)
193
+ self.class.swagger_types.each_pair do |key, type|
194
+ if type =~ /\AArray<(.*)>/i
195
+ # check to ensure the input is an array given that the attribute
196
+ # is documented as an array but the input is not
197
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
198
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
199
+ end
200
+ elsif !attributes[self.class.attribute_map[key]].nil?
201
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
202
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
203
+ end
204
+
205
+ self
206
+ end
207
+
208
+ # Deserializes the data based on type
209
+ # @param string type Data type
210
+ # @param string value Value to be deserialized
211
+ # @return [Object] Deserialized data
212
+ def _deserialize(type, value)
213
+ case type.to_sym
214
+ when :DateTime
215
+ DateTime.parse(value)
216
+ when :Date
217
+ Date.parse(value)
218
+ when :String
219
+ value.to_s
220
+ when :Integer
221
+ value.to_i
222
+ when :Float
223
+ value.to_f
224
+ when :BOOLEAN
225
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
226
+ true
227
+ else
228
+ false
229
+ end
230
+ when :Object
231
+ # generic object (usually a Hash), return directly
232
+ value
233
+ when /\AArray<(?<inner_type>.+)>\z/
234
+ inner_type = Regexp.last_match[:inner_type]
235
+ value.map { |v| _deserialize(inner_type, v) }
236
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
237
+ k_type = Regexp.last_match[:k_type]
238
+ v_type = Regexp.last_match[:v_type]
239
+ {}.tap do |hash|
240
+ value.each do |k, v|
241
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
242
+ end
243
+ end
244
+ else # model
245
+ temp_model = PostFinanceCheckout.const_get(type).new
246
+ temp_model.build_from_hash(value)
247
+ end
248
+ end
249
+
250
+ # Returns the string representation of the object
251
+ # @return [String] String presentation of the object
252
+ def to_s
253
+ to_hash.to_s
254
+ end
255
+
256
+ # to_body is an alias to to_hash (backward compatibility)
257
+ # @return [Hash] Returns the object in the form of hash
258
+ def to_body
259
+ to_hash
260
+ end
261
+
262
+ # Returns the object in the form of hash
263
+ # @return [Hash] Returns the object in the form of hash
264
+ def to_hash
265
+ hash = {}
266
+ self.class.attribute_map.each_pair do |attr, param|
267
+ value = self.send(attr)
268
+ next if value.nil?
269
+ hash[param] = _to_hash(value)
270
+ end
271
+ hash
272
+ end
273
+
274
+ # Outputs non-array value in the form of hash
275
+ # For object, use to_hash. Otherwise, just return the value
276
+ # @param [Object] value Any valid value
277
+ # @return [Hash] Returns the value in the form of hash
278
+ def _to_hash(value)
279
+ if value.is_a?(Array)
280
+ value.compact.map{ |v| _to_hash(v) }
281
+ elsif value.is_a?(Hash)
282
+ {}.tap do |hash|
283
+ value.each { |k, v| hash[k] = _to_hash(v) }
284
+ end
285
+ elsif value.respond_to? :to_hash
286
+ value.to_hash
287
+ else
288
+ value
289
+ end
290
+ end
291
+
292
+ end
293
+ end
@@ -0,0 +1,37 @@
1
+ =begin
2
+ The PostFinance Checkout API allows an easy interaction with the PostFinance Checkout web service.
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+
16
+ =end
17
+
18
+ require 'date'
19
+
20
+ module PostFinanceCheckout
21
+ class AnalyticsQueryExecutionState
22
+
23
+ PROCESSING = 'PROCESSING'.freeze
24
+ PROCESSED = 'PROCESSED'.freeze
25
+ FAILED = 'FAILED'.freeze
26
+ CANCELED = 'CANCELED'.freeze
27
+
28
+ # Builds the enum from string
29
+ # @param [String] The enum value in the form of the string
30
+ # @return [String] The enum value
31
+ def build_from_hash(value)
32
+ constantValues = AnalyticsQueryExecutionState.constants.select { |c| AnalyticsQueryExecutionState::const_get(c) == value }
33
+ raise "Invalid ENUM value #{value} for class #AnalyticsQueryExecutionState" if constantValues.empty?
34
+ value
35
+ end
36
+ end
37
+ end