crypto_apis 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (205) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +51 -15
  3. data/docs/BroadcastLocallySignedTransactionR.md +24 -0
  4. data/docs/BroadcastLocallySignedTransactionRB.md +20 -0
  5. data/docs/BroadcastLocallySignedTransactionRBData.md +18 -0
  6. data/docs/BroadcastLocallySignedTransactionRBDataItem.md +22 -0
  7. data/docs/BroadcastLocallySignedTransactionRData.md +18 -0
  8. data/docs/BroadcastLocallySignedTransactionRI.md +18 -0
  9. data/docs/BroadcastTransactionFail.md +24 -0
  10. data/docs/BroadcastTransactionFailData.md +22 -0
  11. data/docs/BroadcastTransactionFailDataItem.md +24 -0
  12. data/docs/BroadcastTransactionSuccess.md +24 -0
  13. data/docs/BroadcastTransactionSuccessData.md +22 -0
  14. data/docs/BroadcastTransactionSuccessDataItem.md +22 -0
  15. data/docs/CreateCoinsTransactionRequestFromAddressRBDataItem.md +6 -2
  16. data/docs/CreateCoinsTransactionRequestFromAddressRI.md +4 -0
  17. data/docs/CreateCoinsTransactionRequestFromWalletRBDataItem.md +7 -3
  18. data/docs/{CreateCoinsTransactionRequestFromWalletRBDataItemDestinations.md → CreateCoinsTransactionRequestFromWalletRBDataItemRecipients.md} +3 -3
  19. data/docs/CreateCoinsTransactionRequestFromWalletRI.md +4 -0
  20. data/docs/CreateTokensTransactionRequestFromAddressRBDataItem.md +6 -2
  21. data/docs/CreateTokensTransactionRequestFromAddressRI.md +4 -0
  22. data/docs/FeaturesApi.md +167 -0
  23. data/docs/{ListReceivingAddressesR.md → GenerateDepositAddressR.md} +3 -3
  24. data/docs/{GenerateReceivingAddressRB.md → GenerateDepositAddressRB.md} +3 -3
  25. data/docs/GenerateDepositAddressRBData.md +18 -0
  26. data/docs/{GenerateReceivingAddressRBDataItem.md → GenerateDepositAddressRBDataItem.md} +2 -2
  27. data/docs/GenerateDepositAddressRData.md +18 -0
  28. data/docs/{GenerateReceivingAddressRI.md → GenerateDepositAddressRI.md} +2 -2
  29. data/docs/GeneratingApi.md +16 -16
  30. data/docs/GetAddressDetailsRIConfirmedBalance.md +2 -2
  31. data/docs/GetAddressDetailsRITotalReceived.md +2 -2
  32. data/docs/GetAddressDetailsRITotalSpent.md +2 -2
  33. data/docs/GetBlockDetailsByBlockHashRIBS.md +2 -0
  34. data/docs/GetBlockDetailsByBlockHashRIBSBSC.md +36 -0
  35. data/docs/GetBlockDetailsByBlockHeightRIBS.md +2 -0
  36. data/docs/GetBlockDetailsByBlockHeightRIBSBSC.md +34 -0
  37. data/docs/GetLatestMinedBlockRIBS.md +2 -0
  38. data/docs/GetLatestMinedBlockRIBSBSC.md +34 -0
  39. data/docs/GetTransactionDetailsByTransactionIDRIBS.md +2 -0
  40. data/docs/GetTransactionDetailsByTransactionIDRIBSBSC.md +28 -0
  41. data/docs/GetTransactionDetailsByTransactionIDRIBSBSCGasPrice.md +20 -0
  42. data/docs/GetTransactionDetailsByTransactionIDRIFee.md +1 -1
  43. data/docs/InformativeApi.md +15 -15
  44. data/docs/{GenerateReceivingAddressR.md → ListDepositAddressesR.md} +3 -3
  45. data/docs/{ListReceivingAddressesRData.md → ListDepositAddressesRData.md} +3 -3
  46. data/docs/{ListReceivingAddressesRI.md → ListDepositAddressesRI.md} +2 -2
  47. data/docs/ListTransactionsByAddressRIBS.md +2 -0
  48. data/docs/ListTransactionsByAddressRIBSBSC.md +30 -0
  49. data/docs/ListTransactionsByBlockHashRIBS.md +2 -0
  50. data/docs/ListTransactionsByBlockHashRIBSBSC.md +30 -0
  51. data/docs/ListTransactionsByBlockHashRIFee.md +1 -1
  52. data/docs/ListTransactionsByBlockHeightRIBS.md +2 -0
  53. data/docs/ListTransactionsByBlockHeightRIBSBSC.md +28 -0
  54. data/docs/ListTransactionsByBlockHeightRIBSBSCGasPrice.md +20 -0
  55. data/docs/ListXRPRippleTransactionsByAddressRI.md +2 -4
  56. data/docs/TransactionRequestApproval.md +24 -0
  57. data/docs/TransactionRequestApprovalData.md +22 -0
  58. data/docs/TransactionRequestApprovalDataItem.md +28 -0
  59. data/docs/TransactionRequestBroadcasted.md +24 -0
  60. data/docs/TransactionRequestBroadcastedData.md +22 -0
  61. data/docs/TransactionRequestBroadcastedDataItem.md +30 -0
  62. data/docs/TransactionRequestFail.md +24 -0
  63. data/docs/TransactionRequestFailData.md +22 -0
  64. data/docs/TransactionRequestFailDataItem.md +30 -0
  65. data/docs/TransactionRequestMined.md +24 -0
  66. data/docs/TransactionRequestMinedData.md +22 -0
  67. data/docs/TransactionRequestRejection.md +24 -0
  68. data/docs/TransactionRequestRejectionData.md +22 -0
  69. data/docs/TransactionRequestRejectionDataItem.md +28 -0
  70. data/docs/TransactionsApi.md +10 -10
  71. data/docs/XRPRippleApi.md +3 -1
  72. data/lib/crypto_apis.rb +46 -11
  73. data/lib/crypto_apis/api/features_api.rb +194 -0
  74. data/lib/crypto_apis/api/generating_api.rb +17 -17
  75. data/lib/crypto_apis/api/informative_api.rb +18 -18
  76. data/lib/crypto_apis/api/transactions_api.rb +10 -10
  77. data/lib/crypto_apis/api/unified_endpoints_api.rb +7 -7
  78. data/lib/crypto_apis/api/xrp_ripple_api.rb +7 -0
  79. data/lib/crypto_apis/models/broadcast_locally_signed_transaction_r.rb +263 -0
  80. data/lib/crypto_apis/models/broadcast_locally_signed_transaction_r_data.rb +223 -0
  81. data/lib/crypto_apis/models/broadcast_locally_signed_transaction_rb.rb +233 -0
  82. data/lib/crypto_apis/models/broadcast_locally_signed_transaction_rb_data.rb +223 -0
  83. data/lib/crypto_apis/models/broadcast_locally_signed_transaction_rb_data_item.rb +249 -0
  84. data/lib/crypto_apis/models/broadcast_locally_signed_transaction_ri.rb +224 -0
  85. data/lib/crypto_apis/models/broadcast_transaction_fail.rb +268 -0
  86. data/lib/crypto_apis/models/broadcast_transaction_fail_data.rb +254 -0
  87. data/lib/crypto_apis/models/broadcast_transaction_fail_data_item.rb +270 -0
  88. data/lib/crypto_apis/models/broadcast_transaction_success.rb +268 -0
  89. data/lib/crypto_apis/models/broadcast_transaction_success_data.rb +254 -0
  90. data/lib/crypto_apis/models/broadcast_transaction_success_data_item.rb +255 -0
  91. data/lib/crypto_apis/models/create_coins_transaction_request_from_address_rb_data_item.rb +30 -10
  92. data/lib/crypto_apis/models/create_coins_transaction_request_from_address_ri.rb +21 -1
  93. data/lib/crypto_apis/models/create_coins_transaction_request_from_wallet_rb_data_item.rb +38 -18
  94. data/lib/crypto_apis/models/{create_coins_transaction_request_from_wallet_rb_data_item_destinations.rb → create_coins_transaction_request_from_wallet_rb_data_item_recipients.rb} +4 -4
  95. data/lib/crypto_apis/models/create_coins_transaction_request_from_wallet_ri.rb +21 -1
  96. data/lib/crypto_apis/models/create_tokens_transaction_request_from_address_rb_data_item.rb +30 -10
  97. data/lib/crypto_apis/models/create_tokens_transaction_request_from_address_ri.rb +31 -1
  98. data/lib/crypto_apis/models/{list_receiving_addresses_r.rb → generate_deposit_address_r.rb} +4 -4
  99. data/lib/crypto_apis/models/{generate_receiving_address_r_data.rb → generate_deposit_address_r_data.rb} +4 -4
  100. data/lib/crypto_apis/models/{generate_receiving_address_rb.rb → generate_deposit_address_rb.rb} +4 -4
  101. data/lib/crypto_apis/models/{generate_receiving_address_rb_data.rb → generate_deposit_address_rb_data.rb} +4 -4
  102. data/lib/crypto_apis/models/{generate_receiving_address_rb_data_item.rb → generate_deposit_address_rb_data_item.rb} +3 -3
  103. data/lib/crypto_apis/models/{list_receiving_addresses_ri.rb → generate_deposit_address_ri.rb} +3 -3
  104. data/lib/crypto_apis/models/get_address_details_ri_confirmed_balance.rb +0 -1
  105. data/lib/crypto_apis/models/get_address_details_ri_total_received.rb +0 -1
  106. data/lib/crypto_apis/models/get_address_details_ri_total_spent.rb +0 -1
  107. data/lib/crypto_apis/models/get_block_details_by_block_hash_ribs.rb +1 -0
  108. data/lib/crypto_apis/models/get_block_details_by_block_hash_ribsbsc.rb +361 -0
  109. data/lib/crypto_apis/models/get_block_details_by_block_height_ribs.rb +1 -0
  110. data/lib/crypto_apis/models/get_block_details_by_block_height_ribsbsc.rb +345 -0
  111. data/lib/crypto_apis/models/get_latest_mined_block_ribs.rb +1 -0
  112. data/lib/crypto_apis/models/get_latest_mined_block_ribsbsc.rb +345 -0
  113. data/lib/crypto_apis/models/get_transaction_details_by_transaction_idri_fee.rb +0 -1
  114. data/lib/crypto_apis/models/get_transaction_details_by_transaction_idribs.rb +1 -0
  115. data/lib/crypto_apis/models/get_transaction_details_by_transaction_idribsbsc.rb +299 -0
  116. data/lib/crypto_apis/models/get_transaction_details_by_transaction_idribsbsc_gas_price.rb +238 -0
  117. data/lib/crypto_apis/models/{generate_receiving_address_r.rb → list_deposit_addresses_r.rb} +4 -4
  118. data/lib/crypto_apis/models/{list_receiving_addresses_r_data.rb → list_deposit_addresses_r_data.rb} +4 -4
  119. data/lib/crypto_apis/models/{generate_receiving_address_ri.rb → list_deposit_addresses_ri.rb} +3 -3
  120. data/lib/crypto_apis/models/list_transactions_by_address_ribs.rb +1 -0
  121. data/lib/crypto_apis/models/list_transactions_by_address_ribsbsc.rb +314 -0
  122. data/lib/crypto_apis/models/list_transactions_by_block_hash_ri_fee.rb +0 -1
  123. data/lib/crypto_apis/models/list_transactions_by_block_hash_ribs.rb +1 -0
  124. data/lib/crypto_apis/models/list_transactions_by_block_hash_ribsbsc.rb +314 -0
  125. data/lib/crypto_apis/models/list_transactions_by_block_height_ribs.rb +1 -0
  126. data/lib/crypto_apis/models/list_transactions_by_block_height_ribsbsc.rb +299 -0
  127. data/lib/crypto_apis/models/list_transactions_by_block_height_ribsbsc_gas_price.rb +238 -0
  128. data/lib/crypto_apis/models/list_xrp_ripple_transactions_by_address_ri.rb +1 -16
  129. data/lib/crypto_apis/models/transaction_request_approval.rb +268 -0
  130. data/lib/crypto_apis/models/transaction_request_approval_data.rb +254 -0
  131. data/lib/crypto_apis/models/transaction_request_approval_data_item.rb +300 -0
  132. data/lib/crypto_apis/models/transaction_request_broadcasted.rb +268 -0
  133. data/lib/crypto_apis/models/transaction_request_broadcasted_data.rb +254 -0
  134. data/lib/crypto_apis/models/transaction_request_broadcasted_data_item.rb +315 -0
  135. data/lib/crypto_apis/models/transaction_request_fail.rb +268 -0
  136. data/lib/crypto_apis/models/transaction_request_fail_data.rb +254 -0
  137. data/lib/crypto_apis/models/transaction_request_fail_data_item.rb +315 -0
  138. data/lib/crypto_apis/models/transaction_request_mined.rb +268 -0
  139. data/lib/crypto_apis/models/transaction_request_mined_data.rb +254 -0
  140. data/lib/crypto_apis/models/transaction_request_rejection.rb +268 -0
  141. data/lib/crypto_apis/models/transaction_request_rejection_data.rb +254 -0
  142. data/lib/crypto_apis/models/transaction_request_rejection_data_item.rb +300 -0
  143. data/lib/crypto_apis/version.rb +1 -1
  144. data/spec/api/{validating_api_spec.rb → features_api_spec.rb} +21 -6
  145. data/spec/api/generating_api_spec.rb +5 -5
  146. data/spec/api/informative_api_spec.rb +5 -5
  147. data/spec/api/transactions_api_spec.rb +1 -1
  148. data/spec/api/xrp_ripple_api_spec.rb +1 -0
  149. data/spec/models/broadcast_locally_signed_transaction_r_data_spec.rb +34 -0
  150. data/spec/models/broadcast_locally_signed_transaction_r_spec.rb +52 -0
  151. data/spec/models/broadcast_locally_signed_transaction_rb_data_item_spec.rb +46 -0
  152. data/spec/models/broadcast_locally_signed_transaction_rb_data_spec.rb +34 -0
  153. data/spec/models/broadcast_locally_signed_transaction_rb_spec.rb +40 -0
  154. data/spec/models/broadcast_locally_signed_transaction_ri_spec.rb +34 -0
  155. data/spec/models/broadcast_transaction_fail_data_item_spec.rb +52 -0
  156. data/spec/models/broadcast_transaction_fail_data_spec.rb +46 -0
  157. data/spec/models/broadcast_transaction_fail_spec.rb +52 -0
  158. data/spec/models/broadcast_transaction_success_data_item_spec.rb +46 -0
  159. data/spec/models/broadcast_transaction_success_data_spec.rb +46 -0
  160. data/spec/models/broadcast_transaction_success_spec.rb +52 -0
  161. data/spec/models/create_coins_transaction_request_from_address_rb_data_item_spec.rb +13 -1
  162. data/spec/models/create_coins_transaction_request_from_address_ri_spec.rb +12 -0
  163. data/spec/models/{create_coins_transaction_request_from_wallet_rb_data_item_destinations_spec.rb → create_coins_transaction_request_from_wallet_rb_data_item_recipients_spec.rb} +6 -6
  164. data/spec/models/create_coins_transaction_request_from_wallet_rb_data_item_spec.rb +13 -1
  165. data/spec/models/create_coins_transaction_request_from_wallet_ri_spec.rb +12 -0
  166. data/spec/models/create_tokens_transaction_request_from_address_rb_data_item_spec.rb +13 -1
  167. data/spec/models/create_tokens_transaction_request_from_address_ri_spec.rb +12 -0
  168. data/spec/models/{generate_receiving_address_r_data_spec.rb → generate_deposit_address_r_data_spec.rb} +6 -6
  169. data/spec/models/{list_receiving_addresses_r_spec.rb → generate_deposit_address_r_spec.rb} +6 -6
  170. data/spec/models/{generate_receiving_address_rb_data_item_spec.rb → generate_deposit_address_rb_data_item_spec.rb} +6 -6
  171. data/spec/models/{generate_receiving_address_rb_data_spec.rb → generate_deposit_address_rb_data_spec.rb} +6 -6
  172. data/spec/models/{generate_receiving_address_rb_spec.rb → generate_deposit_address_rb_spec.rb} +6 -6
  173. data/spec/models/{list_receiving_addresses_ri_spec.rb → generate_deposit_address_ri_spec.rb} +6 -6
  174. data/spec/models/get_block_details_by_block_hash_ribsbsc_spec.rb +88 -0
  175. data/spec/models/get_block_details_by_block_height_ribsbsc_spec.rb +82 -0
  176. data/spec/models/get_latest_mined_block_ribsbsc_spec.rb +82 -0
  177. data/spec/models/get_transaction_details_by_transaction_idribsbsc_gas_price_spec.rb +40 -0
  178. data/spec/models/get_transaction_details_by_transaction_idribsbsc_spec.rb +64 -0
  179. data/spec/models/{list_receiving_addresses_r_data_spec.rb → list_deposit_addresses_r_data_spec.rb} +6 -6
  180. data/spec/models/{generate_receiving_address_r_spec.rb → list_deposit_addresses_r_spec.rb} +6 -6
  181. data/spec/models/{generate_receiving_address_ri_spec.rb → list_deposit_addresses_ri_spec.rb} +6 -6
  182. data/spec/models/list_transactions_by_address_ribsbsc_spec.rb +70 -0
  183. data/spec/models/list_transactions_by_block_hash_ribsbsc_spec.rb +70 -0
  184. data/spec/models/list_transactions_by_block_height_ribsbsc_gas_price_spec.rb +40 -0
  185. data/spec/models/list_transactions_by_block_height_ribsbsc_spec.rb +64 -0
  186. data/spec/models/list_xrp_ripple_transactions_by_address_ri_spec.rb +0 -6
  187. data/spec/models/transaction_request_approval_data_item_spec.rb +64 -0
  188. data/spec/models/transaction_request_approval_data_spec.rb +46 -0
  189. data/spec/models/transaction_request_approval_spec.rb +52 -0
  190. data/spec/models/transaction_request_broadcasted_data_item_spec.rb +70 -0
  191. data/spec/models/transaction_request_broadcasted_data_spec.rb +46 -0
  192. data/spec/models/transaction_request_broadcasted_spec.rb +52 -0
  193. data/spec/models/transaction_request_fail_data_item_spec.rb +70 -0
  194. data/spec/models/transaction_request_fail_data_spec.rb +46 -0
  195. data/spec/models/transaction_request_fail_spec.rb +52 -0
  196. data/spec/models/transaction_request_mined_data_spec.rb +46 -0
  197. data/spec/models/transaction_request_mined_spec.rb +52 -0
  198. data/spec/models/transaction_request_rejection_data_item_spec.rb +64 -0
  199. data/spec/models/transaction_request_rejection_data_spec.rb +46 -0
  200. data/spec/models/transaction_request_rejection_spec.rb +52 -0
  201. metadata +186 -46
  202. data/docs/GenerateReceivingAddressRBData.md +0 -18
  203. data/docs/GenerateReceivingAddressRData.md +0 -18
  204. data/docs/ValidatingApi.md +0 -87
  205. data/lib/crypto_apis/api/validating_api.rb +0 -108
@@ -0,0 +1,224 @@
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 BroadcastLocallySignedTransactionRI
18
+ # Represents the unique identifier of a transaction, i.e. it could be `transactionId` in UTXO-based protocols like Bitcoin, and transaction `hash` in Ethereum blockchain.
19
+ attr_accessor :transaction_id
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'transaction_id' => :'transactionId'
25
+ }
26
+ end
27
+
28
+ # Returns all the JSON keys this model knows about
29
+ def self.acceptable_attributes
30
+ attribute_map.values
31
+ end
32
+
33
+ # Attribute type mapping.
34
+ def self.openapi_types
35
+ {
36
+ :'transaction_id' => :'String'
37
+ }
38
+ end
39
+
40
+ # List of attributes with nullable: true
41
+ def self.openapi_nullable
42
+ Set.new([
43
+ ])
44
+ end
45
+
46
+ # Initializes the object
47
+ # @param [Hash] attributes Model attributes in the form of hash
48
+ def initialize(attributes = {})
49
+ if (!attributes.is_a?(Hash))
50
+ fail ArgumentError, "The input argument (attributes) must be a hash in `CryptoApis::BroadcastLocallySignedTransactionRI` initialize method"
51
+ end
52
+
53
+ # check to see if the attribute exists and convert string to symbol for hash key
54
+ attributes = attributes.each_with_object({}) { |(k, v), h|
55
+ if (!self.class.attribute_map.key?(k.to_sym))
56
+ fail ArgumentError, "`#{k}` is not a valid attribute in `CryptoApis::BroadcastLocallySignedTransactionRI`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
+ end
58
+ h[k.to_sym] = v
59
+ }
60
+
61
+ if attributes.key?(:'transaction_id')
62
+ self.transaction_id = attributes[:'transaction_id']
63
+ end
64
+ end
65
+
66
+ # Show invalid properties with the reasons. Usually used together with valid?
67
+ # @return Array for valid properties with the reasons
68
+ def list_invalid_properties
69
+ invalid_properties = Array.new
70
+ if @transaction_id.nil?
71
+ invalid_properties.push('invalid value for "transaction_id", transaction_id cannot be nil.')
72
+ end
73
+
74
+ invalid_properties
75
+ end
76
+
77
+ # Check to see if the all the properties in the model are valid
78
+ # @return true if the model is valid
79
+ def valid?
80
+ return false if @transaction_id.nil?
81
+ true
82
+ end
83
+
84
+ # Checks equality by comparing each attribute.
85
+ # @param [Object] Object to be compared
86
+ def ==(o)
87
+ return true if self.equal?(o)
88
+ self.class == o.class &&
89
+ transaction_id == o.transaction_id
90
+ end
91
+
92
+ # @see the `==` method
93
+ # @param [Object] Object to be compared
94
+ def eql?(o)
95
+ self == o
96
+ end
97
+
98
+ # Calculates hash code according to all attributes.
99
+ # @return [Integer] Hash code
100
+ def hash
101
+ [transaction_id].hash
102
+ end
103
+
104
+ # Builds the object from hash
105
+ # @param [Hash] attributes Model attributes in the form of hash
106
+ # @return [Object] Returns the model itself
107
+ def self.build_from_hash(attributes)
108
+ new.build_from_hash(attributes)
109
+ end
110
+
111
+ # Builds the object from hash
112
+ # @param [Hash] attributes Model attributes in the form of hash
113
+ # @return [Object] Returns the model itself
114
+ def build_from_hash(attributes)
115
+ return nil unless attributes.is_a?(Hash)
116
+ self.class.openapi_types.each_pair do |key, type|
117
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
118
+ self.send("#{key}=", nil)
119
+ elsif type =~ /\AArray<(.*)>/i
120
+ # check to ensure the input is an array given that the attribute
121
+ # is documented as an array but the input is not
122
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
123
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
124
+ end
125
+ elsif !attributes[self.class.attribute_map[key]].nil?
126
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
127
+ end
128
+ end
129
+
130
+ self
131
+ end
132
+
133
+ # Deserializes the data based on type
134
+ # @param string type Data type
135
+ # @param string value Value to be deserialized
136
+ # @return [Object] Deserialized data
137
+ def _deserialize(type, value)
138
+ case type.to_sym
139
+ when :Time
140
+ Time.parse(value)
141
+ when :Date
142
+ Date.parse(value)
143
+ when :String
144
+ value.to_s
145
+ when :Integer
146
+ value.to_i
147
+ when :Float
148
+ value.to_f
149
+ when :Boolean
150
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
151
+ true
152
+ else
153
+ false
154
+ end
155
+ when :Object
156
+ # generic object (usually a Hash), return directly
157
+ value
158
+ when /\AArray<(?<inner_type>.+)>\z/
159
+ inner_type = Regexp.last_match[:inner_type]
160
+ value.map { |v| _deserialize(inner_type, v) }
161
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
162
+ k_type = Regexp.last_match[:k_type]
163
+ v_type = Regexp.last_match[:v_type]
164
+ {}.tap do |hash|
165
+ value.each do |k, v|
166
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
167
+ end
168
+ end
169
+ else # model
170
+ # models (e.g. Pet) or oneOf
171
+ klass = CryptoApis.const_get(type)
172
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.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
+ if value.nil?
195
+ is_nullable = self.class.openapi_nullable.include?(attr)
196
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
197
+ end
198
+
199
+ hash[param] = _to_hash(value)
200
+ end
201
+ hash
202
+ end
203
+
204
+ # Outputs non-array value in the form of hash
205
+ # For object, use to_hash. Otherwise, just return the value
206
+ # @param [Object] value Any valid value
207
+ # @return [Hash] Returns the value in the form of hash
208
+ def _to_hash(value)
209
+ if value.is_a?(Array)
210
+ value.compact.map { |v| _to_hash(v) }
211
+ elsif value.is_a?(Hash)
212
+ {}.tap do |hash|
213
+ value.each { |k, v| hash[k] = _to_hash(v) }
214
+ end
215
+ elsif value.respond_to? :to_hash
216
+ value.to_hash
217
+ else
218
+ value
219
+ end
220
+ end
221
+
222
+ end
223
+
224
+ end
@@ -0,0 +1,268 @@
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 BroadcastTransactionFail
18
+ # Specifies the version of the API that incorporates this endpoint.
19
+ attr_accessor :api_version
20
+
21
+ # Represents a unique identifier that serves as reference to the specific request which prompts a callback, e.g. Blockchain Events Subscription, Blockchain Automation, etc.
22
+ attr_accessor :reference_id
23
+
24
+ # Specifies a unique ID generated by the system and attached to each callback. It is used by the server to recognize consecutive requests with the same data with the purpose not to perform the same operation twice.
25
+ attr_accessor :idempotency_key
26
+
27
+ attr_accessor :data
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'api_version' => :'apiVersion',
33
+ :'reference_id' => :'referenceId',
34
+ :'idempotency_key' => :'idempotencyKey',
35
+ :'data' => :'data'
36
+ }
37
+ end
38
+
39
+ # Returns all the JSON keys this model knows about
40
+ def self.acceptable_attributes
41
+ attribute_map.values
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.openapi_types
46
+ {
47
+ :'api_version' => :'String',
48
+ :'reference_id' => :'String',
49
+ :'idempotency_key' => :'String',
50
+ :'data' => :'BroadcastTransactionFailData'
51
+ }
52
+ end
53
+
54
+ # List of attributes with nullable: true
55
+ def self.openapi_nullable
56
+ Set.new([
57
+ ])
58
+ end
59
+
60
+ # Initializes the object
61
+ # @param [Hash] attributes Model attributes in the form of hash
62
+ def initialize(attributes = {})
63
+ if (!attributes.is_a?(Hash))
64
+ fail ArgumentError, "The input argument (attributes) must be a hash in `CryptoApis::BroadcastTransactionFail` initialize method"
65
+ end
66
+
67
+ # check to see if the attribute exists and convert string to symbol for hash key
68
+ attributes = attributes.each_with_object({}) { |(k, v), h|
69
+ if (!self.class.attribute_map.key?(k.to_sym))
70
+ fail ArgumentError, "`#{k}` is not a valid attribute in `CryptoApis::BroadcastTransactionFail`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
71
+ end
72
+ h[k.to_sym] = v
73
+ }
74
+
75
+ if attributes.key?(:'api_version')
76
+ self.api_version = attributes[:'api_version']
77
+ end
78
+
79
+ if attributes.key?(:'reference_id')
80
+ self.reference_id = attributes[:'reference_id']
81
+ end
82
+
83
+ if attributes.key?(:'idempotency_key')
84
+ self.idempotency_key = attributes[:'idempotency_key']
85
+ end
86
+
87
+ if attributes.key?(:'data')
88
+ self.data = attributes[:'data']
89
+ end
90
+ end
91
+
92
+ # Show invalid properties with the reasons. Usually used together with valid?
93
+ # @return Array for valid properties with the reasons
94
+ def list_invalid_properties
95
+ invalid_properties = Array.new
96
+ if @api_version.nil?
97
+ invalid_properties.push('invalid value for "api_version", api_version cannot be nil.')
98
+ end
99
+
100
+ if @reference_id.nil?
101
+ invalid_properties.push('invalid value for "reference_id", reference_id cannot be nil.')
102
+ end
103
+
104
+ if @idempotency_key.nil?
105
+ invalid_properties.push('invalid value for "idempotency_key", idempotency_key cannot be nil.')
106
+ end
107
+
108
+ if @data.nil?
109
+ invalid_properties.push('invalid value for "data", data cannot be nil.')
110
+ end
111
+
112
+ invalid_properties
113
+ end
114
+
115
+ # Check to see if the all the properties in the model are valid
116
+ # @return true if the model is valid
117
+ def valid?
118
+ return false if @api_version.nil?
119
+ return false if @reference_id.nil?
120
+ return false if @idempotency_key.nil?
121
+ return false if @data.nil?
122
+ true
123
+ end
124
+
125
+ # Checks equality by comparing each attribute.
126
+ # @param [Object] Object to be compared
127
+ def ==(o)
128
+ return true if self.equal?(o)
129
+ self.class == o.class &&
130
+ api_version == o.api_version &&
131
+ reference_id == o.reference_id &&
132
+ idempotency_key == o.idempotency_key &&
133
+ data == o.data
134
+ end
135
+
136
+ # @see the `==` method
137
+ # @param [Object] Object to be compared
138
+ def eql?(o)
139
+ self == o
140
+ end
141
+
142
+ # Calculates hash code according to all attributes.
143
+ # @return [Integer] Hash code
144
+ def hash
145
+ [api_version, reference_id, idempotency_key, data].hash
146
+ end
147
+
148
+ # Builds the object from hash
149
+ # @param [Hash] attributes Model attributes in the form of hash
150
+ # @return [Object] Returns the model itself
151
+ def self.build_from_hash(attributes)
152
+ new.build_from_hash(attributes)
153
+ end
154
+
155
+ # Builds the object from hash
156
+ # @param [Hash] attributes Model attributes in the form of hash
157
+ # @return [Object] Returns the model itself
158
+ def build_from_hash(attributes)
159
+ return nil unless attributes.is_a?(Hash)
160
+ self.class.openapi_types.each_pair do |key, type|
161
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
162
+ self.send("#{key}=", nil)
163
+ elsif type =~ /\AArray<(.*)>/i
164
+ # check to ensure the input is an array given that the attribute
165
+ # is documented as an array but the input is not
166
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
167
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
168
+ end
169
+ elsif !attributes[self.class.attribute_map[key]].nil?
170
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
171
+ end
172
+ end
173
+
174
+ self
175
+ end
176
+
177
+ # Deserializes the data based on type
178
+ # @param string type Data type
179
+ # @param string value Value to be deserialized
180
+ # @return [Object] Deserialized data
181
+ def _deserialize(type, value)
182
+ case type.to_sym
183
+ when :Time
184
+ Time.parse(value)
185
+ when :Date
186
+ Date.parse(value)
187
+ when :String
188
+ value.to_s
189
+ when :Integer
190
+ value.to_i
191
+ when :Float
192
+ value.to_f
193
+ when :Boolean
194
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
195
+ true
196
+ else
197
+ false
198
+ end
199
+ when :Object
200
+ # generic object (usually a Hash), return directly
201
+ value
202
+ when /\AArray<(?<inner_type>.+)>\z/
203
+ inner_type = Regexp.last_match[:inner_type]
204
+ value.map { |v| _deserialize(inner_type, v) }
205
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
206
+ k_type = Regexp.last_match[:k_type]
207
+ v_type = Regexp.last_match[:v_type]
208
+ {}.tap do |hash|
209
+ value.each do |k, v|
210
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
211
+ end
212
+ end
213
+ else # model
214
+ # models (e.g. Pet) or oneOf
215
+ klass = CryptoApis.const_get(type)
216
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
217
+ end
218
+ end
219
+
220
+ # Returns the string representation of the object
221
+ # @return [String] String presentation of the object
222
+ def to_s
223
+ to_hash.to_s
224
+ end
225
+
226
+ # to_body is an alias to to_hash (backward compatibility)
227
+ # @return [Hash] Returns the object in the form of hash
228
+ def to_body
229
+ to_hash
230
+ end
231
+
232
+ # Returns the object in the form of hash
233
+ # @return [Hash] Returns the object in the form of hash
234
+ def to_hash
235
+ hash = {}
236
+ self.class.attribute_map.each_pair do |attr, param|
237
+ value = self.send(attr)
238
+ if value.nil?
239
+ is_nullable = self.class.openapi_nullable.include?(attr)
240
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
241
+ end
242
+
243
+ hash[param] = _to_hash(value)
244
+ end
245
+ hash
246
+ end
247
+
248
+ # Outputs non-array value in the form of hash
249
+ # For object, use to_hash. Otherwise, just return the value
250
+ # @param [Object] value Any valid value
251
+ # @return [Hash] Returns the value in the form of hash
252
+ def _to_hash(value)
253
+ if value.is_a?(Array)
254
+ value.compact.map { |v| _to_hash(v) }
255
+ elsif value.is_a?(Hash)
256
+ {}.tap do |hash|
257
+ value.each { |k, v| hash[k] = _to_hash(v) }
258
+ end
259
+ elsif value.respond_to? :to_hash
260
+ value.to_hash
261
+ else
262
+ value
263
+ end
264
+ end
265
+
266
+ end
267
+
268
+ end