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,223 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'date'
|
4
|
+
|
5
|
+
module BudgeaClient
|
6
|
+
|
7
|
+
class ConnectorLogo
|
8
|
+
attr_accessor :id
|
9
|
+
|
10
|
+
# ID of the bank
|
11
|
+
attr_accessor :id_bank
|
12
|
+
|
13
|
+
# Id of the Bank/Provider Logo
|
14
|
+
attr_accessor :id_file
|
15
|
+
|
16
|
+
# Logo's type
|
17
|
+
attr_accessor :type
|
18
|
+
|
19
|
+
|
20
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
21
|
+
def self.attribute_map
|
22
|
+
{
|
23
|
+
:'id' => :'id',
|
24
|
+
:'id_bank' => :'id_bank',
|
25
|
+
:'id_file' => :'id_file',
|
26
|
+
:'type' => :'type'
|
27
|
+
}
|
28
|
+
end
|
29
|
+
|
30
|
+
# Attribute type mapping.
|
31
|
+
def self.swagger_types
|
32
|
+
{
|
33
|
+
:'id' => :'Integer',
|
34
|
+
:'id_bank' => :'Integer',
|
35
|
+
:'id_file' => :'Integer',
|
36
|
+
:'type' => :'String'
|
37
|
+
}
|
38
|
+
end
|
39
|
+
|
40
|
+
# Initializes the object
|
41
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
42
|
+
def initialize(attributes = {})
|
43
|
+
return unless attributes.is_a?(Hash)
|
44
|
+
|
45
|
+
# convert string to symbol for hash key
|
46
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
47
|
+
|
48
|
+
if attributes.has_key?(:'id')
|
49
|
+
self.id = attributes[:'id']
|
50
|
+
end
|
51
|
+
|
52
|
+
if attributes.has_key?(:'id_bank')
|
53
|
+
self.id_bank = attributes[:'id_bank']
|
54
|
+
end
|
55
|
+
|
56
|
+
if attributes.has_key?(:'id_file')
|
57
|
+
self.id_file = attributes[:'id_file']
|
58
|
+
end
|
59
|
+
|
60
|
+
if attributes.has_key?(:'type')
|
61
|
+
self.type = attributes[:'type']
|
62
|
+
end
|
63
|
+
|
64
|
+
end
|
65
|
+
|
66
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
67
|
+
# @return Array for valid properties with the reasons
|
68
|
+
def list_invalid_properties
|
69
|
+
invalid_properties = Array.new
|
70
|
+
if @id.nil?
|
71
|
+
invalid_properties.push("invalid value for 'id', id cannot be nil.")
|
72
|
+
end
|
73
|
+
|
74
|
+
if @id_bank.nil?
|
75
|
+
invalid_properties.push("invalid value for 'id_bank', id_bank cannot be nil.")
|
76
|
+
end
|
77
|
+
|
78
|
+
if @id_file.nil?
|
79
|
+
invalid_properties.push("invalid value for 'id_file', id_file cannot be nil.")
|
80
|
+
end
|
81
|
+
|
82
|
+
return invalid_properties
|
83
|
+
end
|
84
|
+
|
85
|
+
# Check to see if the all the properties in the model are valid
|
86
|
+
# @return true if the model is valid
|
87
|
+
def valid?
|
88
|
+
return false if @id.nil?
|
89
|
+
return false if @id_bank.nil?
|
90
|
+
return false if @id_file.nil?
|
91
|
+
return true
|
92
|
+
end
|
93
|
+
|
94
|
+
# Checks equality by comparing each attribute.
|
95
|
+
# @param [Object] Object to be compared
|
96
|
+
def ==(o)
|
97
|
+
return true if self.equal?(o)
|
98
|
+
self.class == o.class &&
|
99
|
+
id == o.id &&
|
100
|
+
id_bank == o.id_bank &&
|
101
|
+
id_file == o.id_file &&
|
102
|
+
type == o.type
|
103
|
+
end
|
104
|
+
|
105
|
+
# @see the `==` method
|
106
|
+
# @param [Object] Object to be compared
|
107
|
+
def eql?(o)
|
108
|
+
self == o
|
109
|
+
end
|
110
|
+
|
111
|
+
# Calculates hash code according to all attributes.
|
112
|
+
# @return [Fixnum] Hash code
|
113
|
+
def hash
|
114
|
+
[id, id_bank, id_file, type].hash
|
115
|
+
end
|
116
|
+
|
117
|
+
# Builds the object from hash
|
118
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
119
|
+
# @return [Object] Returns the model itself
|
120
|
+
def build_from_hash(attributes)
|
121
|
+
return nil unless attributes.is_a?(Hash)
|
122
|
+
self.class.swagger_types.each_pair do |key, type|
|
123
|
+
if type =~ /\AArray<(.*)>/i
|
124
|
+
# check to ensure the input is an array given that the the attribute
|
125
|
+
# is documented as an array but the input is not
|
126
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
127
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
128
|
+
end
|
129
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
130
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
131
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
132
|
+
end
|
133
|
+
|
134
|
+
self
|
135
|
+
end
|
136
|
+
|
137
|
+
# Deserializes the data based on type
|
138
|
+
# @param string type Data type
|
139
|
+
# @param string value Value to be deserialized
|
140
|
+
# @return [Object] Deserialized data
|
141
|
+
def _deserialize(type, value)
|
142
|
+
case type.to_sym
|
143
|
+
when :DateTime
|
144
|
+
DateTime.parse(value)
|
145
|
+
when :Date
|
146
|
+
Date.parse(value)
|
147
|
+
when :String
|
148
|
+
value.to_s
|
149
|
+
when :Integer
|
150
|
+
value.to_i
|
151
|
+
when :Float
|
152
|
+
value.to_f
|
153
|
+
when :BOOLEAN
|
154
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
155
|
+
true
|
156
|
+
else
|
157
|
+
false
|
158
|
+
end
|
159
|
+
when :Object
|
160
|
+
# generic object (usually a Hash), return directly
|
161
|
+
value
|
162
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
163
|
+
inner_type = Regexp.last_match[:inner_type]
|
164
|
+
value.map { |v| _deserialize(inner_type, v) }
|
165
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
166
|
+
k_type = Regexp.last_match[:k_type]
|
167
|
+
v_type = Regexp.last_match[:v_type]
|
168
|
+
{}.tap do |hash|
|
169
|
+
value.each do |k, v|
|
170
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
171
|
+
end
|
172
|
+
end
|
173
|
+
else # model
|
174
|
+
temp_model = BudgeaClient.const_get(type).new
|
175
|
+
temp_model.build_from_hash(value)
|
176
|
+
end
|
177
|
+
end
|
178
|
+
|
179
|
+
# Returns the string representation of the object
|
180
|
+
# @return [String] String presentation of the object
|
181
|
+
def to_s
|
182
|
+
to_hash.to_s
|
183
|
+
end
|
184
|
+
|
185
|
+
# to_body is an alias to to_hash (backward compatibility)
|
186
|
+
# @return [Hash] Returns the object in the form of hash
|
187
|
+
def to_body
|
188
|
+
to_hash
|
189
|
+
end
|
190
|
+
|
191
|
+
# Returns the object in the form of hash
|
192
|
+
# @return [Hash] Returns the object in the form of hash
|
193
|
+
def to_hash
|
194
|
+
hash = {}
|
195
|
+
self.class.attribute_map.each_pair do |attr, param|
|
196
|
+
value = self.send(attr)
|
197
|
+
next if value.nil?
|
198
|
+
hash[param] = _to_hash(value)
|
199
|
+
end
|
200
|
+
hash
|
201
|
+
end
|
202
|
+
|
203
|
+
# Outputs non-array value in the form of hash
|
204
|
+
# For object, use to_hash. Otherwise, just return the value
|
205
|
+
# @param [Object] value Any valid value
|
206
|
+
# @return [Hash] Returns the value in the form of hash
|
207
|
+
def _to_hash(value)
|
208
|
+
if value.is_a?(Array)
|
209
|
+
value.compact.map{ |v| _to_hash(v) }
|
210
|
+
elsif value.is_a?(Hash)
|
211
|
+
{}.tap do |hash|
|
212
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
213
|
+
end
|
214
|
+
elsif value.respond_to? :to_hash
|
215
|
+
value.to_hash
|
216
|
+
else
|
217
|
+
value
|
218
|
+
end
|
219
|
+
end
|
220
|
+
|
221
|
+
end
|
222
|
+
|
223
|
+
end
|
@@ -0,0 +1,216 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'date'
|
4
|
+
|
5
|
+
module BudgeaClient
|
6
|
+
|
7
|
+
class Currency
|
8
|
+
# ISO 4217 code used as ID
|
9
|
+
attr_accessor :id
|
10
|
+
|
11
|
+
# Symbol representing the currency
|
12
|
+
attr_accessor :symbol
|
13
|
+
|
14
|
+
# Amount is prefixed or not by the currency
|
15
|
+
attr_accessor :prefix
|
16
|
+
|
17
|
+
|
18
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
19
|
+
def self.attribute_map
|
20
|
+
{
|
21
|
+
:'id' => :'id',
|
22
|
+
:'symbol' => :'symbol',
|
23
|
+
:'prefix' => :'prefix'
|
24
|
+
}
|
25
|
+
end
|
26
|
+
|
27
|
+
# Attribute type mapping.
|
28
|
+
def self.swagger_types
|
29
|
+
{
|
30
|
+
:'id' => :'String',
|
31
|
+
:'symbol' => :'String',
|
32
|
+
:'prefix' => :'BOOLEAN'
|
33
|
+
}
|
34
|
+
end
|
35
|
+
|
36
|
+
# Initializes the object
|
37
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
38
|
+
def initialize(attributes = {})
|
39
|
+
return unless attributes.is_a?(Hash)
|
40
|
+
|
41
|
+
# convert string to symbol for hash key
|
42
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
43
|
+
|
44
|
+
if attributes.has_key?(:'id')
|
45
|
+
self.id = attributes[:'id']
|
46
|
+
end
|
47
|
+
|
48
|
+
if attributes.has_key?(:'symbol')
|
49
|
+
self.symbol = attributes[:'symbol']
|
50
|
+
end
|
51
|
+
|
52
|
+
if attributes.has_key?(:'prefix')
|
53
|
+
self.prefix = attributes[:'prefix']
|
54
|
+
else
|
55
|
+
self.prefix = false
|
56
|
+
end
|
57
|
+
|
58
|
+
end
|
59
|
+
|
60
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
61
|
+
# @return Array for valid properties with the reasons
|
62
|
+
def list_invalid_properties
|
63
|
+
invalid_properties = Array.new
|
64
|
+
if @id.nil?
|
65
|
+
invalid_properties.push("invalid value for 'id', id cannot be nil.")
|
66
|
+
end
|
67
|
+
|
68
|
+
if @symbol.nil?
|
69
|
+
invalid_properties.push("invalid value for 'symbol', symbol cannot be nil.")
|
70
|
+
end
|
71
|
+
|
72
|
+
if @prefix.nil?
|
73
|
+
invalid_properties.push("invalid value for 'prefix', prefix cannot be nil.")
|
74
|
+
end
|
75
|
+
|
76
|
+
return invalid_properties
|
77
|
+
end
|
78
|
+
|
79
|
+
# Check to see if the all the properties in the model are valid
|
80
|
+
# @return true if the model is valid
|
81
|
+
def valid?
|
82
|
+
return false if @id.nil?
|
83
|
+
return false if @symbol.nil?
|
84
|
+
return false if @prefix.nil?
|
85
|
+
return true
|
86
|
+
end
|
87
|
+
|
88
|
+
# Checks equality by comparing each attribute.
|
89
|
+
# @param [Object] Object to be compared
|
90
|
+
def ==(o)
|
91
|
+
return true if self.equal?(o)
|
92
|
+
self.class == o.class &&
|
93
|
+
id == o.id &&
|
94
|
+
symbol == o.symbol &&
|
95
|
+
prefix == o.prefix
|
96
|
+
end
|
97
|
+
|
98
|
+
# @see the `==` method
|
99
|
+
# @param [Object] Object to be compared
|
100
|
+
def eql?(o)
|
101
|
+
self == o
|
102
|
+
end
|
103
|
+
|
104
|
+
# Calculates hash code according to all attributes.
|
105
|
+
# @return [Fixnum] Hash code
|
106
|
+
def hash
|
107
|
+
[id, symbol, prefix].hash
|
108
|
+
end
|
109
|
+
|
110
|
+
# Builds the object from hash
|
111
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
112
|
+
# @return [Object] Returns the model itself
|
113
|
+
def build_from_hash(attributes)
|
114
|
+
return nil unless attributes.is_a?(Hash)
|
115
|
+
self.class.swagger_types.each_pair do |key, type|
|
116
|
+
if type =~ /\AArray<(.*)>/i
|
117
|
+
# check to ensure the input is an array given that the the attribute
|
118
|
+
# is documented as an array but the input is not
|
119
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
120
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
121
|
+
end
|
122
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
123
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
124
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
125
|
+
end
|
126
|
+
|
127
|
+
self
|
128
|
+
end
|
129
|
+
|
130
|
+
# Deserializes the data based on type
|
131
|
+
# @param string type Data type
|
132
|
+
# @param string value Value to be deserialized
|
133
|
+
# @return [Object] Deserialized data
|
134
|
+
def _deserialize(type, value)
|
135
|
+
case type.to_sym
|
136
|
+
when :DateTime
|
137
|
+
DateTime.parse(value)
|
138
|
+
when :Date
|
139
|
+
Date.parse(value)
|
140
|
+
when :String
|
141
|
+
value.to_s
|
142
|
+
when :Integer
|
143
|
+
value.to_i
|
144
|
+
when :Float
|
145
|
+
value.to_f
|
146
|
+
when :BOOLEAN
|
147
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
148
|
+
true
|
149
|
+
else
|
150
|
+
false
|
151
|
+
end
|
152
|
+
when :Object
|
153
|
+
# generic object (usually a Hash), return directly
|
154
|
+
value
|
155
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
156
|
+
inner_type = Regexp.last_match[:inner_type]
|
157
|
+
value.map { |v| _deserialize(inner_type, v) }
|
158
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
159
|
+
k_type = Regexp.last_match[:k_type]
|
160
|
+
v_type = Regexp.last_match[:v_type]
|
161
|
+
{}.tap do |hash|
|
162
|
+
value.each do |k, v|
|
163
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
164
|
+
end
|
165
|
+
end
|
166
|
+
else # model
|
167
|
+
temp_model = BudgeaClient.const_get(type).new
|
168
|
+
temp_model.build_from_hash(value)
|
169
|
+
end
|
170
|
+
end
|
171
|
+
|
172
|
+
# Returns the string representation of the object
|
173
|
+
# @return [String] String presentation of the object
|
174
|
+
def to_s
|
175
|
+
to_hash.to_s
|
176
|
+
end
|
177
|
+
|
178
|
+
# to_body is an alias to to_hash (backward compatibility)
|
179
|
+
# @return [Hash] Returns the object in the form of hash
|
180
|
+
def to_body
|
181
|
+
to_hash
|
182
|
+
end
|
183
|
+
|
184
|
+
# Returns the object in the form of hash
|
185
|
+
# @return [Hash] Returns the object in the form of hash
|
186
|
+
def to_hash
|
187
|
+
hash = {}
|
188
|
+
self.class.attribute_map.each_pair do |attr, param|
|
189
|
+
value = self.send(attr)
|
190
|
+
next if value.nil?
|
191
|
+
hash[param] = _to_hash(value)
|
192
|
+
end
|
193
|
+
hash
|
194
|
+
end
|
195
|
+
|
196
|
+
# Outputs non-array value in the form of hash
|
197
|
+
# For object, use to_hash. Otherwise, just return the value
|
198
|
+
# @param [Object] value Any valid value
|
199
|
+
# @return [Hash] Returns the value in the form of hash
|
200
|
+
def _to_hash(value)
|
201
|
+
if value.is_a?(Array)
|
202
|
+
value.compact.map{ |v| _to_hash(v) }
|
203
|
+
elsif value.is_a?(Hash)
|
204
|
+
{}.tap do |hash|
|
205
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
206
|
+
end
|
207
|
+
elsif value.respond_to? :to_hash
|
208
|
+
value.to_hash
|
209
|
+
else
|
210
|
+
value
|
211
|
+
end
|
212
|
+
end
|
213
|
+
|
214
|
+
end
|
215
|
+
|
216
|
+
end
|
@@ -0,0 +1,269 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'date'
|
4
|
+
|
5
|
+
module BudgeaClient
|
6
|
+
|
7
|
+
class Device
|
8
|
+
attr_accessor :id
|
9
|
+
|
10
|
+
attr_accessor :id_token
|
11
|
+
|
12
|
+
attr_accessor :type
|
13
|
+
|
14
|
+
attr_accessor :notification_token
|
15
|
+
|
16
|
+
attr_accessor :last_update
|
17
|
+
|
18
|
+
attr_accessor :version
|
19
|
+
|
20
|
+
attr_accessor :debug
|
21
|
+
|
22
|
+
|
23
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
24
|
+
def self.attribute_map
|
25
|
+
{
|
26
|
+
:'id' => :'id',
|
27
|
+
:'id_token' => :'id_token',
|
28
|
+
:'type' => :'type',
|
29
|
+
:'notification_token' => :'notification_token',
|
30
|
+
:'last_update' => :'last_update',
|
31
|
+
:'version' => :'version',
|
32
|
+
:'debug' => :'debug'
|
33
|
+
}
|
34
|
+
end
|
35
|
+
|
36
|
+
# Attribute type mapping.
|
37
|
+
def self.swagger_types
|
38
|
+
{
|
39
|
+
:'id' => :'Integer',
|
40
|
+
:'id_token' => :'Integer',
|
41
|
+
:'type' => :'String',
|
42
|
+
:'notification_token' => :'String',
|
43
|
+
:'last_update' => :'DateTime',
|
44
|
+
:'version' => :'String',
|
45
|
+
:'debug' => :'BOOLEAN'
|
46
|
+
}
|
47
|
+
end
|
48
|
+
|
49
|
+
# Initializes the object
|
50
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
51
|
+
def initialize(attributes = {})
|
52
|
+
return unless attributes.is_a?(Hash)
|
53
|
+
|
54
|
+
# convert string to symbol for hash key
|
55
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
56
|
+
|
57
|
+
if attributes.has_key?(:'id')
|
58
|
+
self.id = attributes[:'id']
|
59
|
+
end
|
60
|
+
|
61
|
+
if attributes.has_key?(:'id_token')
|
62
|
+
self.id_token = attributes[:'id_token']
|
63
|
+
end
|
64
|
+
|
65
|
+
if attributes.has_key?(:'type')
|
66
|
+
self.type = attributes[:'type']
|
67
|
+
end
|
68
|
+
|
69
|
+
if attributes.has_key?(:'notification_token')
|
70
|
+
self.notification_token = attributes[:'notification_token']
|
71
|
+
end
|
72
|
+
|
73
|
+
if attributes.has_key?(:'last_update')
|
74
|
+
self.last_update = attributes[:'last_update']
|
75
|
+
end
|
76
|
+
|
77
|
+
if attributes.has_key?(:'version')
|
78
|
+
self.version = attributes[:'version']
|
79
|
+
end
|
80
|
+
|
81
|
+
if attributes.has_key?(:'debug')
|
82
|
+
self.debug = attributes[:'debug']
|
83
|
+
else
|
84
|
+
self.debug = false
|
85
|
+
end
|
86
|
+
|
87
|
+
end
|
88
|
+
|
89
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
90
|
+
# @return Array for valid properties with the reasons
|
91
|
+
def list_invalid_properties
|
92
|
+
invalid_properties = Array.new
|
93
|
+
if @id.nil?
|
94
|
+
invalid_properties.push("invalid value for 'id', id cannot be nil.")
|
95
|
+
end
|
96
|
+
|
97
|
+
if @id_token.nil?
|
98
|
+
invalid_properties.push("invalid value for 'id_token', id_token cannot be nil.")
|
99
|
+
end
|
100
|
+
|
101
|
+
if @type.nil?
|
102
|
+
invalid_properties.push("invalid value for 'type', type cannot be nil.")
|
103
|
+
end
|
104
|
+
|
105
|
+
if @notification_token.nil?
|
106
|
+
invalid_properties.push("invalid value for 'notification_token', notification_token cannot be nil.")
|
107
|
+
end
|
108
|
+
|
109
|
+
if @last_update.nil?
|
110
|
+
invalid_properties.push("invalid value for 'last_update', last_update cannot be nil.")
|
111
|
+
end
|
112
|
+
|
113
|
+
if @version.nil?
|
114
|
+
invalid_properties.push("invalid value for 'version', version cannot be nil.")
|
115
|
+
end
|
116
|
+
|
117
|
+
if @debug.nil?
|
118
|
+
invalid_properties.push("invalid value for 'debug', debug cannot be nil.")
|
119
|
+
end
|
120
|
+
|
121
|
+
return invalid_properties
|
122
|
+
end
|
123
|
+
|
124
|
+
# Check to see if the all the properties in the model are valid
|
125
|
+
# @return true if the model is valid
|
126
|
+
def valid?
|
127
|
+
return false if @id.nil?
|
128
|
+
return false if @id_token.nil?
|
129
|
+
return false if @type.nil?
|
130
|
+
return false if @notification_token.nil?
|
131
|
+
return false if @last_update.nil?
|
132
|
+
return false if @version.nil?
|
133
|
+
return false if @debug.nil?
|
134
|
+
return true
|
135
|
+
end
|
136
|
+
|
137
|
+
# Checks equality by comparing each attribute.
|
138
|
+
# @param [Object] Object to be compared
|
139
|
+
def ==(o)
|
140
|
+
return true if self.equal?(o)
|
141
|
+
self.class == o.class &&
|
142
|
+
id == o.id &&
|
143
|
+
id_token == o.id_token &&
|
144
|
+
type == o.type &&
|
145
|
+
notification_token == o.notification_token &&
|
146
|
+
last_update == o.last_update &&
|
147
|
+
version == o.version &&
|
148
|
+
debug == o.debug
|
149
|
+
end
|
150
|
+
|
151
|
+
# @see the `==` method
|
152
|
+
# @param [Object] Object to be compared
|
153
|
+
def eql?(o)
|
154
|
+
self == o
|
155
|
+
end
|
156
|
+
|
157
|
+
# Calculates hash code according to all attributes.
|
158
|
+
# @return [Fixnum] Hash code
|
159
|
+
def hash
|
160
|
+
[id, id_token, type, notification_token, last_update, version, debug].hash
|
161
|
+
end
|
162
|
+
|
163
|
+
# Builds the object from hash
|
164
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
165
|
+
# @return [Object] Returns the model itself
|
166
|
+
def build_from_hash(attributes)
|
167
|
+
return nil unless attributes.is_a?(Hash)
|
168
|
+
self.class.swagger_types.each_pair do |key, type|
|
169
|
+
if type =~ /\AArray<(.*)>/i
|
170
|
+
# check to ensure the input is an array given that the the attribute
|
171
|
+
# is documented as an array but the input is not
|
172
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
173
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
174
|
+
end
|
175
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
176
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
177
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
178
|
+
end
|
179
|
+
|
180
|
+
self
|
181
|
+
end
|
182
|
+
|
183
|
+
# Deserializes the data based on type
|
184
|
+
# @param string type Data type
|
185
|
+
# @param string value Value to be deserialized
|
186
|
+
# @return [Object] Deserialized data
|
187
|
+
def _deserialize(type, value)
|
188
|
+
case type.to_sym
|
189
|
+
when :DateTime
|
190
|
+
DateTime.parse(value)
|
191
|
+
when :Date
|
192
|
+
Date.parse(value)
|
193
|
+
when :String
|
194
|
+
value.to_s
|
195
|
+
when :Integer
|
196
|
+
value.to_i
|
197
|
+
when :Float
|
198
|
+
value.to_f
|
199
|
+
when :BOOLEAN
|
200
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
201
|
+
true
|
202
|
+
else
|
203
|
+
false
|
204
|
+
end
|
205
|
+
when :Object
|
206
|
+
# generic object (usually a Hash), return directly
|
207
|
+
value
|
208
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
209
|
+
inner_type = Regexp.last_match[:inner_type]
|
210
|
+
value.map { |v| _deserialize(inner_type, v) }
|
211
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
212
|
+
k_type = Regexp.last_match[:k_type]
|
213
|
+
v_type = Regexp.last_match[:v_type]
|
214
|
+
{}.tap do |hash|
|
215
|
+
value.each do |k, v|
|
216
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
217
|
+
end
|
218
|
+
end
|
219
|
+
else # model
|
220
|
+
temp_model = BudgeaClient.const_get(type).new
|
221
|
+
temp_model.build_from_hash(value)
|
222
|
+
end
|
223
|
+
end
|
224
|
+
|
225
|
+
# Returns the string representation of the object
|
226
|
+
# @return [String] String presentation of the object
|
227
|
+
def to_s
|
228
|
+
to_hash.to_s
|
229
|
+
end
|
230
|
+
|
231
|
+
# to_body is an alias to to_hash (backward compatibility)
|
232
|
+
# @return [Hash] Returns the object in the form of hash
|
233
|
+
def to_body
|
234
|
+
to_hash
|
235
|
+
end
|
236
|
+
|
237
|
+
# Returns the object in the form of hash
|
238
|
+
# @return [Hash] Returns the object in the form of hash
|
239
|
+
def to_hash
|
240
|
+
hash = {}
|
241
|
+
self.class.attribute_map.each_pair do |attr, param|
|
242
|
+
value = self.send(attr)
|
243
|
+
next if value.nil?
|
244
|
+
hash[param] = _to_hash(value)
|
245
|
+
end
|
246
|
+
hash
|
247
|
+
end
|
248
|
+
|
249
|
+
# Outputs non-array value in the form of hash
|
250
|
+
# For object, use to_hash. Otherwise, just return the value
|
251
|
+
# @param [Object] value Any valid value
|
252
|
+
# @return [Hash] Returns the value in the form of hash
|
253
|
+
def _to_hash(value)
|
254
|
+
if value.is_a?(Array)
|
255
|
+
value.compact.map{ |v| _to_hash(v) }
|
256
|
+
elsif value.is_a?(Hash)
|
257
|
+
{}.tap do |hash|
|
258
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
259
|
+
end
|
260
|
+
elsif value.respond_to? :to_hash
|
261
|
+
value.to_hash
|
262
|
+
else
|
263
|
+
value
|
264
|
+
end
|
265
|
+
end
|
266
|
+
|
267
|
+
end
|
268
|
+
|
269
|
+
end
|