pnap_payments_api 1.0.3 → 1.0.5
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/VERSION +1 -1
- data/lib/pnap_payments_api/api/transactions_api.rb +3 -3
- data/lib/pnap_payments_api/api_client.rb +17 -14
- data/lib/pnap_payments_api/api_error.rb +1 -1
- data/lib/pnap_payments_api/api_model_base.rb +88 -0
- data/lib/pnap_payments_api/configuration.rb +11 -1
- data/lib/pnap_payments_api/models/card_payment_method_details.rb +21 -78
- data/lib/pnap_payments_api/models/error.rb +21 -78
- data/lib/pnap_payments_api/models/paginated_response.rb +41 -78
- data/lib/pnap_payments_api/models/paginated_transactions.rb +51 -78
- data/lib/pnap_payments_api/models/transaction.rb +81 -78
- data/lib/pnap_payments_api/models/transaction_metadata.rb +31 -78
- data/lib/pnap_payments_api/version.rb +1 -2
- data/lib/pnap_payments_api.rb +2 -1
- data/pnap_payments_api.gemspec +6 -6
- data/spec/api/transactions_api_spec.rb +1 -1
- data/spec/models/card_payment_method_details_spec.rb +2 -2
- data/spec/models/error_spec.rb +2 -2
- data/spec/models/paginated_response_spec.rb +2 -2
- data/spec/models/paginated_transactions_spec.rb +2 -2
- data/spec/models/transaction_metadata_spec.rb +2 -2
- data/spec/models/transaction_spec.rb +2 -2
- data/spec/spec_helper.rb +1 -1
- metadata +10 -10
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 0.1
|
|
7
7
|
Contact: support@phoenixnap.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
|
|
9
|
+
Generator version: 7.20.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module PaymentsApi
|
|
17
|
-
class PaginatedResponse
|
|
17
|
+
class PaginatedResponse < ApiModelBase
|
|
18
18
|
# Maximum number of items in the page (actual returned length can be less).
|
|
19
19
|
attr_accessor :limit
|
|
20
20
|
|
|
@@ -33,9 +33,14 @@ module PaymentsApi
|
|
|
33
33
|
}
|
|
34
34
|
end
|
|
35
35
|
|
|
36
|
+
# Returns attribute mapping this model knows about
|
|
37
|
+
def self.acceptable_attribute_map
|
|
38
|
+
attribute_map
|
|
39
|
+
end
|
|
40
|
+
|
|
36
41
|
# Returns all the JSON keys this model knows about
|
|
37
42
|
def self.acceptable_attributes
|
|
38
|
-
|
|
43
|
+
acceptable_attribute_map.values
|
|
39
44
|
end
|
|
40
45
|
|
|
41
46
|
# Attribute type mapping.
|
|
@@ -61,9 +66,10 @@ module PaymentsApi
|
|
|
61
66
|
end
|
|
62
67
|
|
|
63
68
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
69
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
64
70
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
65
|
-
if (!
|
|
66
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `PaymentsApi::PaginatedResponse`. Please check the name to make sure it's valid. List of attributes: " +
|
|
71
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
72
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PaymentsApi::PaginatedResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
67
73
|
end
|
|
68
74
|
h[k.to_sym] = v
|
|
69
75
|
}
|
|
@@ -117,6 +123,36 @@ module PaymentsApi
|
|
|
117
123
|
true
|
|
118
124
|
end
|
|
119
125
|
|
|
126
|
+
# Custom attribute writer method with validation
|
|
127
|
+
# @param [Object] limit Value to be assigned
|
|
128
|
+
def limit=(limit)
|
|
129
|
+
if limit.nil?
|
|
130
|
+
fail ArgumentError, 'limit cannot be nil'
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
@limit = limit
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
# Custom attribute writer method with validation
|
|
137
|
+
# @param [Object] offset Value to be assigned
|
|
138
|
+
def offset=(offset)
|
|
139
|
+
if offset.nil?
|
|
140
|
+
fail ArgumentError, 'offset cannot be nil'
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
@offset = offset
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# Custom attribute writer method with validation
|
|
147
|
+
# @param [Object] total Value to be assigned
|
|
148
|
+
def total=(total)
|
|
149
|
+
if total.nil?
|
|
150
|
+
fail ArgumentError, 'total cannot be nil'
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
@total = total
|
|
154
|
+
end
|
|
155
|
+
|
|
120
156
|
# Checks equality by comparing each attribute.
|
|
121
157
|
# @param [Object] Object to be compared
|
|
122
158
|
def ==(o)
|
|
@@ -162,61 +198,6 @@ module PaymentsApi
|
|
|
162
198
|
new(transformed_hash)
|
|
163
199
|
end
|
|
164
200
|
|
|
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 self._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 = PaymentsApi.const_get(type)
|
|
204
|
-
klass.respond_to?(:openapi_any_of) || 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
201
|
# Returns the object in the form of hash
|
|
221
202
|
# @return [Hash] Returns the object in the form of hash
|
|
222
203
|
def to_hash
|
|
@@ -233,24 +214,6 @@ module PaymentsApi
|
|
|
233
214
|
hash
|
|
234
215
|
end
|
|
235
216
|
|
|
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
217
|
end
|
|
255
218
|
|
|
256
219
|
end
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 0.1
|
|
7
7
|
Contact: support@phoenixnap.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
|
|
9
|
+
Generator version: 7.20.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module PaymentsApi
|
|
17
|
-
class PaginatedTransactions
|
|
17
|
+
class PaginatedTransactions < ApiModelBase
|
|
18
18
|
# Maximum number of items in the page (actual returned length can be less).
|
|
19
19
|
attr_accessor :limit
|
|
20
20
|
|
|
@@ -36,9 +36,14 @@ module PaymentsApi
|
|
|
36
36
|
}
|
|
37
37
|
end
|
|
38
38
|
|
|
39
|
+
# Returns attribute mapping this model knows about
|
|
40
|
+
def self.acceptable_attribute_map
|
|
41
|
+
attribute_map
|
|
42
|
+
end
|
|
43
|
+
|
|
39
44
|
# Returns all the JSON keys this model knows about
|
|
40
45
|
def self.acceptable_attributes
|
|
41
|
-
|
|
46
|
+
acceptable_attribute_map.values
|
|
42
47
|
end
|
|
43
48
|
|
|
44
49
|
# Attribute type mapping.
|
|
@@ -72,9 +77,10 @@ module PaymentsApi
|
|
|
72
77
|
end
|
|
73
78
|
|
|
74
79
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
80
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
75
81
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
76
|
-
if (!
|
|
77
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `PaymentsApi::PaginatedTransactions`. Please check the name to make sure it's valid. List of attributes: " +
|
|
82
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
83
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PaymentsApi::PaginatedTransactions`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
78
84
|
end
|
|
79
85
|
h[k.to_sym] = v
|
|
80
86
|
}
|
|
@@ -141,6 +147,46 @@ module PaymentsApi
|
|
|
141
147
|
true
|
|
142
148
|
end
|
|
143
149
|
|
|
150
|
+
# Custom attribute writer method with validation
|
|
151
|
+
# @param [Object] limit Value to be assigned
|
|
152
|
+
def limit=(limit)
|
|
153
|
+
if limit.nil?
|
|
154
|
+
fail ArgumentError, 'limit cannot be nil'
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
@limit = limit
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
# Custom attribute writer method with validation
|
|
161
|
+
# @param [Object] offset Value to be assigned
|
|
162
|
+
def offset=(offset)
|
|
163
|
+
if offset.nil?
|
|
164
|
+
fail ArgumentError, 'offset cannot be nil'
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
@offset = offset
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
# Custom attribute writer method with validation
|
|
171
|
+
# @param [Object] total Value to be assigned
|
|
172
|
+
def total=(total)
|
|
173
|
+
if total.nil?
|
|
174
|
+
fail ArgumentError, 'total cannot be nil'
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
@total = total
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
# Custom attribute writer method with validation
|
|
181
|
+
# @param [Object] results Value to be assigned
|
|
182
|
+
def results=(results)
|
|
183
|
+
if results.nil?
|
|
184
|
+
fail ArgumentError, 'results cannot be nil'
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
@results = results
|
|
188
|
+
end
|
|
189
|
+
|
|
144
190
|
# Checks equality by comparing each attribute.
|
|
145
191
|
# @param [Object] Object to be compared
|
|
146
192
|
def ==(o)
|
|
@@ -187,61 +233,6 @@ module PaymentsApi
|
|
|
187
233
|
new(transformed_hash)
|
|
188
234
|
end
|
|
189
235
|
|
|
190
|
-
# Deserializes the data based on type
|
|
191
|
-
# @param string type Data type
|
|
192
|
-
# @param string value Value to be deserialized
|
|
193
|
-
# @return [Object] Deserialized data
|
|
194
|
-
def self._deserialize(type, value)
|
|
195
|
-
case type.to_sym
|
|
196
|
-
when :Time
|
|
197
|
-
Time.parse(value)
|
|
198
|
-
when :Date
|
|
199
|
-
Date.parse(value)
|
|
200
|
-
when :String
|
|
201
|
-
value.to_s
|
|
202
|
-
when :Integer
|
|
203
|
-
value.to_i
|
|
204
|
-
when :Float
|
|
205
|
-
value.to_f
|
|
206
|
-
when :Boolean
|
|
207
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
208
|
-
true
|
|
209
|
-
else
|
|
210
|
-
false
|
|
211
|
-
end
|
|
212
|
-
when :Object
|
|
213
|
-
# generic object (usually a Hash), return directly
|
|
214
|
-
value
|
|
215
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
216
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
217
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
218
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
219
|
-
k_type = Regexp.last_match[:k_type]
|
|
220
|
-
v_type = Regexp.last_match[:v_type]
|
|
221
|
-
{}.tap do |hash|
|
|
222
|
-
value.each do |k, v|
|
|
223
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
224
|
-
end
|
|
225
|
-
end
|
|
226
|
-
else # model
|
|
227
|
-
# models (e.g. Pet) or oneOf
|
|
228
|
-
klass = PaymentsApi.const_get(type)
|
|
229
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
230
|
-
end
|
|
231
|
-
end
|
|
232
|
-
|
|
233
|
-
# Returns the string representation of the object
|
|
234
|
-
# @return [String] String presentation of the object
|
|
235
|
-
def to_s
|
|
236
|
-
to_hash.to_s
|
|
237
|
-
end
|
|
238
|
-
|
|
239
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
240
|
-
# @return [Hash] Returns the object in the form of hash
|
|
241
|
-
def to_body
|
|
242
|
-
to_hash
|
|
243
|
-
end
|
|
244
|
-
|
|
245
236
|
# Returns the object in the form of hash
|
|
246
237
|
# @return [Hash] Returns the object in the form of hash
|
|
247
238
|
def to_hash
|
|
@@ -258,24 +249,6 @@ module PaymentsApi
|
|
|
258
249
|
hash
|
|
259
250
|
end
|
|
260
251
|
|
|
261
|
-
# Outputs non-array value in the form of hash
|
|
262
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
263
|
-
# @param [Object] value Any valid value
|
|
264
|
-
# @return [Hash] Returns the value in the form of hash
|
|
265
|
-
def _to_hash(value)
|
|
266
|
-
if value.is_a?(Array)
|
|
267
|
-
value.compact.map { |v| _to_hash(v) }
|
|
268
|
-
elsif value.is_a?(Hash)
|
|
269
|
-
{}.tap do |hash|
|
|
270
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
271
|
-
end
|
|
272
|
-
elsif value.respond_to? :to_hash
|
|
273
|
-
value.to_hash
|
|
274
|
-
else
|
|
275
|
-
value
|
|
276
|
-
end
|
|
277
|
-
end
|
|
278
|
-
|
|
279
252
|
end
|
|
280
253
|
|
|
281
254
|
end
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 0.1
|
|
7
7
|
Contact: support@phoenixnap.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
|
|
9
|
+
Generator version: 7.20.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -15,7 +15,7 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module PaymentsApi
|
|
17
17
|
# Transaction response model.
|
|
18
|
-
class Transaction
|
|
18
|
+
class Transaction < ApiModelBase
|
|
19
19
|
# The Transaction ID.
|
|
20
20
|
attr_accessor :id
|
|
21
21
|
|
|
@@ -52,9 +52,14 @@ module PaymentsApi
|
|
|
52
52
|
}
|
|
53
53
|
end
|
|
54
54
|
|
|
55
|
+
# Returns attribute mapping this model knows about
|
|
56
|
+
def self.acceptable_attribute_map
|
|
57
|
+
attribute_map
|
|
58
|
+
end
|
|
59
|
+
|
|
55
60
|
# Returns all the JSON keys this model knows about
|
|
56
61
|
def self.acceptable_attributes
|
|
57
|
-
|
|
62
|
+
acceptable_attribute_map.values
|
|
58
63
|
end
|
|
59
64
|
|
|
60
65
|
# Attribute type mapping.
|
|
@@ -85,9 +90,10 @@ module PaymentsApi
|
|
|
85
90
|
end
|
|
86
91
|
|
|
87
92
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
93
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
88
94
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
89
|
-
if (!
|
|
90
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `PaymentsApi::Transaction`. Please check the name to make sure it's valid. List of attributes: " +
|
|
95
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
96
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PaymentsApi::Transaction`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
91
97
|
end
|
|
92
98
|
h[k.to_sym] = v
|
|
93
99
|
}
|
|
@@ -189,6 +195,76 @@ module PaymentsApi
|
|
|
189
195
|
true
|
|
190
196
|
end
|
|
191
197
|
|
|
198
|
+
# Custom attribute writer method with validation
|
|
199
|
+
# @param [Object] id Value to be assigned
|
|
200
|
+
def id=(id)
|
|
201
|
+
if id.nil?
|
|
202
|
+
fail ArgumentError, 'id cannot be nil'
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
@id = id
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
# Custom attribute writer method with validation
|
|
209
|
+
# @param [Object] status Value to be assigned
|
|
210
|
+
def status=(status)
|
|
211
|
+
if status.nil?
|
|
212
|
+
fail ArgumentError, 'status cannot be nil'
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
@status = status
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
# Custom attribute writer method with validation
|
|
219
|
+
# @param [Object] amount Value to be assigned
|
|
220
|
+
def amount=(amount)
|
|
221
|
+
if amount.nil?
|
|
222
|
+
fail ArgumentError, 'amount cannot be nil'
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
@amount = amount
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
# Custom attribute writer method with validation
|
|
229
|
+
# @param [Object] currency Value to be assigned
|
|
230
|
+
def currency=(currency)
|
|
231
|
+
if currency.nil?
|
|
232
|
+
fail ArgumentError, 'currency cannot be nil'
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
@currency = currency
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
# Custom attribute writer method with validation
|
|
239
|
+
# @param [Object] date Value to be assigned
|
|
240
|
+
def date=(date)
|
|
241
|
+
if date.nil?
|
|
242
|
+
fail ArgumentError, 'date cannot be nil'
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
@date = date
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
# Custom attribute writer method with validation
|
|
249
|
+
# @param [Object] metadata Value to be assigned
|
|
250
|
+
def metadata=(metadata)
|
|
251
|
+
if metadata.nil?
|
|
252
|
+
fail ArgumentError, 'metadata cannot be nil'
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
@metadata = metadata
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
# Custom attribute writer method with validation
|
|
259
|
+
# @param [Object] card_payment_method_details Value to be assigned
|
|
260
|
+
def card_payment_method_details=(card_payment_method_details)
|
|
261
|
+
if card_payment_method_details.nil?
|
|
262
|
+
fail ArgumentError, 'card_payment_method_details cannot be nil'
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
@card_payment_method_details = card_payment_method_details
|
|
266
|
+
end
|
|
267
|
+
|
|
192
268
|
# Checks equality by comparing each attribute.
|
|
193
269
|
# @param [Object] Object to be compared
|
|
194
270
|
def ==(o)
|
|
@@ -239,61 +315,6 @@ module PaymentsApi
|
|
|
239
315
|
new(transformed_hash)
|
|
240
316
|
end
|
|
241
317
|
|
|
242
|
-
# Deserializes the data based on type
|
|
243
|
-
# @param string type Data type
|
|
244
|
-
# @param string value Value to be deserialized
|
|
245
|
-
# @return [Object] Deserialized data
|
|
246
|
-
def self._deserialize(type, value)
|
|
247
|
-
case type.to_sym
|
|
248
|
-
when :Time
|
|
249
|
-
Time.parse(value)
|
|
250
|
-
when :Date
|
|
251
|
-
Date.parse(value)
|
|
252
|
-
when :String
|
|
253
|
-
value.to_s
|
|
254
|
-
when :Integer
|
|
255
|
-
value.to_i
|
|
256
|
-
when :Float
|
|
257
|
-
value.to_f
|
|
258
|
-
when :Boolean
|
|
259
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
260
|
-
true
|
|
261
|
-
else
|
|
262
|
-
false
|
|
263
|
-
end
|
|
264
|
-
when :Object
|
|
265
|
-
# generic object (usually a Hash), return directly
|
|
266
|
-
value
|
|
267
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
268
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
269
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
270
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
271
|
-
k_type = Regexp.last_match[:k_type]
|
|
272
|
-
v_type = Regexp.last_match[:v_type]
|
|
273
|
-
{}.tap do |hash|
|
|
274
|
-
value.each do |k, v|
|
|
275
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
276
|
-
end
|
|
277
|
-
end
|
|
278
|
-
else # model
|
|
279
|
-
# models (e.g. Pet) or oneOf
|
|
280
|
-
klass = PaymentsApi.const_get(type)
|
|
281
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
282
|
-
end
|
|
283
|
-
end
|
|
284
|
-
|
|
285
|
-
# Returns the string representation of the object
|
|
286
|
-
# @return [String] String presentation of the object
|
|
287
|
-
def to_s
|
|
288
|
-
to_hash.to_s
|
|
289
|
-
end
|
|
290
|
-
|
|
291
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
292
|
-
# @return [Hash] Returns the object in the form of hash
|
|
293
|
-
def to_body
|
|
294
|
-
to_hash
|
|
295
|
-
end
|
|
296
|
-
|
|
297
318
|
# Returns the object in the form of hash
|
|
298
319
|
# @return [Hash] Returns the object in the form of hash
|
|
299
320
|
def to_hash
|
|
@@ -310,24 +331,6 @@ module PaymentsApi
|
|
|
310
331
|
hash
|
|
311
332
|
end
|
|
312
333
|
|
|
313
|
-
# Outputs non-array value in the form of hash
|
|
314
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
315
|
-
# @param [Object] value Any valid value
|
|
316
|
-
# @return [Hash] Returns the value in the form of hash
|
|
317
|
-
def _to_hash(value)
|
|
318
|
-
if value.is_a?(Array)
|
|
319
|
-
value.compact.map { |v| _to_hash(v) }
|
|
320
|
-
elsif value.is_a?(Hash)
|
|
321
|
-
{}.tap do |hash|
|
|
322
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
323
|
-
end
|
|
324
|
-
elsif value.respond_to? :to_hash
|
|
325
|
-
value.to_hash
|
|
326
|
-
else
|
|
327
|
-
value
|
|
328
|
-
end
|
|
329
|
-
end
|
|
330
|
-
|
|
331
334
|
end
|
|
332
335
|
|
|
333
336
|
end
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 0.1
|
|
7
7
|
Contact: support@phoenixnap.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
|
|
9
|
+
Generator version: 7.20.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -15,7 +15,7 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module PaymentsApi
|
|
17
17
|
# Transaction's metadata.
|
|
18
|
-
class TransactionMetadata
|
|
18
|
+
class TransactionMetadata < ApiModelBase
|
|
19
19
|
# The Invoice ID that this transaction pertains to.
|
|
20
20
|
attr_accessor :invoice_id
|
|
21
21
|
|
|
@@ -34,9 +34,14 @@ module PaymentsApi
|
|
|
34
34
|
}
|
|
35
35
|
end
|
|
36
36
|
|
|
37
|
+
# Returns attribute mapping this model knows about
|
|
38
|
+
def self.acceptable_attribute_map
|
|
39
|
+
attribute_map
|
|
40
|
+
end
|
|
41
|
+
|
|
37
42
|
# Returns all the JSON keys this model knows about
|
|
38
43
|
def self.acceptable_attributes
|
|
39
|
-
|
|
44
|
+
acceptable_attribute_map.values
|
|
40
45
|
end
|
|
41
46
|
|
|
42
47
|
# Attribute type mapping.
|
|
@@ -62,9 +67,10 @@ module PaymentsApi
|
|
|
62
67
|
end
|
|
63
68
|
|
|
64
69
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
70
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
65
71
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
66
|
-
if (!
|
|
67
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `PaymentsApi::TransactionMetadata`. Please check the name to make sure it's valid. List of attributes: " +
|
|
72
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
73
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PaymentsApi::TransactionMetadata`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
68
74
|
end
|
|
69
75
|
h[k.to_sym] = v
|
|
70
76
|
}
|
|
@@ -111,6 +117,26 @@ module PaymentsApi
|
|
|
111
117
|
true
|
|
112
118
|
end
|
|
113
119
|
|
|
120
|
+
# Custom attribute writer method with validation
|
|
121
|
+
# @param [Object] invoice_id Value to be assigned
|
|
122
|
+
def invoice_id=(invoice_id)
|
|
123
|
+
if invoice_id.nil?
|
|
124
|
+
fail ArgumentError, 'invoice_id cannot be nil'
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
@invoice_id = invoice_id
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
# Custom attribute writer method with validation
|
|
131
|
+
# @param [Object] is_auto_charge Value to be assigned
|
|
132
|
+
def is_auto_charge=(is_auto_charge)
|
|
133
|
+
if is_auto_charge.nil?
|
|
134
|
+
fail ArgumentError, 'is_auto_charge cannot be nil'
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
@is_auto_charge = is_auto_charge
|
|
138
|
+
end
|
|
139
|
+
|
|
114
140
|
# Checks equality by comparing each attribute.
|
|
115
141
|
# @param [Object] Object to be compared
|
|
116
142
|
def ==(o)
|
|
@@ -156,61 +182,6 @@ module PaymentsApi
|
|
|
156
182
|
new(transformed_hash)
|
|
157
183
|
end
|
|
158
184
|
|
|
159
|
-
# Deserializes the data based on type
|
|
160
|
-
# @param string type Data type
|
|
161
|
-
# @param string value Value to be deserialized
|
|
162
|
-
# @return [Object] Deserialized data
|
|
163
|
-
def self._deserialize(type, value)
|
|
164
|
-
case type.to_sym
|
|
165
|
-
when :Time
|
|
166
|
-
Time.parse(value)
|
|
167
|
-
when :Date
|
|
168
|
-
Date.parse(value)
|
|
169
|
-
when :String
|
|
170
|
-
value.to_s
|
|
171
|
-
when :Integer
|
|
172
|
-
value.to_i
|
|
173
|
-
when :Float
|
|
174
|
-
value.to_f
|
|
175
|
-
when :Boolean
|
|
176
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
177
|
-
true
|
|
178
|
-
else
|
|
179
|
-
false
|
|
180
|
-
end
|
|
181
|
-
when :Object
|
|
182
|
-
# generic object (usually a Hash), return directly
|
|
183
|
-
value
|
|
184
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
185
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
186
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
187
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
188
|
-
k_type = Regexp.last_match[:k_type]
|
|
189
|
-
v_type = Regexp.last_match[:v_type]
|
|
190
|
-
{}.tap do |hash|
|
|
191
|
-
value.each do |k, v|
|
|
192
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
193
|
-
end
|
|
194
|
-
end
|
|
195
|
-
else # model
|
|
196
|
-
# models (e.g. Pet) or oneOf
|
|
197
|
-
klass = PaymentsApi.const_get(type)
|
|
198
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
199
|
-
end
|
|
200
|
-
end
|
|
201
|
-
|
|
202
|
-
# Returns the string representation of the object
|
|
203
|
-
# @return [String] String presentation of the object
|
|
204
|
-
def to_s
|
|
205
|
-
to_hash.to_s
|
|
206
|
-
end
|
|
207
|
-
|
|
208
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
209
|
-
# @return [Hash] Returns the object in the form of hash
|
|
210
|
-
def to_body
|
|
211
|
-
to_hash
|
|
212
|
-
end
|
|
213
|
-
|
|
214
185
|
# Returns the object in the form of hash
|
|
215
186
|
# @return [Hash] Returns the object in the form of hash
|
|
216
187
|
def to_hash
|
|
@@ -227,24 +198,6 @@ module PaymentsApi
|
|
|
227
198
|
hash
|
|
228
199
|
end
|
|
229
200
|
|
|
230
|
-
# Outputs non-array value in the form of hash
|
|
231
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
232
|
-
# @param [Object] value Any valid value
|
|
233
|
-
# @return [Hash] Returns the value in the form of hash
|
|
234
|
-
def _to_hash(value)
|
|
235
|
-
if value.is_a?(Array)
|
|
236
|
-
value.compact.map { |v| _to_hash(v) }
|
|
237
|
-
elsif value.is_a?(Hash)
|
|
238
|
-
{}.tap do |hash|
|
|
239
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
240
|
-
end
|
|
241
|
-
elsif value.respond_to? :to_hash
|
|
242
|
-
value.to_hash
|
|
243
|
-
else
|
|
244
|
-
value
|
|
245
|
-
end
|
|
246
|
-
end
|
|
247
|
-
|
|
248
201
|
end
|
|
249
202
|
|
|
250
203
|
end
|