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