budgea_client 5.3.2 → 5.3.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (131) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +2 -2
  3. data/README.md +6 -4
  4. data/budgea_client.gemspec +1 -1
  5. data/budgea_openapi.json +53 -34
  6. data/config.json +1 -1
  7. data/docs/Transfer.md +1 -0
  8. data/docs/TransferData.md +12 -0
  9. data/docs/TransferValidationData.md +8 -0
  10. data/docs/TransfersApi.md +11 -16
  11. data/lib/budgea_client.rb +3 -1
  12. data/lib/budgea_client/api/administration_api.rb +1 -1
  13. data/lib/budgea_client/api/authentication_api.rb +1 -1
  14. data/lib/budgea_client/api/banks_api.rb +1 -1
  15. data/lib/budgea_client/api/connections_api.rb +1 -1
  16. data/lib/budgea_client/api/documents_api.rb +1 -1
  17. data/lib/budgea_client/api/ocr_api.rb +1 -1
  18. data/lib/budgea_client/api/oidc_api.rb +1 -1
  19. data/lib/budgea_client/api/pfm_api.rb +1 -1
  20. data/lib/budgea_client/api/providers_api.rb +1 -1
  21. data/lib/budgea_client/api/recipients_api.rb +1 -1
  22. data/lib/budgea_client/api/terms_api.rb +1 -1
  23. data/lib/budgea_client/api/transfer_api.rb +1 -1
  24. data/lib/budgea_client/api/transfers_api.rb +22 -29
  25. data/lib/budgea_client/api/users_management_api.rb +1 -1
  26. data/lib/budgea_client/api/wealth_api.rb +1 -1
  27. data/lib/budgea_client/api_client.rb +1 -1
  28. data/lib/budgea_client/api_error.rb +1 -1
  29. data/lib/budgea_client/configuration.rb +1 -1
  30. data/lib/budgea_client/models/access.rb +1 -1
  31. data/lib/budgea_client/models/account.rb +1 -1
  32. data/lib/budgea_client/models/account_log.rb +1 -1
  33. data/lib/budgea_client/models/account_type.rb +1 -1
  34. data/lib/budgea_client/models/alert.rb +1 -1
  35. data/lib/budgea_client/models/auth_provider.rb +1 -1
  36. data/lib/budgea_client/models/category.rb +1 -1
  37. data/lib/budgea_client/models/certificate.rb +1 -1
  38. data/lib/budgea_client/models/client.rb +1 -1
  39. data/lib/budgea_client/models/config_log.rb +1 -1
  40. data/lib/budgea_client/models/connection.rb +1 -1
  41. data/lib/budgea_client/models/connection_log.rb +1 -1
  42. data/lib/budgea_client/models/connection_source.rb +1 -1
  43. data/lib/budgea_client/models/connector.rb +1 -1
  44. data/lib/budgea_client/models/connector_category.rb +1 -1
  45. data/lib/budgea_client/models/connector_logo.rb +1 -1
  46. data/lib/budgea_client/models/connector_source.rb +1 -1
  47. data/lib/budgea_client/models/currency.rb +1 -1
  48. data/lib/budgea_client/models/device.rb +1 -1
  49. data/lib/budgea_client/models/document.rb +1 -1
  50. data/lib/budgea_client/models/document_type.rb +1 -1
  51. data/lib/budgea_client/models/field.rb +1 -1
  52. data/lib/budgea_client/models/field_value.rb +1 -1
  53. data/lib/budgea_client/models/file.rb +1 -1
  54. data/lib/budgea_client/models/group.rb +1 -1
  55. data/lib/budgea_client/models/hash_table.rb +1 -1
  56. data/lib/budgea_client/models/inline_response_200.rb +1 -1
  57. data/lib/budgea_client/models/inline_response_200_1.rb +1 -1
  58. data/lib/budgea_client/models/inline_response_200_10.rb +1 -1
  59. data/lib/budgea_client/models/inline_response_200_11.rb +1 -1
  60. data/lib/budgea_client/models/inline_response_200_12.rb +1 -1
  61. data/lib/budgea_client/models/inline_response_200_13.rb +1 -1
  62. data/lib/budgea_client/models/inline_response_200_14.rb +1 -1
  63. data/lib/budgea_client/models/inline_response_200_15.rb +1 -1
  64. data/lib/budgea_client/models/inline_response_200_16.rb +1 -1
  65. data/lib/budgea_client/models/inline_response_200_17.rb +1 -1
  66. data/lib/budgea_client/models/inline_response_200_18.rb +1 -1
  67. data/lib/budgea_client/models/inline_response_200_19.rb +1 -1
  68. data/lib/budgea_client/models/inline_response_200_2.rb +1 -1
  69. data/lib/budgea_client/models/inline_response_200_20.rb +1 -1
  70. data/lib/budgea_client/models/inline_response_200_21.rb +1 -1
  71. data/lib/budgea_client/models/inline_response_200_22.rb +1 -1
  72. data/lib/budgea_client/models/inline_response_200_23.rb +1 -1
  73. data/lib/budgea_client/models/inline_response_200_24.rb +1 -1
  74. data/lib/budgea_client/models/inline_response_200_25.rb +1 -1
  75. data/lib/budgea_client/models/inline_response_200_26.rb +1 -1
  76. data/lib/budgea_client/models/inline_response_200_27.rb +1 -1
  77. data/lib/budgea_client/models/inline_response_200_28.rb +1 -1
  78. data/lib/budgea_client/models/inline_response_200_29.rb +1 -1
  79. data/lib/budgea_client/models/inline_response_200_3.rb +1 -1
  80. data/lib/budgea_client/models/inline_response_200_30.rb +1 -1
  81. data/lib/budgea_client/models/inline_response_200_31.rb +1 -1
  82. data/lib/budgea_client/models/inline_response_200_32.rb +1 -1
  83. data/lib/budgea_client/models/inline_response_200_33.rb +1 -1
  84. data/lib/budgea_client/models/inline_response_200_34.rb +1 -1
  85. data/lib/budgea_client/models/inline_response_200_35.rb +1 -1
  86. data/lib/budgea_client/models/inline_response_200_36.rb +1 -1
  87. data/lib/budgea_client/models/inline_response_200_37.rb +1 -1
  88. data/lib/budgea_client/models/inline_response_200_38.rb +1 -1
  89. data/lib/budgea_client/models/inline_response_200_39.rb +1 -1
  90. data/lib/budgea_client/models/inline_response_200_4.rb +1 -1
  91. data/lib/budgea_client/models/inline_response_200_40.rb +1 -1
  92. data/lib/budgea_client/models/inline_response_200_41.rb +1 -1
  93. data/lib/budgea_client/models/inline_response_200_42.rb +1 -1
  94. data/lib/budgea_client/models/inline_response_200_5.rb +1 -1
  95. data/lib/budgea_client/models/inline_response_200_6.rb +1 -1
  96. data/lib/budgea_client/models/inline_response_200_7.rb +1 -1
  97. data/lib/budgea_client/models/inline_response_200_8.rb +1 -1
  98. data/lib/budgea_client/models/inline_response_200_9.rb +1 -1
  99. data/lib/budgea_client/models/investment.rb +1 -1
  100. data/lib/budgea_client/models/investment_value.rb +1 -1
  101. data/lib/budgea_client/models/keyword.rb +1 -1
  102. data/lib/budgea_client/models/locked_user.rb +1 -1
  103. data/lib/budgea_client/models/oidc_whitelist.rb +1 -1
  104. data/lib/budgea_client/models/order.rb +1 -1
  105. data/lib/budgea_client/models/pocket.rb +1 -1
  106. data/lib/budgea_client/models/profile.rb +1 -1
  107. data/lib/budgea_client/models/project.rb +1 -1
  108. data/lib/budgea_client/models/project_type.rb +1 -1
  109. data/lib/budgea_client/models/recipient.rb +1 -1
  110. data/lib/budgea_client/models/recipient_log.rb +1 -1
  111. data/lib/budgea_client/models/security.rb +1 -1
  112. data/lib/budgea_client/models/subscription.rb +1 -1
  113. data/lib/budgea_client/models/subscription_log.rb +1 -1
  114. data/lib/budgea_client/models/terms_of_service.rb +1 -1
  115. data/lib/budgea_client/models/transaction.rb +1 -1
  116. data/lib/budgea_client/models/transaction_information.rb +1 -1
  117. data/lib/budgea_client/models/transactions_cluster.rb +1 -1
  118. data/lib/budgea_client/models/transfer.rb +16 -5
  119. data/lib/budgea_client/models/transfer_data.rb +240 -0
  120. data/lib/budgea_client/models/transfer_log.rb +1 -1
  121. data/lib/budgea_client/models/transfer_validation_data.rb +185 -0
  122. data/lib/budgea_client/models/user.rb +1 -1
  123. data/lib/budgea_client/models/user_alert.rb +1 -1
  124. data/lib/budgea_client/models/webhook.rb +1 -1
  125. data/lib/budgea_client/models/webhook_data.rb +1 -1
  126. data/lib/budgea_client/models/webhook_log.rb +1 -1
  127. data/lib/budgea_client/version.rb +2 -2
  128. data/spec/models/transfer_data_spec.rb +65 -0
  129. data/spec/models/transfer_validation_data_spec.rb +41 -0
  130. metadata +11 -4
  131. data/pkg/budgea_client-5.3.1.gem +0 -0
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: 2.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.14
9
+ Swagger Codegen version: 2.4.15
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: 2.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.14
9
+ Swagger Codegen version: 2.4.15
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: 2.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.14
9
+ Swagger Codegen version: 2.4.15
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: 2.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.14
9
+ Swagger Codegen version: 2.4.15
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: 2.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.14
9
+ Swagger Codegen version: 2.4.15
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: 2.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.14
9
+ Swagger Codegen version: 2.4.15
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: 2.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.14
9
+ Swagger Codegen version: 2.4.15
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: 2.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.14
9
+ Swagger Codegen version: 2.4.15
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: 2.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.14
9
+ Swagger Codegen version: 2.4.15
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: 2.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.14
9
+ Swagger Codegen version: 2.4.15
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: 2.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.14
9
+ Swagger Codegen version: 2.4.15
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: 2.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.14
9
+ Swagger Codegen version: 2.4.15
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: 2.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.14
9
+ Swagger Codegen version: 2.4.15
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: 2.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.14
9
+ Swagger Codegen version: 2.4.15
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: 2.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.14
9
+ Swagger Codegen version: 2.4.15
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: 2.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.14
9
+ Swagger Codegen version: 2.4.15
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: 2.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.14
9
+ Swagger Codegen version: 2.4.15
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: 2.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.14
9
+ Swagger Codegen version: 2.4.15
10
10
 
11
11
  =end
12
12
 
@@ -78,6 +78,8 @@ module BudgeaClient
78
78
  # Currency of the object
79
79
  attr_accessor :currency
80
80
 
81
+ attr_accessor :fields
82
+
81
83
  # Attribute mapping from ruby-style variable name to JSON key.
82
84
  def self.attribute_map
83
85
  {
@@ -101,7 +103,8 @@ module BudgeaClient
101
103
  :'beneficiary_number' => :'beneficiary_number',
102
104
  :'beneficiary_label' => :'beneficiary_label',
103
105
  :'validate_mechanism' => :'validate_mechanism',
104
- :'currency' => :'currency'
106
+ :'currency' => :'currency',
107
+ :'fields' => :'fields'
105
108
  }
106
109
  end
107
110
 
@@ -128,7 +131,8 @@ module BudgeaClient
128
131
  :'beneficiary_number' => :'String',
129
132
  :'beneficiary_label' => :'String',
130
133
  :'validate_mechanism' => :'String',
131
- :'currency' => :'Object'
134
+ :'currency' => :'Object',
135
+ :'fields' => :'Array<Field>'
132
136
  }
133
137
  end
134
138
 
@@ -225,6 +229,12 @@ module BudgeaClient
225
229
  if attributes.has_key?(:'currency')
226
230
  self.currency = attributes[:'currency']
227
231
  end
232
+
233
+ if attributes.has_key?(:'fields')
234
+ if (value = attributes[:'fields']).is_a?(Array)
235
+ self.fields = value
236
+ end
237
+ end
228
238
  end
229
239
 
230
240
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -295,7 +305,8 @@ module BudgeaClient
295
305
  beneficiary_number == o.beneficiary_number &&
296
306
  beneficiary_label == o.beneficiary_label &&
297
307
  validate_mechanism == o.validate_mechanism &&
298
- currency == o.currency
308
+ currency == o.currency &&
309
+ fields == o.fields
299
310
  end
300
311
 
301
312
  # @see the `==` method
@@ -307,7 +318,7 @@ module BudgeaClient
307
318
  # Calculates hash code according to all attributes.
308
319
  # @return [Fixnum] Hash code
309
320
  def hash
310
- [id, id_account, id_user, id_recipient, account_iban, recipient_iban, exec_date, register_date, amount, fees, webid, state, error, label, account_balance, id_transaction, beneficiary_type, beneficiary_number, beneficiary_label, validate_mechanism, currency].hash
321
+ [id, id_account, id_user, id_recipient, account_iban, recipient_iban, exec_date, register_date, amount, fees, webid, state, error, label, account_balance, id_transaction, beneficiary_type, beneficiary_number, beneficiary_label, validate_mechanism, currency, fields].hash
311
322
  end
312
323
 
313
324
  # Builds the object from hash
@@ -0,0 +1,240 @@
1
+ =begin
2
+ #Budgea API Documentation
3
+
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
+
6
+ OpenAPI spec version: 2.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.15
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module BudgeaClient
16
+ class TransferData
17
+ # id of the account
18
+ attr_accessor :id_account
19
+
20
+ # id of the recipient
21
+ attr_accessor :id_recipient
22
+
23
+ # amount of transfer
24
+ attr_accessor :amount
25
+
26
+ # reason of transfer
27
+ attr_accessor :label
28
+
29
+ # excution date of transfer
30
+ attr_accessor :exec_date
31
+
32
+ # Attribute mapping from ruby-style variable name to JSON key.
33
+ def self.attribute_map
34
+ {
35
+ :'id_account' => :'id_account',
36
+ :'id_recipient' => :'id_recipient',
37
+ :'amount' => :'amount',
38
+ :'label' => :'label',
39
+ :'exec_date' => :'exec_date'
40
+ }
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.swagger_types
45
+ {
46
+ :'id_account' => :'Integer',
47
+ :'id_recipient' => :'Integer',
48
+ :'amount' => :'Float',
49
+ :'label' => :'String',
50
+ :'exec_date' => :'Date'
51
+ }
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ return unless attributes.is_a?(Hash)
58
+
59
+ # convert string to symbol for hash key
60
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
61
+
62
+ if attributes.has_key?(:'id_account')
63
+ self.id_account = attributes[:'id_account']
64
+ end
65
+
66
+ if attributes.has_key?(:'id_recipient')
67
+ self.id_recipient = attributes[:'id_recipient']
68
+ end
69
+
70
+ if attributes.has_key?(:'amount')
71
+ self.amount = attributes[:'amount']
72
+ end
73
+
74
+ if attributes.has_key?(:'label')
75
+ self.label = attributes[:'label']
76
+ end
77
+
78
+ if attributes.has_key?(:'exec_date')
79
+ self.exec_date = attributes[:'exec_date']
80
+ end
81
+ end
82
+
83
+ # Show invalid properties with the reasons. Usually used together with valid?
84
+ # @return Array for valid properties with the reasons
85
+ def list_invalid_properties
86
+ invalid_properties = Array.new
87
+ if @id_account.nil?
88
+ invalid_properties.push('invalid value for "id_account", id_account cannot be nil.')
89
+ end
90
+
91
+ if @id_recipient.nil?
92
+ invalid_properties.push('invalid value for "id_recipient", id_recipient cannot be nil.')
93
+ end
94
+
95
+ if @amount.nil?
96
+ invalid_properties.push('invalid value for "amount", amount cannot be nil.')
97
+ end
98
+
99
+ invalid_properties
100
+ end
101
+
102
+ # Check to see if the all the properties in the model are valid
103
+ # @return true if the model is valid
104
+ def valid?
105
+ return false if @id_account.nil?
106
+ return false if @id_recipient.nil?
107
+ return false if @amount.nil?
108
+ true
109
+ end
110
+
111
+ # Checks equality by comparing each attribute.
112
+ # @param [Object] Object to be compared
113
+ def ==(o)
114
+ return true if self.equal?(o)
115
+ self.class == o.class &&
116
+ id_account == o.id_account &&
117
+ id_recipient == o.id_recipient &&
118
+ amount == o.amount &&
119
+ label == o.label &&
120
+ exec_date == o.exec_date
121
+ end
122
+
123
+ # @see the `==` method
124
+ # @param [Object] Object to be compared
125
+ def eql?(o)
126
+ self == o
127
+ end
128
+
129
+ # Calculates hash code according to all attributes.
130
+ # @return [Fixnum] Hash code
131
+ def hash
132
+ [id_account, id_recipient, amount, label, exec_date].hash
133
+ end
134
+
135
+ # Builds the object from hash
136
+ # @param [Hash] attributes Model attributes in the form of hash
137
+ # @return [Object] Returns the model itself
138
+ def build_from_hash(attributes)
139
+ return nil unless attributes.is_a?(Hash)
140
+ self.class.swagger_types.each_pair do |key, type|
141
+ if type =~ /\AArray<(.*)>/i
142
+ # check to ensure the input is an array given that the attribute
143
+ # is documented as an array but the input is not
144
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
145
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
146
+ end
147
+ elsif !attributes[self.class.attribute_map[key]].nil?
148
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
149
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
150
+ end
151
+
152
+ self
153
+ end
154
+
155
+ # Deserializes the data based on type
156
+ # @param string type Data type
157
+ # @param string value Value to be deserialized
158
+ # @return [Object] Deserialized data
159
+ def _deserialize(type, value)
160
+ case type.to_sym
161
+ when :DateTime
162
+ DateTime.parse(value)
163
+ when :Date
164
+ Date.parse(value)
165
+ when :String
166
+ value.to_s
167
+ when :Integer
168
+ value.to_i
169
+ when :Float
170
+ value.to_f
171
+ when :BOOLEAN
172
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
173
+ true
174
+ else
175
+ false
176
+ end
177
+ when :Object
178
+ # generic object (usually a Hash), return directly
179
+ value
180
+ when /\AArray<(?<inner_type>.+)>\z/
181
+ inner_type = Regexp.last_match[:inner_type]
182
+ value.map { |v| _deserialize(inner_type, v) }
183
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
184
+ k_type = Regexp.last_match[:k_type]
185
+ v_type = Regexp.last_match[:v_type]
186
+ {}.tap do |hash|
187
+ value.each do |k, v|
188
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
189
+ end
190
+ end
191
+ else # model
192
+ temp_model = BudgeaClient.const_get(type).new
193
+ temp_model.build_from_hash(value)
194
+ end
195
+ end
196
+
197
+ # Returns the string representation of the object
198
+ # @return [String] String presentation of the object
199
+ def to_s
200
+ to_hash.to_s
201
+ end
202
+
203
+ # to_body is an alias to to_hash (backward compatibility)
204
+ # @return [Hash] Returns the object in the form of hash
205
+ def to_body
206
+ to_hash
207
+ end
208
+
209
+ # Returns the object in the form of hash
210
+ # @return [Hash] Returns the object in the form of hash
211
+ def to_hash
212
+ hash = {}
213
+ self.class.attribute_map.each_pair do |attr, param|
214
+ value = self.send(attr)
215
+ next if value.nil?
216
+ hash[param] = _to_hash(value)
217
+ end
218
+ hash
219
+ end
220
+
221
+ # Outputs non-array value in the form of hash
222
+ # For object, use to_hash. Otherwise, just return the value
223
+ # @param [Object] value Any valid value
224
+ # @return [Hash] Returns the value in the form of hash
225
+ def _to_hash(value)
226
+ if value.is_a?(Array)
227
+ value.compact.map { |v| _to_hash(v) }
228
+ elsif value.is_a?(Hash)
229
+ {}.tap do |hash|
230
+ value.each { |k, v| hash[k] = _to_hash(v) }
231
+ end
232
+ elsif value.respond_to? :to_hash
233
+ value.to_hash
234
+ else
235
+ value
236
+ end
237
+ end
238
+
239
+ end
240
+ end