budgea_client 3.0.1 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/budgea_openapi.json +6 -4
- data/docs/Connector.md +1 -0
- data/lib/budgea_client/models/connector.rb +15 -4
- data/lib/budgea_client/version.rb +1 -1
- data/pkg/budgea_client-3.0.1.gem +0 -0
- data/spec/api/administration_api_spec.rb +225 -23
- data/spec/api/authentication_api_spec.rb +81 -11
- data/spec/api/banks_api_spec.rb +379 -236
- data/spec/api/connections_api_spec.rb +76 -39
- data/spec/api/documents_api_spec.rb +124 -114
- data/spec/api/ocr_api_spec.rb +13 -3
- data/spec/api/oidc_api_spec.rb +14 -4
- data/spec/api/pfm_api_spec.rb +61 -51
- data/spec/api/providers_api_spec.rb +260 -238
- data/spec/api/recipients_api_spec.rb +23 -9
- data/spec/api/terms_api_spec.rb +17 -8
- data/spec/api/transfers_api_spec.rb +88 -57
- data/spec/api/users_management_api_spec.rb +25 -15
- data/spec/api/wealth_api_spec.rb +150 -24
- data/spec/api_client_spec.rb +45 -35
- data/spec/configuration_spec.rb +19 -9
- data/spec/models/access_spec.rb +16 -7
- data/spec/models/account_log_spec.rb +21 -12
- data/spec/models/account_spec.rb +59 -20
- data/spec/models/account_type_spec.rb +19 -10
- data/spec/models/alert_spec.rb +19 -10
- data/spec/models/category_spec.rb +21 -12
- data/spec/models/client_spec.rb +25 -28
- data/spec/models/connection_log_spec.rb +38 -17
- data/spec/models/connection_spec.rb +33 -12
- data/spec/models/connector_logo_spec.rb +16 -7
- data/spec/models/connector_spec.rb +18 -0
- data/spec/models/currency_spec.rb +38 -5
- data/spec/models/device_spec.rb +18 -9
- data/spec/models/document_spec.rb +37 -34
- data/spec/models/document_type_spec.rb +14 -5
- data/spec/models/field_spec.rb +32 -11
- data/spec/models/field_value_spec.rb +13 -4
- data/spec/models/file_spec.rb +15 -6
- data/spec/models/group_spec.rb +19 -10
- data/spec/models/hash_table_spec.rb +15 -6
- data/spec/models/inline_response_200_10_spec.rb +19 -4
- data/spec/models/inline_response_200_11_spec.rb +19 -4
- data/spec/models/inline_response_200_12_spec.rb +19 -4
- data/spec/models/inline_response_200_13_spec.rb +19 -4
- data/spec/models/inline_response_200_14_spec.rb +19 -4
- data/spec/models/inline_response_200_15_spec.rb +19 -4
- data/spec/models/inline_response_200_16_spec.rb +19 -4
- data/spec/models/inline_response_200_17_spec.rb +19 -4
- data/spec/models/inline_response_200_18_spec.rb +19 -4
- data/spec/models/inline_response_200_19_spec.rb +13 -4
- data/spec/models/inline_response_200_1_spec.rb +13 -4
- data/spec/models/inline_response_200_20_spec.rb +19 -4
- data/spec/models/inline_response_200_21_spec.rb +19 -4
- data/spec/models/inline_response_200_22_spec.rb +19 -4
- data/spec/models/inline_response_200_23_spec.rb +19 -4
- data/spec/models/inline_response_200_24_spec.rb +19 -4
- data/spec/models/inline_response_200_25_spec.rb +19 -4
- data/spec/models/inline_response_200_26_spec.rb +19 -4
- data/spec/models/inline_response_200_27_spec.rb +19 -4
- data/spec/models/inline_response_200_28_spec.rb +19 -4
- data/spec/models/inline_response_200_29_spec.rb +19 -4
- data/spec/models/inline_response_200_2_spec.rb +14 -5
- data/spec/models/inline_response_200_30_spec.rb +19 -4
- data/spec/models/inline_response_200_31_spec.rb +19 -4
- data/spec/models/inline_response_200_32_spec.rb +19 -4
- data/spec/models/inline_response_200_33_spec.rb +19 -4
- data/spec/models/inline_response_200_34_spec.rb +7 -1
- data/spec/models/inline_response_200_35_spec.rb +7 -1
- data/spec/models/inline_response_200_36_spec.rb +7 -1
- data/spec/models/inline_response_200_37_spec.rb +7 -1
- data/spec/models/inline_response_200_38_spec.rb +7 -1
- data/spec/models/inline_response_200_3_spec.rb +15 -12
- data/spec/models/inline_response_200_4_spec.rb +14 -17
- data/spec/models/inline_response_200_5_spec.rb +33 -6
- data/spec/models/inline_response_200_6_spec.rb +15 -12
- data/spec/models/inline_response_200_7_spec.rb +25 -4
- data/spec/models/inline_response_200_8_spec.rb +19 -4
- data/spec/models/inline_response_200_9_spec.rb +19 -4
- data/spec/models/inline_response_200_spec.rb +18 -3
- data/spec/models/investment_spec.rb +36 -27
- data/spec/models/investment_value_spec.rb +17 -8
- data/spec/models/invite_spec.rb +17 -8
- data/spec/models/locked_user_spec.rb +14 -5
- data/spec/models/oidc_whitelist_spec.rb +13 -4
- data/spec/models/pocket_spec.rb +21 -12
- data/spec/models/profile_spec.rb +23 -14
- data/spec/models/project_spec.rb +20 -11
- data/spec/models/project_type_spec.rb +14 -5
- data/spec/models/recipient_log_spec.rb +6 -0
- data/spec/models/recipient_spec.rb +44 -17
- data/spec/models/security_spec.rb +16 -7
- data/spec/models/subscription_spec.rb +28 -13
- data/spec/models/terms_of_service_spec.rb +16 -7
- data/spec/models/transaction_information_spec.rb +15 -6
- data/spec/models/transaction_spec.rb +71 -32
- data/spec/models/transactions_cluster_spec.rb +20 -11
- data/spec/models/transfer_log_spec.rb +6 -0
- data/spec/models/transfer_spec.rb +33 -18
- data/spec/models/user_alert_spec.rb +25 -16
- data/spec/models/user_spec.rb +18 -9
- data/spec/models/webhook_spec.rb +31 -10
- data/spec/spec_helper.rb +62 -2
- metadata +3 -14
- data/docs/Bank.md +0 -20
- data/docs/BankCategory.md +0 -9
- data/docs/ConnectionContact.md +0 -17
- data/lib/budgea_client/models/bank.rb +0 -335
- data/lib/budgea_client/models/bank_category.rb +0 -206
- data/lib/budgea_client/models/connection_contact.rb +0 -274
- data/spec/models/bank_category_spec.rb +0 -38
- data/spec/models/bank_spec.rb +0 -92
- data/spec/models/connection_contact_spec.rb +0 -86
@@ -1,206 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
#Budgea API Documentation
|
3
|
-
|
4
|
-
#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
5
|
-
|
6
|
-
OpenAPI spec version: 2.0
|
7
|
-
|
8
|
-
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.4.1
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'date'
|
14
|
-
|
15
|
-
module BudgeaClient
|
16
|
-
class BankCategory
|
17
|
-
# ID of the bank category
|
18
|
-
attr_accessor :id
|
19
|
-
|
20
|
-
# Name of the category
|
21
|
-
attr_accessor :name
|
22
|
-
|
23
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
24
|
-
def self.attribute_map
|
25
|
-
{
|
26
|
-
:'id' => :'id',
|
27
|
-
:'name' => :'name'
|
28
|
-
}
|
29
|
-
end
|
30
|
-
|
31
|
-
# Attribute type mapping.
|
32
|
-
def self.swagger_types
|
33
|
-
{
|
34
|
-
:'id' => :'Integer',
|
35
|
-
:'name' => :'String'
|
36
|
-
}
|
37
|
-
end
|
38
|
-
|
39
|
-
# Initializes the object
|
40
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
41
|
-
def initialize(attributes = {})
|
42
|
-
return unless attributes.is_a?(Hash)
|
43
|
-
|
44
|
-
# convert string to symbol for hash key
|
45
|
-
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
46
|
-
|
47
|
-
if attributes.has_key?(:'id')
|
48
|
-
self.id = attributes[:'id']
|
49
|
-
end
|
50
|
-
|
51
|
-
if attributes.has_key?(:'name')
|
52
|
-
self.name = attributes[:'name']
|
53
|
-
else
|
54
|
-
self.name = 'false'
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
59
|
-
# @return Array for valid properties with the reasons
|
60
|
-
def list_invalid_properties
|
61
|
-
invalid_properties = Array.new
|
62
|
-
if @id.nil?
|
63
|
-
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
64
|
-
end
|
65
|
-
|
66
|
-
if @name.nil?
|
67
|
-
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
68
|
-
end
|
69
|
-
|
70
|
-
invalid_properties
|
71
|
-
end
|
72
|
-
|
73
|
-
# Check to see if the all the properties in the model are valid
|
74
|
-
# @return true if the model is valid
|
75
|
-
def valid?
|
76
|
-
return false if @id.nil?
|
77
|
-
return false if @name.nil?
|
78
|
-
true
|
79
|
-
end
|
80
|
-
|
81
|
-
# Checks equality by comparing each attribute.
|
82
|
-
# @param [Object] Object to be compared
|
83
|
-
def ==(o)
|
84
|
-
return true if self.equal?(o)
|
85
|
-
self.class == o.class &&
|
86
|
-
id == o.id &&
|
87
|
-
name == o.name
|
88
|
-
end
|
89
|
-
|
90
|
-
# @see the `==` method
|
91
|
-
# @param [Object] Object to be compared
|
92
|
-
def eql?(o)
|
93
|
-
self == o
|
94
|
-
end
|
95
|
-
|
96
|
-
# Calculates hash code according to all attributes.
|
97
|
-
# @return [Fixnum] Hash code
|
98
|
-
def hash
|
99
|
-
[id, name].hash
|
100
|
-
end
|
101
|
-
|
102
|
-
# Builds the object from hash
|
103
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
104
|
-
# @return [Object] Returns the model itself
|
105
|
-
def build_from_hash(attributes)
|
106
|
-
return nil unless attributes.is_a?(Hash)
|
107
|
-
self.class.swagger_types.each_pair do |key, type|
|
108
|
-
if type =~ /\AArray<(.*)>/i
|
109
|
-
# check to ensure the input is an array given that the the attribute
|
110
|
-
# is documented as an array but the input is not
|
111
|
-
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
112
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
113
|
-
end
|
114
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
115
|
-
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
116
|
-
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
117
|
-
end
|
118
|
-
|
119
|
-
self
|
120
|
-
end
|
121
|
-
|
122
|
-
# Deserializes the data based on type
|
123
|
-
# @param string type Data type
|
124
|
-
# @param string value Value to be deserialized
|
125
|
-
# @return [Object] Deserialized data
|
126
|
-
def _deserialize(type, value)
|
127
|
-
case type.to_sym
|
128
|
-
when :DateTime
|
129
|
-
DateTime.parse(value)
|
130
|
-
when :Date
|
131
|
-
Date.parse(value)
|
132
|
-
when :String
|
133
|
-
value.to_s
|
134
|
-
when :Integer
|
135
|
-
value.to_i
|
136
|
-
when :Float
|
137
|
-
value.to_f
|
138
|
-
when :BOOLEAN
|
139
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
140
|
-
true
|
141
|
-
else
|
142
|
-
false
|
143
|
-
end
|
144
|
-
when :Object
|
145
|
-
# generic object (usually a Hash), return directly
|
146
|
-
value
|
147
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
148
|
-
inner_type = Regexp.last_match[:inner_type]
|
149
|
-
value.map { |v| _deserialize(inner_type, v) }
|
150
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
151
|
-
k_type = Regexp.last_match[:k_type]
|
152
|
-
v_type = Regexp.last_match[:v_type]
|
153
|
-
{}.tap do |hash|
|
154
|
-
value.each do |k, v|
|
155
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
156
|
-
end
|
157
|
-
end
|
158
|
-
else # model
|
159
|
-
temp_model = BudgeaClient.const_get(type).new
|
160
|
-
temp_model.build_from_hash(value)
|
161
|
-
end
|
162
|
-
end
|
163
|
-
|
164
|
-
# Returns the string representation of the object
|
165
|
-
# @return [String] String presentation of the object
|
166
|
-
def to_s
|
167
|
-
to_hash.to_s
|
168
|
-
end
|
169
|
-
|
170
|
-
# to_body is an alias to to_hash (backward compatibility)
|
171
|
-
# @return [Hash] Returns the object in the form of hash
|
172
|
-
def to_body
|
173
|
-
to_hash
|
174
|
-
end
|
175
|
-
|
176
|
-
# Returns the object in the form of hash
|
177
|
-
# @return [Hash] Returns the object in the form of hash
|
178
|
-
def to_hash
|
179
|
-
hash = {}
|
180
|
-
self.class.attribute_map.each_pair do |attr, param|
|
181
|
-
value = self.send(attr)
|
182
|
-
next if value.nil?
|
183
|
-
hash[param] = _to_hash(value)
|
184
|
-
end
|
185
|
-
hash
|
186
|
-
end
|
187
|
-
|
188
|
-
# Outputs non-array value in the form of hash
|
189
|
-
# For object, use to_hash. Otherwise, just return the value
|
190
|
-
# @param [Object] value Any valid value
|
191
|
-
# @return [Hash] Returns the value in the form of hash
|
192
|
-
def _to_hash(value)
|
193
|
-
if value.is_a?(Array)
|
194
|
-
value.compact.map { |v| _to_hash(v) }
|
195
|
-
elsif value.is_a?(Hash)
|
196
|
-
{}.tap do |hash|
|
197
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
198
|
-
end
|
199
|
-
elsif value.respond_to? :to_hash
|
200
|
-
value.to_hash
|
201
|
-
else
|
202
|
-
value
|
203
|
-
end
|
204
|
-
end
|
205
|
-
end
|
206
|
-
end
|
@@ -1,274 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'date'
|
4
|
-
|
5
|
-
module BudgeaClient
|
6
|
-
|
7
|
-
class ConnectionContact
|
8
|
-
attr_accessor :id
|
9
|
-
|
10
|
-
attr_accessor :id_connection
|
11
|
-
|
12
|
-
attr_accessor :name
|
13
|
-
|
14
|
-
attr_accessor :email
|
15
|
-
|
16
|
-
attr_accessor :phone
|
17
|
-
|
18
|
-
attr_accessor :mobile
|
19
|
-
|
20
|
-
attr_accessor :fax
|
21
|
-
|
22
|
-
attr_accessor :agency
|
23
|
-
|
24
|
-
attr_accessor :address
|
25
|
-
|
26
|
-
attr_accessor :role
|
27
|
-
|
28
|
-
|
29
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
30
|
-
def self.attribute_map
|
31
|
-
{
|
32
|
-
:'id' => :'id',
|
33
|
-
:'id_connection' => :'id_connection',
|
34
|
-
:'name' => :'name',
|
35
|
-
:'email' => :'email',
|
36
|
-
:'phone' => :'phone',
|
37
|
-
:'mobile' => :'mobile',
|
38
|
-
:'fax' => :'fax',
|
39
|
-
:'agency' => :'agency',
|
40
|
-
:'address' => :'address',
|
41
|
-
:'role' => :'role'
|
42
|
-
}
|
43
|
-
end
|
44
|
-
|
45
|
-
# Attribute type mapping.
|
46
|
-
def self.swagger_types
|
47
|
-
{
|
48
|
-
:'id' => :'Integer',
|
49
|
-
:'id_connection' => :'Integer',
|
50
|
-
:'name' => :'String',
|
51
|
-
:'email' => :'String',
|
52
|
-
:'phone' => :'String',
|
53
|
-
:'mobile' => :'String',
|
54
|
-
:'fax' => :'String',
|
55
|
-
:'agency' => :'String',
|
56
|
-
:'address' => :'String',
|
57
|
-
:'role' => :'String'
|
58
|
-
}
|
59
|
-
end
|
60
|
-
|
61
|
-
# Initializes the object
|
62
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
63
|
-
def initialize(attributes = {})
|
64
|
-
return unless attributes.is_a?(Hash)
|
65
|
-
|
66
|
-
# convert string to symbol for hash key
|
67
|
-
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
68
|
-
|
69
|
-
if attributes.has_key?(:'id')
|
70
|
-
self.id = attributes[:'id']
|
71
|
-
end
|
72
|
-
|
73
|
-
if attributes.has_key?(:'id_connection')
|
74
|
-
self.id_connection = attributes[:'id_connection']
|
75
|
-
end
|
76
|
-
|
77
|
-
if attributes.has_key?(:'name')
|
78
|
-
self.name = attributes[:'name']
|
79
|
-
end
|
80
|
-
|
81
|
-
if attributes.has_key?(:'email')
|
82
|
-
self.email = attributes[:'email']
|
83
|
-
end
|
84
|
-
|
85
|
-
if attributes.has_key?(:'phone')
|
86
|
-
self.phone = attributes[:'phone']
|
87
|
-
end
|
88
|
-
|
89
|
-
if attributes.has_key?(:'mobile')
|
90
|
-
self.mobile = attributes[:'mobile']
|
91
|
-
end
|
92
|
-
|
93
|
-
if attributes.has_key?(:'fax')
|
94
|
-
self.fax = attributes[:'fax']
|
95
|
-
end
|
96
|
-
|
97
|
-
if attributes.has_key?(:'agency')
|
98
|
-
self.agency = attributes[:'agency']
|
99
|
-
end
|
100
|
-
|
101
|
-
if attributes.has_key?(:'address')
|
102
|
-
self.address = attributes[:'address']
|
103
|
-
end
|
104
|
-
|
105
|
-
if attributes.has_key?(:'role')
|
106
|
-
self.role = attributes[:'role']
|
107
|
-
end
|
108
|
-
|
109
|
-
end
|
110
|
-
|
111
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
112
|
-
# @return Array for valid properties with the reasons
|
113
|
-
def list_invalid_properties
|
114
|
-
invalid_properties = Array.new
|
115
|
-
if @id.nil?
|
116
|
-
invalid_properties.push("invalid value for 'id', id cannot be nil.")
|
117
|
-
end
|
118
|
-
|
119
|
-
if @id_connection.nil?
|
120
|
-
invalid_properties.push("invalid value for 'id_connection', id_connection cannot be nil.")
|
121
|
-
end
|
122
|
-
|
123
|
-
if @name.nil?
|
124
|
-
invalid_properties.push("invalid value for 'name', name cannot be nil.")
|
125
|
-
end
|
126
|
-
|
127
|
-
return invalid_properties
|
128
|
-
end
|
129
|
-
|
130
|
-
# Check to see if the all the properties in the model are valid
|
131
|
-
# @return true if the model is valid
|
132
|
-
def valid?
|
133
|
-
return false if @id.nil?
|
134
|
-
return false if @id_connection.nil?
|
135
|
-
return false if @name.nil?
|
136
|
-
return true
|
137
|
-
end
|
138
|
-
|
139
|
-
# Checks equality by comparing each attribute.
|
140
|
-
# @param [Object] Object to be compared
|
141
|
-
def ==(o)
|
142
|
-
return true if self.equal?(o)
|
143
|
-
self.class == o.class &&
|
144
|
-
id == o.id &&
|
145
|
-
id_connection == o.id_connection &&
|
146
|
-
name == o.name &&
|
147
|
-
email == o.email &&
|
148
|
-
phone == o.phone &&
|
149
|
-
mobile == o.mobile &&
|
150
|
-
fax == o.fax &&
|
151
|
-
agency == o.agency &&
|
152
|
-
address == o.address &&
|
153
|
-
role == o.role
|
154
|
-
end
|
155
|
-
|
156
|
-
# @see the `==` method
|
157
|
-
# @param [Object] Object to be compared
|
158
|
-
def eql?(o)
|
159
|
-
self == o
|
160
|
-
end
|
161
|
-
|
162
|
-
# Calculates hash code according to all attributes.
|
163
|
-
# @return [Fixnum] Hash code
|
164
|
-
def hash
|
165
|
-
[id, id_connection, name, email, phone, mobile, fax, agency, address, role].hash
|
166
|
-
end
|
167
|
-
|
168
|
-
# Builds the object from hash
|
169
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
170
|
-
# @return [Object] Returns the model itself
|
171
|
-
def build_from_hash(attributes)
|
172
|
-
return nil unless attributes.is_a?(Hash)
|
173
|
-
self.class.swagger_types.each_pair do |key, type|
|
174
|
-
if type =~ /\AArray<(.*)>/i
|
175
|
-
# check to ensure the input is an array given that the the attribute
|
176
|
-
# is documented as an array but the input is not
|
177
|
-
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
178
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
179
|
-
end
|
180
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
181
|
-
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
182
|
-
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
183
|
-
end
|
184
|
-
|
185
|
-
self
|
186
|
-
end
|
187
|
-
|
188
|
-
# Deserializes the data based on type
|
189
|
-
# @param string type Data type
|
190
|
-
# @param string value Value to be deserialized
|
191
|
-
# @return [Object] Deserialized data
|
192
|
-
def _deserialize(type, value)
|
193
|
-
case type.to_sym
|
194
|
-
when :DateTime
|
195
|
-
DateTime.parse(value)
|
196
|
-
when :Date
|
197
|
-
Date.parse(value)
|
198
|
-
when :String
|
199
|
-
value.to_s
|
200
|
-
when :Integer
|
201
|
-
value.to_i
|
202
|
-
when :Float
|
203
|
-
value.to_f
|
204
|
-
when :BOOLEAN
|
205
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
206
|
-
true
|
207
|
-
else
|
208
|
-
false
|
209
|
-
end
|
210
|
-
when :Object
|
211
|
-
# generic object (usually a Hash), return directly
|
212
|
-
value
|
213
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
214
|
-
inner_type = Regexp.last_match[:inner_type]
|
215
|
-
value.map { |v| _deserialize(inner_type, v) }
|
216
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
217
|
-
k_type = Regexp.last_match[:k_type]
|
218
|
-
v_type = Regexp.last_match[:v_type]
|
219
|
-
{}.tap do |hash|
|
220
|
-
value.each do |k, v|
|
221
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
222
|
-
end
|
223
|
-
end
|
224
|
-
else # model
|
225
|
-
temp_model = BudgeaClient.const_get(type).new
|
226
|
-
temp_model.build_from_hash(value)
|
227
|
-
end
|
228
|
-
end
|
229
|
-
|
230
|
-
# Returns the string representation of the object
|
231
|
-
# @return [String] String presentation of the object
|
232
|
-
def to_s
|
233
|
-
to_hash.to_s
|
234
|
-
end
|
235
|
-
|
236
|
-
# to_body is an alias to to_hash (backward compatibility)
|
237
|
-
# @return [Hash] Returns the object in the form of hash
|
238
|
-
def to_body
|
239
|
-
to_hash
|
240
|
-
end
|
241
|
-
|
242
|
-
# Returns the object in the form of hash
|
243
|
-
# @return [Hash] Returns the object in the form of hash
|
244
|
-
def to_hash
|
245
|
-
hash = {}
|
246
|
-
self.class.attribute_map.each_pair do |attr, param|
|
247
|
-
value = self.send(attr)
|
248
|
-
next if value.nil?
|
249
|
-
hash[param] = _to_hash(value)
|
250
|
-
end
|
251
|
-
hash
|
252
|
-
end
|
253
|
-
|
254
|
-
# Outputs non-array value in the form of hash
|
255
|
-
# For object, use to_hash. Otherwise, just return the value
|
256
|
-
# @param [Object] value Any valid value
|
257
|
-
# @return [Hash] Returns the value in the form of hash
|
258
|
-
def _to_hash(value)
|
259
|
-
if value.is_a?(Array)
|
260
|
-
value.compact.map{ |v| _to_hash(v) }
|
261
|
-
elsif value.is_a?(Hash)
|
262
|
-
{}.tap do |hash|
|
263
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
264
|
-
end
|
265
|
-
elsif value.respond_to? :to_hash
|
266
|
-
value.to_hash
|
267
|
-
else
|
268
|
-
value
|
269
|
-
end
|
270
|
-
end
|
271
|
-
|
272
|
-
end
|
273
|
-
|
274
|
-
end
|