pcp-server-ruby-sdk 1.0.0 → 1.1.0
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/CHANGELOG.md +10 -0
- data/api-definition.yaml +4737 -0
- data/lib/PCP-server-Ruby-SDK/endpoints/checkout_api_client.rb +24 -0
- data/lib/PCP-server-Ruby-SDK/endpoints/payment_execution_api_client.rb +47 -0
- data/lib/PCP-server-Ruby-SDK/endpoints/payment_information_api_client.rb +27 -2
- data/lib/PCP-server-Ruby-SDK/models/bank_account_information.rb +17 -5
- data/lib/PCP-server-Ruby-SDK/models/bank_payout_method_specific_input.rb +198 -0
- data/lib/PCP-server-Ruby-SDK/models/capture_output.rb +45 -41
- data/lib/PCP-server-Ruby-SDK/models/financing_payment_method_specific_output.rb +43 -40
- data/lib/PCP-server-Ruby-SDK/models/mobile_payment_method_specific_input.rb +16 -33
- data/lib/PCP-server-Ruby-SDK/models/mobile_payment_three_dsecure.rb +185 -0
- data/lib/PCP-server-Ruby-SDK/models/order_line_details_input.rb +12 -6
- data/lib/PCP-server-Ruby-SDK/models/{payment_product320_specific_input.rb → pause_payment_request.rb} +13 -31
- data/lib/PCP-server-Ruby-SDK/models/pause_payment_response.rb +192 -0
- data/lib/PCP-server-Ruby-SDK/models/payee.rb +212 -0
- data/lib/PCP-server-Ruby-SDK/models/payment_event.rb +14 -14
- data/lib/PCP-server-Ruby-SDK/models/payment_execution.rb +39 -5
- data/lib/PCP-server-Ruby-SDK/models/payment_information_refund_request.rb +212 -0
- data/lib/PCP-server-Ruby-SDK/models/payment_information_refund_response.rb +202 -0
- data/lib/PCP-server-Ruby-SDK/models/payment_information_response.rb +40 -25
- data/lib/PCP-server-Ruby-SDK/models/payment_instructions.rb +222 -0
- data/lib/PCP-server-Ruby-SDK/models/payment_product302_specific_input.rb +232 -0
- data/lib/PCP-server-Ruby-SDK/models/payout_output.rb +28 -24
- data/lib/PCP-server-Ruby-SDK/models/payout_response.rb +6 -25
- data/lib/PCP-server-Ruby-SDK/models/refresh_payment_request.rb +192 -0
- data/lib/PCP-server-Ruby-SDK/models/refresh_type.rb +30 -0
- data/lib/PCP-server-Ruby-SDK/models/sepa_transfer_payment_product_772_specific_input.rb +192 -0
- data/lib/PCP-server-Ruby-SDK/models/status_value.rb +12 -10
- data/lib/PCP-server-Ruby-SDK/queries/get_checkouts_query.rb +3 -1
- data/lib/PCP-server-Ruby-SDK/transformer/apple_pay_transformer.rb +2 -2
- data/lib/PCP-server-Ruby-SDK/version.rb +1 -1
- data/lib/PCP-server-Ruby-SDK.rb +24 -2
- data/package-lock.json +196 -243
- data/package.json +1 -1
- data/scripts.sh +7 -14
- data/spec/endpoints/checkout_api_client_spec.rb +51 -0
- data/spec/endpoints/payment_execution_api_client_spec.rb +102 -0
- data/spec/endpoints/payment_information_api_client_spec.rb +52 -0
- data/spec/transformer/apple_pay_transformer_spec.rb +1 -1
- data/spec/utils/server_meta_info_spec.rb +2 -2
- metadata +19 -7
@@ -0,0 +1,222 @@
|
|
1
|
+
require 'date'
|
2
|
+
require 'time'
|
3
|
+
|
4
|
+
# Object containing information on payment instructions details (e.g. on the invoice payments)
|
5
|
+
module PCPServerSDK
|
6
|
+
module Models
|
7
|
+
class PaymentInstructions
|
8
|
+
# Payee details
|
9
|
+
attr_accessor :payee
|
10
|
+
|
11
|
+
# Due date of the payment. Format: YYYYMMDD
|
12
|
+
attr_accessor :due_date
|
13
|
+
|
14
|
+
# External payment reference number as part of payment instructions for the consumer
|
15
|
+
attr_accessor :reference_number
|
16
|
+
|
17
|
+
# Status, usually describing the status of the invoice if paid, overdue, open...
|
18
|
+
attr_accessor :status
|
19
|
+
|
20
|
+
class EnumAttributeValidator
|
21
|
+
attr_reader :datatype
|
22
|
+
attr_reader :allowable_values
|
23
|
+
|
24
|
+
def initialize(datatype, allowable_values)
|
25
|
+
@allowable_values = allowable_values.map do |value|
|
26
|
+
case datatype.to_s
|
27
|
+
when /Integer/i
|
28
|
+
value.to_i
|
29
|
+
when /Float/i
|
30
|
+
value.to_f
|
31
|
+
else
|
32
|
+
value
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def valid?(value)
|
38
|
+
!value || allowable_values.include?(value)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
43
|
+
def self.attribute_map
|
44
|
+
{
|
45
|
+
:'payee' => :'payee',
|
46
|
+
:'due_date' => :'dueDate',
|
47
|
+
:'reference_number' => :'referenceNumber',
|
48
|
+
:'status' => :'status'
|
49
|
+
}
|
50
|
+
end
|
51
|
+
|
52
|
+
# Returns all the JSON keys this model knows about
|
53
|
+
def self.acceptable_attributes
|
54
|
+
attribute_map.values
|
55
|
+
end
|
56
|
+
|
57
|
+
# Attribute type mapping.
|
58
|
+
def self.openapi_types
|
59
|
+
{
|
60
|
+
:'payee' => :'Payee',
|
61
|
+
:'due_date' => :'String',
|
62
|
+
:'reference_number' => :'String',
|
63
|
+
:'status' => :'String'
|
64
|
+
}
|
65
|
+
end
|
66
|
+
|
67
|
+
# List of attributes with nullable: true
|
68
|
+
def self.openapi_nullable
|
69
|
+
Set.new([])
|
70
|
+
end
|
71
|
+
|
72
|
+
# Initializes the object
|
73
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
74
|
+
def initialize(attributes = {})
|
75
|
+
if (!attributes.is_a?(Hash))
|
76
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PaymentInstructions` initialize method"
|
77
|
+
end
|
78
|
+
|
79
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
80
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
81
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PaymentInstructions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
82
|
+
end
|
83
|
+
h[k.to_sym] = v
|
84
|
+
}
|
85
|
+
|
86
|
+
if attributes.key?(:'payee')
|
87
|
+
self.payee = attributes[:'payee']
|
88
|
+
end
|
89
|
+
|
90
|
+
if attributes.key?(:'due_date')
|
91
|
+
self.due_date = attributes[:'due_date']
|
92
|
+
end
|
93
|
+
|
94
|
+
if attributes.key?(:'reference_number')
|
95
|
+
self.reference_number = attributes[:'reference_number']
|
96
|
+
end
|
97
|
+
|
98
|
+
if attributes.key?(:'status')
|
99
|
+
self.status = attributes[:'status']
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
# Checks equality by comparing each attribute.
|
104
|
+
def ==(o)
|
105
|
+
return true if self.equal?(o)
|
106
|
+
self.class == o.class &&
|
107
|
+
payee == o.payee &&
|
108
|
+
due_date == o.due_date &&
|
109
|
+
reference_number == o.reference_number &&
|
110
|
+
status == o.status
|
111
|
+
end
|
112
|
+
|
113
|
+
# @see the `==` method
|
114
|
+
def eql?(o)
|
115
|
+
self == o
|
116
|
+
end
|
117
|
+
|
118
|
+
# Calculates hash code according to all attributes.
|
119
|
+
def hash
|
120
|
+
[payee, due_date, reference_number, status].hash
|
121
|
+
end
|
122
|
+
|
123
|
+
# Builds the object from hash
|
124
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
125
|
+
# @return [Object] Returns the model itself
|
126
|
+
def self.build_from_hash(attributes)
|
127
|
+
return nil unless attributes.is_a?(Hash)
|
128
|
+
attributes = attributes.transform_keys(&:to_sym)
|
129
|
+
transformed_hash = {}
|
130
|
+
openapi_types.each_pair do |key, type|
|
131
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
132
|
+
transformed_hash["#{key}"] = nil
|
133
|
+
elsif type =~ /\AArray<(.*)>/i
|
134
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
135
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
136
|
+
end
|
137
|
+
elsif !attributes[attribute_map[key]].nil?
|
138
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
139
|
+
end
|
140
|
+
end
|
141
|
+
new(transformed_hash)
|
142
|
+
end
|
143
|
+
|
144
|
+
# Deserializes the data based on type
|
145
|
+
def self._deserialize(type, value)
|
146
|
+
case type.to_sym
|
147
|
+
when :Time
|
148
|
+
Time.parse(value)
|
149
|
+
when :Date
|
150
|
+
Date.parse(value)
|
151
|
+
when :String
|
152
|
+
value.to_s
|
153
|
+
when :Integer
|
154
|
+
value.to_i
|
155
|
+
when :Float
|
156
|
+
value.to_f
|
157
|
+
when :Boolean
|
158
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
159
|
+
true
|
160
|
+
else
|
161
|
+
false
|
162
|
+
end
|
163
|
+
when :Object
|
164
|
+
value
|
165
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
166
|
+
inner_type = Regexp.last_match[:inner_type]
|
167
|
+
value.map { |v| _deserialize(inner_type, v) }
|
168
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
169
|
+
k_type = Regexp.last_match[:k_type]
|
170
|
+
v_type = Regexp.last_match[:v_type]
|
171
|
+
{}.tap do |hash|
|
172
|
+
value.each do |k, v|
|
173
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
174
|
+
end
|
175
|
+
end
|
176
|
+
else
|
177
|
+
klass = PCPServerSDK::Models.const_get(type)
|
178
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
179
|
+
end
|
180
|
+
end
|
181
|
+
|
182
|
+
# Returns the string representation of the object
|
183
|
+
def to_s
|
184
|
+
to_hash.to_s
|
185
|
+
end
|
186
|
+
|
187
|
+
# to_body is an alias to to_hash (backward compatibility)
|
188
|
+
def to_body
|
189
|
+
to_hash
|
190
|
+
end
|
191
|
+
|
192
|
+
# Returns the object in the form of hash
|
193
|
+
def to_hash
|
194
|
+
hash = {}
|
195
|
+
self.class.attribute_map.each_pair do |attr, param|
|
196
|
+
value = self.send(attr)
|
197
|
+
if value.nil?
|
198
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
199
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
200
|
+
end
|
201
|
+
hash[param] = _to_hash(value)
|
202
|
+
end
|
203
|
+
hash
|
204
|
+
end
|
205
|
+
|
206
|
+
# Outputs non-array value in the form of hash
|
207
|
+
def _to_hash(value)
|
208
|
+
if value.is_a?(Array)
|
209
|
+
value.compact.map { |v| _to_hash(v) }
|
210
|
+
elsif value.is_a?(Hash)
|
211
|
+
{}.tap do |hash|
|
212
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
213
|
+
end
|
214
|
+
elsif value.respond_to? :to_hash
|
215
|
+
value.to_hash
|
216
|
+
else
|
217
|
+
value
|
218
|
+
end
|
219
|
+
end
|
220
|
+
end
|
221
|
+
end
|
222
|
+
end
|
@@ -0,0 +1,232 @@
|
|
1
|
+
require 'date'
|
2
|
+
require 'time'
|
3
|
+
|
4
|
+
# Object containing additional Information needed for Apple Pay payment transactions.
|
5
|
+
module PCPServerSDK
|
6
|
+
module Models
|
7
|
+
class PaymentProduct302SpecificInput
|
8
|
+
# Type of your Apple Pay integration.
|
9
|
+
attr_accessor :integration_type
|
10
|
+
|
11
|
+
# Network/Scheme of the card used for the payment.
|
12
|
+
attr_accessor :network
|
13
|
+
|
14
|
+
# Token information for Apple Pay transactions.
|
15
|
+
attr_accessor :token
|
16
|
+
|
17
|
+
# Domain of the Webshop.
|
18
|
+
attr_accessor :domain_name
|
19
|
+
|
20
|
+
# Name of the Store.
|
21
|
+
attr_accessor :display_name
|
22
|
+
|
23
|
+
class EnumAttributeValidator
|
24
|
+
attr_reader :datatype
|
25
|
+
attr_reader :allowable_values
|
26
|
+
|
27
|
+
def initialize(datatype, allowable_values)
|
28
|
+
@allowable_values = allowable_values.map do |value|
|
29
|
+
case datatype.to_s
|
30
|
+
when /Integer/i
|
31
|
+
value.to_i
|
32
|
+
when /Float/i
|
33
|
+
value.to_f
|
34
|
+
else
|
35
|
+
value
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
def valid?(value)
|
41
|
+
!value || allowable_values.include?(value)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
# Attribute mapping from Ruby-style variable name to JSON key.
|
46
|
+
def self.attribute_map
|
47
|
+
{
|
48
|
+
:'integration_type' => :'integrationType',
|
49
|
+
:'network' => :'network',
|
50
|
+
:'token' => :'token',
|
51
|
+
:'domain_name' => :'domainName',
|
52
|
+
:'display_name' => :'displayName'
|
53
|
+
}
|
54
|
+
end
|
55
|
+
|
56
|
+
# Returns all the JSON keys this model knows about
|
57
|
+
def self.acceptable_attributes
|
58
|
+
attribute_map.values
|
59
|
+
end
|
60
|
+
|
61
|
+
# Attribute type mapping.
|
62
|
+
def self.openapi_types
|
63
|
+
{
|
64
|
+
:'integration_type' => :'String',
|
65
|
+
:'network' => :'String',
|
66
|
+
:'token' => :'ApplePaymentDataTokenInformation',
|
67
|
+
:'domain_name' => :'String',
|
68
|
+
:'display_name' => :'String'
|
69
|
+
}
|
70
|
+
end
|
71
|
+
|
72
|
+
# List of attributes with nullable: true
|
73
|
+
def self.openapi_nullable
|
74
|
+
Set.new([])
|
75
|
+
end
|
76
|
+
|
77
|
+
# Initializes the object
|
78
|
+
# @param [Hash] attributes Model attributes in the form of a hash
|
79
|
+
def initialize(attributes = {})
|
80
|
+
if (!attributes.is_a?(Hash))
|
81
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PaymentProduct302SpecificInput` initialize method"
|
82
|
+
end
|
83
|
+
|
84
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
85
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
86
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PaymentProduct302SpecificInput`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
87
|
+
end
|
88
|
+
h[k.to_sym] = v
|
89
|
+
}
|
90
|
+
|
91
|
+
if attributes.key?(:'integration_type')
|
92
|
+
self.integration_type = attributes[:'integration_type']
|
93
|
+
end
|
94
|
+
|
95
|
+
if attributes.key?(:'network')
|
96
|
+
self.network = attributes[:'network']
|
97
|
+
end
|
98
|
+
|
99
|
+
if attributes.key?(:'token')
|
100
|
+
self.token = attributes[:'token']
|
101
|
+
end
|
102
|
+
|
103
|
+
if attributes.key?(:'domain_name')
|
104
|
+
self.domain_name = attributes[:'domain_name']
|
105
|
+
end
|
106
|
+
|
107
|
+
if attributes.key?(:'display_name')
|
108
|
+
self.display_name = attributes[:'display_name']
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
# Checks equality by comparing each attribute.
|
113
|
+
def ==(o)
|
114
|
+
return true if self.equal?(o)
|
115
|
+
self.class == o.class &&
|
116
|
+
integration_type == o.integration_type &&
|
117
|
+
network == o.network &&
|
118
|
+
token == o.token &&
|
119
|
+
domain_name == o.domain_name &&
|
120
|
+
display_name == o.display_name
|
121
|
+
end
|
122
|
+
|
123
|
+
# @see the `==` method
|
124
|
+
def eql?(o)
|
125
|
+
self == o
|
126
|
+
end
|
127
|
+
|
128
|
+
# Calculates hash code according to all attributes.
|
129
|
+
def hash
|
130
|
+
[integration_type, network, token, domain_name, display_name].hash
|
131
|
+
end
|
132
|
+
|
133
|
+
# Builds the object from hash
|
134
|
+
# @param [Hash] attributes Model attributes in the form of a hash
|
135
|
+
# @return [Object] Returns the model itself
|
136
|
+
def self.build_from_hash(attributes)
|
137
|
+
return nil unless attributes.is_a?(Hash)
|
138
|
+
attributes = attributes.transform_keys(&:to_sym)
|
139
|
+
transformed_hash = {}
|
140
|
+
openapi_types.each_pair do |key, type|
|
141
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
142
|
+
transformed_hash["#{key}"] = nil
|
143
|
+
elsif type =~ /\AArray<(.*)>/i
|
144
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
145
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
146
|
+
end
|
147
|
+
elsif !attributes[attribute_map[key]].nil?
|
148
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
149
|
+
end
|
150
|
+
end
|
151
|
+
new(transformed_hash)
|
152
|
+
end
|
153
|
+
|
154
|
+
# Deserializes the data based on type
|
155
|
+
def self._deserialize(type, value)
|
156
|
+
case type.to_sym
|
157
|
+
when :Time
|
158
|
+
Time.parse(value)
|
159
|
+
when :Date
|
160
|
+
Date.parse(value)
|
161
|
+
when :String
|
162
|
+
value.to_s
|
163
|
+
when :Integer
|
164
|
+
value.to_i
|
165
|
+
when :Float
|
166
|
+
value.to_f
|
167
|
+
when :Boolean
|
168
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
169
|
+
true
|
170
|
+
else
|
171
|
+
false
|
172
|
+
end
|
173
|
+
when :Object
|
174
|
+
value
|
175
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
176
|
+
inner_type = Regexp.last_match[:inner_type]
|
177
|
+
value.map { |v| _deserialize(inner_type, v) }
|
178
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
179
|
+
k_type = Regexp.last_match[:k_type]
|
180
|
+
v_type = Regexp.last_match[:v_type]
|
181
|
+
{}.tap do |hash|
|
182
|
+
value.each do |k, v|
|
183
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
184
|
+
end
|
185
|
+
end
|
186
|
+
else
|
187
|
+
klass = PCPServerSDK::Models.const_get(type)
|
188
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
189
|
+
end
|
190
|
+
end
|
191
|
+
|
192
|
+
# Returns the string representation of the object
|
193
|
+
def to_s
|
194
|
+
to_hash.to_s
|
195
|
+
end
|
196
|
+
|
197
|
+
# to_body is an alias to to_hash (backward compatibility)
|
198
|
+
def to_body
|
199
|
+
to_hash
|
200
|
+
end
|
201
|
+
|
202
|
+
# Returns the object in the form of hash
|
203
|
+
def to_hash
|
204
|
+
hash = {}
|
205
|
+
self.class.attribute_map.each_pair do |attr, param|
|
206
|
+
value = self.send(attr)
|
207
|
+
if value.nil?
|
208
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
209
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
210
|
+
end
|
211
|
+
hash[param] = _to_hash(value)
|
212
|
+
end
|
213
|
+
hash
|
214
|
+
end
|
215
|
+
|
216
|
+
# Outputs non-array value in the form of hash
|
217
|
+
def _to_hash(value)
|
218
|
+
if value.is_a?(Array)
|
219
|
+
value.compact.map { |v| _to_hash(v) }
|
220
|
+
elsif value.is_a?(Hash)
|
221
|
+
{}.tap do |hash|
|
222
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
223
|
+
end
|
224
|
+
elsif value.respond_to? :to_hash
|
225
|
+
value.to_hash
|
226
|
+
else
|
227
|
+
value
|
228
|
+
end
|
229
|
+
end
|
230
|
+
end
|
231
|
+
end
|
232
|
+
end
|
@@ -1,19 +1,42 @@
|
|
1
|
-
|
2
1
|
require 'date'
|
3
2
|
require 'time'
|
4
3
|
|
5
|
-
# Object containing details from the created payout.
|
4
|
+
# Object containing details from the created payout.
|
6
5
|
module PCPServerSDK
|
7
6
|
module Models
|
8
7
|
class PayoutOutput
|
8
|
+
# Amount of money details
|
9
9
|
attr_accessor :amount_of_money
|
10
10
|
|
11
|
+
# Payment references
|
11
12
|
attr_accessor :references
|
12
13
|
|
13
14
|
# Payment method identifier based on the paymentProductId.
|
14
15
|
attr_accessor :payment_method
|
15
16
|
|
16
|
-
|
17
|
+
class EnumAttributeValidator
|
18
|
+
attr_reader :datatype
|
19
|
+
attr_reader :allowable_values
|
20
|
+
|
21
|
+
def initialize(datatype, allowable_values)
|
22
|
+
@allowable_values = allowable_values.map do |value|
|
23
|
+
case datatype.to_s
|
24
|
+
when /Integer/i
|
25
|
+
value.to_i
|
26
|
+
when /Float/i
|
27
|
+
value.to_f
|
28
|
+
else
|
29
|
+
value
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def valid?(value)
|
35
|
+
!value || allowable_values.include?(value)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
# Attribute mapping from Ruby-style variable name to JSON key.
|
17
40
|
def self.attribute_map
|
18
41
|
{
|
19
42
|
:'amount_of_money' => :'amountOfMoney',
|
@@ -38,8 +61,7 @@ module PCPServerSDK
|
|
38
61
|
|
39
62
|
# List of attributes with nullable: true
|
40
63
|
def self.openapi_nullable
|
41
|
-
Set.new([
|
42
|
-
])
|
64
|
+
Set.new([])
|
43
65
|
end
|
44
66
|
|
45
67
|
# Initializes the object
|
@@ -49,7 +71,6 @@ module PCPServerSDK
|
|
49
71
|
fail ArgumentError, "The input argument (attributes) must be a hash in `PayoutOutput` initialize method"
|
50
72
|
end
|
51
73
|
|
52
|
-
# check to see if the attribute exists and convert string to symbol for hash key
|
53
74
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
54
75
|
if (!self.class.attribute_map.key?(k.to_sym))
|
55
76
|
fail ArgumentError, "`#{k}` is not a valid attribute in `PayoutOutput`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
@@ -71,7 +92,6 @@ module PCPServerSDK
|
|
71
92
|
end
|
72
93
|
|
73
94
|
# Checks equality by comparing each attribute.
|
74
|
-
# @param [Object] Object to be compared
|
75
95
|
def ==(o)
|
76
96
|
return true if self.equal?(o)
|
77
97
|
self.class == o.class &&
|
@@ -81,13 +101,11 @@ module PCPServerSDK
|
|
81
101
|
end
|
82
102
|
|
83
103
|
# @see the `==` method
|
84
|
-
# @param [Object] Object to be compared
|
85
104
|
def eql?(o)
|
86
105
|
self == o
|
87
106
|
end
|
88
107
|
|
89
108
|
# Calculates hash code according to all attributes.
|
90
|
-
# @return [Integer] Hash code
|
91
109
|
def hash
|
92
110
|
[amount_of_money, references, payment_method].hash
|
93
111
|
end
|
@@ -103,8 +121,6 @@ module PCPServerSDK
|
|
103
121
|
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
104
122
|
transformed_hash["#{key}"] = nil
|
105
123
|
elsif type =~ /\AArray<(.*)>/i
|
106
|
-
# check to ensure the input is an array given that the attribute
|
107
|
-
# is documented as an array but the input is not
|
108
124
|
if attributes[attribute_map[key]].is_a?(Array)
|
109
125
|
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
110
126
|
end
|
@@ -116,9 +132,6 @@ module PCPServerSDK
|
|
116
132
|
end
|
117
133
|
|
118
134
|
# Deserializes the data based on type
|
119
|
-
# @param string type Data type
|
120
|
-
# @param string value Value to be deserialized
|
121
|
-
# @return [Object] Deserialized data
|
122
135
|
def self._deserialize(type, value)
|
123
136
|
case type.to_sym
|
124
137
|
when :Time
|
@@ -138,7 +151,6 @@ module PCPServerSDK
|
|
138
151
|
false
|
139
152
|
end
|
140
153
|
when :Object
|
141
|
-
# generic object (usually a Hash), return directly
|
142
154
|
value
|
143
155
|
when /\AArray<(?<inner_type>.+)>\z/
|
144
156
|
inner_type = Regexp.last_match[:inner_type]
|
@@ -151,27 +163,23 @@ module PCPServerSDK
|
|
151
163
|
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
152
164
|
end
|
153
165
|
end
|
154
|
-
else
|
155
|
-
# models (e.g. Pet) or oneOf
|
166
|
+
else
|
156
167
|
klass = PCPServerSDK::Models.const_get(type)
|
157
168
|
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
158
169
|
end
|
159
170
|
end
|
160
171
|
|
161
172
|
# Returns the string representation of the object
|
162
|
-
# @return [String] String presentation of the object
|
163
173
|
def to_s
|
164
174
|
to_hash.to_s
|
165
175
|
end
|
166
176
|
|
167
177
|
# to_body is an alias to to_hash (backward compatibility)
|
168
|
-
# @return [Hash] Returns the object in the form of hash
|
169
178
|
def to_body
|
170
179
|
to_hash
|
171
180
|
end
|
172
181
|
|
173
182
|
# Returns the object in the form of hash
|
174
|
-
# @return [Hash] Returns the object in the form of hash
|
175
183
|
def to_hash
|
176
184
|
hash = {}
|
177
185
|
self.class.attribute_map.each_pair do |attr, param|
|
@@ -180,16 +188,12 @@ module PCPServerSDK
|
|
180
188
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
181
189
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
182
190
|
end
|
183
|
-
|
184
191
|
hash[param] = _to_hash(value)
|
185
192
|
end
|
186
193
|
hash
|
187
194
|
end
|
188
195
|
|
189
196
|
# Outputs non-array value in the form of hash
|
190
|
-
# For object, use to_hash. Otherwise, just return the value
|
191
|
-
# @param [Object] value Any valid value
|
192
|
-
# @return [Hash] Returns the value in the form of hash
|
193
197
|
def _to_hash(value)
|
194
198
|
if value.is_a?(Array)
|
195
199
|
value.compact.map { |v| _to_hash(v) }
|