budgea_client 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +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,185 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'date'
|
|
4
|
+
|
|
5
|
+
module BudgeaClient
|
|
6
|
+
|
|
7
|
+
class InlineResponse2009
|
|
8
|
+
attr_accessor :connectorlogos
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
12
|
+
def self.attribute_map
|
|
13
|
+
{
|
|
14
|
+
:'connectorlogos' => :'connectorlogos'
|
|
15
|
+
}
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# Attribute type mapping.
|
|
19
|
+
def self.swagger_types
|
|
20
|
+
{
|
|
21
|
+
:'connectorlogos' => :'Array<ConnectorLogo>'
|
|
22
|
+
}
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# Initializes the object
|
|
26
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
27
|
+
def initialize(attributes = {})
|
|
28
|
+
return unless attributes.is_a?(Hash)
|
|
29
|
+
|
|
30
|
+
# convert string to symbol for hash key
|
|
31
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
|
32
|
+
|
|
33
|
+
if attributes.has_key?(:'connectorlogos')
|
|
34
|
+
if (value = attributes[:'connectorlogos']).is_a?(Array)
|
|
35
|
+
self.connectorlogos = value
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
42
|
+
# @return Array for valid properties with the reasons
|
|
43
|
+
def list_invalid_properties
|
|
44
|
+
invalid_properties = Array.new
|
|
45
|
+
if @connectorlogos.nil?
|
|
46
|
+
invalid_properties.push("invalid value for 'connectorlogos', connectorlogos cannot be nil.")
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
return invalid_properties
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Check to see if the all the properties in the model are valid
|
|
53
|
+
# @return true if the model is valid
|
|
54
|
+
def valid?
|
|
55
|
+
return false if @connectorlogos.nil?
|
|
56
|
+
return true
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# Checks equality by comparing each attribute.
|
|
60
|
+
# @param [Object] Object to be compared
|
|
61
|
+
def ==(o)
|
|
62
|
+
return true if self.equal?(o)
|
|
63
|
+
self.class == o.class &&
|
|
64
|
+
connectorlogos == o.connectorlogos
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# @see the `==` method
|
|
68
|
+
# @param [Object] Object to be compared
|
|
69
|
+
def eql?(o)
|
|
70
|
+
self == o
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# Calculates hash code according to all attributes.
|
|
74
|
+
# @return [Fixnum] Hash code
|
|
75
|
+
def hash
|
|
76
|
+
[connectorlogos].hash
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# Builds the object from hash
|
|
80
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
81
|
+
# @return [Object] Returns the model itself
|
|
82
|
+
def build_from_hash(attributes)
|
|
83
|
+
return nil unless attributes.is_a?(Hash)
|
|
84
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
85
|
+
if type =~ /\AArray<(.*)>/i
|
|
86
|
+
# check to ensure the input is an array given that the the attribute
|
|
87
|
+
# is documented as an array but the input is not
|
|
88
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
89
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
|
90
|
+
end
|
|
91
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
92
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
93
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
self
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Deserializes the data based on type
|
|
100
|
+
# @param string type Data type
|
|
101
|
+
# @param string value Value to be deserialized
|
|
102
|
+
# @return [Object] Deserialized data
|
|
103
|
+
def _deserialize(type, value)
|
|
104
|
+
case type.to_sym
|
|
105
|
+
when :DateTime
|
|
106
|
+
DateTime.parse(value)
|
|
107
|
+
when :Date
|
|
108
|
+
Date.parse(value)
|
|
109
|
+
when :String
|
|
110
|
+
value.to_s
|
|
111
|
+
when :Integer
|
|
112
|
+
value.to_i
|
|
113
|
+
when :Float
|
|
114
|
+
value.to_f
|
|
115
|
+
when :BOOLEAN
|
|
116
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
117
|
+
true
|
|
118
|
+
else
|
|
119
|
+
false
|
|
120
|
+
end
|
|
121
|
+
when :Object
|
|
122
|
+
# generic object (usually a Hash), return directly
|
|
123
|
+
value
|
|
124
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
125
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
126
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
127
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
128
|
+
k_type = Regexp.last_match[:k_type]
|
|
129
|
+
v_type = Regexp.last_match[:v_type]
|
|
130
|
+
{}.tap do |hash|
|
|
131
|
+
value.each do |k, v|
|
|
132
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
133
|
+
end
|
|
134
|
+
end
|
|
135
|
+
else # model
|
|
136
|
+
temp_model = BudgeaClient.const_get(type).new
|
|
137
|
+
temp_model.build_from_hash(value)
|
|
138
|
+
end
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# Returns the string representation of the object
|
|
142
|
+
# @return [String] String presentation of the object
|
|
143
|
+
def to_s
|
|
144
|
+
to_hash.to_s
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
148
|
+
# @return [Hash] Returns the object in the form of hash
|
|
149
|
+
def to_body
|
|
150
|
+
to_hash
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
# Returns the object in the form of hash
|
|
154
|
+
# @return [Hash] Returns the object in the form of hash
|
|
155
|
+
def to_hash
|
|
156
|
+
hash = {}
|
|
157
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
158
|
+
value = self.send(attr)
|
|
159
|
+
next if value.nil?
|
|
160
|
+
hash[param] = _to_hash(value)
|
|
161
|
+
end
|
|
162
|
+
hash
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
# Outputs non-array value in the form of hash
|
|
166
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
167
|
+
# @param [Object] value Any valid value
|
|
168
|
+
# @return [Hash] Returns the value in the form of hash
|
|
169
|
+
def _to_hash(value)
|
|
170
|
+
if value.is_a?(Array)
|
|
171
|
+
value.compact.map{ |v| _to_hash(v) }
|
|
172
|
+
elsif value.is_a?(Hash)
|
|
173
|
+
{}.tap do |hash|
|
|
174
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
175
|
+
end
|
|
176
|
+
elsif value.respond_to? :to_hash
|
|
177
|
+
value.to_hash
|
|
178
|
+
else
|
|
179
|
+
value
|
|
180
|
+
end
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
end
|
|
@@ -0,0 +1,449 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'date'
|
|
4
|
+
|
|
5
|
+
module BudgeaClient
|
|
6
|
+
|
|
7
|
+
class Investment
|
|
8
|
+
# ID of the investment
|
|
9
|
+
attr_accessor :id
|
|
10
|
+
|
|
11
|
+
# ID of the related account
|
|
12
|
+
attr_accessor :id_account
|
|
13
|
+
|
|
14
|
+
# Label of the investment
|
|
15
|
+
attr_accessor :label
|
|
16
|
+
|
|
17
|
+
# Investment code
|
|
18
|
+
attr_accessor :code
|
|
19
|
+
|
|
20
|
+
# Code type (ISIN of AMF)
|
|
21
|
+
attr_accessor :code_type
|
|
22
|
+
|
|
23
|
+
# Source of the ISIN code (website, notFound)
|
|
24
|
+
attr_accessor :source
|
|
25
|
+
|
|
26
|
+
# Description of the investment
|
|
27
|
+
attr_accessor :description
|
|
28
|
+
|
|
29
|
+
# Quantity
|
|
30
|
+
attr_accessor :quantity
|
|
31
|
+
|
|
32
|
+
# Average buy price
|
|
33
|
+
attr_accessor :unitprice
|
|
34
|
+
|
|
35
|
+
# Current unit value
|
|
36
|
+
attr_accessor :unitvalue
|
|
37
|
+
|
|
38
|
+
# Current valuation
|
|
39
|
+
attr_accessor :valuation
|
|
40
|
+
|
|
41
|
+
# Capital gain
|
|
42
|
+
attr_accessor :diff
|
|
43
|
+
|
|
44
|
+
# Capital gain in percent (between 0 and 1)
|
|
45
|
+
attr_accessor :diff_percent
|
|
46
|
+
|
|
47
|
+
# Capital gain from previous value
|
|
48
|
+
attr_accessor :prev_diff
|
|
49
|
+
|
|
50
|
+
# Percent of the portfolio
|
|
51
|
+
attr_accessor :portfolio_share
|
|
52
|
+
|
|
53
|
+
# Value date
|
|
54
|
+
attr_accessor :vdate
|
|
55
|
+
|
|
56
|
+
# Value date of the previous value (prev_diff)
|
|
57
|
+
attr_accessor :prev_vdate
|
|
58
|
+
|
|
59
|
+
# ID of the related security
|
|
60
|
+
attr_accessor :id_security
|
|
61
|
+
|
|
62
|
+
# Original currency
|
|
63
|
+
attr_accessor :original_currency
|
|
64
|
+
|
|
65
|
+
# Valuation in original currency
|
|
66
|
+
attr_accessor :original_valuation
|
|
67
|
+
|
|
68
|
+
# Average buy price in the original currency
|
|
69
|
+
attr_accessor :original_unitvalue
|
|
70
|
+
|
|
71
|
+
# Current unit value in the original currency
|
|
72
|
+
attr_accessor :original_unitprice
|
|
73
|
+
|
|
74
|
+
# Capital gain in the original currency
|
|
75
|
+
attr_accessor :original_diff
|
|
76
|
+
|
|
77
|
+
# Last update of the investment
|
|
78
|
+
attr_accessor :last_update
|
|
79
|
+
|
|
80
|
+
# If set, this investment has been removed from the website
|
|
81
|
+
attr_accessor :deleted
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
85
|
+
def self.attribute_map
|
|
86
|
+
{
|
|
87
|
+
:'id' => :'id',
|
|
88
|
+
:'id_account' => :'id_account',
|
|
89
|
+
:'label' => :'label',
|
|
90
|
+
:'code' => :'code',
|
|
91
|
+
:'code_type' => :'code_type',
|
|
92
|
+
:'source' => :'source',
|
|
93
|
+
:'description' => :'description',
|
|
94
|
+
:'quantity' => :'quantity',
|
|
95
|
+
:'unitprice' => :'unitprice',
|
|
96
|
+
:'unitvalue' => :'unitvalue',
|
|
97
|
+
:'valuation' => :'valuation',
|
|
98
|
+
:'diff' => :'diff',
|
|
99
|
+
:'diff_percent' => :'diff_percent',
|
|
100
|
+
:'prev_diff' => :'prev_diff',
|
|
101
|
+
:'portfolio_share' => :'portfolio_share',
|
|
102
|
+
:'vdate' => :'vdate',
|
|
103
|
+
:'prev_vdate' => :'prev_vdate',
|
|
104
|
+
:'id_security' => :'id_security',
|
|
105
|
+
:'original_currency' => :'original_currency',
|
|
106
|
+
:'original_valuation' => :'original_valuation',
|
|
107
|
+
:'original_unitvalue' => :'original_unitvalue',
|
|
108
|
+
:'original_unitprice' => :'original_unitprice',
|
|
109
|
+
:'original_diff' => :'original_diff',
|
|
110
|
+
:'last_update' => :'last_update',
|
|
111
|
+
:'deleted' => :'deleted'
|
|
112
|
+
}
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# Attribute type mapping.
|
|
116
|
+
def self.swagger_types
|
|
117
|
+
{
|
|
118
|
+
:'id' => :'Integer',
|
|
119
|
+
:'id_account' => :'Integer',
|
|
120
|
+
:'label' => :'String',
|
|
121
|
+
:'code' => :'String',
|
|
122
|
+
:'code_type' => :'String',
|
|
123
|
+
:'source' => :'String',
|
|
124
|
+
:'description' => :'String',
|
|
125
|
+
:'quantity' => :'Float',
|
|
126
|
+
:'unitprice' => :'Float',
|
|
127
|
+
:'unitvalue' => :'Float',
|
|
128
|
+
:'valuation' => :'Float',
|
|
129
|
+
:'diff' => :'Float',
|
|
130
|
+
:'diff_percent' => :'Float',
|
|
131
|
+
:'prev_diff' => :'Float',
|
|
132
|
+
:'portfolio_share' => :'Float',
|
|
133
|
+
:'vdate' => :'Date',
|
|
134
|
+
:'prev_vdate' => :'Date',
|
|
135
|
+
:'id_security' => :'Integer',
|
|
136
|
+
:'original_currency' => :'Object',
|
|
137
|
+
:'original_valuation' => :'Float',
|
|
138
|
+
:'original_unitvalue' => :'Float',
|
|
139
|
+
:'original_unitprice' => :'Float',
|
|
140
|
+
:'original_diff' => :'Float',
|
|
141
|
+
:'last_update' => :'DateTime',
|
|
142
|
+
:'deleted' => :'DateTime'
|
|
143
|
+
}
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# Initializes the object
|
|
147
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
148
|
+
def initialize(attributes = {})
|
|
149
|
+
return unless attributes.is_a?(Hash)
|
|
150
|
+
|
|
151
|
+
# convert string to symbol for hash key
|
|
152
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
|
153
|
+
|
|
154
|
+
if attributes.has_key?(:'id')
|
|
155
|
+
self.id = attributes[:'id']
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
if attributes.has_key?(:'id_account')
|
|
159
|
+
self.id_account = attributes[:'id_account']
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
if attributes.has_key?(:'label')
|
|
163
|
+
self.label = attributes[:'label']
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
if attributes.has_key?(:'code')
|
|
167
|
+
self.code = attributes[:'code']
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
if attributes.has_key?(:'code_type')
|
|
171
|
+
self.code_type = attributes[:'code_type']
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
if attributes.has_key?(:'source')
|
|
175
|
+
self.source = attributes[:'source']
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
if attributes.has_key?(:'description')
|
|
179
|
+
self.description = attributes[:'description']
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
if attributes.has_key?(:'quantity')
|
|
183
|
+
self.quantity = attributes[:'quantity']
|
|
184
|
+
else
|
|
185
|
+
self.quantity = 0.0
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
if attributes.has_key?(:'unitprice')
|
|
189
|
+
self.unitprice = attributes[:'unitprice']
|
|
190
|
+
else
|
|
191
|
+
self.unitprice = 0.0
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
if attributes.has_key?(:'unitvalue')
|
|
195
|
+
self.unitvalue = attributes[:'unitvalue']
|
|
196
|
+
else
|
|
197
|
+
self.unitvalue = 0.0
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
if attributes.has_key?(:'valuation')
|
|
201
|
+
self.valuation = attributes[:'valuation']
|
|
202
|
+
else
|
|
203
|
+
self.valuation = 0.0
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
if attributes.has_key?(:'diff')
|
|
207
|
+
self.diff = attributes[:'diff']
|
|
208
|
+
else
|
|
209
|
+
self.diff = 0.0
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
if attributes.has_key?(:'diff_percent')
|
|
213
|
+
self.diff_percent = attributes[:'diff_percent']
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
if attributes.has_key?(:'prev_diff')
|
|
217
|
+
self.prev_diff = attributes[:'prev_diff']
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
if attributes.has_key?(:'portfolio_share')
|
|
221
|
+
self.portfolio_share = attributes[:'portfolio_share']
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
if attributes.has_key?(:'vdate')
|
|
225
|
+
self.vdate = attributes[:'vdate']
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
if attributes.has_key?(:'prev_vdate')
|
|
229
|
+
self.prev_vdate = attributes[:'prev_vdate']
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
if attributes.has_key?(:'id_security')
|
|
233
|
+
self.id_security = attributes[:'id_security']
|
|
234
|
+
end
|
|
235
|
+
|
|
236
|
+
if attributes.has_key?(:'original_currency')
|
|
237
|
+
self.original_currency = attributes[:'original_currency']
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
if attributes.has_key?(:'original_valuation')
|
|
241
|
+
self.original_valuation = attributes[:'original_valuation']
|
|
242
|
+
end
|
|
243
|
+
|
|
244
|
+
if attributes.has_key?(:'original_unitvalue')
|
|
245
|
+
self.original_unitvalue = attributes[:'original_unitvalue']
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
if attributes.has_key?(:'original_unitprice')
|
|
249
|
+
self.original_unitprice = attributes[:'original_unitprice']
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
if attributes.has_key?(:'original_diff')
|
|
253
|
+
self.original_diff = attributes[:'original_diff']
|
|
254
|
+
end
|
|
255
|
+
|
|
256
|
+
if attributes.has_key?(:'last_update')
|
|
257
|
+
self.last_update = attributes[:'last_update']
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
if attributes.has_key?(:'deleted')
|
|
261
|
+
self.deleted = attributes[:'deleted']
|
|
262
|
+
end
|
|
263
|
+
|
|
264
|
+
end
|
|
265
|
+
|
|
266
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
267
|
+
# @return Array for valid properties with the reasons
|
|
268
|
+
def list_invalid_properties
|
|
269
|
+
invalid_properties = Array.new
|
|
270
|
+
if @id.nil?
|
|
271
|
+
invalid_properties.push("invalid value for 'id', id cannot be nil.")
|
|
272
|
+
end
|
|
273
|
+
|
|
274
|
+
if @id_account.nil?
|
|
275
|
+
invalid_properties.push("invalid value for 'id_account', id_account cannot be nil.")
|
|
276
|
+
end
|
|
277
|
+
|
|
278
|
+
if @label.nil?
|
|
279
|
+
invalid_properties.push("invalid value for 'label', label cannot be nil.")
|
|
280
|
+
end
|
|
281
|
+
|
|
282
|
+
if @code.nil?
|
|
283
|
+
invalid_properties.push("invalid value for 'code', code cannot be nil.")
|
|
284
|
+
end
|
|
285
|
+
|
|
286
|
+
return invalid_properties
|
|
287
|
+
end
|
|
288
|
+
|
|
289
|
+
# Check to see if the all the properties in the model are valid
|
|
290
|
+
# @return true if the model is valid
|
|
291
|
+
def valid?
|
|
292
|
+
return false if @id.nil?
|
|
293
|
+
return false if @id_account.nil?
|
|
294
|
+
return false if @label.nil?
|
|
295
|
+
return false if @code.nil?
|
|
296
|
+
return true
|
|
297
|
+
end
|
|
298
|
+
|
|
299
|
+
# Checks equality by comparing each attribute.
|
|
300
|
+
# @param [Object] Object to be compared
|
|
301
|
+
def ==(o)
|
|
302
|
+
return true if self.equal?(o)
|
|
303
|
+
self.class == o.class &&
|
|
304
|
+
id == o.id &&
|
|
305
|
+
id_account == o.id_account &&
|
|
306
|
+
label == o.label &&
|
|
307
|
+
code == o.code &&
|
|
308
|
+
code_type == o.code_type &&
|
|
309
|
+
source == o.source &&
|
|
310
|
+
description == o.description &&
|
|
311
|
+
quantity == o.quantity &&
|
|
312
|
+
unitprice == o.unitprice &&
|
|
313
|
+
unitvalue == o.unitvalue &&
|
|
314
|
+
valuation == o.valuation &&
|
|
315
|
+
diff == o.diff &&
|
|
316
|
+
diff_percent == o.diff_percent &&
|
|
317
|
+
prev_diff == o.prev_diff &&
|
|
318
|
+
portfolio_share == o.portfolio_share &&
|
|
319
|
+
vdate == o.vdate &&
|
|
320
|
+
prev_vdate == o.prev_vdate &&
|
|
321
|
+
id_security == o.id_security &&
|
|
322
|
+
original_currency == o.original_currency &&
|
|
323
|
+
original_valuation == o.original_valuation &&
|
|
324
|
+
original_unitvalue == o.original_unitvalue &&
|
|
325
|
+
original_unitprice == o.original_unitprice &&
|
|
326
|
+
original_diff == o.original_diff &&
|
|
327
|
+
last_update == o.last_update &&
|
|
328
|
+
deleted == o.deleted
|
|
329
|
+
end
|
|
330
|
+
|
|
331
|
+
# @see the `==` method
|
|
332
|
+
# @param [Object] Object to be compared
|
|
333
|
+
def eql?(o)
|
|
334
|
+
self == o
|
|
335
|
+
end
|
|
336
|
+
|
|
337
|
+
# Calculates hash code according to all attributes.
|
|
338
|
+
# @return [Fixnum] Hash code
|
|
339
|
+
def hash
|
|
340
|
+
[id, id_account, label, code, code_type, source, description, quantity, unitprice, unitvalue, valuation, diff, diff_percent, prev_diff, portfolio_share, vdate, prev_vdate, id_security, original_currency, original_valuation, original_unitvalue, original_unitprice, original_diff, last_update, deleted].hash
|
|
341
|
+
end
|
|
342
|
+
|
|
343
|
+
# Builds the object from hash
|
|
344
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
345
|
+
# @return [Object] Returns the model itself
|
|
346
|
+
def build_from_hash(attributes)
|
|
347
|
+
return nil unless attributes.is_a?(Hash)
|
|
348
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
349
|
+
if type =~ /\AArray<(.*)>/i
|
|
350
|
+
# check to ensure the input is an array given that the the attribute
|
|
351
|
+
# is documented as an array but the input is not
|
|
352
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
353
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
|
354
|
+
end
|
|
355
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
356
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
357
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
358
|
+
end
|
|
359
|
+
|
|
360
|
+
self
|
|
361
|
+
end
|
|
362
|
+
|
|
363
|
+
# Deserializes the data based on type
|
|
364
|
+
# @param string type Data type
|
|
365
|
+
# @param string value Value to be deserialized
|
|
366
|
+
# @return [Object] Deserialized data
|
|
367
|
+
def _deserialize(type, value)
|
|
368
|
+
case type.to_sym
|
|
369
|
+
when :DateTime
|
|
370
|
+
DateTime.parse(value)
|
|
371
|
+
when :Date
|
|
372
|
+
Date.parse(value)
|
|
373
|
+
when :String
|
|
374
|
+
value.to_s
|
|
375
|
+
when :Integer
|
|
376
|
+
value.to_i
|
|
377
|
+
when :Float
|
|
378
|
+
value.to_f
|
|
379
|
+
when :BOOLEAN
|
|
380
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
381
|
+
true
|
|
382
|
+
else
|
|
383
|
+
false
|
|
384
|
+
end
|
|
385
|
+
when :Object
|
|
386
|
+
# generic object (usually a Hash), return directly
|
|
387
|
+
value
|
|
388
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
389
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
390
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
391
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
392
|
+
k_type = Regexp.last_match[:k_type]
|
|
393
|
+
v_type = Regexp.last_match[:v_type]
|
|
394
|
+
{}.tap do |hash|
|
|
395
|
+
value.each do |k, v|
|
|
396
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
397
|
+
end
|
|
398
|
+
end
|
|
399
|
+
else # model
|
|
400
|
+
temp_model = BudgeaClient.const_get(type).new
|
|
401
|
+
temp_model.build_from_hash(value)
|
|
402
|
+
end
|
|
403
|
+
end
|
|
404
|
+
|
|
405
|
+
# Returns the string representation of the object
|
|
406
|
+
# @return [String] String presentation of the object
|
|
407
|
+
def to_s
|
|
408
|
+
to_hash.to_s
|
|
409
|
+
end
|
|
410
|
+
|
|
411
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
412
|
+
# @return [Hash] Returns the object in the form of hash
|
|
413
|
+
def to_body
|
|
414
|
+
to_hash
|
|
415
|
+
end
|
|
416
|
+
|
|
417
|
+
# Returns the object in the form of hash
|
|
418
|
+
# @return [Hash] Returns the object in the form of hash
|
|
419
|
+
def to_hash
|
|
420
|
+
hash = {}
|
|
421
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
422
|
+
value = self.send(attr)
|
|
423
|
+
next if value.nil?
|
|
424
|
+
hash[param] = _to_hash(value)
|
|
425
|
+
end
|
|
426
|
+
hash
|
|
427
|
+
end
|
|
428
|
+
|
|
429
|
+
# Outputs non-array value in the form of hash
|
|
430
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
431
|
+
# @param [Object] value Any valid value
|
|
432
|
+
# @return [Hash] Returns the value in the form of hash
|
|
433
|
+
def _to_hash(value)
|
|
434
|
+
if value.is_a?(Array)
|
|
435
|
+
value.compact.map{ |v| _to_hash(v) }
|
|
436
|
+
elsif value.is_a?(Hash)
|
|
437
|
+
{}.tap do |hash|
|
|
438
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
439
|
+
end
|
|
440
|
+
elsif value.respond_to? :to_hash
|
|
441
|
+
value.to_hash
|
|
442
|
+
else
|
|
443
|
+
value
|
|
444
|
+
end
|
|
445
|
+
end
|
|
446
|
+
|
|
447
|
+
end
|
|
448
|
+
|
|
449
|
+
end
|