pcp-server-ruby-sdk 1.12.0 → 1.13.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 (168) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -0
  3. data/README.md +1 -1
  4. data/api-definition.yaml +323 -41
  5. data/lib/PCP-server-Ruby-SDK/endpoints/payment_intent_api_client.rb +37 -0
  6. data/lib/PCP-server-Ruby-SDK/models/address.rb +9 -237
  7. data/lib/PCP-server-Ruby-SDK/models/address_personal.rb +10 -246
  8. data/lib/PCP-server-Ruby-SDK/models/amount_of_money.rb +4 -195
  9. data/lib/PCP-server-Ruby-SDK/models/api_error.rb +27 -232
  10. data/lib/PCP-server-Ruby-SDK/models/apple_payment_data_token_header_information.rb +6 -194
  11. data/lib/PCP-server-Ruby-SDK/models/apple_payment_data_token_information.rb +8 -229
  12. data/lib/PCP-server-Ruby-SDK/models/bank_account_information.rb +11 -207
  13. data/lib/PCP-server-Ruby-SDK/models/bank_payout_method_specific_input.rb +4 -187
  14. data/lib/PCP-server-Ruby-SDK/models/cancel_item.rb +6 -195
  15. data/lib/PCP-server-Ruby-SDK/models/cancel_payment_request.rb +6 -222
  16. data/lib/PCP-server-Ruby-SDK/models/cancel_payment_response.rb +4 -190
  17. data/lib/PCP-server-Ruby-SDK/models/cancel_request.rb +6 -224
  18. data/lib/PCP-server-Ruby-SDK/models/cancel_response.rb +4 -190
  19. data/lib/PCP-server-Ruby-SDK/models/capture_output.rb +9 -214
  20. data/lib/PCP-server-Ruby-SDK/models/capture_payment_request.rb +14 -253
  21. data/lib/PCP-server-Ruby-SDK/models/capture_payment_response.rb +7 -239
  22. data/lib/PCP-server-Ruby-SDK/models/card_fraud_results.rb +29 -184
  23. data/lib/PCP-server-Ruby-SDK/models/card_info.rb +3 -182
  24. data/lib/PCP-server-Ruby-SDK/models/card_payment_details.rb +8 -210
  25. data/lib/PCP-server-Ruby-SDK/models/card_payment_method_specific_input.rb +32 -307
  26. data/lib/PCP-server-Ruby-SDK/models/card_payment_method_specific_output.rb +6 -210
  27. data/lib/PCP-server-Ruby-SDK/models/card_recurrence_details.rb +12 -186
  28. data/lib/PCP-server-Ruby-SDK/models/cart_item_data.rb +10 -0
  29. data/lib/PCP-server-Ruby-SDK/models/cart_item_input.rb +5 -198
  30. data/lib/PCP-server-Ruby-SDK/models/cart_item_invoice_data.rb +5 -184
  31. data/lib/PCP-server-Ruby-SDK/models/cart_item_order_status.rb +4 -213
  32. data/lib/PCP-server-Ruby-SDK/models/cart_item_patch.rb +5 -200
  33. data/lib/PCP-server-Ruby-SDK/models/cart_item_result.rb +5 -200
  34. data/lib/PCP-server-Ruby-SDK/models/cart_item_supplier_references.rb +6 -195
  35. data/lib/PCP-server-Ruby-SDK/models/checkout_references.rb +4 -192
  36. data/lib/PCP-server-Ruby-SDK/models/checkout_response.rb +15 -319
  37. data/lib/PCP-server-Ruby-SDK/models/checkouts_response.rb +4 -193
  38. data/lib/PCP-server-Ruby-SDK/models/company_information.rb +3 -182
  39. data/lib/PCP-server-Ruby-SDK/models/complete_financing_payment_method_specific_input.rb +12 -202
  40. data/lib/PCP-server-Ruby-SDK/models/complete_order_request.rb +3 -181
  41. data/lib/PCP-server-Ruby-SDK/models/complete_payment_method_specific_input.rb +4 -191
  42. data/lib/PCP-server-Ruby-SDK/models/complete_payment_product840_specific_input.rb +7 -226
  43. data/lib/PCP-server-Ruby-SDK/models/complete_payment_request.rb +6 -209
  44. data/lib/PCP-server-Ruby-SDK/models/complete_payment_response.rb +5 -199
  45. data/lib/PCP-server-Ruby-SDK/models/complete_redirect_payment_method_specific_input.rb +4 -192
  46. data/lib/PCP-server-Ruby-SDK/models/contact_details.rb +4 -191
  47. data/lib/PCP-server-Ruby-SDK/models/create_checkout_request.rb +13 -240
  48. data/lib/PCP-server-Ruby-SDK/models/create_checkout_response.rb +16 -307
  49. data/lib/PCP-server-Ruby-SDK/models/create_commerce_case_response.rb +7 -219
  50. data/lib/PCP-server-Ruby-SDK/models/create_payment_intent.rb +11 -0
  51. data/lib/PCP-server-Ruby-SDK/models/create_payment_intent_request.rb +13 -0
  52. data/lib/PCP-server-Ruby-SDK/models/create_payment_intent_response.rb +10 -0
  53. data/lib/PCP-server-Ruby-SDK/models/create_payment_response.rb +7 -218
  54. data/lib/PCP-server-Ruby-SDK/models/customer.rb +28 -260
  55. data/lib/PCP-server-Ruby-SDK/models/customer_account.rb +10 -44
  56. data/lib/PCP-server-Ruby-SDK/models/customer_device.rb +8 -209
  57. data/lib/PCP-server-Ruby-SDK/models/deliver_item.rb +6 -195
  58. data/lib/PCP-server-Ruby-SDK/models/deliver_request.rb +10 -246
  59. data/lib/PCP-server-Ruby-SDK/models/deliver_response.rb +4 -191
  60. data/lib/PCP-server-Ruby-SDK/models/delivery_information.rb +3 -185
  61. data/lib/PCP-server-Ruby-SDK/models/error_response.rb +4 -193
  62. data/lib/PCP-server-Ruby-SDK/models/financing_payment_method_specific_input.rb +15 -203
  63. data/lib/PCP-server-Ruby-SDK/models/financing_payment_method_specific_output.rb +10 -196
  64. data/lib/PCP-server-Ruby-SDK/models/fund_distribution.rb +12 -263
  65. data/lib/PCP-server-Ruby-SDK/models/fund_split.rb +5 -205
  66. data/lib/PCP-server-Ruby-SDK/models/fund_split_request.rb +3 -147
  67. data/lib/PCP-server-Ruby-SDK/models/fund_split_response.rb +10 -174
  68. data/lib/PCP-server-Ruby-SDK/models/installment_option.rb +13 -273
  69. data/lib/PCP-server-Ruby-SDK/models/link_information.rb +4 -196
  70. data/lib/PCP-server-Ruby-SDK/models/merchant_action.rb +16 -194
  71. data/lib/PCP-server-Ruby-SDK/models/mobile_payment_method_specific_input.rb +13 -246
  72. data/lib/PCP-server-Ruby-SDK/models/mobile_payment_method_specific_output.rb +7 -219
  73. data/lib/PCP-server-Ruby-SDK/models/mobile_payment_three_dsecure.rb +3 -179
  74. data/lib/PCP-server-Ruby-SDK/models/model_base.rb +147 -0
  75. data/lib/PCP-server-Ruby-SDK/models/order.rb +7 -221
  76. data/lib/PCP-server-Ruby-SDK/models/order_item.rb +6 -197
  77. data/lib/PCP-server-Ruby-SDK/models/order_line_details_input.rb +29 -305
  78. data/lib/PCP-server-Ruby-SDK/models/order_line_details_patch.rb +5 -326
  79. data/lib/PCP-server-Ruby-SDK/models/order_line_details_result.rb +5 -326
  80. data/lib/PCP-server-Ruby-SDK/models/order_request.rb +7 -244
  81. data/lib/PCP-server-Ruby-SDK/models/order_response.rb +4 -192
  82. data/lib/PCP-server-Ruby-SDK/models/patch_checkout_request.rb +8 -228
  83. data/lib/PCP-server-Ruby-SDK/models/patch_commerce_case_request.rb +3 -183
  84. data/lib/PCP-server-Ruby-SDK/models/pause_payment_request.rb +2 -165
  85. data/lib/PCP-server-Ruby-SDK/models/pause_payment_response.rb +3 -186
  86. data/lib/PCP-server-Ruby-SDK/models/payee.rb +6 -204
  87. data/lib/PCP-server-Ruby-SDK/models/payment_creation_output.rb +3 -183
  88. data/lib/PCP-server-Ruby-SDK/models/payment_event.rb +19 -274
  89. data/lib/PCP-server-Ruby-SDK/models/payment_execution.rb +29 -335
  90. data/lib/PCP-server-Ruby-SDK/models/payment_execution_request.rb +4 -191
  91. data/lib/PCP-server-Ruby-SDK/models/payment_execution_specific_input.rb +6 -212
  92. data/lib/PCP-server-Ruby-SDK/models/payment_information_refund_request.rb +7 -205
  93. data/lib/PCP-server-Ruby-SDK/models/payment_information_refund_response.rb +5 -196
  94. data/lib/PCP-server-Ruby-SDK/models/payment_information_request.rb +10 -249
  95. data/lib/PCP-server-Ruby-SDK/models/payment_information_response.rb +30 -314
  96. data/lib/PCP-server-Ruby-SDK/models/payment_instructions.rb +8 -214
  97. data/lib/PCP-server-Ruby-SDK/models/payment_intent_output.rb +13 -0
  98. data/lib/PCP-server-Ruby-SDK/models/payment_intent_response.rb +13 -0
  99. data/lib/PCP-server-Ruby-SDK/models/payment_intent_response_data.rb +12 -0
  100. data/lib/PCP-server-Ruby-SDK/models/payment_method_specific_input.rb +9 -261
  101. data/lib/PCP-server-Ruby-SDK/models/payment_method_specific_input_for_intent.rb +9 -0
  102. data/lib/PCP-server-Ruby-SDK/models/payment_output.rb +11 -255
  103. data/lib/PCP-server-Ruby-SDK/models/payment_product302_specific_input.rb +11 -225
  104. data/lib/PCP-server-Ruby-SDK/models/payment_product3391_specific_input.rb +6 -197
  105. data/lib/PCP-server-Ruby-SDK/models/payment_product3391_specific_output.rb +3 -185
  106. data/lib/PCP-server-Ruby-SDK/models/payment_product3392_specific_input.rb +3 -185
  107. data/lib/PCP-server-Ruby-SDK/models/payment_product5002_specific_input.rb +7 -203
  108. data/lib/PCP-server-Ruby-SDK/models/payment_product771_specific_output.rb +3 -183
  109. data/lib/PCP-server-Ruby-SDK/models/payment_product840_customer_account.rb +6 -210
  110. data/lib/PCP-server-Ruby-SDK/models/payment_product840_specific_output.rb +5 -209
  111. data/lib/PCP-server-Ruby-SDK/models/payment_product840_specific_output_data.rb +11 -0
  112. data/lib/PCP-server-Ruby-SDK/models/payment_product840_specific_output_for_intent.rb +13 -0
  113. data/lib/PCP-server-Ruby-SDK/models/payment_references.rb +6 -184
  114. data/lib/PCP-server-Ruby-SDK/models/payment_references_for_refund.rb +12 -197
  115. data/lib/PCP-server-Ruby-SDK/models/payment_response.rb +6 -234
  116. data/lib/PCP-server-Ruby-SDK/models/payment_status_output.rb +6 -234
  117. data/lib/PCP-server-Ruby-SDK/models/payout_output.rb +5 -205
  118. data/lib/PCP-server-Ruby-SDK/models/payout_response.rb +6 -215
  119. data/lib/PCP-server-Ruby-SDK/models/personal_information.rb +11 -227
  120. data/lib/PCP-server-Ruby-SDK/models/personal_name.rb +5 -201
  121. data/lib/PCP-server-Ruby-SDK/models/positive_amount_of_money.rb +4 -196
  122. data/lib/PCP-server-Ruby-SDK/models/processing_mandate_information.rb +9 -254
  123. data/lib/PCP-server-Ruby-SDK/models/redirect_data.rb +3 -183
  124. data/lib/PCP-server-Ruby-SDK/models/redirect_payment_method_specific_input.rb +14 -249
  125. data/lib/PCP-server-Ruby-SDK/models/redirect_payment_method_specific_input_for_intent.rb +12 -0
  126. data/lib/PCP-server-Ruby-SDK/models/redirect_payment_method_specific_output.rb +6 -211
  127. data/lib/PCP-server-Ruby-SDK/models/redirect_payment_method_specific_output_for_create_intent.rb +12 -0
  128. data/lib/PCP-server-Ruby-SDK/models/redirect_payment_method_specific_output_for_intent.rb +10 -0
  129. data/lib/PCP-server-Ruby-SDK/models/redirect_payment_product840_specific_input.rb +6 -205
  130. data/lib/PCP-server-Ruby-SDK/models/redirect_payment_product840_specific_input_data.rb +10 -0
  131. data/lib/PCP-server-Ruby-SDK/models/redirect_payment_product900_specific_input.rb +12 -177
  132. data/lib/PCP-server-Ruby-SDK/models/redirection_data.rb +11 -186
  133. data/lib/PCP-server-Ruby-SDK/models/references.rb +47 -205
  134. data/lib/PCP-server-Ruby-SDK/models/refresh_payment_request.rb +3 -186
  135. data/lib/PCP-server-Ruby-SDK/models/refund_error_response.rb +4 -193
  136. data/lib/PCP-server-Ruby-SDK/models/refund_output.rb +8 -211
  137. data/lib/PCP-server-Ruby-SDK/models/refund_payment_response.rb +7 -242
  138. data/lib/PCP-server-Ruby-SDK/models/refund_request.rb +6 -210
  139. data/lib/PCP-server-Ruby-SDK/models/return_information.rb +4 -194
  140. data/lib/PCP-server-Ruby-SDK/models/return_item.rb +6 -196
  141. data/lib/PCP-server-Ruby-SDK/models/return_request.rb +6 -234
  142. data/lib/PCP-server-Ruby-SDK/models/return_response.rb +4 -191
  143. data/lib/PCP-server-Ruby-SDK/models/sepa_direct_debit_payment_method_specific_input.rb +4 -193
  144. data/lib/PCP-server-Ruby-SDK/models/sepa_direct_debit_payment_method_specific_output.rb +4 -193
  145. data/lib/PCP-server-Ruby-SDK/models/sepa_direct_debit_payment_product771_specific_input.rb +4 -192
  146. data/lib/PCP-server-Ruby-SDK/models/sepa_transfer_payment_product_772_specific_input.rb +3 -186
  147. data/lib/PCP-server-Ruby-SDK/models/shipping.rb +3 -183
  148. data/lib/PCP-server-Ruby-SDK/models/shipping_address.rb +14 -0
  149. data/lib/PCP-server-Ruby-SDK/models/shopping_cart_data.rb +9 -0
  150. data/lib/PCP-server-Ruby-SDK/models/shopping_cart_input.rb +3 -185
  151. data/lib/PCP-server-Ruby-SDK/models/shopping_cart_patch.rb +3 -185
  152. data/lib/PCP-server-Ruby-SDK/models/shopping_cart_result.rb +3 -185
  153. data/lib/PCP-server-Ruby-SDK/models/status_output.rb +21 -264
  154. data/lib/PCP-server-Ruby-SDK/models/three_d_secure_results.rb +6 -226
  155. data/lib/PCP-server-Ruby-SDK/version.rb +1 -1
  156. data/lib/PCP-server-Ruby-SDK.rb +18 -0
  157. data/package-lock.json +2 -2
  158. data/package.json +1 -1
  159. data/scripts/convert_models_to_model_base.rb +128 -0
  160. data/spec/endpoints/payment_intent_api_client_spec.rb +43 -0
  161. data/spec/models/api_definition_conformance_spec.rb +88 -0
  162. data/spec/models/model_base_spec.rb +87 -0
  163. data/spec/models/payment_intent_models_spec.rb +25 -0
  164. data/spec/models/required_field_validation_spec.rb +5 -5
  165. metadata +35 -11
  166. data/lib/PCP-server-Ruby-SDK/models/action_type.rb +0 -34
  167. data/lib/PCP-server-Ruby-SDK/models/avs_result.rb +0 -52
  168. data/lib/PCP-server-Ruby-SDK/models/business_relation.rb +0 -30
@@ -1,171 +1,8 @@
1
- require 'date'
2
- require 'time'
1
+ require_relative 'model_base'
3
2
 
4
- # Request to pause a specific payment.
5
3
  module PCPServerSDK
6
4
  module Models
7
- class PausePaymentRequest
8
- # Attribute mapping from ruby-style variable name to JSON key.
9
- def self.attribute_map
10
- {}
11
- end
12
-
13
- # Returns all the JSON keys this model knows about
14
- def self.acceptable_attributes
15
- attribute_map.values
16
- end
17
-
18
- # Attribute type mapping.
19
- def self.openapi_types
20
- {}
21
- end
22
-
23
- # List of attributes with nullable: true
24
- def self.openapi_nullable
25
- Set.new([])
26
- end
27
-
28
- # Initializes the object
29
- # @param [Hash] attributes Model attributes in the form of hash
30
- def initialize(attributes = {})
31
- if (!attributes.is_a?(Hash))
32
- fail ArgumentError, "The input argument (attributes) must be a hash in `PausePaymentRequest` initialize method"
33
- end
34
-
35
- attributes = attributes.each_with_object({}) { |(k, v), h|
36
- if (!self.class.attribute_map.key?(k.to_sym))
37
- 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
38
- end
39
- h[k.to_sym] = v
40
- }
41
- end
42
-
43
- # Checks equality by comparing each attribute.
44
- # @param [Object] Object to be compared
45
- def ==(o)
46
- return true if self.equal?(o)
47
- self.class == o.class
48
- end
49
-
50
- # @see the `==` method
51
- # @param [Object] Object to be compared
52
- def eql?(o)
53
- self == o
54
- end
55
-
56
- # Calculates hash code according to all attributes.
57
- # @return [Integer] Hash code
58
- def hash
59
- [].hash
60
- end
61
-
62
- # Builds the object from hash
63
- # @param [Hash] attributes Model attributes in the form of hash
64
- # @return [Object] Returns the model itself
65
- def self.build_from_hash(attributes)
66
- return nil unless attributes.is_a?(Hash)
67
- attributes = attributes.transform_keys(&:to_sym)
68
- transformed_hash = {}
69
- openapi_types.each_pair do |key, type|
70
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
71
- transformed_hash["#{key}"] = nil
72
- elsif type =~ /\AArray<(.*)>/i
73
- if attributes[attribute_map[key]].is_a?(Array)
74
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
75
- end
76
- elsif !attributes[attribute_map[key]].nil?
77
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
78
- end
79
- end
80
- new(transformed_hash)
81
- end
82
-
83
- # Deserializes the data based on type
84
- # @param string type Data type
85
- # @param string value Value to be deserialized
86
- # @return [Object] Deserialized data
87
- def self._deserialize(type, value)
88
- case type.to_sym
89
- when :Time
90
- Time.parse(value)
91
- when :Date
92
- Date.parse(value)
93
- when :String
94
- value.to_s
95
- when :Integer
96
- value.to_i
97
- when :Float
98
- value.to_f
99
- when :Boolean
100
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
101
- true
102
- else
103
- false
104
- end
105
- when :Object
106
- value
107
- when /\AArray<(?<inner_type>.+)>\z/
108
- inner_type = Regexp.last_match[:inner_type]
109
- value.map { |v| _deserialize(inner_type, v) }
110
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
111
- k_type = Regexp.last_match[:k_type]
112
- v_type = Regexp.last_match[:v_type]
113
- {}.tap do |hash|
114
- value.each do |k, v|
115
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
116
- end
117
- end
118
- else
119
- klass = PCPServerSDK::Models.const_get(type)
120
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
121
- end
122
- end
123
-
124
- # Returns the string representation of the object
125
- # @return [String] String presentation of the object
126
- def to_s
127
- to_hash.to_s
128
- end
129
-
130
- # to_body is an alias to to_hash (backward compatibility)
131
- # @return [Hash] Returns the object in the form of hash
132
- def to_body
133
- to_hash
134
- end
135
-
136
- # Returns the object in the form of hash
137
- # @return [Hash] Returns the object in the form of hash
138
- def to_hash
139
- hash = {}
140
- self.class.attribute_map.each_pair do |attr, param|
141
- value = self.send(attr)
142
- if value.nil?
143
- is_nullable = self.class.openapi_nullable.include?(attr)
144
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
145
- end
146
-
147
- hash[param] = _to_hash(value)
148
- end
149
- hash
150
- end
151
-
152
- # Outputs non-array value in the form of hash
153
- # For object, use to_hash. Otherwise, just return the value
154
- # @param [Object] value Any valid value
155
- # @return [Hash] Returns the value in the form of hash
156
- def _to_hash(value)
157
- if value.is_a?(Array)
158
- value.compact.map { |v| _to_hash(v) }
159
- elsif value.is_a?(Hash)
160
- {}.tap do |hash|
161
- value.each { |k, v| hash[k] = _to_hash(v) }
162
- end
163
- elsif value.respond_to? :to_hash
164
- value.to_hash
165
- else
166
- value
167
- end
168
- end
5
+ class PausePaymentRequest < ModelBase
169
6
  end
170
7
  end
171
8
  end
@@ -1,192 +1,9 @@
1
- require 'date'
2
- require 'time'
1
+ require_relative 'model_base'
3
2
 
4
- # Response for pausing a payment execution.
5
3
  module PCPServerSDK
6
4
  module Models
7
- class PausePaymentResponse
8
- # Status of the paused payment.
9
- attr_accessor :status
10
-
11
- class EnumAttributeValidator
12
- attr_reader :datatype
13
- attr_reader :allowable_values
14
-
15
- def initialize(datatype, allowable_values)
16
- @allowable_values = allowable_values.map do |value|
17
- case datatype.to_s
18
- when /Integer/i
19
- value.to_i
20
- when /Float/i
21
- value.to_f
22
- else
23
- value
24
- end
25
- end
26
- end
27
-
28
- def valid?(value)
29
- !value || allowable_values.include?(value)
30
- end
31
- end
32
-
33
- # Attribute mapping from ruby-style variable name to JSON key.
34
- def self.attribute_map
35
- {
36
- :'status' => :'status'
37
- }
38
- end
39
-
40
- # Returns all the JSON keys this model knows about
41
- def self.acceptable_attributes
42
- attribute_map.values
43
- end
44
-
45
- # Attribute type mapping.
46
- def self.openapi_types
47
- {
48
- :'status' => :'StatusValue'
49
- }
50
- end
51
-
52
- # List of attributes with nullable: true
53
- def self.openapi_nullable
54
- Set.new([])
55
- end
56
-
57
- # Initializes the object
58
- # @param [Hash] attributes Model attributes in the form of hash
59
- def initialize(attributes = {})
60
- if (!attributes.is_a?(Hash))
61
- fail ArgumentError, "The input argument (attributes) must be a hash in `PausePaymentResponse` initialize method"
62
- end
63
-
64
- attributes = attributes.each_with_object({}) { |(k, v), h|
65
- if (!self.class.attribute_map.key?(k.to_sym))
66
- fail ArgumentError, "`#{k}` is not a valid attribute in `PausePaymentResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
67
- end
68
- h[k.to_sym] = v
69
- }
70
-
71
- if attributes.key?(:'status')
72
- self.status = attributes[:'status']
73
- end
74
- end
75
-
76
- # Checks equality by comparing each attribute.
77
- def ==(o)
78
- return true if self.equal?(o)
79
- self.class == o.class &&
80
- status == o.status
81
- end
82
-
83
- # @see the `==` method
84
- def eql?(o)
85
- self == o
86
- end
87
-
88
- # Calculates hash code according to all attributes.
89
- def hash
90
- [status].hash
91
- end
92
-
93
- # Builds the object from hash
94
- # @param [Hash] attributes Model attributes in the form of hash
95
- # @return [Object] Returns the model itself
96
- def self.build_from_hash(attributes)
97
- return nil unless attributes.is_a?(Hash)
98
- attributes = attributes.transform_keys(&:to_sym)
99
- transformed_hash = {}
100
- openapi_types.each_pair do |key, type|
101
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
102
- transformed_hash["#{key}"] = nil
103
- elsif type =~ /\AArray<(.*)>/i
104
- if attributes[attribute_map[key]].is_a?(Array)
105
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
106
- end
107
- elsif !attributes[attribute_map[key]].nil?
108
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
109
- end
110
- end
111
- new(transformed_hash)
112
- end
113
-
114
- # Deserializes the data based on type
115
- def self._deserialize(type, value)
116
- case type.to_sym
117
- when :Time
118
- Time.parse(value)
119
- when :Date
120
- Date.parse(value)
121
- when :String
122
- value.to_s
123
- when :Integer
124
- value.to_i
125
- when :Float
126
- value.to_f
127
- when :Boolean
128
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
129
- true
130
- else
131
- false
132
- end
133
- when :Object
134
- value
135
- when /\AArray<(?<inner_type>.+)>\z/
136
- inner_type = Regexp.last_match[:inner_type]
137
- value.map { |v| _deserialize(inner_type, v) }
138
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
139
- k_type = Regexp.last_match[:k_type]
140
- v_type = Regexp.last_match[:v_type]
141
- {}.tap do |hash|
142
- value.each do |k, v|
143
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
144
- end
145
- end
146
- else
147
- klass = PCPServerSDK::Models.const_get(type)
148
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
149
- end
150
- end
151
-
152
- # Returns the string representation of the object
153
- def to_s
154
- to_hash.to_s
155
- end
156
-
157
- # to_body is an alias to to_hash (backward compatibility)
158
- def to_body
159
- to_hash
160
- end
161
-
162
- # Returns the object in the form of hash
163
- def to_hash
164
- hash = {}
165
- self.class.attribute_map.each_pair do |attr, param|
166
- value = self.send(attr)
167
- if value.nil?
168
- is_nullable = self.class.openapi_nullable.include?(attr)
169
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
170
- end
171
- hash[param] = _to_hash(value)
172
- end
173
- hash
174
- end
175
-
176
- # Outputs non-array value in the form of hash
177
- def _to_hash(value)
178
- if value.is_a?(Array)
179
- value.compact.map { |v| _to_hash(v) }
180
- elsif value.is_a?(Hash)
181
- {}.tap do |hash|
182
- value.each { |k, v| hash[k] = _to_hash(v) }
183
- end
184
- elsif value.respond_to? :to_hash
185
- value.to_hash
186
- else
187
- value
188
- end
189
- end
5
+ class PausePaymentResponse < ModelBase
6
+ attribute :status, :status, :StatusValue
190
7
  end
191
8
  end
192
9
  end
@@ -1,212 +1,14 @@
1
- require 'date'
2
- require 'time'
1
+ require_relative 'model_base'
3
2
 
4
- # Payee bank account details as part of the payment instructions
5
3
  module PCPServerSDK
6
4
  module Models
7
- class Payee
8
- # IBAN of the payee's or beneficiary's bank account.
9
- attr_accessor :iban
10
-
5
+ class Payee < ModelBase
6
+ # IBAN of the payee's or beneficiary's bank account. The IBAN is the International Bank Account Number. It is an internationally agreed format for the BBAN and includes the ISO country code and two check digits.
7
+ attribute :iban, :iban, :String
11
8
  # Bank Identification Code
12
- attr_accessor :bic
13
-
9
+ attribute :bic, :bic, :String
14
10
  # Name of the payee
15
- attr_accessor :name
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.
40
- def self.attribute_map
41
- {
42
- :'iban' => :'iban',
43
- :'bic' => :'bic',
44
- :'name' => :'name'
45
- }
46
- end
47
-
48
- # Returns all the JSON keys this model knows about
49
- def self.acceptable_attributes
50
- attribute_map.values
51
- end
52
-
53
- # Attribute type mapping.
54
- def self.openapi_types
55
- {
56
- :'iban' => :'String',
57
- :'bic' => :'String',
58
- :'name' => :'String'
59
- }
60
- end
61
-
62
- # List of attributes with nullable: true
63
- def self.openapi_nullable
64
- Set.new([])
65
- end
66
-
67
- # Initializes the object
68
- # @param [Hash] attributes Model attributes in the form of hash
69
- def initialize(attributes = {})
70
- if (!attributes.is_a?(Hash))
71
- fail ArgumentError, "The input argument (attributes) must be a hash in `Payee` initialize method"
72
- end
73
-
74
- attributes = attributes.each_with_object({}) { |(k, v), h|
75
- if (!self.class.attribute_map.key?(k.to_sym))
76
- fail ArgumentError, "`#{k}` is not a valid attribute in `Payee`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
77
- end
78
- h[k.to_sym] = v
79
- }
80
-
81
- if attributes.key?(:'iban')
82
- self.iban = attributes[:'iban']
83
- end
84
-
85
- if attributes.key?(:'bic')
86
- self.bic = attributes[:'bic']
87
- end
88
-
89
- if attributes.key?(:'name')
90
- self.name = attributes[:'name']
91
- end
92
- end
93
-
94
- # Checks equality by comparing each attribute.
95
- def ==(o)
96
- return true if self.equal?(o)
97
- self.class == o.class &&
98
- iban == o.iban &&
99
- bic == o.bic &&
100
- name == o.name
101
- end
102
-
103
- # @see the `==` method
104
- def eql?(o)
105
- self == o
106
- end
107
-
108
- # Calculates hash code according to all attributes.
109
- def hash
110
- [iban, bic, name].hash
111
- end
112
-
113
- # Builds the object from hash
114
- # @param [Hash] attributes Model attributes in the form of hash
115
- # @return [Object] Returns the model itself
116
- def self.build_from_hash(attributes)
117
- return nil unless attributes.is_a?(Hash)
118
- attributes = attributes.transform_keys(&:to_sym)
119
- transformed_hash = {}
120
- openapi_types.each_pair do |key, type|
121
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
122
- transformed_hash["#{key}"] = nil
123
- elsif type =~ /\AArray<(.*)>/i
124
- if attributes[attribute_map[key]].is_a?(Array)
125
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
126
- end
127
- elsif !attributes[attribute_map[key]].nil?
128
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
129
- end
130
- end
131
- new(transformed_hash)
132
- end
133
-
134
- # Deserializes the data based on type
135
- def self._deserialize(type, value)
136
- case type.to_sym
137
- when :Time
138
- Time.parse(value)
139
- when :Date
140
- Date.parse(value)
141
- when :String
142
- value.to_s
143
- when :Integer
144
- value.to_i
145
- when :Float
146
- value.to_f
147
- when :Boolean
148
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
149
- true
150
- else
151
- false
152
- end
153
- when :Object
154
- value
155
- when /\AArray<(?<inner_type>.+)>\z/
156
- inner_type = Regexp.last_match[:inner_type]
157
- value.map { |v| _deserialize(inner_type, v) }
158
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
159
- k_type = Regexp.last_match[:k_type]
160
- v_type = Regexp.last_match[:v_type]
161
- {}.tap do |hash|
162
- value.each do |k, v|
163
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
164
- end
165
- end
166
- else
167
- klass = PCPServerSDK::Models.const_get(type)
168
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
169
- end
170
- end
171
-
172
- # Returns the string representation of the object
173
- def to_s
174
- to_hash.to_s
175
- end
176
-
177
- # to_body is an alias to to_hash (backward compatibility)
178
- def to_body
179
- to_hash
180
- end
181
-
182
- # Returns the object in the form of hash
183
- def to_hash
184
- hash = {}
185
- self.class.attribute_map.each_pair do |attr, param|
186
- value = self.send(attr)
187
- if value.nil?
188
- is_nullable = self.class.openapi_nullable.include?(attr)
189
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
190
- end
191
- hash[param] = _to_hash(value)
192
- end
193
- hash
194
- end
195
-
196
- # Outputs non-array value in the form of hash
197
- def _to_hash(value)
198
- if value.is_a?(Array)
199
- value.compact.map { |v| _to_hash(v) }
200
- elsif value.is_a?(Hash)
201
- {}.tap do |hash|
202
- value.each { |k, v| hash[k] = _to_hash(v) }
203
- end
204
- elsif value.respond_to? :to_hash
205
- value.to_hash
206
- else
207
- value
208
- end
209
- end
11
+ attribute :name, :name, :String
210
12
  end
211
13
  end
212
14
  end