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