hydrogen-electron-api 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +7 -0
  3. data/README.md +86 -0
  4. data/Rakefile +8 -0
  5. data/electron_api.gemspec +46 -0
  6. data/git_push.sh +55 -0
  7. data/lib/electron_api/api/ach_api.rb +75 -0
  8. data/lib/electron_api/api/card_api.rb +639 -0
  9. data/lib/electron_api/api_client.rb +391 -0
  10. data/lib/electron_api/api_error.rb +38 -0
  11. data/lib/electron_api/auth_configuration.rb +181 -0
  12. data/lib/electron_api/configuration.rb +209 -0
  13. data/lib/electron_api/environment.rb +36 -0
  14. data/lib/electron_api/models/ach_card_request_co.rb +180 -0
  15. data/lib/electron_api/models/ach_card_response_vo.rb +216 -0
  16. data/lib/electron_api/models/base_response_vo.rb +198 -0
  17. data/lib/electron_api/models/card_base_request_co.rb +200 -0
  18. data/lib/electron_api/models/card_client_request_co.rb +191 -0
  19. data/lib/electron_api/models/card_load_request_co.rb +189 -0
  20. data/lib/electron_api/models/card_load_unload_response_vo.rb +234 -0
  21. data/lib/electron_api/models/card_replace_response_vo.rb +234 -0
  22. data/lib/electron_api/models/card_reserve_account_response_vo.rb +234 -0
  23. data/lib/electron_api/models/card_spending_control_request_co.rb +180 -0
  24. data/lib/electron_api/models/card_spending_control_response_vo.rb +216 -0
  25. data/lib/electron_api/models/card_unload_request_co.rb +189 -0
  26. data/lib/electron_api/models/create_card_client_response_vo.rb +216 -0
  27. data/lib/electron_api/models/spending_control_vendor_request_data_vo.rb +254 -0
  28. data/lib/electron_api/models/update_card_client_response_vo.rb +216 -0
  29. data/lib/electron_api/version.rb +15 -0
  30. data/lib/electron_api.rb +57 -0
  31. data/spec/api/ach_api_spec.rb +46 -0
  32. data/spec/api/card_api_spec.rb +166 -0
  33. data/spec/api_client_spec.rb +243 -0
  34. data/spec/configuration_spec.rb +42 -0
  35. data/spec/models/ach_card_request_co_spec.rb +41 -0
  36. data/spec/models/ach_card_response_vo_spec.rb +65 -0
  37. data/spec/models/base_response_vo_spec.rb +53 -0
  38. data/spec/models/card_base_request_co_spec.rb +53 -0
  39. data/spec/models/card_client_request_co_spec.rb +47 -0
  40. data/spec/models/card_load_request_co_spec.rb +47 -0
  41. data/spec/models/card_load_unload_response_vo_spec.rb +77 -0
  42. data/spec/models/card_replace_response_vo_spec.rb +77 -0
  43. data/spec/models/card_reserve_account_response_vo_spec.rb +77 -0
  44. data/spec/models/card_spending_control_request_co_spec.rb +41 -0
  45. data/spec/models/card_spending_control_response_vo_spec.rb +65 -0
  46. data/spec/models/card_unload_request_co_spec.rb +47 -0
  47. data/spec/models/create_card_client_response_vo_spec.rb +65 -0
  48. data/spec/models/spending_control_vendor_request_data_vo_spec.rb +89 -0
  49. data/spec/models/update_card_client_response_vo_spec.rb +65 -0
  50. data/spec/spec_helper.rb +111 -0
  51. metadata +312 -0
@@ -0,0 +1,189 @@
1
+ =begin
2
+ #Hydrogen Electron API
3
+
4
+ #The Hydrogen Electron API
5
+
6
+ OpenAPI spec version: 1.3.1
7
+ Contact: info@hydrogenplatform.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.24
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module ElectronApi
16
+ class CardLoadRequestCO
17
+ attr_accessor :nucleus_funding_id
18
+
19
+ attr_accessor :reason
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'nucleus_funding_id' => :'nucleus_funding_id',
25
+ :'reason' => :'reason'
26
+ }
27
+ end
28
+
29
+ # Attribute type mapping.
30
+ def self.swagger_types
31
+ {
32
+ :'nucleus_funding_id' => :'String',
33
+ :'reason' => :'String'
34
+ }
35
+ end
36
+
37
+ # Initializes the object
38
+ # @param [Hash] attributes Model attributes in the form of hash
39
+ def initialize(attributes = {})
40
+ return unless attributes.is_a?(Hash)
41
+
42
+ # convert string to symbol for hash key
43
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
44
+
45
+ if attributes.has_key?(:'nucleus_funding_id')
46
+ self.nucleus_funding_id = attributes[:'nucleus_funding_id']
47
+ end
48
+
49
+ if attributes.has_key?(:'reason')
50
+ self.reason = attributes[:'reason']
51
+ end
52
+ end
53
+
54
+ # Show invalid properties with the reasons. Usually used together with valid?
55
+ # @return Array for valid properties with the reasons
56
+ def list_invalid_properties
57
+ invalid_properties = Array.new
58
+ invalid_properties
59
+ end
60
+
61
+ # Check to see if the all the properties in the model are valid
62
+ # @return true if the model is valid
63
+ def valid?
64
+ true
65
+ end
66
+
67
+ # Checks equality by comparing each attribute.
68
+ # @param [Object] Object to be compared
69
+ def ==(o)
70
+ return true if self.equal?(o)
71
+ self.class == o.class &&
72
+ nucleus_funding_id == o.nucleus_funding_id &&
73
+ reason == o.reason
74
+ end
75
+
76
+ # @see the `==` method
77
+ # @param [Object] Object to be compared
78
+ def eql?(o)
79
+ self == o
80
+ end
81
+
82
+ # Calculates hash code according to all attributes.
83
+ # @return [Fixnum] Hash code
84
+ def hash
85
+ [nucleus_funding_id, reason].hash
86
+ end
87
+
88
+ # Builds the object from hash
89
+ # @param [Hash] attributes Model attributes in the form of hash
90
+ # @return [Object] Returns the model itself
91
+ def build_from_hash(attributes)
92
+ self.class.swagger_types.each_pair do |key, type|
93
+ if type =~ /\AArray<(.*)>/i
94
+ # check to ensure the input is an array given that the attribute
95
+ # is documented as an array but the input is not
96
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
97
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
98
+ end
99
+ elsif !attributes[self.class.attribute_map[key]].nil?
100
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
101
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
102
+ end
103
+
104
+ self
105
+ end
106
+
107
+ # Deserializes the data based on type
108
+ # @param string type Data type
109
+ # @param string value Value to be deserialized
110
+ # @return [Object] Deserialized data
111
+ def _deserialize(type, value)
112
+ case type.to_sym
113
+ when :DateTime
114
+ value
115
+ when :Date
116
+ value
117
+ when :String
118
+ value.to_s
119
+ when :Integer
120
+ value.to_i
121
+ when :Float
122
+ value.to_f
123
+ when :BOOLEAN
124
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
125
+ true
126
+ else
127
+ false
128
+ end
129
+ when :Object
130
+ # generic object (usually a Hash), return directly
131
+ value
132
+ when /\AArray<(?<inner_type>.+)>\z/
133
+ inner_type = Regexp.last_match[:inner_type]
134
+ value.map { |v| _deserialize(inner_type, v) }
135
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
136
+ k_type = Regexp.last_match[:k_type]
137
+ v_type = Regexp.last_match[:v_type]
138
+ {}.tap do |hash|
139
+ value.each do |k, v|
140
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
141
+ end
142
+ end
143
+ else # model
144
+ temp_model = ElectronApi.const_get(type).new
145
+ temp_model.build_from_hash(value)
146
+ end
147
+ end
148
+
149
+ # Returns the string representation of the object
150
+ # @return [String] String presentation of the object
151
+ def to_s
152
+ to_hash.to_s
153
+ end
154
+
155
+ # to_body is an alias to to_hash (backward compatibility)
156
+ # @return [Hash] Returns the object in the form of hash
157
+ def to_body
158
+ to_hash
159
+ end
160
+
161
+ # Returns the object in the form of hash
162
+ # @return [Hash] Returns the object in the form of hash
163
+ def to_hash
164
+ hash = {}
165
+ self.class.attribute_map.each_pair do |attr, param|
166
+ value = self.send(attr)
167
+ hash[param] = _to_hash(value)
168
+ end
169
+ hash
170
+ end# Outputs non-array value in the form of hash
171
+ # For object, use to_hash. Otherwise, just return the value
172
+ # @param [Object] value Any valid value
173
+ # @return [Hash] Returns the value in the form of hash
174
+ def _to_hash(value)
175
+ if value.is_a?(Array)
176
+ value.compact.map { |v| _to_hash(v) }
177
+ elsif value.is_a?(Hash)
178
+ {}.tap do |hash|
179
+ value.each { |k, v| hash[k] = _to_hash(v) }
180
+ end
181
+ elsif value.respond_to? :to_hash
182
+ value.to_hash
183
+ else
184
+ value
185
+ end
186
+ end
187
+
188
+ end
189
+ end
@@ -0,0 +1,234 @@
1
+ =begin
2
+ #Hydrogen Electron API
3
+
4
+ #The Hydrogen Electron API
5
+
6
+ OpenAPI spec version: 1.3.1
7
+ Contact: info@hydrogenplatform.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.24
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module ElectronApi
16
+ class CardLoadUnloadResponseVO
17
+ attr_accessor :amount
18
+
19
+ attr_accessor :card_status
20
+
21
+ attr_accessor :message
22
+
23
+ attr_accessor :nucleus_card_id
24
+
25
+ attr_accessor :nucleus_funding_id
26
+
27
+ attr_accessor :vendor_name
28
+
29
+ attr_accessor :vendor_response
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'amount' => :'amount',
35
+ :'card_status' => :'card_status',
36
+ :'message' => :'message',
37
+ :'nucleus_card_id' => :'nucleus_card_id',
38
+ :'nucleus_funding_id' => :'nucleus_funding_id',
39
+ :'vendor_name' => :'vendor_name',
40
+ :'vendor_response' => :'vendor_response'
41
+ }
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.swagger_types
46
+ {
47
+ :'amount' => :'Float',
48
+ :'card_status' => :'String',
49
+ :'message' => :'String',
50
+ :'nucleus_card_id' => :'String',
51
+ :'nucleus_funding_id' => :'String',
52
+ :'vendor_name' => :'String',
53
+ :'vendor_response' => :'Object'
54
+ }
55
+ end
56
+
57
+ # Initializes the object
58
+ # @param [Hash] attributes Model attributes in the form of hash
59
+ def initialize(attributes = {})
60
+ return unless attributes.is_a?(Hash)
61
+
62
+ # convert string to symbol for hash key
63
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
64
+
65
+ if attributes.has_key?(:'amount')
66
+ self.amount = attributes[:'amount']
67
+ end
68
+
69
+ if attributes.has_key?(:'card_status')
70
+ self.card_status = attributes[:'card_status']
71
+ end
72
+
73
+ if attributes.has_key?(:'message')
74
+ self.message = attributes[:'message']
75
+ end
76
+
77
+ if attributes.has_key?(:'nucleus_card_id')
78
+ self.nucleus_card_id = attributes[:'nucleus_card_id']
79
+ end
80
+
81
+ if attributes.has_key?(:'nucleus_funding_id')
82
+ self.nucleus_funding_id = attributes[:'nucleus_funding_id']
83
+ end
84
+
85
+ if attributes.has_key?(:'vendor_name')
86
+ self.vendor_name = attributes[:'vendor_name']
87
+ end
88
+
89
+ if attributes.has_key?(:'vendor_response')
90
+ self.vendor_response = attributes[:'vendor_response']
91
+ end
92
+ end
93
+
94
+ # Show invalid properties with the reasons. Usually used together with valid?
95
+ # @return Array for valid properties with the reasons
96
+ def list_invalid_properties
97
+ invalid_properties = Array.new
98
+ invalid_properties
99
+ end
100
+
101
+ # Check to see if the all the properties in the model are valid
102
+ # @return true if the model is valid
103
+ def valid?
104
+ true
105
+ end
106
+
107
+ # Checks equality by comparing each attribute.
108
+ # @param [Object] Object to be compared
109
+ def ==(o)
110
+ return true if self.equal?(o)
111
+ self.class == o.class &&
112
+ amount == o.amount &&
113
+ card_status == o.card_status &&
114
+ message == o.message &&
115
+ nucleus_card_id == o.nucleus_card_id &&
116
+ nucleus_funding_id == o.nucleus_funding_id &&
117
+ vendor_name == o.vendor_name &&
118
+ vendor_response == o.vendor_response
119
+ end
120
+
121
+ # @see the `==` method
122
+ # @param [Object] Object to be compared
123
+ def eql?(o)
124
+ self == o
125
+ end
126
+
127
+ # Calculates hash code according to all attributes.
128
+ # @return [Fixnum] Hash code
129
+ def hash
130
+ [amount, card_status, message, nucleus_card_id, nucleus_funding_id, vendor_name, vendor_response].hash
131
+ end
132
+
133
+ # Builds the object from hash
134
+ # @param [Hash] attributes Model attributes in the form of hash
135
+ # @return [Object] Returns the model itself
136
+ def build_from_hash(attributes)
137
+ self.class.swagger_types.each_pair do |key, type|
138
+ if type =~ /\AArray<(.*)>/i
139
+ # check to ensure the input is an array given that the attribute
140
+ # is documented as an array but the input is not
141
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
142
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
143
+ end
144
+ elsif !attributes[self.class.attribute_map[key]].nil?
145
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
146
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
147
+ end
148
+
149
+ self
150
+ end
151
+
152
+ # Deserializes the data based on type
153
+ # @param string type Data type
154
+ # @param string value Value to be deserialized
155
+ # @return [Object] Deserialized data
156
+ def _deserialize(type, value)
157
+ case type.to_sym
158
+ when :DateTime
159
+ value
160
+ when :Date
161
+ value
162
+ when :String
163
+ value.to_s
164
+ when :Integer
165
+ value.to_i
166
+ when :Float
167
+ value.to_f
168
+ when :BOOLEAN
169
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
170
+ true
171
+ else
172
+ false
173
+ end
174
+ when :Object
175
+ # generic object (usually a Hash), return directly
176
+ value
177
+ when /\AArray<(?<inner_type>.+)>\z/
178
+ inner_type = Regexp.last_match[:inner_type]
179
+ value.map { |v| _deserialize(inner_type, v) }
180
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
181
+ k_type = Regexp.last_match[:k_type]
182
+ v_type = Regexp.last_match[:v_type]
183
+ {}.tap do |hash|
184
+ value.each do |k, v|
185
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
186
+ end
187
+ end
188
+ else # model
189
+ temp_model = ElectronApi.const_get(type).new
190
+ temp_model.build_from_hash(value)
191
+ end
192
+ end
193
+
194
+ # Returns the string representation of the object
195
+ # @return [String] String presentation of the object
196
+ def to_s
197
+ to_hash.to_s
198
+ end
199
+
200
+ # to_body is an alias to to_hash (backward compatibility)
201
+ # @return [Hash] Returns the object in the form of hash
202
+ def to_body
203
+ to_hash
204
+ end
205
+
206
+ # Returns the object in the form of hash
207
+ # @return [Hash] Returns the object in the form of hash
208
+ def to_hash
209
+ hash = {}
210
+ self.class.attribute_map.each_pair do |attr, param|
211
+ value = self.send(attr)
212
+ hash[param] = _to_hash(value)
213
+ end
214
+ hash
215
+ end# Outputs non-array value in the form of hash
216
+ # For object, use to_hash. Otherwise, just return the value
217
+ # @param [Object] value Any valid value
218
+ # @return [Hash] Returns the value in the form of hash
219
+ def _to_hash(value)
220
+ if value.is_a?(Array)
221
+ value.compact.map { |v| _to_hash(v) }
222
+ elsif value.is_a?(Hash)
223
+ {}.tap do |hash|
224
+ value.each { |k, v| hash[k] = _to_hash(v) }
225
+ end
226
+ elsif value.respond_to? :to_hash
227
+ value.to_hash
228
+ else
229
+ value
230
+ end
231
+ end
232
+
233
+ end
234
+ end
@@ -0,0 +1,234 @@
1
+ =begin
2
+ #Hydrogen Electron API
3
+
4
+ #The Hydrogen Electron API
5
+
6
+ OpenAPI spec version: 1.3.1
7
+ Contact: info@hydrogenplatform.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.24
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module ElectronApi
16
+ class CardReplaceResponseVO
17
+ attr_accessor :card_status
18
+
19
+ attr_accessor :message
20
+
21
+ attr_accessor :new_nucleus_card_id
22
+
23
+ attr_accessor :nucleus_card_id
24
+
25
+ attr_accessor :replaced_nucleus_card_id
26
+
27
+ attr_accessor :vendor_name
28
+
29
+ attr_accessor :vendor_response
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'card_status' => :'card_status',
35
+ :'message' => :'message',
36
+ :'new_nucleus_card_id' => :'new_nucleus_card_id',
37
+ :'nucleus_card_id' => :'nucleus_card_id',
38
+ :'replaced_nucleus_card_id' => :'replaced_nucleus_card_id',
39
+ :'vendor_name' => :'vendor_name',
40
+ :'vendor_response' => :'vendor_response'
41
+ }
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.swagger_types
46
+ {
47
+ :'card_status' => :'String',
48
+ :'message' => :'String',
49
+ :'new_nucleus_card_id' => :'String',
50
+ :'nucleus_card_id' => :'String',
51
+ :'replaced_nucleus_card_id' => :'String',
52
+ :'vendor_name' => :'String',
53
+ :'vendor_response' => :'Object'
54
+ }
55
+ end
56
+
57
+ # Initializes the object
58
+ # @param [Hash] attributes Model attributes in the form of hash
59
+ def initialize(attributes = {})
60
+ return unless attributes.is_a?(Hash)
61
+
62
+ # convert string to symbol for hash key
63
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
64
+
65
+ if attributes.has_key?(:'card_status')
66
+ self.card_status = attributes[:'card_status']
67
+ end
68
+
69
+ if attributes.has_key?(:'message')
70
+ self.message = attributes[:'message']
71
+ end
72
+
73
+ if attributes.has_key?(:'new_nucleus_card_id')
74
+ self.new_nucleus_card_id = attributes[:'new_nucleus_card_id']
75
+ end
76
+
77
+ if attributes.has_key?(:'nucleus_card_id')
78
+ self.nucleus_card_id = attributes[:'nucleus_card_id']
79
+ end
80
+
81
+ if attributes.has_key?(:'replaced_nucleus_card_id')
82
+ self.replaced_nucleus_card_id = attributes[:'replaced_nucleus_card_id']
83
+ end
84
+
85
+ if attributes.has_key?(:'vendor_name')
86
+ self.vendor_name = attributes[:'vendor_name']
87
+ end
88
+
89
+ if attributes.has_key?(:'vendor_response')
90
+ self.vendor_response = attributes[:'vendor_response']
91
+ end
92
+ end
93
+
94
+ # Show invalid properties with the reasons. Usually used together with valid?
95
+ # @return Array for valid properties with the reasons
96
+ def list_invalid_properties
97
+ invalid_properties = Array.new
98
+ invalid_properties
99
+ end
100
+
101
+ # Check to see if the all the properties in the model are valid
102
+ # @return true if the model is valid
103
+ def valid?
104
+ true
105
+ end
106
+
107
+ # Checks equality by comparing each attribute.
108
+ # @param [Object] Object to be compared
109
+ def ==(o)
110
+ return true if self.equal?(o)
111
+ self.class == o.class &&
112
+ card_status == o.card_status &&
113
+ message == o.message &&
114
+ new_nucleus_card_id == o.new_nucleus_card_id &&
115
+ nucleus_card_id == o.nucleus_card_id &&
116
+ replaced_nucleus_card_id == o.replaced_nucleus_card_id &&
117
+ vendor_name == o.vendor_name &&
118
+ vendor_response == o.vendor_response
119
+ end
120
+
121
+ # @see the `==` method
122
+ # @param [Object] Object to be compared
123
+ def eql?(o)
124
+ self == o
125
+ end
126
+
127
+ # Calculates hash code according to all attributes.
128
+ # @return [Fixnum] Hash code
129
+ def hash
130
+ [card_status, message, new_nucleus_card_id, nucleus_card_id, replaced_nucleus_card_id, vendor_name, vendor_response].hash
131
+ end
132
+
133
+ # Builds the object from hash
134
+ # @param [Hash] attributes Model attributes in the form of hash
135
+ # @return [Object] Returns the model itself
136
+ def build_from_hash(attributes)
137
+ self.class.swagger_types.each_pair do |key, type|
138
+ if type =~ /\AArray<(.*)>/i
139
+ # check to ensure the input is an array given that the attribute
140
+ # is documented as an array but the input is not
141
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
142
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
143
+ end
144
+ elsif !attributes[self.class.attribute_map[key]].nil?
145
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
146
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
147
+ end
148
+
149
+ self
150
+ end
151
+
152
+ # Deserializes the data based on type
153
+ # @param string type Data type
154
+ # @param string value Value to be deserialized
155
+ # @return [Object] Deserialized data
156
+ def _deserialize(type, value)
157
+ case type.to_sym
158
+ when :DateTime
159
+ value
160
+ when :Date
161
+ value
162
+ when :String
163
+ value.to_s
164
+ when :Integer
165
+ value.to_i
166
+ when :Float
167
+ value.to_f
168
+ when :BOOLEAN
169
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
170
+ true
171
+ else
172
+ false
173
+ end
174
+ when :Object
175
+ # generic object (usually a Hash), return directly
176
+ value
177
+ when /\AArray<(?<inner_type>.+)>\z/
178
+ inner_type = Regexp.last_match[:inner_type]
179
+ value.map { |v| _deserialize(inner_type, v) }
180
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
181
+ k_type = Regexp.last_match[:k_type]
182
+ v_type = Regexp.last_match[:v_type]
183
+ {}.tap do |hash|
184
+ value.each do |k, v|
185
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
186
+ end
187
+ end
188
+ else # model
189
+ temp_model = ElectronApi.const_get(type).new
190
+ temp_model.build_from_hash(value)
191
+ end
192
+ end
193
+
194
+ # Returns the string representation of the object
195
+ # @return [String] String presentation of the object
196
+ def to_s
197
+ to_hash.to_s
198
+ end
199
+
200
+ # to_body is an alias to to_hash (backward compatibility)
201
+ # @return [Hash] Returns the object in the form of hash
202
+ def to_body
203
+ to_hash
204
+ end
205
+
206
+ # Returns the object in the form of hash
207
+ # @return [Hash] Returns the object in the form of hash
208
+ def to_hash
209
+ hash = {}
210
+ self.class.attribute_map.each_pair do |attr, param|
211
+ value = self.send(attr)
212
+ hash[param] = _to_hash(value)
213
+ end
214
+ hash
215
+ end# Outputs non-array value in the form of hash
216
+ # For object, use to_hash. Otherwise, just return the value
217
+ # @param [Object] value Any valid value
218
+ # @return [Hash] Returns the value in the form of hash
219
+ def _to_hash(value)
220
+ if value.is_a?(Array)
221
+ value.compact.map { |v| _to_hash(v) }
222
+ elsif value.is_a?(Hash)
223
+ {}.tap do |hash|
224
+ value.each { |k, v| hash[k] = _to_hash(v) }
225
+ end
226
+ elsif value.respond_to? :to_hash
227
+ value.to_hash
228
+ else
229
+ value
230
+ end
231
+ end
232
+
233
+ end
234
+ end