pcp-server-ruby-sdk 1.0.0 → 1.2.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.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +28 -0
  3. data/README.md +9 -3
  4. data/api-definition.yaml +4803 -0
  5. data/lib/PCP-server-Ruby-SDK/endpoints/checkout_api_client.rb +24 -0
  6. data/lib/PCP-server-Ruby-SDK/endpoints/payment_execution_api_client.rb +47 -0
  7. data/lib/PCP-server-Ruby-SDK/endpoints/payment_information_api_client.rb +27 -2
  8. data/lib/PCP-server-Ruby-SDK/models/action_type.rb +34 -0
  9. data/lib/PCP-server-Ruby-SDK/models/api_error.rb +1 -1
  10. data/lib/PCP-server-Ruby-SDK/models/avs_result.rb +52 -0
  11. data/lib/PCP-server-Ruby-SDK/models/bank_account_information.rb +17 -5
  12. data/lib/PCP-server-Ruby-SDK/models/bank_payout_method_specific_input.rb +198 -0
  13. data/lib/PCP-server-Ruby-SDK/models/business_relation.rb +30 -0
  14. data/lib/PCP-server-Ruby-SDK/models/capture_output.rb +45 -41
  15. data/lib/PCP-server-Ruby-SDK/models/card_fraud_results.rb +3 -2
  16. data/lib/PCP-server-Ruby-SDK/models/card_recurrence_details.rb +5 -2
  17. data/lib/PCP-server-Ruby-SDK/models/customer.rb +21 -6
  18. data/lib/PCP-server-Ruby-SDK/models/customer_account.rb +51 -0
  19. data/lib/PCP-server-Ruby-SDK/models/financing_payment_method_specific_output.rb +43 -40
  20. data/lib/PCP-server-Ruby-SDK/models/merchant_action.rb +3 -2
  21. data/lib/PCP-server-Ruby-SDK/models/mobile_payment_method_specific_input.rb +16 -33
  22. data/lib/PCP-server-Ruby-SDK/models/mobile_payment_three_dsecure.rb +185 -0
  23. data/lib/PCP-server-Ruby-SDK/models/order_line_details_input.rb +12 -6
  24. data/lib/PCP-server-Ruby-SDK/models/{payment_product320_specific_input.rb → pause_payment_request.rb} +13 -31
  25. data/lib/PCP-server-Ruby-SDK/models/pause_payment_response.rb +192 -0
  26. data/lib/PCP-server-Ruby-SDK/models/payee.rb +212 -0
  27. data/lib/PCP-server-Ruby-SDK/models/payment_event.rb +14 -14
  28. data/lib/PCP-server-Ruby-SDK/models/payment_execution.rb +39 -5
  29. data/lib/PCP-server-Ruby-SDK/models/payment_information_refund_request.rb +212 -0
  30. data/lib/PCP-server-Ruby-SDK/models/payment_information_refund_response.rb +202 -0
  31. data/lib/PCP-server-Ruby-SDK/models/payment_information_response.rb +40 -25
  32. data/lib/PCP-server-Ruby-SDK/models/payment_instructions.rb +222 -0
  33. data/lib/PCP-server-Ruby-SDK/models/payment_product302_specific_input.rb +232 -0
  34. data/lib/PCP-server-Ruby-SDK/models/payout_output.rb +28 -24
  35. data/lib/PCP-server-Ruby-SDK/models/payout_response.rb +6 -25
  36. data/lib/PCP-server-Ruby-SDK/models/recurring_payment_sequence_indicator.rb +30 -0
  37. data/lib/PCP-server-Ruby-SDK/models/redirect_payment_product840_specific_input.rb +14 -4
  38. data/lib/PCP-server-Ruby-SDK/models/refresh_payment_request.rb +192 -0
  39. data/lib/PCP-server-Ruby-SDK/models/refresh_type.rb +30 -0
  40. data/lib/PCP-server-Ruby-SDK/models/sepa_transfer_payment_product_772_specific_input.rb +192 -0
  41. data/lib/PCP-server-Ruby-SDK/models/status_value.rb +12 -10
  42. data/lib/PCP-server-Ruby-SDK/queries/get_checkouts_query.rb +3 -1
  43. data/lib/PCP-server-Ruby-SDK/transformer/apple_pay_transformer.rb +2 -2
  44. data/lib/PCP-server-Ruby-SDK/version.rb +1 -1
  45. data/lib/PCP-server-Ruby-SDK.rb +24 -2
  46. data/package-lock.json +174 -245
  47. data/package.json +1 -1
  48. data/scripts.sh +7 -14
  49. data/spec/endpoints/checkout_api_client_spec.rb +51 -0
  50. data/spec/endpoints/payment_execution_api_client_spec.rb +102 -0
  51. data/spec/endpoints/payment_information_api_client_spec.rb +52 -0
  52. data/spec/transformer/apple_pay_transformer_spec.rb +1 -1
  53. data/spec/utils/server_meta_info_spec.rb +2 -2
  54. metadata +24 -7
@@ -1,4 +1,3 @@
1
-
2
1
  require 'date'
3
2
  require 'time'
4
3
 
@@ -11,7 +10,9 @@ module PCPServerSDK
11
10
 
12
11
  attr_accessor :authorization_mode
13
12
 
14
- # The payment data if we will do the decryption of the encrypted payment data. Typically you'd use encryptedCustomerInput in the root of the create payment request to provide the encrypted payment data instead.
13
+ # The payment data if we will do the decryption of the encrypted payment data.
14
+ # Typically you'd use encryptedCustomerInput in the root of the create payment request
15
+ # to provide the encrypted payment data instead.
15
16
  attr_accessor :encrypted_payment_data
16
17
 
17
18
  # Public Key Hash A unique identifier to retrieve key used by Apple to encrypt information.
@@ -20,9 +21,10 @@ module PCPServerSDK
20
21
  # Ephemeral Key A unique generated key used by Apple to encrypt data.
21
22
  attr_accessor :ephemeral_key
22
23
 
23
- attr_accessor :payment_product302_specific_input
24
-
24
+ # 3D Secure authentication data
25
+ attr_accessor :three_d_secure
25
26
 
27
+ attr_accessor :payment_product302_specific_input
26
28
 
27
29
  class EnumAttributeValidator
28
30
  attr_reader :datatype
@@ -54,6 +56,7 @@ module PCPServerSDK
54
56
  :'encrypted_payment_data' => :'encryptedPaymentData',
55
57
  :'public_key_hash' => :'publicKeyHash',
56
58
  :'ephemeral_key' => :'ephemeralKey',
59
+ :'three_d_secure' => :'threeDSecure',
57
60
  :'payment_product302_specific_input' => :'paymentProduct302SpecificInput'
58
61
  }
59
62
  end
@@ -71,7 +74,8 @@ module PCPServerSDK
71
74
  :'encrypted_payment_data' => :'String',
72
75
  :'public_key_hash' => :'String',
73
76
  :'ephemeral_key' => :'String',
74
- :'payment_product302_specific_input' => :'PaymentProduct320SpecificInput'
77
+ :'three_d_secure' => :'MobilePaymentThreeDSecure',
78
+ :'payment_product302_specific_input' => :'PaymentProduct302SpecificInput'
75
79
  }
76
80
  end
77
81
 
@@ -88,7 +92,6 @@ module PCPServerSDK
88
92
  fail ArgumentError, "The input argument (attributes) must be a hash in `MobilePaymentMethodSpecificInput` initialize method"
89
93
  end
90
94
 
91
- # check to see if the attribute exists and convert string to symbol for hash key
92
95
  attributes = attributes.each_with_object({}) { |(k, v), h|
93
96
  if (!self.class.attribute_map.key?(k.to_sym))
94
97
  fail ArgumentError, "`#{k}` is not a valid attribute in `MobilePaymentMethodSpecificInput`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
@@ -116,6 +119,10 @@ module PCPServerSDK
116
119
  self.ephemeral_key = attributes[:'ephemeral_key']
117
120
  end
118
121
 
122
+ if attributes.key?(:'three_d_secure')
123
+ self.three_d_secure = attributes[:'three_d_secure']
124
+ end
125
+
119
126
  if attributes.key?(:'payment_product302_specific_input')
120
127
  self.payment_product302_specific_input = attributes[:'payment_product302_specific_input']
121
128
  end
@@ -131,24 +138,18 @@ module PCPServerSDK
131
138
  encrypted_payment_data == o.encrypted_payment_data &&
132
139
  public_key_hash == o.public_key_hash &&
133
140
  ephemeral_key == o.ephemeral_key &&
141
+ three_d_secure == o.three_d_secure &&
134
142
  payment_product302_specific_input == o.payment_product302_specific_input
135
143
  end
136
144
 
137
- # @see the `==` method
138
- # @param [Object] Object to be compared
139
145
  def eql?(o)
140
146
  self == o
141
147
  end
142
148
 
143
- # Calculates hash code according to all attributes.
144
- # @return [Integer] Hash code
145
149
  def hash
146
- [payment_product_id, authorization_mode, encrypted_payment_data, public_key_hash, ephemeral_key, payment_product302_specific_input].hash
150
+ [payment_product_id, authorization_mode, encrypted_payment_data, public_key_hash, ephemeral_key, three_d_secure, payment_product302_specific_input].hash
147
151
  end
148
152
 
149
- # Builds the object from hash
150
- # @param [Hash] attributes Model attributes in the form of hash
151
- # @return [Object] Returns the model itself
152
153
  def self.build_from_hash(attributes)
153
154
  return nil unless attributes.is_a?(Hash)
154
155
  attributes = attributes.transform_keys(&:to_sym)
@@ -157,8 +158,6 @@ module PCPServerSDK
157
158
  if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
158
159
  transformed_hash["#{key}"] = nil
159
160
  elsif type =~ /\AArray<(.*)>/i
160
- # check to ensure the input is an array given that the attribute
161
- # is documented as an array but the input is not
162
161
  if attributes[attribute_map[key]].is_a?(Array)
163
162
  transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
164
163
  end
@@ -169,10 +168,6 @@ module PCPServerSDK
169
168
  new(transformed_hash)
170
169
  end
171
170
 
172
- # Deserializes the data based on type
173
- # @param string type Data type
174
- # @param string value Value to be deserialized
175
- # @return [Object] Deserialized data
176
171
  def self._deserialize(type, value)
177
172
  case type.to_sym
178
173
  when :Time
@@ -192,7 +187,6 @@ module PCPServerSDK
192
187
  false
193
188
  end
194
189
  when :Object
195
- # generic object (usually a Hash), return directly
196
190
  value
197
191
  when /\AArray<(?<inner_type>.+)>\z/
198
192
  inner_type = Regexp.last_match[:inner_type]
@@ -205,27 +199,20 @@ module PCPServerSDK
205
199
  hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
206
200
  end
207
201
  end
208
- else # model
209
- # models (e.g. Pet) or oneOf
202
+ else
210
203
  klass = PCPServerSDK::Models.const_get(type)
211
204
  klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
212
205
  end
213
206
  end
214
207
 
215
- # Returns the string representation of the object
216
- # @return [String] String presentation of the object
217
208
  def to_s
218
209
  to_hash.to_s
219
210
  end
220
211
 
221
- # to_body is an alias to to_hash (backward compatibility)
222
- # @return [Hash] Returns the object in the form of hash
223
212
  def to_body
224
213
  to_hash
225
214
  end
226
215
 
227
- # Returns the object in the form of hash
228
- # @return [Hash] Returns the object in the form of hash
229
216
  def to_hash
230
217
  hash = {}
231
218
  self.class.attribute_map.each_pair do |attr, param|
@@ -240,10 +227,6 @@ module PCPServerSDK
240
227
  hash
241
228
  end
242
229
 
243
- # Outputs non-array value in the form of hash
244
- # For object, use to_hash. Otherwise, just return the value
245
- # @param [Object] value Any valid value
246
- # @return [Hash] Returns the value in the form of hash
247
230
  def _to_hash(value)
248
231
  if value.is_a?(Array)
249
232
  value.compact.map { |v| _to_hash(v) }
@@ -0,0 +1,185 @@
1
+ require 'date'
2
+ require 'time'
3
+
4
+ # Object containing specific data regarding 3-D Secure for card digital wallets.
5
+ # Necessary to perform 3D Secure when there is no liability shift from
6
+ # the wallet and corresponding card network.
7
+ module PCPServerSDK
8
+ module Models
9
+ class MobilePaymentThreeDSecure
10
+ # Redirection data required for 3D Secure authentication.
11
+ attr_accessor :redirection_data
12
+
13
+ # Attribute mapping from ruby-style variable name to JSON key.
14
+ def self.attribute_map
15
+ {
16
+ :'redirection_data' => :'redirectionData'
17
+ }
18
+ end
19
+
20
+ # Returns all the JSON keys this model knows about
21
+ def self.acceptable_attributes
22
+ attribute_map.values
23
+ end
24
+
25
+ # Attribute type mapping.
26
+ def self.openapi_types
27
+ {
28
+ :'redirection_data' => :'RedirectionData'
29
+ }
30
+ end
31
+
32
+ # List of attributes with nullable: true
33
+ def self.openapi_nullable
34
+ Set.new([])
35
+ end
36
+
37
+ # Initializes the object
38
+ # @param [Hash] attributes Model attributes in the form of hash
39
+ def initialize(attributes = {})
40
+ if (!attributes.is_a?(Hash))
41
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MobilePaymentThreeDSecure` initialize method"
42
+ end
43
+
44
+ attributes = attributes.each_with_object({}) { |(k, v), h|
45
+ if (!self.class.attribute_map.key?(k.to_sym))
46
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MobilePaymentThreeDSecure`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
47
+ end
48
+ h[k.to_sym] = v
49
+ }
50
+
51
+ if attributes.key?(:'redirection_data')
52
+ self.redirection_data = attributes[:'redirection_data']
53
+ end
54
+ end
55
+
56
+ # Checks equality by comparing each attribute.
57
+ # @param [Object] Object to be compared
58
+ def ==(o)
59
+ return true if self.equal?(o)
60
+ self.class == o.class &&
61
+ redirection_data == o.redirection_data
62
+ end
63
+
64
+ # @see the `==` method
65
+ # @param [Object] Object to be compared
66
+ def eql?(o)
67
+ self == o
68
+ end
69
+
70
+ # Calculates hash code according to all attributes.
71
+ # @return [Integer] Hash code
72
+ def hash
73
+ [redirection_data].hash
74
+ end
75
+
76
+ # Builds the object from hash
77
+ # @param [Hash] attributes Model attributes in the form of hash
78
+ # @return [Object] Returns the model itself
79
+ def self.build_from_hash(attributes)
80
+ return nil unless attributes.is_a?(Hash)
81
+ attributes = attributes.transform_keys(&:to_sym)
82
+ transformed_hash = {}
83
+ openapi_types.each_pair do |key, type|
84
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
85
+ transformed_hash["#{key}"] = nil
86
+ elsif type =~ /\AArray<(.*)>/i
87
+ if attributes[attribute_map[key]].is_a?(Array)
88
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
89
+ end
90
+ elsif !attributes[attribute_map[key]].nil?
91
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
92
+ end
93
+ end
94
+ new(transformed_hash)
95
+ end
96
+
97
+ # Deserializes the data based on type
98
+ # @param string type Data type
99
+ # @param string value Value to be deserialized
100
+ # @return [Object] Deserialized data
101
+ def self._deserialize(type, value)
102
+ case type.to_sym
103
+ when :Time
104
+ Time.parse(value)
105
+ when :Date
106
+ Date.parse(value)
107
+ when :String
108
+ value.to_s
109
+ when :Integer
110
+ value.to_i
111
+ when :Float
112
+ value.to_f
113
+ when :Boolean
114
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
115
+ true
116
+ else
117
+ false
118
+ end
119
+ when :Object
120
+ value
121
+ when /\AArray<(?<inner_type>.+)>\z/
122
+ inner_type = Regexp.last_match[:inner_type]
123
+ value.map { |v| _deserialize(inner_type, v) }
124
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
125
+ k_type = Regexp.last_match[:k_type]
126
+ v_type = Regexp.last_match[:v_type]
127
+ {}.tap do |hash|
128
+ value.each do |k, v|
129
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
130
+ end
131
+ end
132
+ else
133
+ klass = PCPServerSDK::Models.const_get(type)
134
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
135
+ end
136
+ end
137
+
138
+ # Returns the string representation of the object
139
+ # @return [String] String presentation of the object
140
+ def to_s
141
+ to_hash.to_s
142
+ end
143
+
144
+ # to_body is an alias to to_hash (backward compatibility)
145
+ # @return [Hash] Returns the object in the form of hash
146
+ def to_body
147
+ to_hash
148
+ end
149
+
150
+ # Returns the object in the form of hash
151
+ # @return [Hash] Returns the object in the form of hash
152
+ def to_hash
153
+ hash = {}
154
+ self.class.attribute_map.each_pair do |attr, param|
155
+ value = self.send(attr)
156
+ if value.nil?
157
+ is_nullable = self.class.openapi_nullable.include?(attr)
158
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
159
+ end
160
+
161
+ hash[param] = _to_hash(value)
162
+ end
163
+ hash
164
+ end
165
+
166
+ # Outputs non-array value in the form of hash
167
+ # For object, use to_hash. Otherwise, just return the value
168
+ # @param [Object] value Any valid value
169
+ # @return [Hash] Returns the value in the form of hash
170
+ def _to_hash(value)
171
+ if value.is_a?(Array)
172
+ value.compact.map { |v| _to_hash(v) }
173
+ elsif value.is_a?(Hash)
174
+ {}.tap do |hash|
175
+ value.each { |k, v| hash[k] = _to_hash(v) }
176
+ end
177
+ elsif value.respond_to? :to_hash
178
+ value.to_hash
179
+ else
180
+ value
181
+ end
182
+ end
183
+ end
184
+ end
185
+ end
@@ -1,4 +1,3 @@
1
-
2
1
  require 'date'
3
2
  require 'time'
4
3
 
@@ -20,6 +19,9 @@ module PCPServerSDK
20
19
  # Tax on the line item, with the last two digits implied as decimal places
21
20
  attr_accessor :tax_amount
22
21
 
22
+ # This field indicates if the `taxAmount` is to be interpreted as the tax amount per unit rather than for the entire line item. This field is included in the response only when `taxAmount` is set; otherwise, it will return as `null`.
23
+ attr_accessor :tax_amount_per_unit
24
+
23
25
  # URL of the product in shop. Used for PAYONE Buy Now, Pay Later (BNPL).
24
26
  attr_accessor :product_url
25
27
 
@@ -32,8 +34,6 @@ module PCPServerSDK
32
34
  # Optional parameter to define the delivery shop or touchpoint where an item has been collected (e.g. for Click & Collect or Click & Reserve).
33
35
  attr_accessor :merchant_shop_delivery_reference
34
36
 
35
-
36
-
37
37
  class EnumAttributeValidator
38
38
  attr_reader :datatype
39
39
  attr_reader :allowable_values
@@ -64,6 +64,7 @@ module PCPServerSDK
64
64
  :'product_type' => :'productType',
65
65
  :'quantity' => :'quantity',
66
66
  :'tax_amount' => :'taxAmount',
67
+ :'tax_amount_per_unit' => :'taxAmountPerUnit',
67
68
  :'product_url' => :'productUrl',
68
69
  :'product_image_url' => :'productImageUrl',
69
70
  :'product_category_path' => :'productCategoryPath',
@@ -84,6 +85,7 @@ module PCPServerSDK
84
85
  :'product_type' => :'ProductType',
85
86
  :'quantity' => :'Integer',
86
87
  :'tax_amount' => :'Integer',
88
+ :'tax_amount_per_unit' => :'Boolean',
87
89
  :'product_url' => :'String',
88
90
  :'product_image_url' => :'String',
89
91
  :'product_category_path' => :'String',
@@ -93,12 +95,10 @@ module PCPServerSDK
93
95
 
94
96
  # List of attributes with nullable: true
95
97
  def self.openapi_nullable
96
- Set.new([
97
- ])
98
+ Set.new([])
98
99
  end
99
100
 
100
101
  # Initializes the object
101
- # @param [Hash] attributes Model attributes in the form of hash
102
102
  def initialize(attributes = {})
103
103
  if (!attributes.is_a?(Hash))
104
104
  fail ArgumentError, "The input argument (attributes) must be a hash in `OrderLineDetailsInput` initialize method"
@@ -136,6 +136,12 @@ module PCPServerSDK
136
136
  self.tax_amount = attributes[:'tax_amount']
137
137
  end
138
138
 
139
+ if attributes.key?(:'tax_amount_per_unit')
140
+ self.tax_amount_per_unit = attributes[:'tax_amount_per_unit']
141
+ else
142
+ self.tax_amount_per_unit = false
143
+ end
144
+
139
145
  if attributes.key?(:'product_url')
140
146
  self.product_url = attributes[:'product_url']
141
147
  end
@@ -1,16 +1,11 @@
1
-
2
1
  require 'date'
3
2
  require 'time'
4
3
 
5
- # Object containing additional Information needed for Apple Pay payment transactions.
4
+ # Request to refresh the payment status of a specific payment.
6
5
  module PCPServerSDK
7
6
  module Models
8
- class PaymentProduct320SpecificInput
9
- attr_accessor :network
10
-
11
- attr_accessor :token
12
-
13
-
7
+ class PausePaymentRequest
8
+ attr_accessor :refresh_type
14
9
 
15
10
  class EnumAttributeValidator
16
11
  attr_reader :datatype
@@ -37,8 +32,7 @@ module PCPServerSDK
37
32
  # Attribute mapping from ruby-style variable name to JSON key.
38
33
  def self.attribute_map
39
34
  {
40
- :'network' => :'network',
41
- :'token' => :'token'
35
+ :'refresh_type' => :'refreshType'
42
36
  }
43
37
  end
44
38
 
@@ -50,38 +44,31 @@ module PCPServerSDK
50
44
  # Attribute type mapping.
51
45
  def self.openapi_types
52
46
  {
53
- :'network' => :'String',
54
- :'token' => :'ApplePaymentDataTokenInformation'
47
+ :'refresh_type' => :'RefreshType'
55
48
  }
56
49
  end
57
50
 
58
51
  # List of attributes with nullable: true
59
52
  def self.openapi_nullable
60
- Set.new([
61
- ])
53
+ Set.new([])
62
54
  end
63
55
 
64
56
  # Initializes the object
65
57
  # @param [Hash] attributes Model attributes in the form of hash
66
58
  def initialize(attributes = {})
67
59
  if (!attributes.is_a?(Hash))
68
- fail ArgumentError, "The input argument (attributes) must be a hash in `PaymentProduct320SpecificInput` initialize method"
60
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PausePaymentRequest` initialize method"
69
61
  end
70
62
 
71
- # check to see if the attribute exists and convert string to symbol for hash key
72
63
  attributes = attributes.each_with_object({}) { |(k, v), h|
73
64
  if (!self.class.attribute_map.key?(k.to_sym))
74
- fail ArgumentError, "`#{k}` is not a valid attribute in `PaymentProduct320SpecificInput`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PausePaymentRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
75
66
  end
76
67
  h[k.to_sym] = v
77
68
  }
78
69
 
79
- if attributes.key?(:'network')
80
- self.network = attributes[:'network']
81
- end
82
-
83
- if attributes.key?(:'token')
84
- self.token = attributes[:'token']
70
+ if attributes.key?(:'refresh_type')
71
+ self.refresh_type = attributes[:'refresh_type']
85
72
  end
86
73
  end
87
74
 
@@ -90,8 +77,7 @@ module PCPServerSDK
90
77
  def ==(o)
91
78
  return true if self.equal?(o)
92
79
  self.class == o.class &&
93
- network == o.network &&
94
- token == o.token
80
+ refresh_type == o.refresh_type
95
81
  end
96
82
 
97
83
  # @see the `==` method
@@ -103,7 +89,7 @@ module PCPServerSDK
103
89
  # Calculates hash code according to all attributes.
104
90
  # @return [Integer] Hash code
105
91
  def hash
106
- [network, token].hash
92
+ [refresh_type].hash
107
93
  end
108
94
 
109
95
  # Builds the object from hash
@@ -117,8 +103,6 @@ module PCPServerSDK
117
103
  if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
118
104
  transformed_hash["#{key}"] = nil
119
105
  elsif type =~ /\AArray<(.*)>/i
120
- # check to ensure the input is an array given that the attribute
121
- # is documented as an array but the input is not
122
106
  if attributes[attribute_map[key]].is_a?(Array)
123
107
  transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
124
108
  end
@@ -152,7 +136,6 @@ module PCPServerSDK
152
136
  false
153
137
  end
154
138
  when :Object
155
- # generic object (usually a Hash), return directly
156
139
  value
157
140
  when /\AArray<(?<inner_type>.+)>\z/
158
141
  inner_type = Regexp.last_match[:inner_type]
@@ -165,8 +148,7 @@ module PCPServerSDK
165
148
  hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
166
149
  end
167
150
  end
168
- else # model
169
- # models (e.g. Pet) or oneOf
151
+ else
170
152
  klass = PCPServerSDK::Models.const_get(type)
171
153
  klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
172
154
  end