hydrogen-electron-api 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +7 -0
- data/README.md +86 -0
- data/Rakefile +8 -0
- data/electron_api.gemspec +46 -0
- data/git_push.sh +55 -0
- data/lib/electron_api/api/ach_api.rb +75 -0
- data/lib/electron_api/api/card_api.rb +639 -0
- data/lib/electron_api/api_client.rb +391 -0
- data/lib/electron_api/api_error.rb +38 -0
- data/lib/electron_api/auth_configuration.rb +181 -0
- data/lib/electron_api/configuration.rb +209 -0
- data/lib/electron_api/environment.rb +36 -0
- data/lib/electron_api/models/ach_card_request_co.rb +180 -0
- data/lib/electron_api/models/ach_card_response_vo.rb +216 -0
- data/lib/electron_api/models/base_response_vo.rb +198 -0
- data/lib/electron_api/models/card_base_request_co.rb +200 -0
- data/lib/electron_api/models/card_client_request_co.rb +191 -0
- data/lib/electron_api/models/card_load_request_co.rb +189 -0
- data/lib/electron_api/models/card_load_unload_response_vo.rb +234 -0
- data/lib/electron_api/models/card_replace_response_vo.rb +234 -0
- data/lib/electron_api/models/card_reserve_account_response_vo.rb +234 -0
- data/lib/electron_api/models/card_spending_control_request_co.rb +180 -0
- data/lib/electron_api/models/card_spending_control_response_vo.rb +216 -0
- data/lib/electron_api/models/card_unload_request_co.rb +189 -0
- data/lib/electron_api/models/create_card_client_response_vo.rb +216 -0
- data/lib/electron_api/models/spending_control_vendor_request_data_vo.rb +254 -0
- data/lib/electron_api/models/update_card_client_response_vo.rb +216 -0
- data/lib/electron_api/version.rb +15 -0
- data/lib/electron_api.rb +57 -0
- data/spec/api/ach_api_spec.rb +46 -0
- data/spec/api/card_api_spec.rb +166 -0
- data/spec/api_client_spec.rb +243 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/ach_card_request_co_spec.rb +41 -0
- data/spec/models/ach_card_response_vo_spec.rb +65 -0
- data/spec/models/base_response_vo_spec.rb +53 -0
- data/spec/models/card_base_request_co_spec.rb +53 -0
- data/spec/models/card_client_request_co_spec.rb +47 -0
- data/spec/models/card_load_request_co_spec.rb +47 -0
- data/spec/models/card_load_unload_response_vo_spec.rb +77 -0
- data/spec/models/card_replace_response_vo_spec.rb +77 -0
- data/spec/models/card_reserve_account_response_vo_spec.rb +77 -0
- data/spec/models/card_spending_control_request_co_spec.rb +41 -0
- data/spec/models/card_spending_control_response_vo_spec.rb +65 -0
- data/spec/models/card_unload_request_co_spec.rb +47 -0
- data/spec/models/create_card_client_response_vo_spec.rb +65 -0
- data/spec/models/spending_control_vendor_request_data_vo_spec.rb +89 -0
- data/spec/models/update_card_client_response_vo_spec.rb +65 -0
- data/spec/spec_helper.rb +111 -0
- metadata +312 -0
@@ -0,0 +1,209 @@
|
|
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 'addressable/uri'
|
14
|
+
|
15
|
+
module ElectronApi
|
16
|
+
class Configuration
|
17
|
+
# Defines url scheme
|
18
|
+
attr_accessor :scheme
|
19
|
+
|
20
|
+
# Defines url host
|
21
|
+
attr_accessor :host
|
22
|
+
|
23
|
+
# Defines url base path
|
24
|
+
attr_accessor :base_path
|
25
|
+
|
26
|
+
# Defines API keys used with API Key authentications.
|
27
|
+
#
|
28
|
+
# @return [Hash] key: parameter name, value: parameter value (API key)
|
29
|
+
#
|
30
|
+
# @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string)
|
31
|
+
# config.api_key['api_key'] = 'xxx'
|
32
|
+
attr_accessor :api_key
|
33
|
+
|
34
|
+
# Defines API key prefixes used with API Key authentications.
|
35
|
+
#
|
36
|
+
# @return [Hash] key: parameter name, value: API key prefix
|
37
|
+
#
|
38
|
+
# @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers)
|
39
|
+
# config.api_key_prefix['api_key'] = 'Token'
|
40
|
+
attr_accessor :api_key_prefix
|
41
|
+
|
42
|
+
# Defines the username used with HTTP basic authentication.
|
43
|
+
#
|
44
|
+
# @return [String]
|
45
|
+
attr_accessor :username
|
46
|
+
|
47
|
+
# Defines the password used with HTTP basic authentication.
|
48
|
+
#
|
49
|
+
# @return [String]
|
50
|
+
attr_accessor :password
|
51
|
+
|
52
|
+
# Defines the access token (Bearer) used with OAuth2.
|
53
|
+
attr_accessor :access_token
|
54
|
+
|
55
|
+
# Set this to enable/disable debugging. When enabled (set to true), HTTP request/response
|
56
|
+
# details will be logged with `logger.debug` (see the `logger` attribute).
|
57
|
+
# Default to false.
|
58
|
+
#
|
59
|
+
# @return [true, false]
|
60
|
+
attr_accessor :debugging
|
61
|
+
|
62
|
+
# Defines the logger used for debugging.
|
63
|
+
# Default to `Rails.logger` (when in Rails) or logging to STDOUT.
|
64
|
+
#
|
65
|
+
# @return [#debug]
|
66
|
+
attr_accessor :logger
|
67
|
+
|
68
|
+
# Defines the temporary folder to store downloaded files
|
69
|
+
# (for API endpoints that have file response).
|
70
|
+
# Default to use `Tempfile`.
|
71
|
+
#
|
72
|
+
# @return [String]
|
73
|
+
attr_accessor :temp_folder_path
|
74
|
+
|
75
|
+
# The time limit for HTTP request in seconds.
|
76
|
+
# Default to 0 (never times out).
|
77
|
+
attr_accessor :timeout
|
78
|
+
|
79
|
+
# Set this to false to skip client side validation in the operation.
|
80
|
+
# Default to true.
|
81
|
+
# @return [true, false]
|
82
|
+
attr_accessor :client_side_validation
|
83
|
+
|
84
|
+
### TLS/SSL setting
|
85
|
+
# Set this to false to skip verifying SSL certificate when calling API from https server.
|
86
|
+
# Default to true.
|
87
|
+
#
|
88
|
+
# @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
|
89
|
+
#
|
90
|
+
# @return [true, false]
|
91
|
+
attr_accessor :verify_ssl
|
92
|
+
|
93
|
+
### TLS/SSL setting
|
94
|
+
# Set this to false to skip verifying SSL host name
|
95
|
+
# Default to true.
|
96
|
+
#
|
97
|
+
# @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
|
98
|
+
#
|
99
|
+
# @return [true, false]
|
100
|
+
attr_accessor :verify_ssl_host
|
101
|
+
|
102
|
+
### TLS/SSL setting
|
103
|
+
# Set this to customize the certificate file to verify the peer.
|
104
|
+
#
|
105
|
+
# @return [String] the path to the certificate file
|
106
|
+
#
|
107
|
+
# @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code:
|
108
|
+
# https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145
|
109
|
+
attr_accessor :ssl_ca_cert
|
110
|
+
|
111
|
+
### TLS/SSL setting
|
112
|
+
# Client certificate file (for client certificate)
|
113
|
+
attr_accessor :cert_file
|
114
|
+
|
115
|
+
### TLS/SSL setting
|
116
|
+
# Client private key file (for client certificate)
|
117
|
+
attr_accessor :key_file
|
118
|
+
|
119
|
+
# Set this to customize parameters encoding of array parameter with multi collectionFormat.
|
120
|
+
# Default to nil.
|
121
|
+
#
|
122
|
+
# @see The params_encoding option of Ethon. Related source code:
|
123
|
+
# https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96
|
124
|
+
attr_accessor :params_encoding
|
125
|
+
|
126
|
+
attr_accessor :inject_format
|
127
|
+
|
128
|
+
attr_accessor :force_ending_format
|
129
|
+
|
130
|
+
def initialize
|
131
|
+
@scheme = 'https'
|
132
|
+
@host = 'api.hydrogenplatform.com'
|
133
|
+
@base_path = '/electron/v1'
|
134
|
+
@api_key = {}
|
135
|
+
@api_key_prefix = {}
|
136
|
+
@timeout = 0
|
137
|
+
@client_side_validation = true
|
138
|
+
@verify_ssl = true
|
139
|
+
@verify_ssl_host = true
|
140
|
+
@params_encoding = nil
|
141
|
+
@cert_file = nil
|
142
|
+
@key_file = nil
|
143
|
+
@debugging = false
|
144
|
+
@inject_format = false
|
145
|
+
@force_ending_format = false
|
146
|
+
@logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
|
147
|
+
|
148
|
+
yield(self) if block_given?
|
149
|
+
end
|
150
|
+
|
151
|
+
# The default Configuration object.
|
152
|
+
def self.default
|
153
|
+
@@default ||= Configuration.new
|
154
|
+
end
|
155
|
+
|
156
|
+
def configure
|
157
|
+
yield(self) if block_given?
|
158
|
+
end
|
159
|
+
|
160
|
+
def scheme=(scheme)
|
161
|
+
# remove :// from scheme
|
162
|
+
@scheme = scheme.sub(/:\/\//, '')
|
163
|
+
end
|
164
|
+
|
165
|
+
def host=(host)
|
166
|
+
# remove http(s):// and anything after a slash
|
167
|
+
@host = host.sub(/https?:\/\//, '').split('/').first
|
168
|
+
end
|
169
|
+
|
170
|
+
def base_path=(base_path)
|
171
|
+
# Add leading and trailing slashes to base_path
|
172
|
+
@base_path = "/#{base_path}".gsub(/\/+/, '/')
|
173
|
+
@base_path = '' if @base_path == '/'
|
174
|
+
end
|
175
|
+
|
176
|
+
def base_url
|
177
|
+
url = "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '')
|
178
|
+
Addressable::URI.encode(url)
|
179
|
+
end
|
180
|
+
|
181
|
+
# Gets API key (with prefix if set).
|
182
|
+
# @param [String] param_name the parameter name of API key auth
|
183
|
+
def api_key_with_prefix(param_name)
|
184
|
+
if @api_key_prefix[param_name]
|
185
|
+
"#{@api_key_prefix[param_name]} #{@api_key[param_name]}"
|
186
|
+
else
|
187
|
+
@api_key[param_name]
|
188
|
+
end
|
189
|
+
end
|
190
|
+
|
191
|
+
# Gets Basic Auth token string
|
192
|
+
def basic_auth_token
|
193
|
+
'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n")
|
194
|
+
end
|
195
|
+
|
196
|
+
# Returns Auth Settings hash for api client.
|
197
|
+
def auth_settings
|
198
|
+
{
|
199
|
+
'oauth2' =>
|
200
|
+
{
|
201
|
+
type: 'oauth2',
|
202
|
+
in: 'header',
|
203
|
+
key: 'Authorization',
|
204
|
+
value: "Bearer #{access_token}"
|
205
|
+
},
|
206
|
+
}
|
207
|
+
end
|
208
|
+
end
|
209
|
+
end
|
@@ -0,0 +1,36 @@
|
|
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
|
+
require 'uri'
|
13
|
+
|
14
|
+
module ElectronApi
|
15
|
+
class Environment
|
16
|
+
attr_accessor :api_client
|
17
|
+
attr_accessor :auth_config
|
18
|
+
attr_accessor :SANDBOX
|
19
|
+
attr_accessor :PRODUCTION
|
20
|
+
def initialize(api_client = ApiClient.default, config = Configuration.default, auth_config = AuthConfiguration.default)
|
21
|
+
@api_client = api_client
|
22
|
+
@config = config
|
23
|
+
@auth_config = auth_config
|
24
|
+
@SANDBOX = 'sandbox.hydrogenplatform.com'
|
25
|
+
@PRODUCTION = 'api.hydrogenplatform.com'
|
26
|
+
end
|
27
|
+
|
28
|
+
def set_environment(host)
|
29
|
+
if (host)
|
30
|
+
@config.config.host=host
|
31
|
+
@api_client.config.host=host
|
32
|
+
@auth_config.set_base_url(host)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,180 @@
|
|
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 AchCardRequestCO
|
17
|
+
attr_accessor :nucleus_funding_id
|
18
|
+
|
19
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
20
|
+
def self.attribute_map
|
21
|
+
{
|
22
|
+
:'nucleus_funding_id' => :'nucleus_funding_id'
|
23
|
+
}
|
24
|
+
end
|
25
|
+
|
26
|
+
# Attribute type mapping.
|
27
|
+
def self.swagger_types
|
28
|
+
{
|
29
|
+
:'nucleus_funding_id' => :'String'
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
33
|
+
# Initializes the object
|
34
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
35
|
+
def initialize(attributes = {})
|
36
|
+
return unless attributes.is_a?(Hash)
|
37
|
+
|
38
|
+
# convert string to symbol for hash key
|
39
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
40
|
+
|
41
|
+
if attributes.has_key?(:'nucleus_funding_id')
|
42
|
+
self.nucleus_funding_id = attributes[:'nucleus_funding_id']
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
47
|
+
# @return Array for valid properties with the reasons
|
48
|
+
def list_invalid_properties
|
49
|
+
invalid_properties = Array.new
|
50
|
+
invalid_properties
|
51
|
+
end
|
52
|
+
|
53
|
+
# Check to see if the all the properties in the model are valid
|
54
|
+
# @return true if the model is valid
|
55
|
+
def valid?
|
56
|
+
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
|
+
nucleus_funding_id == o.nucleus_funding_id
|
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
|
+
[nucleus_funding_id].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
|
+
self.class.swagger_types.each_pair do |key, type|
|
84
|
+
if type =~ /\AArray<(.*)>/i
|
85
|
+
# check to ensure the input is an array given that the attribute
|
86
|
+
# is documented as an array but the input is not
|
87
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
88
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
89
|
+
end
|
90
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
91
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
92
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
93
|
+
end
|
94
|
+
|
95
|
+
self
|
96
|
+
end
|
97
|
+
|
98
|
+
# Deserializes the data based on type
|
99
|
+
# @param string type Data type
|
100
|
+
# @param string value Value to be deserialized
|
101
|
+
# @return [Object] Deserialized data
|
102
|
+
def _deserialize(type, value)
|
103
|
+
case type.to_sym
|
104
|
+
when :DateTime
|
105
|
+
value
|
106
|
+
when :Date
|
107
|
+
value
|
108
|
+
when :String
|
109
|
+
value.to_s
|
110
|
+
when :Integer
|
111
|
+
value.to_i
|
112
|
+
when :Float
|
113
|
+
value.to_f
|
114
|
+
when :BOOLEAN
|
115
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
116
|
+
true
|
117
|
+
else
|
118
|
+
false
|
119
|
+
end
|
120
|
+
when :Object
|
121
|
+
# generic object (usually a Hash), return directly
|
122
|
+
value
|
123
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
124
|
+
inner_type = Regexp.last_match[:inner_type]
|
125
|
+
value.map { |v| _deserialize(inner_type, v) }
|
126
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
127
|
+
k_type = Regexp.last_match[:k_type]
|
128
|
+
v_type = Regexp.last_match[:v_type]
|
129
|
+
{}.tap do |hash|
|
130
|
+
value.each do |k, v|
|
131
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
132
|
+
end
|
133
|
+
end
|
134
|
+
else # model
|
135
|
+
temp_model = ElectronApi.const_get(type).new
|
136
|
+
temp_model.build_from_hash(value)
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
140
|
+
# Returns the string representation of the object
|
141
|
+
# @return [String] String presentation of the object
|
142
|
+
def to_s
|
143
|
+
to_hash.to_s
|
144
|
+
end
|
145
|
+
|
146
|
+
# to_body is an alias to to_hash (backward compatibility)
|
147
|
+
# @return [Hash] Returns the object in the form of hash
|
148
|
+
def to_body
|
149
|
+
to_hash
|
150
|
+
end
|
151
|
+
|
152
|
+
# Returns the object in the form of hash
|
153
|
+
# @return [Hash] Returns the object in the form of hash
|
154
|
+
def to_hash
|
155
|
+
hash = {}
|
156
|
+
self.class.attribute_map.each_pair do |attr, param|
|
157
|
+
value = self.send(attr)
|
158
|
+
hash[param] = _to_hash(value)
|
159
|
+
end
|
160
|
+
hash
|
161
|
+
end# Outputs non-array value in the form of hash
|
162
|
+
# For object, use to_hash. Otherwise, just return the value
|
163
|
+
# @param [Object] value Any valid value
|
164
|
+
# @return [Hash] Returns the value in the form of hash
|
165
|
+
def _to_hash(value)
|
166
|
+
if value.is_a?(Array)
|
167
|
+
value.compact.map { |v| _to_hash(v) }
|
168
|
+
elsif value.is_a?(Hash)
|
169
|
+
{}.tap do |hash|
|
170
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
171
|
+
end
|
172
|
+
elsif value.respond_to? :to_hash
|
173
|
+
value.to_hash
|
174
|
+
else
|
175
|
+
value
|
176
|
+
end
|
177
|
+
end
|
178
|
+
|
179
|
+
end
|
180
|
+
end
|
@@ -0,0 +1,216 @@
|
|
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 AchCardResponseVO
|
17
|
+
attr_accessor :message
|
18
|
+
|
19
|
+
attr_accessor :nucleus_funding_id
|
20
|
+
|
21
|
+
attr_accessor :status
|
22
|
+
|
23
|
+
attr_accessor :vendor_name
|
24
|
+
|
25
|
+
attr_accessor :vendor_response
|
26
|
+
|
27
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
28
|
+
def self.attribute_map
|
29
|
+
{
|
30
|
+
:'message' => :'message',
|
31
|
+
:'nucleus_funding_id' => :'nucleus_funding_id',
|
32
|
+
:'status' => :'status',
|
33
|
+
:'vendor_name' => :'vendor_name',
|
34
|
+
:'vendor_response' => :'vendor_response'
|
35
|
+
}
|
36
|
+
end
|
37
|
+
|
38
|
+
# Attribute type mapping.
|
39
|
+
def self.swagger_types
|
40
|
+
{
|
41
|
+
:'message' => :'String',
|
42
|
+
:'nucleus_funding_id' => :'String',
|
43
|
+
:'status' => :'String',
|
44
|
+
:'vendor_name' => :'String',
|
45
|
+
:'vendor_response' => :'Object'
|
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?(:'message')
|
58
|
+
self.message = attributes[:'message']
|
59
|
+
end
|
60
|
+
|
61
|
+
if attributes.has_key?(:'nucleus_funding_id')
|
62
|
+
self.nucleus_funding_id = attributes[:'nucleus_funding_id']
|
63
|
+
end
|
64
|
+
|
65
|
+
if attributes.has_key?(:'status')
|
66
|
+
self.status = attributes[:'status']
|
67
|
+
end
|
68
|
+
|
69
|
+
if attributes.has_key?(:'vendor_name')
|
70
|
+
self.vendor_name = attributes[:'vendor_name']
|
71
|
+
end
|
72
|
+
|
73
|
+
if attributes.has_key?(:'vendor_response')
|
74
|
+
self.vendor_response = attributes[:'vendor_response']
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
79
|
+
# @return Array for valid properties with the reasons
|
80
|
+
def list_invalid_properties
|
81
|
+
invalid_properties = Array.new
|
82
|
+
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
|
+
true
|
89
|
+
end
|
90
|
+
|
91
|
+
# Checks equality by comparing each attribute.
|
92
|
+
# @param [Object] Object to be compared
|
93
|
+
def ==(o)
|
94
|
+
return true if self.equal?(o)
|
95
|
+
self.class == o.class &&
|
96
|
+
message == o.message &&
|
97
|
+
nucleus_funding_id == o.nucleus_funding_id &&
|
98
|
+
status == o.status &&
|
99
|
+
vendor_name == o.vendor_name &&
|
100
|
+
vendor_response == o.vendor_response
|
101
|
+
end
|
102
|
+
|
103
|
+
# @see the `==` method
|
104
|
+
# @param [Object] Object to be compared
|
105
|
+
def eql?(o)
|
106
|
+
self == o
|
107
|
+
end
|
108
|
+
|
109
|
+
# Calculates hash code according to all attributes.
|
110
|
+
# @return [Fixnum] Hash code
|
111
|
+
def hash
|
112
|
+
[message, nucleus_funding_id, status, vendor_name, vendor_response].hash
|
113
|
+
end
|
114
|
+
|
115
|
+
# Builds the object from hash
|
116
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
117
|
+
# @return [Object] Returns the model itself
|
118
|
+
def build_from_hash(attributes)
|
119
|
+
self.class.swagger_types.each_pair do |key, type|
|
120
|
+
if type =~ /\AArray<(.*)>/i
|
121
|
+
# check to ensure the input is an array given that the attribute
|
122
|
+
# is documented as an array but the input is not
|
123
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
124
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
125
|
+
end
|
126
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
127
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
128
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
129
|
+
end
|
130
|
+
|
131
|
+
self
|
132
|
+
end
|
133
|
+
|
134
|
+
# Deserializes the data based on type
|
135
|
+
# @param string type Data type
|
136
|
+
# @param string value Value to be deserialized
|
137
|
+
# @return [Object] Deserialized data
|
138
|
+
def _deserialize(type, value)
|
139
|
+
case type.to_sym
|
140
|
+
when :DateTime
|
141
|
+
value
|
142
|
+
when :Date
|
143
|
+
value
|
144
|
+
when :String
|
145
|
+
value.to_s
|
146
|
+
when :Integer
|
147
|
+
value.to_i
|
148
|
+
when :Float
|
149
|
+
value.to_f
|
150
|
+
when :BOOLEAN
|
151
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
152
|
+
true
|
153
|
+
else
|
154
|
+
false
|
155
|
+
end
|
156
|
+
when :Object
|
157
|
+
# generic object (usually a Hash), return directly
|
158
|
+
value
|
159
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
160
|
+
inner_type = Regexp.last_match[:inner_type]
|
161
|
+
value.map { |v| _deserialize(inner_type, v) }
|
162
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
163
|
+
k_type = Regexp.last_match[:k_type]
|
164
|
+
v_type = Regexp.last_match[:v_type]
|
165
|
+
{}.tap do |hash|
|
166
|
+
value.each do |k, v|
|
167
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
168
|
+
end
|
169
|
+
end
|
170
|
+
else # model
|
171
|
+
temp_model = ElectronApi.const_get(type).new
|
172
|
+
temp_model.build_from_hash(value)
|
173
|
+
end
|
174
|
+
end
|
175
|
+
|
176
|
+
# Returns the string representation of the object
|
177
|
+
# @return [String] String presentation of the object
|
178
|
+
def to_s
|
179
|
+
to_hash.to_s
|
180
|
+
end
|
181
|
+
|
182
|
+
# to_body is an alias to to_hash (backward compatibility)
|
183
|
+
# @return [Hash] Returns the object in the form of hash
|
184
|
+
def to_body
|
185
|
+
to_hash
|
186
|
+
end
|
187
|
+
|
188
|
+
# Returns the object in the form of hash
|
189
|
+
# @return [Hash] Returns the object in the form of hash
|
190
|
+
def to_hash
|
191
|
+
hash = {}
|
192
|
+
self.class.attribute_map.each_pair do |attr, param|
|
193
|
+
value = self.send(attr)
|
194
|
+
hash[param] = _to_hash(value)
|
195
|
+
end
|
196
|
+
hash
|
197
|
+
end# Outputs non-array value in the form of hash
|
198
|
+
# For object, use to_hash. Otherwise, just return the value
|
199
|
+
# @param [Object] value Any valid value
|
200
|
+
# @return [Hash] Returns the value in the form of hash
|
201
|
+
def _to_hash(value)
|
202
|
+
if value.is_a?(Array)
|
203
|
+
value.compact.map { |v| _to_hash(v) }
|
204
|
+
elsif value.is_a?(Hash)
|
205
|
+
{}.tap do |hash|
|
206
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
207
|
+
end
|
208
|
+
elsif value.respond_to? :to_hash
|
209
|
+
value.to_hash
|
210
|
+
else
|
211
|
+
value
|
212
|
+
end
|
213
|
+
end
|
214
|
+
|
215
|
+
end
|
216
|
+
end
|