crypto_apis 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -10
  3. data/docs/AssetsApi.md +1 -1
  4. data/docs/AutomaticCoinsForwardingApi.md +1 -1
  5. data/docs/AutomaticTokensForwardingApi.md +1 -1
  6. data/docs/GetBlockDetailsByBlockHashRIBS.md +0 -2
  7. data/docs/GetBlockDetailsByBlockHeightRIBS.md +0 -2
  8. data/docs/GetLatestMinedBlockRIBS.md +0 -2
  9. data/docs/GetTransactionDetailsByTransactionIDRIBS.md +0 -2
  10. data/docs/InformativeApi.md +1 -1
  11. data/docs/InternalApi.md +1 -1
  12. data/docs/ListTransactionsByAddressRIBS.md +0 -2
  13. data/docs/ListTransactionsByBlockHashRIBS.md +0 -2
  14. data/docs/ListTransactionsByBlockHeightRIBS.md +0 -2
  15. data/docs/ManageSubscriptionsApi.md +1 -1
  16. data/docs/MetadataApi.md +1 -1
  17. data/docs/OmniLayerApi.md +6 -6
  18. data/docs/TokensApi.md +3 -3
  19. data/docs/UTXOBasedApi.md +1 -1
  20. data/docs/UnifiedEndpointsApi.md +3 -3
  21. data/docs/XRPRippleApi.md +3 -3
  22. data/docs/ZilliqaApi.md +3 -3
  23. data/lib/crypto_apis.rb +0 -9
  24. data/lib/crypto_apis/api/assets_api.rb +2 -2
  25. data/lib/crypto_apis/api/automatic_coins_forwarding_api.rb +2 -2
  26. data/lib/crypto_apis/api/automatic_tokens_forwarding_api.rb +2 -2
  27. data/lib/crypto_apis/api/create_subscriptions_for_api.rb +8 -8
  28. data/lib/crypto_apis/api/informative_api.rb +2 -2
  29. data/lib/crypto_apis/api/internal_api.rb +2 -2
  30. data/lib/crypto_apis/api/manage_subscriptions_api.rb +2 -2
  31. data/lib/crypto_apis/api/metadata_api.rb +2 -2
  32. data/lib/crypto_apis/api/omni_layer_api.rb +12 -12
  33. data/lib/crypto_apis/api/tokens_api.rb +6 -6
  34. data/lib/crypto_apis/api/unified_endpoints_api.rb +14 -14
  35. data/lib/crypto_apis/api/utxo_based_api.rb +2 -2
  36. data/lib/crypto_apis/api/xrp_ripple_api.rb +6 -6
  37. data/lib/crypto_apis/api/zilliqa_api.rb +6 -6
  38. data/lib/crypto_apis/models/get_block_details_by_block_hash_ribs.rb +0 -1
  39. data/lib/crypto_apis/models/get_block_details_by_block_height_ribs.rb +0 -1
  40. data/lib/crypto_apis/models/get_latest_mined_block_ribs.rb +0 -1
  41. data/lib/crypto_apis/models/get_transaction_details_by_transaction_idribs.rb +0 -1
  42. data/lib/crypto_apis/models/list_transactions_by_address_ribs.rb +0 -1
  43. data/lib/crypto_apis/models/list_transactions_by_block_hash_ribs.rb +0 -1
  44. data/lib/crypto_apis/models/list_transactions_by_block_height_ribs.rb +0 -1
  45. data/lib/crypto_apis/version.rb +1 -1
  46. data/spec/api/assets_api_spec.rb +1 -1
  47. data/spec/api/automatic_coins_forwarding_api_spec.rb +1 -1
  48. data/spec/api/automatic_tokens_forwarding_api_spec.rb +1 -1
  49. data/spec/api/informative_api_spec.rb +1 -1
  50. data/spec/api/internal_api_spec.rb +1 -1
  51. data/spec/api/manage_subscriptions_api_spec.rb +1 -1
  52. data/spec/api/metadata_api_spec.rb +1 -1
  53. data/spec/api/omni_layer_api_spec.rb +6 -6
  54. data/spec/api/tokens_api_spec.rb +3 -3
  55. data/spec/api/unified_endpoints_api_spec.rb +3 -3
  56. data/spec/api/utxo_based_api_spec.rb +1 -1
  57. data/spec/api/xrp_ripple_api_spec.rb +3 -3
  58. data/spec/api/zilliqa_api_spec.rb +3 -3
  59. metadata +2 -38
  60. data/docs/GetBlockDetailsByBlockHashRIBSBSC.md +0 -36
  61. data/docs/GetBlockDetailsByBlockHeightRIBSBSC.md +0 -34
  62. data/docs/GetLatestMinedBlockRIBSBSC.md +0 -34
  63. data/docs/GetTransactionDetailsByTransactionIDRIBSBSC.md +0 -28
  64. data/docs/GetTransactionDetailsByTransactionIDRIBSBSCGasPrice.md +0 -20
  65. data/docs/ListTransactionsByAddressRIBSBSC.md +0 -30
  66. data/docs/ListTransactionsByBlockHashRIBSBSC.md +0 -30
  67. data/docs/ListTransactionsByBlockHeightRIBSBSC.md +0 -28
  68. data/docs/ListTransactionsByBlockHeightRIBSBSCGasPrice.md +0 -20
  69. data/lib/crypto_apis/models/get_block_details_by_block_hash_ribsbsc.rb +0 -361
  70. data/lib/crypto_apis/models/get_block_details_by_block_height_ribsbsc.rb +0 -345
  71. data/lib/crypto_apis/models/get_latest_mined_block_ribsbsc.rb +0 -345
  72. data/lib/crypto_apis/models/get_transaction_details_by_transaction_idribsbsc.rb +0 -299
  73. data/lib/crypto_apis/models/get_transaction_details_by_transaction_idribsbsc_gas_price.rb +0 -238
  74. data/lib/crypto_apis/models/list_transactions_by_address_ribsbsc.rb +0 -314
  75. data/lib/crypto_apis/models/list_transactions_by_block_hash_ribsbsc.rb +0 -314
  76. data/lib/crypto_apis/models/list_transactions_by_block_height_ribsbsc.rb +0 -299
  77. data/lib/crypto_apis/models/list_transactions_by_block_height_ribsbsc_gas_price.rb +0 -238
  78. data/spec/models/get_block_details_by_block_hash_ribsbsc_spec.rb +0 -88
  79. data/spec/models/get_block_details_by_block_height_ribsbsc_spec.rb +0 -82
  80. data/spec/models/get_latest_mined_block_ribsbsc_spec.rb +0 -82
  81. data/spec/models/get_transaction_details_by_transaction_idribsbsc_gas_price_spec.rb +0 -40
  82. data/spec/models/get_transaction_details_by_transaction_idribsbsc_spec.rb +0 -64
  83. data/spec/models/list_transactions_by_address_ribsbsc_spec.rb +0 -70
  84. data/spec/models/list_transactions_by_block_hash_ribsbsc_spec.rb +0 -70
  85. data/spec/models/list_transactions_by_block_height_ribsbsc_gas_price_spec.rb +0 -40
  86. data/spec/models/list_transactions_by_block_height_ribsbsc_spec.rb +0 -64
@@ -1,299 +0,0 @@
1
- =begin
2
- #CryptoAPIs
3
-
4
- #Crypto APIs 2.0 is a complex and innovative infrastructure layer that radically simplifies the development of any Blockchain and Crypto related applications. Organized around REST, Crypto APIs 2.0 can assist both novice Bitcoin/Ethereum enthusiasts and crypto experts with the development of their blockchain applications. Crypto APIs 2.0 provides unified endpoints and data, raw data, automatic tokens and coins forwardings, callback functionalities, and much more.
5
-
6
- The version of the OpenAPI document: 2.0.0
7
- Contact: developers@cryptoapis.io
8
- Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.2.1-SNAPSHOT
10
-
11
- =end
12
-
13
- require 'date'
14
- require 'time'
15
-
16
- module CryptoApis
17
- # Binance Smart Chain
18
- class ListTransactionsByBlockHeightRIBSBSC
19
- # Numeric representation of the transaction contract
20
- attr_accessor :contract
21
-
22
- # String representation of the transaction gas
23
- attr_accessor :gas_limit
24
-
25
- attr_accessor :gas_price
26
-
27
- # Numeric representation of the transaction gas used
28
- attr_accessor :gas_used
29
-
30
- # Numeric representation of the transaction input
31
- attr_accessor :input_data
32
-
33
- # Numeric representation of the transaction nonce
34
- attr_accessor :nonce
35
-
36
- # Attribute mapping from ruby-style variable name to JSON key.
37
- def self.attribute_map
38
- {
39
- :'contract' => :'contract',
40
- :'gas_limit' => :'gasLimit',
41
- :'gas_price' => :'gasPrice',
42
- :'gas_used' => :'gasUsed',
43
- :'input_data' => :'inputData',
44
- :'nonce' => :'nonce'
45
- }
46
- end
47
-
48
- # Returns all the JSON keys this model knows about
49
- def self.acceptable_attributes
50
- attribute_map.values
51
- end
52
-
53
- # Attribute type mapping.
54
- def self.openapi_types
55
- {
56
- :'contract' => :'String',
57
- :'gas_limit' => :'String',
58
- :'gas_price' => :'ListTransactionsByBlockHeightRIBSBSCGasPrice',
59
- :'gas_used' => :'String',
60
- :'input_data' => :'String',
61
- :'nonce' => :'String'
62
- }
63
- end
64
-
65
- # List of attributes with nullable: true
66
- def self.openapi_nullable
67
- Set.new([
68
- ])
69
- end
70
-
71
- # Initializes the object
72
- # @param [Hash] attributes Model attributes in the form of hash
73
- def initialize(attributes = {})
74
- if (!attributes.is_a?(Hash))
75
- fail ArgumentError, "The input argument (attributes) must be a hash in `CryptoApis::ListTransactionsByBlockHeightRIBSBSC` initialize method"
76
- end
77
-
78
- # check to see if the attribute exists and convert string to symbol for hash key
79
- attributes = attributes.each_with_object({}) { |(k, v), h|
80
- if (!self.class.attribute_map.key?(k.to_sym))
81
- fail ArgumentError, "`#{k}` is not a valid attribute in `CryptoApis::ListTransactionsByBlockHeightRIBSBSC`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
82
- end
83
- h[k.to_sym] = v
84
- }
85
-
86
- if attributes.key?(:'contract')
87
- self.contract = attributes[:'contract']
88
- end
89
-
90
- if attributes.key?(:'gas_limit')
91
- self.gas_limit = attributes[:'gas_limit']
92
- end
93
-
94
- if attributes.key?(:'gas_price')
95
- self.gas_price = attributes[:'gas_price']
96
- end
97
-
98
- if attributes.key?(:'gas_used')
99
- self.gas_used = attributes[:'gas_used']
100
- end
101
-
102
- if attributes.key?(:'input_data')
103
- self.input_data = attributes[:'input_data']
104
- end
105
-
106
- if attributes.key?(:'nonce')
107
- self.nonce = attributes[:'nonce']
108
- end
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 @contract.nil?
116
- invalid_properties.push('invalid value for "contract", contract cannot be nil.')
117
- end
118
-
119
- if @gas_limit.nil?
120
- invalid_properties.push('invalid value for "gas_limit", gas_limit cannot be nil.')
121
- end
122
-
123
- if @gas_price.nil?
124
- invalid_properties.push('invalid value for "gas_price", gas_price cannot be nil.')
125
- end
126
-
127
- if @gas_used.nil?
128
- invalid_properties.push('invalid value for "gas_used", gas_used cannot be nil.')
129
- end
130
-
131
- if @input_data.nil?
132
- invalid_properties.push('invalid value for "input_data", input_data cannot be nil.')
133
- end
134
-
135
- if @nonce.nil?
136
- invalid_properties.push('invalid value for "nonce", nonce cannot be nil.')
137
- end
138
-
139
- invalid_properties
140
- end
141
-
142
- # Check to see if the all the properties in the model are valid
143
- # @return true if the model is valid
144
- def valid?
145
- return false if @contract.nil?
146
- return false if @gas_limit.nil?
147
- return false if @gas_price.nil?
148
- return false if @gas_used.nil?
149
- return false if @input_data.nil?
150
- return false if @nonce.nil?
151
- true
152
- end
153
-
154
- # Checks equality by comparing each attribute.
155
- # @param [Object] Object to be compared
156
- def ==(o)
157
- return true if self.equal?(o)
158
- self.class == o.class &&
159
- contract == o.contract &&
160
- gas_limit == o.gas_limit &&
161
- gas_price == o.gas_price &&
162
- gas_used == o.gas_used &&
163
- input_data == o.input_data &&
164
- nonce == o.nonce
165
- end
166
-
167
- # @see the `==` method
168
- # @param [Object] Object to be compared
169
- def eql?(o)
170
- self == o
171
- end
172
-
173
- # Calculates hash code according to all attributes.
174
- # @return [Integer] Hash code
175
- def hash
176
- [contract, gas_limit, gas_price, gas_used, input_data, nonce].hash
177
- end
178
-
179
- # Builds the object from hash
180
- # @param [Hash] attributes Model attributes in the form of hash
181
- # @return [Object] Returns the model itself
182
- def self.build_from_hash(attributes)
183
- new.build_from_hash(attributes)
184
- end
185
-
186
- # Builds the object from hash
187
- # @param [Hash] attributes Model attributes in the form of hash
188
- # @return [Object] Returns the model itself
189
- def build_from_hash(attributes)
190
- return nil unless attributes.is_a?(Hash)
191
- self.class.openapi_types.each_pair do |key, type|
192
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
193
- self.send("#{key}=", nil)
194
- elsif type =~ /\AArray<(.*)>/i
195
- # check to ensure the input is an array given that the attribute
196
- # is documented as an array but the input is not
197
- if attributes[self.class.attribute_map[key]].is_a?(Array)
198
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
199
- end
200
- elsif !attributes[self.class.attribute_map[key]].nil?
201
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
202
- end
203
- end
204
-
205
- self
206
- end
207
-
208
- # Deserializes the data based on type
209
- # @param string type Data type
210
- # @param string value Value to be deserialized
211
- # @return [Object] Deserialized data
212
- def _deserialize(type, value)
213
- case type.to_sym
214
- when :Time
215
- Time.parse(value)
216
- when :Date
217
- Date.parse(value)
218
- when :String
219
- value.to_s
220
- when :Integer
221
- value.to_i
222
- when :Float
223
- value.to_f
224
- when :Boolean
225
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
226
- true
227
- else
228
- false
229
- end
230
- when :Object
231
- # generic object (usually a Hash), return directly
232
- value
233
- when /\AArray<(?<inner_type>.+)>\z/
234
- inner_type = Regexp.last_match[:inner_type]
235
- value.map { |v| _deserialize(inner_type, v) }
236
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
237
- k_type = Regexp.last_match[:k_type]
238
- v_type = Regexp.last_match[:v_type]
239
- {}.tap do |hash|
240
- value.each do |k, v|
241
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
242
- end
243
- end
244
- else # model
245
- # models (e.g. Pet) or oneOf
246
- klass = CryptoApis.const_get(type)
247
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
248
- end
249
- end
250
-
251
- # Returns the string representation of the object
252
- # @return [String] String presentation of the object
253
- def to_s
254
- to_hash.to_s
255
- end
256
-
257
- # to_body is an alias to to_hash (backward compatibility)
258
- # @return [Hash] Returns the object in the form of hash
259
- def to_body
260
- to_hash
261
- end
262
-
263
- # Returns the object in the form of hash
264
- # @return [Hash] Returns the object in the form of hash
265
- def to_hash
266
- hash = {}
267
- self.class.attribute_map.each_pair do |attr, param|
268
- value = self.send(attr)
269
- if value.nil?
270
- is_nullable = self.class.openapi_nullable.include?(attr)
271
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
272
- end
273
-
274
- hash[param] = _to_hash(value)
275
- end
276
- hash
277
- end
278
-
279
- # Outputs non-array value in the form of hash
280
- # For object, use to_hash. Otherwise, just return the value
281
- # @param [Object] value Any valid value
282
- # @return [Hash] Returns the value in the form of hash
283
- def _to_hash(value)
284
- if value.is_a?(Array)
285
- value.compact.map { |v| _to_hash(v) }
286
- elsif value.is_a?(Hash)
287
- {}.tap do |hash|
288
- value.each { |k, v| hash[k] = _to_hash(v) }
289
- end
290
- elsif value.respond_to? :to_hash
291
- value.to_hash
292
- else
293
- value
294
- end
295
- end
296
-
297
- end
298
-
299
- end
@@ -1,238 +0,0 @@
1
- =begin
2
- #CryptoAPIs
3
-
4
- #Crypto APIs 2.0 is a complex and innovative infrastructure layer that radically simplifies the development of any Blockchain and Crypto related applications. Organized around REST, Crypto APIs 2.0 can assist both novice Bitcoin/Ethereum enthusiasts and crypto experts with the development of their blockchain applications. Crypto APIs 2.0 provides unified endpoints and data, raw data, automatic tokens and coins forwardings, callback functionalities, and much more.
5
-
6
- The version of the OpenAPI document: 2.0.0
7
- Contact: developers@cryptoapis.io
8
- Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.2.1-SNAPSHOT
10
-
11
- =end
12
-
13
- require 'date'
14
- require 'time'
15
-
16
- module CryptoApis
17
- class ListTransactionsByBlockHeightRIBSBSCGasPrice
18
- # Numeric representation of the transaction gas price
19
- attr_accessor :amount
20
-
21
- attr_accessor :unit
22
-
23
- # Attribute mapping from ruby-style variable name to JSON key.
24
- def self.attribute_map
25
- {
26
- :'amount' => :'amount',
27
- :'unit' => :'unit'
28
- }
29
- end
30
-
31
- # Returns all the JSON keys this model knows about
32
- def self.acceptable_attributes
33
- attribute_map.values
34
- end
35
-
36
- # Attribute type mapping.
37
- def self.openapi_types
38
- {
39
- :'amount' => :'String',
40
- :'unit' => :'String'
41
- }
42
- end
43
-
44
- # List of attributes with nullable: true
45
- def self.openapi_nullable
46
- Set.new([
47
- ])
48
- end
49
-
50
- # Initializes the object
51
- # @param [Hash] attributes Model attributes in the form of hash
52
- def initialize(attributes = {})
53
- if (!attributes.is_a?(Hash))
54
- fail ArgumentError, "The input argument (attributes) must be a hash in `CryptoApis::ListTransactionsByBlockHeightRIBSBSCGasPrice` initialize method"
55
- end
56
-
57
- # check to see if the attribute exists and convert string to symbol for hash key
58
- attributes = attributes.each_with_object({}) { |(k, v), h|
59
- if (!self.class.attribute_map.key?(k.to_sym))
60
- fail ArgumentError, "`#{k}` is not a valid attribute in `CryptoApis::ListTransactionsByBlockHeightRIBSBSCGasPrice`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
61
- end
62
- h[k.to_sym] = v
63
- }
64
-
65
- if attributes.key?(:'amount')
66
- self.amount = attributes[:'amount']
67
- end
68
-
69
- if attributes.key?(:'unit')
70
- self.unit = attributes[:'unit']
71
- end
72
- end
73
-
74
- # Show invalid properties with the reasons. Usually used together with valid?
75
- # @return Array for valid properties with the reasons
76
- def list_invalid_properties
77
- invalid_properties = Array.new
78
- if @amount.nil?
79
- invalid_properties.push('invalid value for "amount", amount cannot be nil.')
80
- end
81
-
82
- if @unit.nil?
83
- invalid_properties.push('invalid value for "unit", unit cannot be nil.')
84
- end
85
-
86
- invalid_properties
87
- end
88
-
89
- # Check to see if the all the properties in the model are valid
90
- # @return true if the model is valid
91
- def valid?
92
- return false if @amount.nil?
93
- return false if @unit.nil?
94
- true
95
- end
96
-
97
- # Checks equality by comparing each attribute.
98
- # @param [Object] Object to be compared
99
- def ==(o)
100
- return true if self.equal?(o)
101
- self.class == o.class &&
102
- amount == o.amount &&
103
- unit == o.unit
104
- end
105
-
106
- # @see the `==` method
107
- # @param [Object] Object to be compared
108
- def eql?(o)
109
- self == o
110
- end
111
-
112
- # Calculates hash code according to all attributes.
113
- # @return [Integer] Hash code
114
- def hash
115
- [amount, unit].hash
116
- end
117
-
118
- # Builds the object from hash
119
- # @param [Hash] attributes Model attributes in the form of hash
120
- # @return [Object] Returns the model itself
121
- def self.build_from_hash(attributes)
122
- new.build_from_hash(attributes)
123
- end
124
-
125
- # Builds the object from hash
126
- # @param [Hash] attributes Model attributes in the form of hash
127
- # @return [Object] Returns the model itself
128
- def build_from_hash(attributes)
129
- return nil unless attributes.is_a?(Hash)
130
- self.class.openapi_types.each_pair do |key, type|
131
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
132
- self.send("#{key}=", nil)
133
- elsif type =~ /\AArray<(.*)>/i
134
- # check to ensure the input is an array given that the attribute
135
- # is documented as an array but the input is not
136
- if attributes[self.class.attribute_map[key]].is_a?(Array)
137
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
138
- end
139
- elsif !attributes[self.class.attribute_map[key]].nil?
140
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
141
- end
142
- end
143
-
144
- self
145
- end
146
-
147
- # Deserializes the data based on type
148
- # @param string type Data type
149
- # @param string value Value to be deserialized
150
- # @return [Object] Deserialized data
151
- def _deserialize(type, value)
152
- case type.to_sym
153
- when :Time
154
- Time.parse(value)
155
- when :Date
156
- Date.parse(value)
157
- when :String
158
- value.to_s
159
- when :Integer
160
- value.to_i
161
- when :Float
162
- value.to_f
163
- when :Boolean
164
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
165
- true
166
- else
167
- false
168
- end
169
- when :Object
170
- # generic object (usually a Hash), return directly
171
- value
172
- when /\AArray<(?<inner_type>.+)>\z/
173
- inner_type = Regexp.last_match[:inner_type]
174
- value.map { |v| _deserialize(inner_type, v) }
175
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
176
- k_type = Regexp.last_match[:k_type]
177
- v_type = Regexp.last_match[:v_type]
178
- {}.tap do |hash|
179
- value.each do |k, v|
180
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
181
- end
182
- end
183
- else # model
184
- # models (e.g. Pet) or oneOf
185
- klass = CryptoApis.const_get(type)
186
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
187
- end
188
- end
189
-
190
- # Returns the string representation of the object
191
- # @return [String] String presentation of the object
192
- def to_s
193
- to_hash.to_s
194
- end
195
-
196
- # to_body is an alias to to_hash (backward compatibility)
197
- # @return [Hash] Returns the object in the form of hash
198
- def to_body
199
- to_hash
200
- end
201
-
202
- # Returns the object in the form of hash
203
- # @return [Hash] Returns the object in the form of hash
204
- def to_hash
205
- hash = {}
206
- self.class.attribute_map.each_pair do |attr, param|
207
- value = self.send(attr)
208
- if value.nil?
209
- is_nullable = self.class.openapi_nullable.include?(attr)
210
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
211
- end
212
-
213
- hash[param] = _to_hash(value)
214
- end
215
- hash
216
- end
217
-
218
- # Outputs non-array value in the form of hash
219
- # For object, use to_hash. Otherwise, just return the value
220
- # @param [Object] value Any valid value
221
- # @return [Hash] Returns the value in the form of hash
222
- def _to_hash(value)
223
- if value.is_a?(Array)
224
- value.compact.map { |v| _to_hash(v) }
225
- elsif value.is_a?(Hash)
226
- {}.tap do |hash|
227
- value.each { |k, v| hash[k] = _to_hash(v) }
228
- end
229
- elsif value.respond_to? :to_hash
230
- value.to_hash
231
- else
232
- value
233
- end
234
- end
235
-
236
- end
237
-
238
- end