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,229 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'date'
4
+
5
+ module BudgeaClient
6
+
7
+ class TermsOfService
8
+ attr_accessor :id
9
+
10
+ attr_accessor :version
11
+
12
+ attr_accessor :id_file
13
+
14
+ attr_accessor :created
15
+
16
+ attr_accessor :deleted
17
+
18
+
19
+ # Attribute mapping from ruby-style variable name to JSON key.
20
+ def self.attribute_map
21
+ {
22
+ :'id' => :'id',
23
+ :'version' => :'version',
24
+ :'id_file' => :'id_file',
25
+ :'created' => :'created',
26
+ :'deleted' => :'deleted'
27
+ }
28
+ end
29
+
30
+ # Attribute type mapping.
31
+ def self.swagger_types
32
+ {
33
+ :'id' => :'Integer',
34
+ :'version' => :'String',
35
+ :'id_file' => :'Integer',
36
+ :'created' => :'DateTime',
37
+ :'deleted' => :'DateTime'
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?(:'version')
54
+ self.version = attributes[:'version']
55
+ end
56
+
57
+ if attributes.has_key?(:'id_file')
58
+ self.id_file = attributes[:'id_file']
59
+ end
60
+
61
+ if attributes.has_key?(:'created')
62
+ self.created = attributes[:'created']
63
+ end
64
+
65
+ if attributes.has_key?(:'deleted')
66
+ self.deleted = attributes[:'deleted']
67
+ end
68
+
69
+ end
70
+
71
+ # Show invalid properties with the reasons. Usually used together with valid?
72
+ # @return Array for valid properties with the reasons
73
+ def list_invalid_properties
74
+ invalid_properties = Array.new
75
+ if @id.nil?
76
+ invalid_properties.push("invalid value for 'id', id cannot be nil.")
77
+ end
78
+
79
+ if @version.nil?
80
+ invalid_properties.push("invalid value for 'version', version cannot be nil.")
81
+ end
82
+
83
+ if @created.nil?
84
+ invalid_properties.push("invalid value for 'created', created cannot be nil.")
85
+ end
86
+
87
+ return invalid_properties
88
+ end
89
+
90
+ # Check to see if the all the properties in the model are valid
91
+ # @return true if the model is valid
92
+ def valid?
93
+ return false if @id.nil?
94
+ return false if @version.nil?
95
+ return false if @created.nil?
96
+ return true
97
+ end
98
+
99
+ # Checks equality by comparing each attribute.
100
+ # @param [Object] Object to be compared
101
+ def ==(o)
102
+ return true if self.equal?(o)
103
+ self.class == o.class &&
104
+ id == o.id &&
105
+ version == o.version &&
106
+ id_file == o.id_file &&
107
+ created == o.created &&
108
+ deleted == o.deleted
109
+ end
110
+
111
+ # @see the `==` method
112
+ # @param [Object] Object to be compared
113
+ def eql?(o)
114
+ self == o
115
+ end
116
+
117
+ # Calculates hash code according to all attributes.
118
+ # @return [Fixnum] Hash code
119
+ def hash
120
+ [id, version, id_file, created, deleted].hash
121
+ end
122
+
123
+ # Builds the object from hash
124
+ # @param [Hash] attributes Model attributes in the form of hash
125
+ # @return [Object] Returns the model itself
126
+ def build_from_hash(attributes)
127
+ return nil unless attributes.is_a?(Hash)
128
+ self.class.swagger_types.each_pair do |key, type|
129
+ if type =~ /\AArray<(.*)>/i
130
+ # check to ensure the input is an array given that the the attribute
131
+ # is documented as an array but the input is not
132
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
133
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
134
+ end
135
+ elsif !attributes[self.class.attribute_map[key]].nil?
136
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
137
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
138
+ end
139
+
140
+ self
141
+ end
142
+
143
+ # Deserializes the data based on type
144
+ # @param string type Data type
145
+ # @param string value Value to be deserialized
146
+ # @return [Object] Deserialized data
147
+ def _deserialize(type, value)
148
+ case type.to_sym
149
+ when :DateTime
150
+ DateTime.parse(value)
151
+ when :Date
152
+ Date.parse(value)
153
+ when :String
154
+ value.to_s
155
+ when :Integer
156
+ value.to_i
157
+ when :Float
158
+ value.to_f
159
+ when :BOOLEAN
160
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
161
+ true
162
+ else
163
+ false
164
+ end
165
+ when :Object
166
+ # generic object (usually a Hash), return directly
167
+ value
168
+ when /\AArray<(?<inner_type>.+)>\z/
169
+ inner_type = Regexp.last_match[:inner_type]
170
+ value.map { |v| _deserialize(inner_type, v) }
171
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
172
+ k_type = Regexp.last_match[:k_type]
173
+ v_type = Regexp.last_match[:v_type]
174
+ {}.tap do |hash|
175
+ value.each do |k, v|
176
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
177
+ end
178
+ end
179
+ else # model
180
+ temp_model = BudgeaClient.const_get(type).new
181
+ temp_model.build_from_hash(value)
182
+ end
183
+ end
184
+
185
+ # Returns the string representation of the object
186
+ # @return [String] String presentation of the object
187
+ def to_s
188
+ to_hash.to_s
189
+ end
190
+
191
+ # to_body is an alias to to_hash (backward compatibility)
192
+ # @return [Hash] Returns the object in the form of hash
193
+ def to_body
194
+ to_hash
195
+ end
196
+
197
+ # Returns the object in the form of hash
198
+ # @return [Hash] Returns the object in the form of hash
199
+ def to_hash
200
+ hash = {}
201
+ self.class.attribute_map.each_pair do |attr, param|
202
+ value = self.send(attr)
203
+ next if value.nil?
204
+ hash[param] = _to_hash(value)
205
+ end
206
+ hash
207
+ end
208
+
209
+ # Outputs non-array value in the form of hash
210
+ # For object, use to_hash. Otherwise, just return the value
211
+ # @param [Object] value Any valid value
212
+ # @return [Hash] Returns the value in the form of hash
213
+ def _to_hash(value)
214
+ if value.is_a?(Array)
215
+ value.compact.map{ |v| _to_hash(v) }
216
+ elsif value.is_a?(Hash)
217
+ {}.tap do |hash|
218
+ value.each { |k, v| hash[k] = _to_hash(v) }
219
+ end
220
+ elsif value.respond_to? :to_hash
221
+ value.to_hash
222
+ else
223
+ value
224
+ end
225
+ end
226
+
227
+ end
228
+
229
+ end
@@ -0,0 +1,507 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'date'
4
+
5
+ module BudgeaClient
6
+
7
+ class Transaction
8
+ # ID of the transaction
9
+ attr_accessor :id
10
+
11
+ # ID of the related account
12
+ attr_accessor :id_account
13
+
14
+ # Webid of the transaction
15
+ attr_accessor :webid
16
+
17
+ # Date considered by PFM services. It is used to change the month of a transaction, for example.
18
+ attr_accessor :application_date
19
+
20
+ # Debit date
21
+ attr_accessor :date
22
+
23
+ # Value of the transaction
24
+ attr_accessor :value
25
+
26
+ # Type of transaction
27
+ attr_accessor :nature
28
+
29
+ # Full label of the transaction
30
+ attr_accessor :original_wording
31
+
32
+ # Simplified label of the transaction
33
+ attr_accessor :simplified_wording
34
+
35
+ # Do not use it
36
+ attr_accessor :stemmed_wording
37
+
38
+ # Label set by the user
39
+ attr_accessor :wording
40
+
41
+ # ID of the related category
42
+ attr_accessor :id_category
43
+
44
+ # Internal state of the transaction
45
+ attr_accessor :state
46
+
47
+ # Date when the transaction has been seen
48
+ attr_accessor :date_scraped
49
+
50
+ # Realization of the transaction
51
+ attr_accessor :rdate
52
+
53
+ # If true, this transaction hasn't been yet debited
54
+ attr_accessor :coming
55
+
56
+ # If false, PFM services will ignore this transaction
57
+ attr_accessor :active
58
+
59
+ # If the transaction is part of a cluster
60
+ attr_accessor :id_cluster
61
+
62
+ # User comment
63
+ attr_accessor :comment
64
+
65
+ # Last update of the transaction
66
+ attr_accessor :last_update
67
+
68
+ # If set, this transaction has been removed from the bank
69
+ attr_accessor :deleted
70
+
71
+ # If set to true, this transaction will never be considered as deleted
72
+ attr_accessor :nopurge
73
+
74
+ # Value in the original currency
75
+ attr_accessor :original_value
76
+
77
+ # Original currency
78
+ attr_accessor :original_currency
79
+
80
+ # Commission taken on the transaction
81
+ attr_accessor :commission
82
+
83
+ # Original country
84
+ attr_accessor :country
85
+
86
+
87
+ # Attribute mapping from ruby-style variable name to JSON key.
88
+ def self.attribute_map
89
+ {
90
+ :'id' => :'id',
91
+ :'id_account' => :'id_account',
92
+ :'webid' => :'webid',
93
+ :'application_date' => :'application_date',
94
+ :'date' => :'date',
95
+ :'value' => :'value',
96
+ :'nature' => :'nature',
97
+ :'original_wording' => :'original_wording',
98
+ :'simplified_wording' => :'simplified_wording',
99
+ :'stemmed_wording' => :'stemmed_wording',
100
+ :'wording' => :'wording',
101
+ :'id_category' => :'id_category',
102
+ :'state' => :'state',
103
+ :'date_scraped' => :'date_scraped',
104
+ :'rdate' => :'rdate',
105
+ :'coming' => :'coming',
106
+ :'active' => :'active',
107
+ :'id_cluster' => :'id_cluster',
108
+ :'comment' => :'comment',
109
+ :'last_update' => :'last_update',
110
+ :'deleted' => :'deleted',
111
+ :'nopurge' => :'nopurge',
112
+ :'original_value' => :'original_value',
113
+ :'original_currency' => :'original_currency',
114
+ :'commission' => :'commission',
115
+ :'country' => :'country'
116
+ }
117
+ end
118
+
119
+ # Attribute type mapping.
120
+ def self.swagger_types
121
+ {
122
+ :'id' => :'Integer',
123
+ :'id_account' => :'Integer',
124
+ :'webid' => :'String',
125
+ :'application_date' => :'Date',
126
+ :'date' => :'Date',
127
+ :'value' => :'Float',
128
+ :'nature' => :'String',
129
+ :'original_wording' => :'String',
130
+ :'simplified_wording' => :'String',
131
+ :'stemmed_wording' => :'String',
132
+ :'wording' => :'String',
133
+ :'id_category' => :'Integer',
134
+ :'state' => :'String',
135
+ :'date_scraped' => :'DateTime',
136
+ :'rdate' => :'Date',
137
+ :'coming' => :'BOOLEAN',
138
+ :'active' => :'BOOLEAN',
139
+ :'id_cluster' => :'Integer',
140
+ :'comment' => :'String',
141
+ :'last_update' => :'DateTime',
142
+ :'deleted' => :'DateTime',
143
+ :'nopurge' => :'BOOLEAN',
144
+ :'original_value' => :'Float',
145
+ :'original_currency' => :'Object',
146
+ :'commission' => :'Float',
147
+ :'country' => :'String'
148
+ }
149
+ end
150
+
151
+ # Initializes the object
152
+ # @param [Hash] attributes Model attributes in the form of hash
153
+ def initialize(attributes = {})
154
+ return unless attributes.is_a?(Hash)
155
+
156
+ # convert string to symbol for hash key
157
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
158
+
159
+ if attributes.has_key?(:'id')
160
+ self.id = attributes[:'id']
161
+ end
162
+
163
+ if attributes.has_key?(:'id_account')
164
+ self.id_account = attributes[:'id_account']
165
+ end
166
+
167
+ if attributes.has_key?(:'webid')
168
+ self.webid = attributes[:'webid']
169
+ end
170
+
171
+ if attributes.has_key?(:'application_date')
172
+ self.application_date = attributes[:'application_date']
173
+ end
174
+
175
+ if attributes.has_key?(:'date')
176
+ self.date = attributes[:'date']
177
+ end
178
+
179
+ if attributes.has_key?(:'value')
180
+ self.value = attributes[:'value']
181
+ end
182
+
183
+ if attributes.has_key?(:'nature')
184
+ self.nature = attributes[:'nature']
185
+ else
186
+ self.nature = "inconnu"
187
+ end
188
+
189
+ if attributes.has_key?(:'original_wording')
190
+ self.original_wording = attributes[:'original_wording']
191
+ end
192
+
193
+ if attributes.has_key?(:'simplified_wording')
194
+ self.simplified_wording = attributes[:'simplified_wording']
195
+ end
196
+
197
+ if attributes.has_key?(:'stemmed_wording')
198
+ self.stemmed_wording = attributes[:'stemmed_wording']
199
+ end
200
+
201
+ if attributes.has_key?(:'wording')
202
+ self.wording = attributes[:'wording']
203
+ end
204
+
205
+ if attributes.has_key?(:'id_category')
206
+ self.id_category = attributes[:'id_category']
207
+ end
208
+
209
+ if attributes.has_key?(:'state')
210
+ self.state = attributes[:'state']
211
+ else
212
+ self.state = "new"
213
+ end
214
+
215
+ if attributes.has_key?(:'date_scraped')
216
+ self.date_scraped = attributes[:'date_scraped']
217
+ end
218
+
219
+ if attributes.has_key?(:'rdate')
220
+ self.rdate = attributes[:'rdate']
221
+ end
222
+
223
+ if attributes.has_key?(:'coming')
224
+ self.coming = attributes[:'coming']
225
+ end
226
+
227
+ if attributes.has_key?(:'active')
228
+ self.active = attributes[:'active']
229
+ else
230
+ self.active = true
231
+ end
232
+
233
+ if attributes.has_key?(:'id_cluster')
234
+ self.id_cluster = attributes[:'id_cluster']
235
+ end
236
+
237
+ if attributes.has_key?(:'comment')
238
+ self.comment = attributes[:'comment']
239
+ end
240
+
241
+ if attributes.has_key?(:'last_update')
242
+ self.last_update = attributes[:'last_update']
243
+ end
244
+
245
+ if attributes.has_key?(:'deleted')
246
+ self.deleted = attributes[:'deleted']
247
+ end
248
+
249
+ if attributes.has_key?(:'nopurge')
250
+ self.nopurge = attributes[:'nopurge']
251
+ else
252
+ self.nopurge = false
253
+ end
254
+
255
+ if attributes.has_key?(:'original_value')
256
+ self.original_value = attributes[:'original_value']
257
+ end
258
+
259
+ if attributes.has_key?(:'original_currency')
260
+ self.original_currency = attributes[:'original_currency']
261
+ end
262
+
263
+ if attributes.has_key?(:'commission')
264
+ self.commission = attributes[:'commission']
265
+ end
266
+
267
+ if attributes.has_key?(:'country')
268
+ self.country = attributes[:'country']
269
+ end
270
+
271
+ end
272
+
273
+ # Show invalid properties with the reasons. Usually used together with valid?
274
+ # @return Array for valid properties with the reasons
275
+ def list_invalid_properties
276
+ invalid_properties = Array.new
277
+ if @id.nil?
278
+ invalid_properties.push("invalid value for 'id', id cannot be nil.")
279
+ end
280
+
281
+ if @id_account.nil?
282
+ invalid_properties.push("invalid value for 'id_account', id_account cannot be nil.")
283
+ end
284
+
285
+ if @date.nil?
286
+ invalid_properties.push("invalid value for 'date', date cannot be nil.")
287
+ end
288
+
289
+ if @value.nil?
290
+ invalid_properties.push("invalid value for 'value', value cannot be nil.")
291
+ end
292
+
293
+ if @nature.nil?
294
+ invalid_properties.push("invalid value for 'nature', nature cannot be nil.")
295
+ end
296
+
297
+ if @original_wording.nil?
298
+ invalid_properties.push("invalid value for 'original_wording', original_wording cannot be nil.")
299
+ end
300
+
301
+ if @simplified_wording.nil?
302
+ invalid_properties.push("invalid value for 'simplified_wording', simplified_wording cannot be nil.")
303
+ end
304
+
305
+ if @stemmed_wording.nil?
306
+ invalid_properties.push("invalid value for 'stemmed_wording', stemmed_wording cannot be nil.")
307
+ end
308
+
309
+ if @state.nil?
310
+ invalid_properties.push("invalid value for 'state', state cannot be nil.")
311
+ end
312
+
313
+ if @date_scraped.nil?
314
+ invalid_properties.push("invalid value for 'date_scraped', date_scraped cannot be nil.")
315
+ end
316
+
317
+ if @rdate.nil?
318
+ invalid_properties.push("invalid value for 'rdate', rdate cannot be nil.")
319
+ end
320
+
321
+ if @coming.nil?
322
+ invalid_properties.push("invalid value for 'coming', coming cannot be nil.")
323
+ end
324
+
325
+ if @active.nil?
326
+ invalid_properties.push("invalid value for 'active', active cannot be nil.")
327
+ end
328
+
329
+ if @nopurge.nil?
330
+ invalid_properties.push("invalid value for 'nopurge', nopurge cannot be nil.")
331
+ end
332
+
333
+ return invalid_properties
334
+ end
335
+
336
+ # Check to see if the all the properties in the model are valid
337
+ # @return true if the model is valid
338
+ def valid?
339
+ return false if @id.nil?
340
+ return false if @id_account.nil?
341
+ return false if @date.nil?
342
+ return false if @value.nil?
343
+ return false if @nature.nil?
344
+ return false if @original_wording.nil?
345
+ return false if @simplified_wording.nil?
346
+ return false if @stemmed_wording.nil?
347
+ return false if @state.nil?
348
+ return false if @date_scraped.nil?
349
+ return false if @rdate.nil?
350
+ return false if @coming.nil?
351
+ return false if @active.nil?
352
+ return false if @nopurge.nil?
353
+ return true
354
+ end
355
+
356
+ # Checks equality by comparing each attribute.
357
+ # @param [Object] Object to be compared
358
+ def ==(o)
359
+ return true if self.equal?(o)
360
+ self.class == o.class &&
361
+ id == o.id &&
362
+ id_account == o.id_account &&
363
+ webid == o.webid &&
364
+ application_date == o.application_date &&
365
+ date == o.date &&
366
+ value == o.value &&
367
+ nature == o.nature &&
368
+ original_wording == o.original_wording &&
369
+ simplified_wording == o.simplified_wording &&
370
+ stemmed_wording == o.stemmed_wording &&
371
+ wording == o.wording &&
372
+ id_category == o.id_category &&
373
+ state == o.state &&
374
+ date_scraped == o.date_scraped &&
375
+ rdate == o.rdate &&
376
+ coming == o.coming &&
377
+ active == o.active &&
378
+ id_cluster == o.id_cluster &&
379
+ comment == o.comment &&
380
+ last_update == o.last_update &&
381
+ deleted == o.deleted &&
382
+ nopurge == o.nopurge &&
383
+ original_value == o.original_value &&
384
+ original_currency == o.original_currency &&
385
+ commission == o.commission &&
386
+ country == o.country
387
+ end
388
+
389
+ # @see the `==` method
390
+ # @param [Object] Object to be compared
391
+ def eql?(o)
392
+ self == o
393
+ end
394
+
395
+ # Calculates hash code according to all attributes.
396
+ # @return [Fixnum] Hash code
397
+ def hash
398
+ [id, id_account, webid, application_date, date, value, nature, original_wording, simplified_wording, stemmed_wording, wording, id_category, state, date_scraped, rdate, coming, active, id_cluster, comment, last_update, deleted, nopurge, original_value, original_currency, commission, country].hash
399
+ end
400
+
401
+ # Builds the object from hash
402
+ # @param [Hash] attributes Model attributes in the form of hash
403
+ # @return [Object] Returns the model itself
404
+ def build_from_hash(attributes)
405
+ return nil unless attributes.is_a?(Hash)
406
+ self.class.swagger_types.each_pair do |key, type|
407
+ if type =~ /\AArray<(.*)>/i
408
+ # check to ensure the input is an array given that the the attribute
409
+ # is documented as an array but the input is not
410
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
411
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
412
+ end
413
+ elsif !attributes[self.class.attribute_map[key]].nil?
414
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
415
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
416
+ end
417
+
418
+ self
419
+ end
420
+
421
+ # Deserializes the data based on type
422
+ # @param string type Data type
423
+ # @param string value Value to be deserialized
424
+ # @return [Object] Deserialized data
425
+ def _deserialize(type, value)
426
+ case type.to_sym
427
+ when :DateTime
428
+ DateTime.parse(value)
429
+ when :Date
430
+ Date.parse(value)
431
+ when :String
432
+ value.to_s
433
+ when :Integer
434
+ value.to_i
435
+ when :Float
436
+ value.to_f
437
+ when :BOOLEAN
438
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
439
+ true
440
+ else
441
+ false
442
+ end
443
+ when :Object
444
+ # generic object (usually a Hash), return directly
445
+ value
446
+ when /\AArray<(?<inner_type>.+)>\z/
447
+ inner_type = Regexp.last_match[:inner_type]
448
+ value.map { |v| _deserialize(inner_type, v) }
449
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
450
+ k_type = Regexp.last_match[:k_type]
451
+ v_type = Regexp.last_match[:v_type]
452
+ {}.tap do |hash|
453
+ value.each do |k, v|
454
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
455
+ end
456
+ end
457
+ else # model
458
+ temp_model = BudgeaClient.const_get(type).new
459
+ temp_model.build_from_hash(value)
460
+ end
461
+ end
462
+
463
+ # Returns the string representation of the object
464
+ # @return [String] String presentation of the object
465
+ def to_s
466
+ to_hash.to_s
467
+ end
468
+
469
+ # to_body is an alias to to_hash (backward compatibility)
470
+ # @return [Hash] Returns the object in the form of hash
471
+ def to_body
472
+ to_hash
473
+ end
474
+
475
+ # Returns the object in the form of hash
476
+ # @return [Hash] Returns the object in the form of hash
477
+ def to_hash
478
+ hash = {}
479
+ self.class.attribute_map.each_pair do |attr, param|
480
+ value = self.send(attr)
481
+ next if value.nil?
482
+ hash[param] = _to_hash(value)
483
+ end
484
+ hash
485
+ end
486
+
487
+ # Outputs non-array value in the form of hash
488
+ # For object, use to_hash. Otherwise, just return the value
489
+ # @param [Object] value Any valid value
490
+ # @return [Hash] Returns the value in the form of hash
491
+ def _to_hash(value)
492
+ if value.is_a?(Array)
493
+ value.compact.map{ |v| _to_hash(v) }
494
+ elsif value.is_a?(Hash)
495
+ {}.tap do |hash|
496
+ value.each { |k, v| hash[k] = _to_hash(v) }
497
+ end
498
+ elsif value.respond_to? :to_hash
499
+ value.to_hash
500
+ else
501
+ value
502
+ end
503
+ end
504
+
505
+ end
506
+
507
+ end