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,345 +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 GetBlockDetailsByBlockHeightRIBSBSC
19
- # Represents a mathematical value of how hard it is to find a valid hash for this block.
20
- attr_accessor :difficulty
21
-
22
- # Represents a random value that can be adjusted to satisfy the Proof of Work
23
- attr_accessor :nonce
24
-
25
- # Represents the total size of the block in Bytes.
26
- attr_accessor :size
27
-
28
- # Numeric representation of the block extra data
29
- attr_accessor :extra_data
30
-
31
- # Numeric representation of the block gas limit
32
- attr_accessor :gas_limit
33
-
34
- # Numeric representation of the block gas used
35
- attr_accessor :gas_used
36
-
37
- # Numeric representation of the block gas limit
38
- attr_accessor :mined_in_seconds
39
-
40
- # Numeric representation of the block sha3 uncles
41
- attr_accessor :sha3_uncles
42
-
43
- # Numeric representation of the block total difficulty
44
- attr_accessor :total_difficulty
45
-
46
- # Attribute mapping from ruby-style variable name to JSON key.
47
- def self.attribute_map
48
- {
49
- :'difficulty' => :'difficulty',
50
- :'nonce' => :'nonce',
51
- :'size' => :'size',
52
- :'extra_data' => :'extraData',
53
- :'gas_limit' => :'gasLimit',
54
- :'gas_used' => :'gasUsed',
55
- :'mined_in_seconds' => :'minedInSeconds',
56
- :'sha3_uncles' => :'sha3Uncles',
57
- :'total_difficulty' => :'totalDifficulty'
58
- }
59
- end
60
-
61
- # Returns all the JSON keys this model knows about
62
- def self.acceptable_attributes
63
- attribute_map.values
64
- end
65
-
66
- # Attribute type mapping.
67
- def self.openapi_types
68
- {
69
- :'difficulty' => :'String',
70
- :'nonce' => :'Integer',
71
- :'size' => :'Integer',
72
- :'extra_data' => :'String',
73
- :'gas_limit' => :'String',
74
- :'gas_used' => :'String',
75
- :'mined_in_seconds' => :'String',
76
- :'sha3_uncles' => :'String',
77
- :'total_difficulty' => :'String'
78
- }
79
- end
80
-
81
- # List of attributes with nullable: true
82
- def self.openapi_nullable
83
- Set.new([
84
- ])
85
- end
86
-
87
- # Initializes the object
88
- # @param [Hash] attributes Model attributes in the form of hash
89
- def initialize(attributes = {})
90
- if (!attributes.is_a?(Hash))
91
- fail ArgumentError, "The input argument (attributes) must be a hash in `CryptoApis::GetBlockDetailsByBlockHeightRIBSBSC` initialize method"
92
- end
93
-
94
- # check to see if the attribute exists and convert string to symbol for hash key
95
- attributes = attributes.each_with_object({}) { |(k, v), h|
96
- if (!self.class.attribute_map.key?(k.to_sym))
97
- fail ArgumentError, "`#{k}` is not a valid attribute in `CryptoApis::GetBlockDetailsByBlockHeightRIBSBSC`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
98
- end
99
- h[k.to_sym] = v
100
- }
101
-
102
- if attributes.key?(:'difficulty')
103
- self.difficulty = attributes[:'difficulty']
104
- end
105
-
106
- if attributes.key?(:'nonce')
107
- self.nonce = attributes[:'nonce']
108
- end
109
-
110
- if attributes.key?(:'size')
111
- self.size = attributes[:'size']
112
- end
113
-
114
- if attributes.key?(:'extra_data')
115
- self.extra_data = attributes[:'extra_data']
116
- end
117
-
118
- if attributes.key?(:'gas_limit')
119
- self.gas_limit = attributes[:'gas_limit']
120
- end
121
-
122
- if attributes.key?(:'gas_used')
123
- self.gas_used = attributes[:'gas_used']
124
- end
125
-
126
- if attributes.key?(:'mined_in_seconds')
127
- self.mined_in_seconds = attributes[:'mined_in_seconds']
128
- end
129
-
130
- if attributes.key?(:'sha3_uncles')
131
- self.sha3_uncles = attributes[:'sha3_uncles']
132
- end
133
-
134
- if attributes.key?(:'total_difficulty')
135
- self.total_difficulty = attributes[:'total_difficulty']
136
- end
137
- end
138
-
139
- # Show invalid properties with the reasons. Usually used together with valid?
140
- # @return Array for valid properties with the reasons
141
- def list_invalid_properties
142
- invalid_properties = Array.new
143
- if @difficulty.nil?
144
- invalid_properties.push('invalid value for "difficulty", difficulty cannot be nil.')
145
- end
146
-
147
- if @nonce.nil?
148
- invalid_properties.push('invalid value for "nonce", nonce cannot be nil.')
149
- end
150
-
151
- if @size.nil?
152
- invalid_properties.push('invalid value for "size", size cannot be nil.')
153
- end
154
-
155
- if @extra_data.nil?
156
- invalid_properties.push('invalid value for "extra_data", extra_data cannot be nil.')
157
- end
158
-
159
- if @gas_limit.nil?
160
- invalid_properties.push('invalid value for "gas_limit", gas_limit cannot be nil.')
161
- end
162
-
163
- if @gas_used.nil?
164
- invalid_properties.push('invalid value for "gas_used", gas_used cannot be nil.')
165
- end
166
-
167
- if @mined_in_seconds.nil?
168
- invalid_properties.push('invalid value for "mined_in_seconds", mined_in_seconds cannot be nil.')
169
- end
170
-
171
- if @sha3_uncles.nil?
172
- invalid_properties.push('invalid value for "sha3_uncles", sha3_uncles cannot be nil.')
173
- end
174
-
175
- if @total_difficulty.nil?
176
- invalid_properties.push('invalid value for "total_difficulty", total_difficulty cannot be nil.')
177
- end
178
-
179
- invalid_properties
180
- end
181
-
182
- # Check to see if the all the properties in the model are valid
183
- # @return true if the model is valid
184
- def valid?
185
- return false if @difficulty.nil?
186
- return false if @nonce.nil?
187
- return false if @size.nil?
188
- return false if @extra_data.nil?
189
- return false if @gas_limit.nil?
190
- return false if @gas_used.nil?
191
- return false if @mined_in_seconds.nil?
192
- return false if @sha3_uncles.nil?
193
- return false if @total_difficulty.nil?
194
- true
195
- end
196
-
197
- # Checks equality by comparing each attribute.
198
- # @param [Object] Object to be compared
199
- def ==(o)
200
- return true if self.equal?(o)
201
- self.class == o.class &&
202
- difficulty == o.difficulty &&
203
- nonce == o.nonce &&
204
- size == o.size &&
205
- extra_data == o.extra_data &&
206
- gas_limit == o.gas_limit &&
207
- gas_used == o.gas_used &&
208
- mined_in_seconds == o.mined_in_seconds &&
209
- sha3_uncles == o.sha3_uncles &&
210
- total_difficulty == o.total_difficulty
211
- end
212
-
213
- # @see the `==` method
214
- # @param [Object] Object to be compared
215
- def eql?(o)
216
- self == o
217
- end
218
-
219
- # Calculates hash code according to all attributes.
220
- # @return [Integer] Hash code
221
- def hash
222
- [difficulty, nonce, size, extra_data, gas_limit, gas_used, mined_in_seconds, sha3_uncles, total_difficulty].hash
223
- end
224
-
225
- # Builds the object from hash
226
- # @param [Hash] attributes Model attributes in the form of hash
227
- # @return [Object] Returns the model itself
228
- def self.build_from_hash(attributes)
229
- new.build_from_hash(attributes)
230
- end
231
-
232
- # Builds the object from hash
233
- # @param [Hash] attributes Model attributes in the form of hash
234
- # @return [Object] Returns the model itself
235
- def build_from_hash(attributes)
236
- return nil unless attributes.is_a?(Hash)
237
- self.class.openapi_types.each_pair do |key, type|
238
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
239
- self.send("#{key}=", nil)
240
- elsif type =~ /\AArray<(.*)>/i
241
- # check to ensure the input is an array given that the attribute
242
- # is documented as an array but the input is not
243
- if attributes[self.class.attribute_map[key]].is_a?(Array)
244
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
245
- end
246
- elsif !attributes[self.class.attribute_map[key]].nil?
247
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
248
- end
249
- end
250
-
251
- self
252
- end
253
-
254
- # Deserializes the data based on type
255
- # @param string type Data type
256
- # @param string value Value to be deserialized
257
- # @return [Object] Deserialized data
258
- def _deserialize(type, value)
259
- case type.to_sym
260
- when :Time
261
- Time.parse(value)
262
- when :Date
263
- Date.parse(value)
264
- when :String
265
- value.to_s
266
- when :Integer
267
- value.to_i
268
- when :Float
269
- value.to_f
270
- when :Boolean
271
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
272
- true
273
- else
274
- false
275
- end
276
- when :Object
277
- # generic object (usually a Hash), return directly
278
- value
279
- when /\AArray<(?<inner_type>.+)>\z/
280
- inner_type = Regexp.last_match[:inner_type]
281
- value.map { |v| _deserialize(inner_type, v) }
282
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
283
- k_type = Regexp.last_match[:k_type]
284
- v_type = Regexp.last_match[:v_type]
285
- {}.tap do |hash|
286
- value.each do |k, v|
287
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
288
- end
289
- end
290
- else # model
291
- # models (e.g. Pet) or oneOf
292
- klass = CryptoApis.const_get(type)
293
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
294
- end
295
- end
296
-
297
- # Returns the string representation of the object
298
- # @return [String] String presentation of the object
299
- def to_s
300
- to_hash.to_s
301
- end
302
-
303
- # to_body is an alias to to_hash (backward compatibility)
304
- # @return [Hash] Returns the object in the form of hash
305
- def to_body
306
- to_hash
307
- end
308
-
309
- # Returns the object in the form of hash
310
- # @return [Hash] Returns the object in the form of hash
311
- def to_hash
312
- hash = {}
313
- self.class.attribute_map.each_pair do |attr, param|
314
- value = self.send(attr)
315
- if value.nil?
316
- is_nullable = self.class.openapi_nullable.include?(attr)
317
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
318
- end
319
-
320
- hash[param] = _to_hash(value)
321
- end
322
- hash
323
- end
324
-
325
- # Outputs non-array value in the form of hash
326
- # For object, use to_hash. Otherwise, just return the value
327
- # @param [Object] value Any valid value
328
- # @return [Hash] Returns the value in the form of hash
329
- def _to_hash(value)
330
- if value.is_a?(Array)
331
- value.compact.map { |v| _to_hash(v) }
332
- elsif value.is_a?(Hash)
333
- {}.tap do |hash|
334
- value.each { |k, v| hash[k] = _to_hash(v) }
335
- end
336
- elsif value.respond_to? :to_hash
337
- value.to_hash
338
- else
339
- value
340
- end
341
- end
342
-
343
- end
344
-
345
- end
@@ -1,345 +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 GetLatestMinedBlockRIBSBSC
19
- # Represents a mathematical value of how hard it is to find a valid hash for this block.
20
- attr_accessor :difficulty
21
-
22
- # Represents a random value that can be adjusted to satisfy the proof of work
23
- attr_accessor :nonce
24
-
25
- # Represents the total size of the block in Bytes.
26
- attr_accessor :size
27
-
28
- # Numeric representation of the block extra data
29
- attr_accessor :extra_data
30
-
31
- # Numeric representation of the block gas limit
32
- attr_accessor :gas_limit
33
-
34
- # Numeric representation of the block gas used
35
- attr_accessor :gas_used
36
-
37
- # Numeric representation of the block gas limit
38
- attr_accessor :mined_in_seconds
39
-
40
- # Numeric representation of the block sha3 uncles
41
- attr_accessor :sha3_uncles
42
-
43
- # Numeric representation of the block total difficulty
44
- attr_accessor :total_difficulty
45
-
46
- # Attribute mapping from ruby-style variable name to JSON key.
47
- def self.attribute_map
48
- {
49
- :'difficulty' => :'difficulty',
50
- :'nonce' => :'nonce',
51
- :'size' => :'size',
52
- :'extra_data' => :'extraData',
53
- :'gas_limit' => :'gasLimit',
54
- :'gas_used' => :'gasUsed',
55
- :'mined_in_seconds' => :'minedInSeconds',
56
- :'sha3_uncles' => :'sha3Uncles',
57
- :'total_difficulty' => :'totalDifficulty'
58
- }
59
- end
60
-
61
- # Returns all the JSON keys this model knows about
62
- def self.acceptable_attributes
63
- attribute_map.values
64
- end
65
-
66
- # Attribute type mapping.
67
- def self.openapi_types
68
- {
69
- :'difficulty' => :'String',
70
- :'nonce' => :'Integer',
71
- :'size' => :'Integer',
72
- :'extra_data' => :'String',
73
- :'gas_limit' => :'String',
74
- :'gas_used' => :'String',
75
- :'mined_in_seconds' => :'Integer',
76
- :'sha3_uncles' => :'String',
77
- :'total_difficulty' => :'String'
78
- }
79
- end
80
-
81
- # List of attributes with nullable: true
82
- def self.openapi_nullable
83
- Set.new([
84
- ])
85
- end
86
-
87
- # Initializes the object
88
- # @param [Hash] attributes Model attributes in the form of hash
89
- def initialize(attributes = {})
90
- if (!attributes.is_a?(Hash))
91
- fail ArgumentError, "The input argument (attributes) must be a hash in `CryptoApis::GetLatestMinedBlockRIBSBSC` initialize method"
92
- end
93
-
94
- # check to see if the attribute exists and convert string to symbol for hash key
95
- attributes = attributes.each_with_object({}) { |(k, v), h|
96
- if (!self.class.attribute_map.key?(k.to_sym))
97
- fail ArgumentError, "`#{k}` is not a valid attribute in `CryptoApis::GetLatestMinedBlockRIBSBSC`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
98
- end
99
- h[k.to_sym] = v
100
- }
101
-
102
- if attributes.key?(:'difficulty')
103
- self.difficulty = attributes[:'difficulty']
104
- end
105
-
106
- if attributes.key?(:'nonce')
107
- self.nonce = attributes[:'nonce']
108
- end
109
-
110
- if attributes.key?(:'size')
111
- self.size = attributes[:'size']
112
- end
113
-
114
- if attributes.key?(:'extra_data')
115
- self.extra_data = attributes[:'extra_data']
116
- end
117
-
118
- if attributes.key?(:'gas_limit')
119
- self.gas_limit = attributes[:'gas_limit']
120
- end
121
-
122
- if attributes.key?(:'gas_used')
123
- self.gas_used = attributes[:'gas_used']
124
- end
125
-
126
- if attributes.key?(:'mined_in_seconds')
127
- self.mined_in_seconds = attributes[:'mined_in_seconds']
128
- end
129
-
130
- if attributes.key?(:'sha3_uncles')
131
- self.sha3_uncles = attributes[:'sha3_uncles']
132
- end
133
-
134
- if attributes.key?(:'total_difficulty')
135
- self.total_difficulty = attributes[:'total_difficulty']
136
- end
137
- end
138
-
139
- # Show invalid properties with the reasons. Usually used together with valid?
140
- # @return Array for valid properties with the reasons
141
- def list_invalid_properties
142
- invalid_properties = Array.new
143
- if @difficulty.nil?
144
- invalid_properties.push('invalid value for "difficulty", difficulty cannot be nil.')
145
- end
146
-
147
- if @nonce.nil?
148
- invalid_properties.push('invalid value for "nonce", nonce cannot be nil.')
149
- end
150
-
151
- if @size.nil?
152
- invalid_properties.push('invalid value for "size", size cannot be nil.')
153
- end
154
-
155
- if @extra_data.nil?
156
- invalid_properties.push('invalid value for "extra_data", extra_data cannot be nil.')
157
- end
158
-
159
- if @gas_limit.nil?
160
- invalid_properties.push('invalid value for "gas_limit", gas_limit cannot be nil.')
161
- end
162
-
163
- if @gas_used.nil?
164
- invalid_properties.push('invalid value for "gas_used", gas_used cannot be nil.')
165
- end
166
-
167
- if @mined_in_seconds.nil?
168
- invalid_properties.push('invalid value for "mined_in_seconds", mined_in_seconds cannot be nil.')
169
- end
170
-
171
- if @sha3_uncles.nil?
172
- invalid_properties.push('invalid value for "sha3_uncles", sha3_uncles cannot be nil.')
173
- end
174
-
175
- if @total_difficulty.nil?
176
- invalid_properties.push('invalid value for "total_difficulty", total_difficulty cannot be nil.')
177
- end
178
-
179
- invalid_properties
180
- end
181
-
182
- # Check to see if the all the properties in the model are valid
183
- # @return true if the model is valid
184
- def valid?
185
- return false if @difficulty.nil?
186
- return false if @nonce.nil?
187
- return false if @size.nil?
188
- return false if @extra_data.nil?
189
- return false if @gas_limit.nil?
190
- return false if @gas_used.nil?
191
- return false if @mined_in_seconds.nil?
192
- return false if @sha3_uncles.nil?
193
- return false if @total_difficulty.nil?
194
- true
195
- end
196
-
197
- # Checks equality by comparing each attribute.
198
- # @param [Object] Object to be compared
199
- def ==(o)
200
- return true if self.equal?(o)
201
- self.class == o.class &&
202
- difficulty == o.difficulty &&
203
- nonce == o.nonce &&
204
- size == o.size &&
205
- extra_data == o.extra_data &&
206
- gas_limit == o.gas_limit &&
207
- gas_used == o.gas_used &&
208
- mined_in_seconds == o.mined_in_seconds &&
209
- sha3_uncles == o.sha3_uncles &&
210
- total_difficulty == o.total_difficulty
211
- end
212
-
213
- # @see the `==` method
214
- # @param [Object] Object to be compared
215
- def eql?(o)
216
- self == o
217
- end
218
-
219
- # Calculates hash code according to all attributes.
220
- # @return [Integer] Hash code
221
- def hash
222
- [difficulty, nonce, size, extra_data, gas_limit, gas_used, mined_in_seconds, sha3_uncles, total_difficulty].hash
223
- end
224
-
225
- # Builds the object from hash
226
- # @param [Hash] attributes Model attributes in the form of hash
227
- # @return [Object] Returns the model itself
228
- def self.build_from_hash(attributes)
229
- new.build_from_hash(attributes)
230
- end
231
-
232
- # Builds the object from hash
233
- # @param [Hash] attributes Model attributes in the form of hash
234
- # @return [Object] Returns the model itself
235
- def build_from_hash(attributes)
236
- return nil unless attributes.is_a?(Hash)
237
- self.class.openapi_types.each_pair do |key, type|
238
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
239
- self.send("#{key}=", nil)
240
- elsif type =~ /\AArray<(.*)>/i
241
- # check to ensure the input is an array given that the attribute
242
- # is documented as an array but the input is not
243
- if attributes[self.class.attribute_map[key]].is_a?(Array)
244
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
245
- end
246
- elsif !attributes[self.class.attribute_map[key]].nil?
247
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
248
- end
249
- end
250
-
251
- self
252
- end
253
-
254
- # Deserializes the data based on type
255
- # @param string type Data type
256
- # @param string value Value to be deserialized
257
- # @return [Object] Deserialized data
258
- def _deserialize(type, value)
259
- case type.to_sym
260
- when :Time
261
- Time.parse(value)
262
- when :Date
263
- Date.parse(value)
264
- when :String
265
- value.to_s
266
- when :Integer
267
- value.to_i
268
- when :Float
269
- value.to_f
270
- when :Boolean
271
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
272
- true
273
- else
274
- false
275
- end
276
- when :Object
277
- # generic object (usually a Hash), return directly
278
- value
279
- when /\AArray<(?<inner_type>.+)>\z/
280
- inner_type = Regexp.last_match[:inner_type]
281
- value.map { |v| _deserialize(inner_type, v) }
282
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
283
- k_type = Regexp.last_match[:k_type]
284
- v_type = Regexp.last_match[:v_type]
285
- {}.tap do |hash|
286
- value.each do |k, v|
287
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
288
- end
289
- end
290
- else # model
291
- # models (e.g. Pet) or oneOf
292
- klass = CryptoApis.const_get(type)
293
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
294
- end
295
- end
296
-
297
- # Returns the string representation of the object
298
- # @return [String] String presentation of the object
299
- def to_s
300
- to_hash.to_s
301
- end
302
-
303
- # to_body is an alias to to_hash (backward compatibility)
304
- # @return [Hash] Returns the object in the form of hash
305
- def to_body
306
- to_hash
307
- end
308
-
309
- # Returns the object in the form of hash
310
- # @return [Hash] Returns the object in the form of hash
311
- def to_hash
312
- hash = {}
313
- self.class.attribute_map.each_pair do |attr, param|
314
- value = self.send(attr)
315
- if value.nil?
316
- is_nullable = self.class.openapi_nullable.include?(attr)
317
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
318
- end
319
-
320
- hash[param] = _to_hash(value)
321
- end
322
- hash
323
- end
324
-
325
- # Outputs non-array value in the form of hash
326
- # For object, use to_hash. Otherwise, just return the value
327
- # @param [Object] value Any valid value
328
- # @return [Hash] Returns the value in the form of hash
329
- def _to_hash(value)
330
- if value.is_a?(Array)
331
- value.compact.map { |v| _to_hash(v) }
332
- elsif value.is_a?(Hash)
333
- {}.tap do |hash|
334
- value.each { |k, v| hash[k] = _to_hash(v) }
335
- end
336
- elsif value.respond_to? :to_hash
337
- value.to_hash
338
- else
339
- value
340
- end
341
- end
342
-
343
- end
344
-
345
- end