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