budgea_client 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (284) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +12 -0
  3. data/Gemfile.lock +89 -0
  4. data/README.md +619 -0
  5. data/Rakefile +13 -0
  6. data/budgea_client.gemspec +35 -0
  7. data/docs/Access.md +12 -0
  8. data/docs/Account.md +25 -0
  9. data/docs/AccountLog.md +15 -0
  10. data/docs/AccountType.md +15 -0
  11. data/docs/AdministrationApi.md +944 -0
  12. data/docs/Alert.md +15 -0
  13. data/docs/AuthenticationApi.md +398 -0
  14. data/docs/Bank.md +18 -0
  15. data/docs/BankCategory.md +9 -0
  16. data/docs/BanksApi.md +6558 -0
  17. data/docs/Category.md +17 -0
  18. data/docs/Client.md +18 -0
  19. data/docs/Connection.md +16 -0
  20. data/docs/ConnectionContact.md +17 -0
  21. data/docs/ConnectionLog.md +21 -0
  22. data/docs/ConnectionsApi.md +934 -0
  23. data/docs/ConnectorLogo.md +11 -0
  24. data/docs/Currency.md +10 -0
  25. data/docs/Device.md +14 -0
  26. data/docs/Document.md +29 -0
  27. data/docs/DocumentType.md +10 -0
  28. data/docs/DocumentsApi.md +5228 -0
  29. data/docs/Field.md +15 -0
  30. data/docs/File.md +11 -0
  31. data/docs/Group.md +15 -0
  32. data/docs/HashTable.md +11 -0
  33. data/docs/InlineResponse200.md +8 -0
  34. data/docs/InlineResponse2001.md +9 -0
  35. data/docs/InlineResponse20010.md +8 -0
  36. data/docs/InlineResponse20011.md +8 -0
  37. data/docs/InlineResponse20012.md +8 -0
  38. data/docs/InlineResponse20013.md +8 -0
  39. data/docs/InlineResponse20014.md +8 -0
  40. data/docs/InlineResponse20015.md +8 -0
  41. data/docs/InlineResponse20016.md +8 -0
  42. data/docs/InlineResponse20017.md +8 -0
  43. data/docs/InlineResponse20018.md +8 -0
  44. data/docs/InlineResponse20019.md +8 -0
  45. data/docs/InlineResponse2002.md +10 -0
  46. data/docs/InlineResponse20020.md +8 -0
  47. data/docs/InlineResponse20021.md +8 -0
  48. data/docs/InlineResponse20022.md +8 -0
  49. data/docs/InlineResponse20023.md +8 -0
  50. data/docs/InlineResponse20024.md +8 -0
  51. data/docs/InlineResponse20025.md +8 -0
  52. data/docs/InlineResponse20026.md +8 -0
  53. data/docs/InlineResponse20027.md +8 -0
  54. data/docs/InlineResponse20028.md +8 -0
  55. data/docs/InlineResponse20029.md +8 -0
  56. data/docs/InlineResponse2003.md +10 -0
  57. data/docs/InlineResponse20030.md +8 -0
  58. data/docs/InlineResponse20031.md +8 -0
  59. data/docs/InlineResponse20032.md +8 -0
  60. data/docs/InlineResponse20033.md +8 -0
  61. data/docs/InlineResponse2004.md +12 -0
  62. data/docs/InlineResponse2005.md +9 -0
  63. data/docs/InlineResponse2006.md +10 -0
  64. data/docs/InlineResponse2007.md +8 -0
  65. data/docs/InlineResponse2008.md +8 -0
  66. data/docs/InlineResponse2009.md +8 -0
  67. data/docs/Investment.md +32 -0
  68. data/docs/InvestmentValue.md +13 -0
  69. data/docs/Invite.md +13 -0
  70. data/docs/LockedUser.md +10 -0
  71. data/docs/OCRApi.md +117 -0
  72. data/docs/OIDCApi.md +167 -0
  73. data/docs/OidcWhitelist.md +9 -0
  74. data/docs/PFMApi.md +2204 -0
  75. data/docs/Pocket.md +17 -0
  76. data/docs/Profile.md +15 -0
  77. data/docs/Project.md +16 -0
  78. data/docs/ProjectType.md +10 -0
  79. data/docs/ProvidersApi.md +7014 -0
  80. data/docs/Recipient.md +22 -0
  81. data/docs/RecipientsApi.md +244 -0
  82. data/docs/Security.md +12 -0
  83. data/docs/Subscription.md +18 -0
  84. data/docs/TermsApi.md +218 -0
  85. data/docs/TermsOfService.md +12 -0
  86. data/docs/Transaction.md +33 -0
  87. data/docs/TransactionInformation.md +11 -0
  88. data/docs/TransactionsCluster.md +16 -0
  89. data/docs/Transfer.md +23 -0
  90. data/docs/TransfersApi.md +2404 -0
  91. data/docs/User.md +10 -0
  92. data/docs/UserAlert.md +21 -0
  93. data/docs/UsersManagementApi.md +608 -0
  94. data/docs/WealthApi.md +828 -0
  95. data/docs/Webhook.md +15 -0
  96. data/git_push.sh +55 -0
  97. data/lib/budgea_client.rb +118 -0
  98. data/lib/budgea_client/api/administration_api.rb +1059 -0
  99. data/lib/budgea_client/api/authentication_api.rb +467 -0
  100. data/lib/budgea_client/api/banks_api.rb +7837 -0
  101. data/lib/budgea_client/api/connections_api.rb +1088 -0
  102. data/lib/budgea_client/api/documents_api.rb +6637 -0
  103. data/lib/budgea_client/api/ocr_api.rb +141 -0
  104. data/lib/budgea_client/api/oidc_api.rb +195 -0
  105. data/lib/budgea_client/api/pfm_api.rb +2630 -0
  106. data/lib/budgea_client/api/providers_api.rb +8694 -0
  107. data/lib/budgea_client/api/recipients_api.rb +293 -0
  108. data/lib/budgea_client/api/terms_api.rb +245 -0
  109. data/lib/budgea_client/api/transfers_api.rb +2941 -0
  110. data/lib/budgea_client/api/users_management_api.rb +695 -0
  111. data/lib/budgea_client/api/wealth_api.rb +994 -0
  112. data/lib/budgea_client/api_client.rb +378 -0
  113. data/lib/budgea_client/api_error.rb +28 -0
  114. data/lib/budgea_client/configuration.rb +192 -0
  115. data/lib/budgea_client/models/access.rb +224 -0
  116. data/lib/budgea_client/models/account.rb +383 -0
  117. data/lib/budgea_client/models/account_log.rb +266 -0
  118. data/lib/budgea_client/models/account_type.rb +281 -0
  119. data/lib/budgea_client/models/alert.rb +273 -0
  120. data/lib/budgea_client/models/bank.rb +308 -0
  121. data/lib/budgea_client/models/bank_category.rb +201 -0
  122. data/lib/budgea_client/models/category.rb +299 -0
  123. data/lib/budgea_client/models/client.rb +305 -0
  124. data/lib/budgea_client/models/connection.rb +276 -0
  125. data/lib/budgea_client/models/connection_contact.rb +274 -0
  126. data/lib/budgea_client/models/connection_log.rb +324 -0
  127. data/lib/budgea_client/models/connector_logo.rb +223 -0
  128. data/lib/budgea_client/models/currency.rb +216 -0
  129. data/lib/budgea_client/models/device.rb +269 -0
  130. data/lib/budgea_client/models/document.rb +398 -0
  131. data/lib/budgea_client/models/document_type.rb +213 -0
  132. data/lib/budgea_client/models/field.rb +273 -0
  133. data/lib/budgea_client/models/file.rb +225 -0
  134. data/lib/budgea_client/models/group.rb +246 -0
  135. data/lib/budgea_client/models/hash_table.rb +227 -0
  136. data/lib/budgea_client/models/inline_response_200.rb +185 -0
  137. data/lib/budgea_client/models/inline_response_200_1.rb +199 -0
  138. data/lib/budgea_client/models/inline_response_200_10.rb +185 -0
  139. data/lib/budgea_client/models/inline_response_200_11.rb +185 -0
  140. data/lib/budgea_client/models/inline_response_200_12.rb +185 -0
  141. data/lib/budgea_client/models/inline_response_200_13.rb +185 -0
  142. data/lib/budgea_client/models/inline_response_200_14.rb +185 -0
  143. data/lib/budgea_client/models/inline_response_200_15.rb +185 -0
  144. data/lib/budgea_client/models/inline_response_200_16.rb +185 -0
  145. data/lib/budgea_client/models/inline_response_200_17.rb +185 -0
  146. data/lib/budgea_client/models/inline_response_200_18.rb +185 -0
  147. data/lib/budgea_client/models/inline_response_200_19.rb +185 -0
  148. data/lib/budgea_client/models/inline_response_200_2.rb +209 -0
  149. data/lib/budgea_client/models/inline_response_200_20.rb +185 -0
  150. data/lib/budgea_client/models/inline_response_200_21.rb +185 -0
  151. data/lib/budgea_client/models/inline_response_200_22.rb +185 -0
  152. data/lib/budgea_client/models/inline_response_200_23.rb +185 -0
  153. data/lib/budgea_client/models/inline_response_200_24.rb +185 -0
  154. data/lib/budgea_client/models/inline_response_200_25.rb +185 -0
  155. data/lib/budgea_client/models/inline_response_200_26.rb +185 -0
  156. data/lib/budgea_client/models/inline_response_200_27.rb +185 -0
  157. data/lib/budgea_client/models/inline_response_200_28.rb +185 -0
  158. data/lib/budgea_client/models/inline_response_200_29.rb +185 -0
  159. data/lib/budgea_client/models/inline_response_200_3.rb +214 -0
  160. data/lib/budgea_client/models/inline_response_200_30.rb +185 -0
  161. data/lib/budgea_client/models/inline_response_200_31.rb +185 -0
  162. data/lib/budgea_client/models/inline_response_200_32.rb +185 -0
  163. data/lib/budgea_client/models/inline_response_200_33.rb +185 -0
  164. data/lib/budgea_client/models/inline_response_200_4.rb +239 -0
  165. data/lib/budgea_client/models/inline_response_200_5.rb +199 -0
  166. data/lib/budgea_client/models/inline_response_200_6.rb +214 -0
  167. data/lib/budgea_client/models/inline_response_200_7.rb +185 -0
  168. data/lib/budgea_client/models/inline_response_200_8.rb +185 -0
  169. data/lib/budgea_client/models/inline_response_200_9.rb +185 -0
  170. data/lib/budgea_client/models/investment.rb +449 -0
  171. data/lib/budgea_client/models/investment_value.rb +249 -0
  172. data/lib/budgea_client/models/invite.rb +233 -0
  173. data/lib/budgea_client/models/locked_user.rb +206 -0
  174. data/lib/budgea_client/models/oidc_whitelist.rb +198 -0
  175. data/lib/budgea_client/models/pocket.rb +298 -0
  176. data/lib/budgea_client/models/profile.rb +308 -0
  177. data/lib/budgea_client/models/project.rb +301 -0
  178. data/lib/budgea_client/models/project_type.rb +206 -0
  179. data/lib/budgea_client/models/recipient.rb +343 -0
  180. data/lib/budgea_client/models/security.rb +229 -0
  181. data/lib/budgea_client/models/subscription.rb +299 -0
  182. data/lib/budgea_client/models/terms_of_service.rb +229 -0
  183. data/lib/budgea_client/models/transaction.rb +507 -0
  184. data/lib/budgea_client/models/transaction_information.rb +224 -0
  185. data/lib/budgea_client/models/transactions_cluster.rb +277 -0
  186. data/lib/budgea_client/models/transfer.rb +354 -0
  187. data/lib/budgea_client/models/user.rb +244 -0
  188. data/lib/budgea_client/models/user_alert.rb +333 -0
  189. data/lib/budgea_client/models/webhook.rb +264 -0
  190. data/lib/budgea_client/version.rb +5 -0
  191. data/pkg/budgea_client-1.0.0.gem +0 -0
  192. data/spec/api/administration_api_spec.rb +271 -0
  193. data/spec/api/authentication_api_spec.rb +126 -0
  194. data/spec/api/banks_api_spec.rb +1787 -0
  195. data/spec/api/connections_api_spec.rb +279 -0
  196. data/spec/api/documents_api_spec.rb +1557 -0
  197. data/spec/api/ocr_api_spec.rb +54 -0
  198. data/spec/api/oidc_api_spec.rb +65 -0
  199. data/spec/api/pfm_api_spec.rb +613 -0
  200. data/spec/api/providers_api_spec.rb +2029 -0
  201. data/spec/api/recipients_api_spec.rb +89 -0
  202. data/spec/api/terms_api_spec.rb +79 -0
  203. data/spec/api/transfers_api_spec.rb +661 -0
  204. data/spec/api/users_management_api_spec.rb +177 -0
  205. data/spec/api/wealth_api_spec.rb +246 -0
  206. data/spec/api_client_spec.rb +216 -0
  207. data/spec/configuration_spec.rb +32 -0
  208. data/spec/models/access_spec.rb +56 -0
  209. data/spec/models/account_log_spec.rb +74 -0
  210. data/spec/models/account_spec.rb +134 -0
  211. data/spec/models/account_type_spec.rb +74 -0
  212. data/spec/models/alert_spec.rb +74 -0
  213. data/spec/models/bank_category_spec.rb +38 -0
  214. data/spec/models/bank_spec.rb +92 -0
  215. data/spec/models/category_spec.rb +86 -0
  216. data/spec/models/client_spec.rb +92 -0
  217. data/spec/models/connection_contact_spec.rb +86 -0
  218. data/spec/models/connection_log_spec.rb +110 -0
  219. data/spec/models/connection_spec.rb +80 -0
  220. data/spec/models/connector_logo_spec.rb +50 -0
  221. data/spec/models/currency_spec.rb +44 -0
  222. data/spec/models/device_spec.rb +68 -0
  223. data/spec/models/document_spec.rb +158 -0
  224. data/spec/models/document_type_spec.rb +44 -0
  225. data/spec/models/field_spec.rb +74 -0
  226. data/spec/models/file_spec.rb +50 -0
  227. data/spec/models/group_spec.rb +74 -0
  228. data/spec/models/hash_table_spec.rb +50 -0
  229. data/spec/models/inline_response_200_10_spec.rb +32 -0
  230. data/spec/models/inline_response_200_11_spec.rb +32 -0
  231. data/spec/models/inline_response_200_12_spec.rb +32 -0
  232. data/spec/models/inline_response_200_13_spec.rb +32 -0
  233. data/spec/models/inline_response_200_14_spec.rb +32 -0
  234. data/spec/models/inline_response_200_15_spec.rb +32 -0
  235. data/spec/models/inline_response_200_16_spec.rb +32 -0
  236. data/spec/models/inline_response_200_17_spec.rb +32 -0
  237. data/spec/models/inline_response_200_18_spec.rb +32 -0
  238. data/spec/models/inline_response_200_19_spec.rb +32 -0
  239. data/spec/models/inline_response_200_1_spec.rb +38 -0
  240. data/spec/models/inline_response_200_20_spec.rb +32 -0
  241. data/spec/models/inline_response_200_21_spec.rb +32 -0
  242. data/spec/models/inline_response_200_22_spec.rb +32 -0
  243. data/spec/models/inline_response_200_23_spec.rb +32 -0
  244. data/spec/models/inline_response_200_24_spec.rb +32 -0
  245. data/spec/models/inline_response_200_25_spec.rb +32 -0
  246. data/spec/models/inline_response_200_26_spec.rb +32 -0
  247. data/spec/models/inline_response_200_27_spec.rb +32 -0
  248. data/spec/models/inline_response_200_28_spec.rb +32 -0
  249. data/spec/models/inline_response_200_29_spec.rb +32 -0
  250. data/spec/models/inline_response_200_2_spec.rb +44 -0
  251. data/spec/models/inline_response_200_30_spec.rb +32 -0
  252. data/spec/models/inline_response_200_31_spec.rb +32 -0
  253. data/spec/models/inline_response_200_32_spec.rb +32 -0
  254. data/spec/models/inline_response_200_33_spec.rb +32 -0
  255. data/spec/models/inline_response_200_3_spec.rb +44 -0
  256. data/spec/models/inline_response_200_4_spec.rb +56 -0
  257. data/spec/models/inline_response_200_5_spec.rb +38 -0
  258. data/spec/models/inline_response_200_6_spec.rb +44 -0
  259. data/spec/models/inline_response_200_7_spec.rb +32 -0
  260. data/spec/models/inline_response_200_8_spec.rb +32 -0
  261. data/spec/models/inline_response_200_9_spec.rb +32 -0
  262. data/spec/models/inline_response_200_spec.rb +32 -0
  263. data/spec/models/investment_spec.rb +176 -0
  264. data/spec/models/investment_value_spec.rb +62 -0
  265. data/spec/models/invite_spec.rb +62 -0
  266. data/spec/models/locked_user_spec.rb +44 -0
  267. data/spec/models/oidc_whitelist_spec.rb +38 -0
  268. data/spec/models/pocket_spec.rb +86 -0
  269. data/spec/models/profile_spec.rb +78 -0
  270. data/spec/models/project_spec.rb +80 -0
  271. data/spec/models/project_type_spec.rb +44 -0
  272. data/spec/models/recipient_spec.rb +116 -0
  273. data/spec/models/security_spec.rb +56 -0
  274. data/spec/models/subscription_spec.rb +92 -0
  275. data/spec/models/terms_of_service_spec.rb +56 -0
  276. data/spec/models/transaction_information_spec.rb +50 -0
  277. data/spec/models/transaction_spec.rb +182 -0
  278. data/spec/models/transactions_cluster_spec.rb +80 -0
  279. data/spec/models/transfer_spec.rb +122 -0
  280. data/spec/models/user_alert_spec.rb +110 -0
  281. data/spec/models/user_spec.rb +48 -0
  282. data/spec/models/webhook_spec.rb +74 -0
  283. data/spec/spec_helper.rb +51 -0
  284. metadata +599 -0
@@ -0,0 +1,224 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'date'
4
+
5
+ module BudgeaClient
6
+
7
+ class TransactionInformation
8
+ # ID of this transaction information
9
+ attr_accessor :id
10
+
11
+ # ID of the related transaction
12
+ attr_accessor :id_transaction
13
+
14
+ # Key of the transaction information
15
+ attr_accessor :key
16
+
17
+ # Value of the transaction information
18
+ attr_accessor :value
19
+
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'id' => :'id',
25
+ :'id_transaction' => :'id_transaction',
26
+ :'key' => :'key',
27
+ :'value' => :'value'
28
+ }
29
+ end
30
+
31
+ # Attribute type mapping.
32
+ def self.swagger_types
33
+ {
34
+ :'id' => :'Integer',
35
+ :'id_transaction' => :'Integer',
36
+ :'key' => :'String',
37
+ :'value' => :'String'
38
+ }
39
+ end
40
+
41
+ # Initializes the object
42
+ # @param [Hash] attributes Model attributes in the form of hash
43
+ def initialize(attributes = {})
44
+ return unless attributes.is_a?(Hash)
45
+
46
+ # convert string to symbol for hash key
47
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
48
+
49
+ if attributes.has_key?(:'id')
50
+ self.id = attributes[:'id']
51
+ end
52
+
53
+ if attributes.has_key?(:'id_transaction')
54
+ self.id_transaction = attributes[:'id_transaction']
55
+ end
56
+
57
+ if attributes.has_key?(:'key')
58
+ self.key = attributes[:'key']
59
+ end
60
+
61
+ if attributes.has_key?(:'value')
62
+ self.value = attributes[:'value']
63
+ end
64
+
65
+ end
66
+
67
+ # Show invalid properties with the reasons. Usually used together with valid?
68
+ # @return Array for valid properties with the reasons
69
+ def list_invalid_properties
70
+ invalid_properties = Array.new
71
+ if @id.nil?
72
+ invalid_properties.push("invalid value for 'id', id cannot be nil.")
73
+ end
74
+
75
+ if @id_transaction.nil?
76
+ invalid_properties.push("invalid value for 'id_transaction', id_transaction cannot be nil.")
77
+ end
78
+
79
+ if @key.nil?
80
+ invalid_properties.push("invalid value for 'key', key cannot be nil.")
81
+ end
82
+
83
+ return invalid_properties
84
+ end
85
+
86
+ # Check to see if the all the properties in the model are valid
87
+ # @return true if the model is valid
88
+ def valid?
89
+ return false if @id.nil?
90
+ return false if @id_transaction.nil?
91
+ return false if @key.nil?
92
+ return true
93
+ end
94
+
95
+ # Checks equality by comparing each attribute.
96
+ # @param [Object] Object to be compared
97
+ def ==(o)
98
+ return true if self.equal?(o)
99
+ self.class == o.class &&
100
+ id == o.id &&
101
+ id_transaction == o.id_transaction &&
102
+ key == o.key &&
103
+ value == o.value
104
+ end
105
+
106
+ # @see the `==` method
107
+ # @param [Object] Object to be compared
108
+ def eql?(o)
109
+ self == o
110
+ end
111
+
112
+ # Calculates hash code according to all attributes.
113
+ # @return [Fixnum] Hash code
114
+ def hash
115
+ [id, id_transaction, key, value].hash
116
+ end
117
+
118
+ # Builds the object from hash
119
+ # @param [Hash] attributes Model attributes in the form of hash
120
+ # @return [Object] Returns the model itself
121
+ def build_from_hash(attributes)
122
+ return nil unless attributes.is_a?(Hash)
123
+ self.class.swagger_types.each_pair do |key, type|
124
+ if type =~ /\AArray<(.*)>/i
125
+ # check to ensure the input is an array given that the the attribute
126
+ # is documented as an array but the input is not
127
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
128
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
129
+ end
130
+ elsif !attributes[self.class.attribute_map[key]].nil?
131
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
132
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
133
+ end
134
+
135
+ self
136
+ end
137
+
138
+ # Deserializes the data based on type
139
+ # @param string type Data type
140
+ # @param string value Value to be deserialized
141
+ # @return [Object] Deserialized data
142
+ def _deserialize(type, value)
143
+ case type.to_sym
144
+ when :DateTime
145
+ DateTime.parse(value)
146
+ when :Date
147
+ Date.parse(value)
148
+ when :String
149
+ value.to_s
150
+ when :Integer
151
+ value.to_i
152
+ when :Float
153
+ value.to_f
154
+ when :BOOLEAN
155
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
156
+ true
157
+ else
158
+ false
159
+ end
160
+ when :Object
161
+ # generic object (usually a Hash), return directly
162
+ value
163
+ when /\AArray<(?<inner_type>.+)>\z/
164
+ inner_type = Regexp.last_match[:inner_type]
165
+ value.map { |v| _deserialize(inner_type, v) }
166
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
167
+ k_type = Regexp.last_match[:k_type]
168
+ v_type = Regexp.last_match[:v_type]
169
+ {}.tap do |hash|
170
+ value.each do |k, v|
171
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
172
+ end
173
+ end
174
+ else # model
175
+ temp_model = BudgeaClient.const_get(type).new
176
+ temp_model.build_from_hash(value)
177
+ end
178
+ end
179
+
180
+ # Returns the string representation of the object
181
+ # @return [String] String presentation of the object
182
+ def to_s
183
+ to_hash.to_s
184
+ end
185
+
186
+ # to_body is an alias to to_hash (backward compatibility)
187
+ # @return [Hash] Returns the object in the form of hash
188
+ def to_body
189
+ to_hash
190
+ end
191
+
192
+ # Returns the object in the form of hash
193
+ # @return [Hash] Returns the object in the form of hash
194
+ def to_hash
195
+ hash = {}
196
+ self.class.attribute_map.each_pair do |attr, param|
197
+ value = self.send(attr)
198
+ next if value.nil?
199
+ hash[param] = _to_hash(value)
200
+ end
201
+ hash
202
+ end
203
+
204
+ # Outputs non-array value in the form of hash
205
+ # For object, use to_hash. Otherwise, just return the value
206
+ # @param [Object] value Any valid value
207
+ # @return [Hash] Returns the value in the form of hash
208
+ def _to_hash(value)
209
+ if value.is_a?(Array)
210
+ value.compact.map{ |v| _to_hash(v) }
211
+ elsif value.is_a?(Hash)
212
+ {}.tap do |hash|
213
+ value.each { |k, v| hash[k] = _to_hash(v) }
214
+ end
215
+ elsif value.respond_to? :to_hash
216
+ value.to_hash
217
+ else
218
+ value
219
+ end
220
+ end
221
+
222
+ end
223
+
224
+ end
@@ -0,0 +1,277 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'date'
4
+
5
+ module BudgeaClient
6
+
7
+ class TransactionsCluster
8
+ attr_accessor :id
9
+
10
+ attr_accessor :id_account
11
+
12
+ attr_accessor :mean_amount
13
+
14
+ attr_accessor :median_increment
15
+
16
+ attr_accessor :enabled
17
+
18
+ attr_accessor :next_date
19
+
20
+ attr_accessor :wording
21
+
22
+ attr_accessor :id_category
23
+
24
+ attr_accessor :created_by
25
+
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'id' => :'id',
31
+ :'id_account' => :'id_account',
32
+ :'mean_amount' => :'mean_amount',
33
+ :'median_increment' => :'median_increment',
34
+ :'enabled' => :'enabled',
35
+ :'next_date' => :'next_date',
36
+ :'wording' => :'wording',
37
+ :'id_category' => :'id_category',
38
+ :'created_by' => :'created_by'
39
+ }
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.swagger_types
44
+ {
45
+ :'id' => :'Integer',
46
+ :'id_account' => :'Integer',
47
+ :'mean_amount' => :'Float',
48
+ :'median_increment' => :'Integer',
49
+ :'enabled' => :'BOOLEAN',
50
+ :'next_date' => :'Date',
51
+ :'wording' => :'String',
52
+ :'id_category' => :'Integer',
53
+ :'created_by' => :'String'
54
+ }
55
+ end
56
+
57
+ # Initializes the object
58
+ # @param [Hash] attributes Model attributes in the form of hash
59
+ def initialize(attributes = {})
60
+ return unless attributes.is_a?(Hash)
61
+
62
+ # convert string to symbol for hash key
63
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
64
+
65
+ if attributes.has_key?(:'id')
66
+ self.id = attributes[:'id']
67
+ end
68
+
69
+ if attributes.has_key?(:'id_account')
70
+ self.id_account = attributes[:'id_account']
71
+ end
72
+
73
+ if attributes.has_key?(:'mean_amount')
74
+ self.mean_amount = attributes[:'mean_amount']
75
+ end
76
+
77
+ if attributes.has_key?(:'median_increment')
78
+ self.median_increment = attributes[:'median_increment']
79
+ end
80
+
81
+ if attributes.has_key?(:'enabled')
82
+ self.enabled = attributes[:'enabled']
83
+ else
84
+ self.enabled = true
85
+ end
86
+
87
+ if attributes.has_key?(:'next_date')
88
+ self.next_date = attributes[:'next_date']
89
+ end
90
+
91
+ if attributes.has_key?(:'wording')
92
+ self.wording = attributes[:'wording']
93
+ end
94
+
95
+ if attributes.has_key?(:'id_category')
96
+ self.id_category = attributes[:'id_category']
97
+ end
98
+
99
+ if attributes.has_key?(:'created_by')
100
+ self.created_by = attributes[:'created_by']
101
+ end
102
+
103
+ end
104
+
105
+ # Show invalid properties with the reasons. Usually used together with valid?
106
+ # @return Array for valid properties with the reasons
107
+ def list_invalid_properties
108
+ invalid_properties = Array.new
109
+ if @id.nil?
110
+ invalid_properties.push("invalid value for 'id', id cannot be nil.")
111
+ end
112
+
113
+ if @id_account.nil?
114
+ invalid_properties.push("invalid value for 'id_account', id_account cannot be nil.")
115
+ end
116
+
117
+ if @mean_amount.nil?
118
+ invalid_properties.push("invalid value for 'mean_amount', mean_amount cannot be nil.")
119
+ end
120
+
121
+ if @enabled.nil?
122
+ invalid_properties.push("invalid value for 'enabled', enabled cannot be nil.")
123
+ end
124
+
125
+ if @wording.nil?
126
+ invalid_properties.push("invalid value for 'wording', wording cannot be nil.")
127
+ end
128
+
129
+ return invalid_properties
130
+ end
131
+
132
+ # Check to see if the all the properties in the model are valid
133
+ # @return true if the model is valid
134
+ def valid?
135
+ return false if @id.nil?
136
+ return false if @id_account.nil?
137
+ return false if @mean_amount.nil?
138
+ return false if @enabled.nil?
139
+ return false if @wording.nil?
140
+ return true
141
+ end
142
+
143
+ # Checks equality by comparing each attribute.
144
+ # @param [Object] Object to be compared
145
+ def ==(o)
146
+ return true if self.equal?(o)
147
+ self.class == o.class &&
148
+ id == o.id &&
149
+ id_account == o.id_account &&
150
+ mean_amount == o.mean_amount &&
151
+ median_increment == o.median_increment &&
152
+ enabled == o.enabled &&
153
+ next_date == o.next_date &&
154
+ wording == o.wording &&
155
+ id_category == o.id_category &&
156
+ created_by == o.created_by
157
+ end
158
+
159
+ # @see the `==` method
160
+ # @param [Object] Object to be compared
161
+ def eql?(o)
162
+ self == o
163
+ end
164
+
165
+ # Calculates hash code according to all attributes.
166
+ # @return [Fixnum] Hash code
167
+ def hash
168
+ [id, id_account, mean_amount, median_increment, enabled, next_date, wording, id_category, created_by].hash
169
+ end
170
+
171
+ # Builds the object from hash
172
+ # @param [Hash] attributes Model attributes in the form of hash
173
+ # @return [Object] Returns the model itself
174
+ def build_from_hash(attributes)
175
+ return nil unless attributes.is_a?(Hash)
176
+ self.class.swagger_types.each_pair do |key, type|
177
+ if type =~ /\AArray<(.*)>/i
178
+ # check to ensure the input is an array given that the the attribute
179
+ # is documented as an array but the input is not
180
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
181
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
182
+ end
183
+ elsif !attributes[self.class.attribute_map[key]].nil?
184
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
185
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
186
+ end
187
+
188
+ self
189
+ end
190
+
191
+ # Deserializes the data based on type
192
+ # @param string type Data type
193
+ # @param string value Value to be deserialized
194
+ # @return [Object] Deserialized data
195
+ def _deserialize(type, value)
196
+ case type.to_sym
197
+ when :DateTime
198
+ DateTime.parse(value)
199
+ when :Date
200
+ Date.parse(value)
201
+ when :String
202
+ value.to_s
203
+ when :Integer
204
+ value.to_i
205
+ when :Float
206
+ value.to_f
207
+ when :BOOLEAN
208
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
209
+ true
210
+ else
211
+ false
212
+ end
213
+ when :Object
214
+ # generic object (usually a Hash), return directly
215
+ value
216
+ when /\AArray<(?<inner_type>.+)>\z/
217
+ inner_type = Regexp.last_match[:inner_type]
218
+ value.map { |v| _deserialize(inner_type, v) }
219
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
220
+ k_type = Regexp.last_match[:k_type]
221
+ v_type = Regexp.last_match[:v_type]
222
+ {}.tap do |hash|
223
+ value.each do |k, v|
224
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
225
+ end
226
+ end
227
+ else # model
228
+ temp_model = BudgeaClient.const_get(type).new
229
+ temp_model.build_from_hash(value)
230
+ end
231
+ end
232
+
233
+ # Returns the string representation of the object
234
+ # @return [String] String presentation of the object
235
+ def to_s
236
+ to_hash.to_s
237
+ end
238
+
239
+ # to_body is an alias to to_hash (backward compatibility)
240
+ # @return [Hash] Returns the object in the form of hash
241
+ def to_body
242
+ to_hash
243
+ end
244
+
245
+ # Returns the object in the form of hash
246
+ # @return [Hash] Returns the object in the form of hash
247
+ def to_hash
248
+ hash = {}
249
+ self.class.attribute_map.each_pair do |attr, param|
250
+ value = self.send(attr)
251
+ next if value.nil?
252
+ hash[param] = _to_hash(value)
253
+ end
254
+ hash
255
+ end
256
+
257
+ # Outputs non-array value in the form of hash
258
+ # For object, use to_hash. Otherwise, just return the value
259
+ # @param [Object] value Any valid value
260
+ # @return [Hash] Returns the value in the form of hash
261
+ def _to_hash(value)
262
+ if value.is_a?(Array)
263
+ value.compact.map{ |v| _to_hash(v) }
264
+ elsif value.is_a?(Hash)
265
+ {}.tap do |hash|
266
+ value.each { |k, v| hash[k] = _to_hash(v) }
267
+ end
268
+ elsif value.respond_to? :to_hash
269
+ value.to_hash
270
+ else
271
+ value
272
+ end
273
+ end
274
+
275
+ end
276
+
277
+ end