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