devdraft 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (234) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +155 -253
  3. data/Rakefile +2 -0
  4. data/devdraft-1.0.0.gem +0 -0
  5. data/{devdraft_ai_sdk.gemspec → devdraft.gemspec} +15 -11
  6. data/docs/APIHealthApi.md +82 -30
  7. data/docs/AggregatedBalanceResponse.md +19 -6
  8. data/docs/AllBalancesResponse.md +19 -6
  9. data/docs/AppBalancesApi.md +125 -65
  10. data/docs/BridgeFiatPaymentRail.md +15 -0
  11. data/docs/BridgePaymentRail.md +12 -3
  12. data/docs/CreateBankPaymentIntentDto.md +49 -21
  13. data/docs/CreateCustomerDto.md +25 -9
  14. data/docs/CreateDirectBankTransferDto.md +29 -11
  15. data/docs/CreateDirectWalletTransferDto.md +21 -7
  16. data/docs/CreateExternalBankTransferDto.md +40 -0
  17. data/docs/CreateExternalStablecoinTransferDto.md +28 -0
  18. data/docs/CreateInvoiceDto.md +45 -19
  19. data/docs/CreateLiquidationAddressDto.md +43 -18
  20. data/docs/CreatePaymentLinkDto.md +53 -28
  21. data/docs/CreateStablePaymentIntentDto.md +43 -18
  22. data/docs/CreateStablecoinConversionDto.md +23 -8
  23. data/docs/CreateTaxDto.md +26 -0
  24. data/docs/CreateWebhookDto.md +23 -8
  25. data/docs/CustomerStatus.md +12 -3
  26. data/docs/CustomerType.md +15 -0
  27. data/docs/CustomersApi.md +187 -114
  28. data/docs/DestinationCurrency.md +12 -3
  29. data/docs/ExchangeRateResponseDto.md +25 -9
  30. data/docs/ExchangeRatesApi.md +130 -72
  31. data/docs/FiatCurrency.md +12 -3
  32. data/docs/HealthResponseDto.md +25 -9
  33. data/docs/InvoiceProductDto.md +17 -5
  34. data/docs/InvoicesApi.md +177 -104
  35. data/docs/LiquidationAddressResponseDto.md +41 -17
  36. data/docs/LiquidationAddressesApi.md +115 -61
  37. data/docs/PaymentIntentsApi.md +93 -57
  38. data/docs/PaymentLinkProductDto.md +17 -5
  39. data/docs/PaymentLinksApi.md +175 -102
  40. data/docs/PaymentRequestDto.md +21 -7
  41. data/docs/PaymentResponseDto.md +23 -8
  42. data/docs/ProductsApi.md +307 -194
  43. data/docs/PublicHealthResponseDto.md +19 -6
  44. data/docs/RefundResponseDto.md +23 -8
  45. data/docs/StableCoinCurrency.md +12 -3
  46. data/docs/TaxControllerCreate201Response.md +30 -0
  47. data/docs/TaxControllerDeleteWithoutId400Response.md +22 -0
  48. data/docs/TaxControllerUpdateWithoutId400Response.md +22 -0
  49. data/docs/TaxesApi.md +374 -122
  50. data/docs/TestPaymentsApi.md +150 -60
  51. data/docs/TransfersApi.md +274 -72
  52. data/docs/UpdateCustomerDto.md +25 -9
  53. data/docs/UpdateTaxDto.md +26 -0
  54. data/docs/UpdateWebhookDto.md +23 -8
  55. data/docs/WalletsApi.md +44 -24
  56. data/docs/WebhookResponseDto.md +29 -11
  57. data/docs/WebhooksApi.md +225 -134
  58. data/git_push.sh +41 -28
  59. data/lib/devdraft/api/api_health_api.rb +32 -16
  60. data/lib/devdraft/api/app_balances_api.rb +45 -22
  61. data/lib/devdraft/api/customers_api.rb +124 -71
  62. data/lib/devdraft/api/exchange_rates_api.rb +49 -26
  63. data/lib/devdraft/api/invoices_api.rb +89 -53
  64. data/lib/devdraft/api/liquidation_addresses_api.rb +70 -44
  65. data/lib/devdraft/api/payment_intents_api.rb +62 -40
  66. data/lib/devdraft/api/payment_links_api.rb +85 -49
  67. data/lib/devdraft/api/products_api.rb +214 -216
  68. data/lib/devdraft/api/taxes_api.rb +257 -66
  69. data/lib/devdraft/api/test_payments_api.rb +70 -44
  70. data/lib/devdraft/api/transfers_api.rb +206 -46
  71. data/lib/devdraft/api/wallets_api.rb +18 -9
  72. data/lib/devdraft/api/webhooks_api.rb +109 -66
  73. data/lib/devdraft/api_client.rb +76 -71
  74. data/lib/devdraft/api_error.rb +5 -4
  75. data/lib/devdraft/api_model_base.rb +88 -0
  76. data/lib/devdraft/configuration.rb +121 -18
  77. data/lib/devdraft/models/aggregated_balance_response.rb +68 -101
  78. data/lib/devdraft/models/all_balances_response.rb +76 -99
  79. data/lib/devdraft/models/bridge_fiat_payment_rail.rb +45 -0
  80. data/lib/devdraft/models/bridge_payment_rail.rb +36 -24
  81. data/lib/devdraft/models/create_bank_payment_intent_dto.rb +191 -114
  82. data/lib/devdraft/models/create_customer_dto.rb +123 -113
  83. data/lib/devdraft/models/create_direct_bank_transfer_dto.rb +105 -104
  84. data/lib/devdraft/models/create_direct_wallet_transfer_dto.rb +89 -100
  85. data/lib/devdraft/models/create_external_bank_transfer_dto.rb +505 -0
  86. data/lib/devdraft/models/create_external_stablecoin_transfer_dto.rb +266 -0
  87. data/lib/devdraft/models/create_invoice_dto.rb +151 -121
  88. data/lib/devdraft/models/create_liquidation_address_dto.rb +195 -115
  89. data/lib/devdraft/models/create_payment_link_dto.rb +192 -214
  90. data/lib/devdraft/models/create_stable_payment_intent_dto.rb +324 -111
  91. data/lib/devdraft/models/create_stablecoin_conversion_dto.rb +102 -101
  92. data/lib/devdraft/models/create_tax_dto.rb +281 -0
  93. data/lib/devdraft/models/create_webhook_dto.rb +104 -101
  94. data/lib/devdraft/models/customer_status.rb +23 -10
  95. data/lib/devdraft/models/customer_type.rb +45 -0
  96. data/lib/devdraft/models/destination_currency.rb +27 -15
  97. data/lib/devdraft/models/exchange_rate_response_dto.rb +103 -102
  98. data/lib/devdraft/models/fiat_currency.rb +22 -10
  99. data/lib/devdraft/models/health_response_dto.rb +99 -106
  100. data/lib/devdraft/models/invoice_product_dto.rb +63 -98
  101. data/lib/devdraft/models/liquidation_address_response_dto.rb +147 -110
  102. data/lib/devdraft/models/payment_link_product_dto.rb +70 -98
  103. data/lib/devdraft/models/payment_request_dto.rb +77 -100
  104. data/lib/devdraft/models/payment_response_dto.rb +102 -101
  105. data/lib/devdraft/models/public_health_response_dto.rb +68 -101
  106. data/lib/devdraft/models/refund_response_dto.rb +102 -101
  107. data/lib/devdraft/models/stable_coin_currency.rb +21 -9
  108. data/lib/devdraft/models/tax_controller_create201_response.rb +201 -0
  109. data/lib/devdraft/models/tax_controller_delete_without_id400_response.rb +165 -0
  110. data/lib/devdraft/models/tax_controller_update_without_id400_response.rb +165 -0
  111. data/lib/devdraft/models/update_customer_dto.rb +117 -113
  112. data/lib/devdraft/models/update_tax_dto.rb +256 -0
  113. data/lib/devdraft/models/update_webhook_dto.rb +70 -101
  114. data/lib/devdraft/models/webhook_response_dto.rb +140 -103
  115. data/lib/devdraft/version.rb +6 -5
  116. data/lib/devdraft.rb +18 -27
  117. data/spec/api/api_health_api_spec.rb +10 -9
  118. data/spec/api/app_balances_api_spec.rb +11 -10
  119. data/spec/api/customers_api_spec.rb +25 -24
  120. data/spec/api/exchange_rates_api_spec.rb +11 -10
  121. data/spec/api/invoices_api_spec.rb +16 -15
  122. data/spec/api/liquidation_addresses_api_spec.rb +13 -12
  123. data/spec/api/payment_intents_api_spec.rb +12 -11
  124. data/spec/api/payment_links_api_spec.rb +14 -13
  125. data/spec/api/products_api_spec.rb +41 -40
  126. data/spec/api/taxes_api_spec.rb +51 -21
  127. data/spec/api/test_payments_api_spec.rb +14 -13
  128. data/spec/api/transfers_api_spec.rb +36 -13
  129. data/spec/api/wallets_api_spec.rb +9 -8
  130. data/spec/api/webhooks_api_spec.rb +20 -19
  131. data/spec/models/aggregated_balance_response_spec.rb +15 -19
  132. data/spec/models/all_balances_response_spec.rb +14 -18
  133. data/spec/models/bridge_fiat_payment_rail_spec.rb +30 -0
  134. data/spec/models/bridge_payment_rail_spec.rb +11 -15
  135. data/spec/models/create_bank_payment_intent_dto_spec.rb +29 -33
  136. data/spec/models/create_customer_dto_spec.rb +17 -25
  137. data/spec/models/create_direct_bank_transfer_dto_spec.rb +19 -23
  138. data/spec/models/create_direct_wallet_transfer_dto_spec.rb +15 -19
  139. data/spec/models/create_external_bank_transfer_dto_spec.rb +102 -0
  140. data/spec/models/create_external_stablecoin_transfer_dto_spec.rb +66 -0
  141. data/spec/models/create_invoice_dto_spec.rb +31 -35
  142. data/spec/models/create_liquidation_address_dto_spec.rb +28 -32
  143. data/spec/models/create_payment_link_dto_spec.rb +34 -76
  144. data/spec/models/create_stable_payment_intent_dto_spec.rb +26 -30
  145. data/spec/models/create_stablecoin_conversion_dto_spec.rb +16 -20
  146. data/spec/models/create_tax_dto_spec.rb +60 -0
  147. data/spec/models/create_webhook_dto_spec.rb +16 -20
  148. data/spec/models/customer_status_spec.rb +11 -15
  149. data/spec/models/customer_type_spec.rb +30 -0
  150. data/spec/models/destination_currency_spec.rb +11 -15
  151. data/spec/models/exchange_rate_response_dto_spec.rb +17 -21
  152. data/spec/models/fiat_currency_spec.rb +11 -15
  153. data/spec/models/health_response_dto_spec.rb +19 -23
  154. data/spec/models/invoice_product_dto_spec.rb +13 -17
  155. data/spec/models/liquidation_address_response_dto_spec.rb +25 -29
  156. data/spec/models/payment_link_product_dto_spec.rb +13 -17
  157. data/spec/models/payment_request_dto_spec.rb +15 -19
  158. data/spec/models/payment_response_dto_spec.rb +16 -20
  159. data/spec/models/public_health_response_dto_spec.rb +15 -19
  160. data/spec/models/refund_response_dto_spec.rb +16 -20
  161. data/spec/models/stable_coin_currency_spec.rb +11 -15
  162. data/spec/models/tax_controller_create201_response_spec.rb +72 -0
  163. data/spec/models/tax_controller_delete_without_id400_response_spec.rb +48 -0
  164. data/spec/models/tax_controller_update_without_id400_response_spec.rb +48 -0
  165. data/spec/models/update_customer_dto_spec.rb +17 -25
  166. data/spec/models/update_tax_dto_spec.rb +60 -0
  167. data/spec/models/update_webhook_dto_spec.rb +16 -20
  168. data/spec/models/webhook_response_dto_spec.rb +19 -23
  169. data/spec/spec_helper.rb +5 -4
  170. metadata +49 -116
  171. data/docs/AllOfAllBalancesResponseEurc.md +0 -9
  172. data/docs/AllOfAllBalancesResponseUsdc.md +0 -9
  173. data/docs/AllOfCreateBankPaymentIntentDtoDestinationCurrency.md +0 -6
  174. data/docs/AllOfCreateBankPaymentIntentDtoDestinationNetwork.md +0 -6
  175. data/docs/AllOfCreateBankPaymentIntentDtoSourceCurrency.md +0 -6
  176. data/docs/AllOfCreateBankPaymentIntentDtoSourcePaymentRail.md +0 -6
  177. data/docs/AllOfCreateCustomerDtoStatus.md +0 -6
  178. data/docs/AllOfCreateLiquidationAddressDtoDestinationCurrency.md +0 -6
  179. data/docs/AllOfCreateLiquidationAddressDtoDestinationPaymentRail.md +0 -6
  180. data/docs/AllOfCreateStablePaymentIntentDtoDestinationCurrency.md +0 -6
  181. data/docs/AllOfCreateStablePaymentIntentDtoDestinationNetwork.md +0 -6
  182. data/docs/AllOfCreateStablePaymentIntentDtoSourceCurrency.md +0 -6
  183. data/docs/AllOfCreateStablePaymentIntentDtoSourceNetwork.md +0 -6
  184. data/docs/AllOfUpdateCustomerDtoStatus.md +0 -6
  185. data/docs/CreateProductDto.md +0 -18
  186. data/docs/CreateTaxInput.md +0 -6
  187. data/docs/UpdatePaymentLinkDto.md +0 -6
  188. data/docs/UpdatePreferenceInput.md +0 -6
  189. data/docs/UpdateProductDto.md +0 -18
  190. data/docs/UpdateTaxInput.md +0 -6
  191. data/example.rb +0 -129
  192. data/lib/devdraft/models/all_of_all_balances_response_eurc.rb +0 -283
  193. data/lib/devdraft/models/all_of_all_balances_response_usdc.rb +0 -283
  194. data/lib/devdraft/models/all_of_create_bank_payment_intent_dto_destination_currency.rb +0 -202
  195. data/lib/devdraft/models/all_of_create_bank_payment_intent_dto_destination_network.rb +0 -202
  196. data/lib/devdraft/models/all_of_create_bank_payment_intent_dto_source_currency.rb +0 -202
  197. data/lib/devdraft/models/all_of_create_bank_payment_intent_dto_source_payment_rail.rb +0 -202
  198. data/lib/devdraft/models/all_of_create_customer_dto_status.rb +0 -202
  199. data/lib/devdraft/models/all_of_create_liquidation_address_dto_destination_currency.rb +0 -202
  200. data/lib/devdraft/models/all_of_create_liquidation_address_dto_destination_payment_rail.rb +0 -202
  201. data/lib/devdraft/models/all_of_create_stable_payment_intent_dto_destination_currency.rb +0 -202
  202. data/lib/devdraft/models/all_of_create_stable_payment_intent_dto_destination_network.rb +0 -202
  203. data/lib/devdraft/models/all_of_create_stable_payment_intent_dto_source_currency.rb +0 -202
  204. data/lib/devdraft/models/all_of_create_stable_payment_intent_dto_source_network.rb +0 -202
  205. data/lib/devdraft/models/all_of_update_customer_dto_status.rb +0 -202
  206. data/lib/devdraft/models/create_product_dto.rb +0 -370
  207. data/lib/devdraft/models/create_tax_input.rb +0 -197
  208. data/lib/devdraft/models/update_payment_link_dto.rb +0 -197
  209. data/lib/devdraft/models/update_preference_input.rb +0 -197
  210. data/lib/devdraft/models/update_product_dto.rb +0 -355
  211. data/lib/devdraft/models/update_tax_input.rb +0 -197
  212. data/spec/api_client_spec.rb +0 -225
  213. data/spec/base_object_spec.rb +0 -109
  214. data/spec/configuration_spec.rb +0 -41
  215. data/spec/models/all_of_all_balances_response_eurc_spec.rb +0 -56
  216. data/spec/models/all_of_all_balances_response_usdc_spec.rb +0 -56
  217. data/spec/models/all_of_create_bank_payment_intent_dto_destination_currency_spec.rb +0 -34
  218. data/spec/models/all_of_create_bank_payment_intent_dto_destination_network_spec.rb +0 -34
  219. data/spec/models/all_of_create_bank_payment_intent_dto_source_currency_spec.rb +0 -34
  220. data/spec/models/all_of_create_bank_payment_intent_dto_source_payment_rail_spec.rb +0 -34
  221. data/spec/models/all_of_create_customer_dto_status_spec.rb +0 -34
  222. data/spec/models/all_of_create_liquidation_address_dto_destination_currency_spec.rb +0 -34
  223. data/spec/models/all_of_create_liquidation_address_dto_destination_payment_rail_spec.rb +0 -34
  224. data/spec/models/all_of_create_stable_payment_intent_dto_destination_currency_spec.rb +0 -34
  225. data/spec/models/all_of_create_stable_payment_intent_dto_destination_network_spec.rb +0 -34
  226. data/spec/models/all_of_create_stable_payment_intent_dto_source_currency_spec.rb +0 -34
  227. data/spec/models/all_of_create_stable_payment_intent_dto_source_network_spec.rb +0 -34
  228. data/spec/models/all_of_update_customer_dto_status_spec.rb +0 -34
  229. data/spec/models/create_product_dto_spec.rb +0 -110
  230. data/spec/models/create_tax_input_spec.rb +0 -34
  231. data/spec/models/update_payment_link_dto_spec.rb +0 -34
  232. data/spec/models/update_preference_input_spec.rb +0 -34
  233. data/spec/models/update_product_dto_spec.rb +0 -110
  234. data/spec/models/update_tax_input_spec.rb +0 -34
@@ -3,16 +3,18 @@
3
3
 
4
4
  # A comprehensive payment processing and business management API that enables seamless integration of cryptocurrency and traditional payment methods.
5
5
 
6
- OpenAPI spec version: 1.0.0
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.17.0
7
10
 
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 3.0.65
10
11
  =end
11
12
 
12
13
  require 'date'
14
+ require 'time'
13
15
 
14
- module DevDraftAI
15
- class ExchangeRateResponseDto
16
+ module Devdraft
17
+ class ExchangeRateResponseDto < ApiModelBase
16
18
  # Source currency code (USD for USDC)
17
19
  attr_accessor :from
18
20
 
@@ -43,15 +45,25 @@ module DevDraftAI
43
45
  }
44
46
  end
45
47
 
48
+ # Returns attribute mapping this model knows about
49
+ def self.acceptable_attribute_map
50
+ attribute_map
51
+ end
52
+
53
+ # Returns all the JSON keys this model knows about
54
+ def self.acceptable_attributes
55
+ acceptable_attribute_map.values
56
+ end
57
+
46
58
  # Attribute type mapping.
47
59
  def self.openapi_types
48
60
  {
49
- :'from' => :'Object',
50
- :'to' => :'Object',
51
- :'midmarket_rate' => :'Object',
52
- :'buy_rate' => :'Object',
53
- :'sell_rate' => :'Object',
54
- :'timestamp' => :'Object'
61
+ :'from' => :'String',
62
+ :'to' => :'String',
63
+ :'midmarket_rate' => :'String',
64
+ :'buy_rate' => :'String',
65
+ :'sell_rate' => :'String',
66
+ :'timestamp' => :'String'
55
67
  }
56
68
  end
57
69
 
@@ -60,40 +72,51 @@ module DevDraftAI
60
72
  Set.new([
61
73
  ])
62
74
  end
63
-
75
+
64
76
  # Initializes the object
65
77
  # @param [Hash] attributes Model attributes in the form of hash
66
78
  def initialize(attributes = {})
67
79
  if (!attributes.is_a?(Hash))
68
- fail ArgumentError, "The input argument (attributes) must be a hash in `DevDraftAI::ExchangeRateResponseDto` initialize method"
80
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Devdraft::ExchangeRateResponseDto` initialize method"
69
81
  end
70
82
 
71
83
  # check to see if the attribute exists and convert string to symbol for hash key
84
+ acceptable_attribute_map = self.class.acceptable_attribute_map
72
85
  attributes = attributes.each_with_object({}) { |(k, v), h|
73
- if (!self.class.attribute_map.key?(k.to_sym))
74
- fail ArgumentError, "`#{k}` is not a valid attribute in `DevDraftAI::ExchangeRateResponseDto`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
86
+ if (!acceptable_attribute_map.key?(k.to_sym))
87
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Devdraft::ExchangeRateResponseDto`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
75
88
  end
76
89
  h[k.to_sym] = v
77
90
  }
78
91
 
79
92
  if attributes.key?(:'from')
80
93
  self.from = attributes[:'from']
94
+ else
95
+ self.from = nil
81
96
  end
82
97
 
83
98
  if attributes.key?(:'to')
84
99
  self.to = attributes[:'to']
100
+ else
101
+ self.to = nil
85
102
  end
86
103
 
87
104
  if attributes.key?(:'midmarket_rate')
88
105
  self.midmarket_rate = attributes[:'midmarket_rate']
106
+ else
107
+ self.midmarket_rate = nil
89
108
  end
90
109
 
91
110
  if attributes.key?(:'buy_rate')
92
111
  self.buy_rate = attributes[:'buy_rate']
112
+ else
113
+ self.buy_rate = nil
93
114
  end
94
115
 
95
116
  if attributes.key?(:'sell_rate')
96
117
  self.sell_rate = attributes[:'sell_rate']
118
+ else
119
+ self.sell_rate = nil
97
120
  end
98
121
 
99
122
  if attributes.key?(:'timestamp')
@@ -104,6 +127,7 @@ module DevDraftAI
104
127
  # Show invalid properties with the reasons. Usually used together with valid?
105
128
  # @return Array for valid properties with the reasons
106
129
  def list_invalid_properties
130
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
107
131
  invalid_properties = Array.new
108
132
  if @from.nil?
109
133
  invalid_properties.push('invalid value for "from", from cannot be nil.')
@@ -131,6 +155,7 @@ module DevDraftAI
131
155
  # Check to see if the all the properties in the model are valid
132
156
  # @return true if the model is valid
133
157
  def valid?
158
+ warn '[DEPRECATED] the `valid?` method is obsolete'
134
159
  return false if @from.nil?
135
160
  return false if @to.nil?
136
161
  return false if @midmarket_rate.nil?
@@ -139,6 +164,56 @@ module DevDraftAI
139
164
  true
140
165
  end
141
166
 
167
+ # Custom attribute writer method with validation
168
+ # @param [Object] from Value to be assigned
169
+ def from=(from)
170
+ if from.nil?
171
+ fail ArgumentError, 'from cannot be nil'
172
+ end
173
+
174
+ @from = from
175
+ end
176
+
177
+ # Custom attribute writer method with validation
178
+ # @param [Object] to Value to be assigned
179
+ def to=(to)
180
+ if to.nil?
181
+ fail ArgumentError, 'to cannot be nil'
182
+ end
183
+
184
+ @to = to
185
+ end
186
+
187
+ # Custom attribute writer method with validation
188
+ # @param [Object] midmarket_rate Value to be assigned
189
+ def midmarket_rate=(midmarket_rate)
190
+ if midmarket_rate.nil?
191
+ fail ArgumentError, 'midmarket_rate cannot be nil'
192
+ end
193
+
194
+ @midmarket_rate = midmarket_rate
195
+ end
196
+
197
+ # Custom attribute writer method with validation
198
+ # @param [Object] buy_rate Value to be assigned
199
+ def buy_rate=(buy_rate)
200
+ if buy_rate.nil?
201
+ fail ArgumentError, 'buy_rate cannot be nil'
202
+ end
203
+
204
+ @buy_rate = buy_rate
205
+ end
206
+
207
+ # Custom attribute writer method with validation
208
+ # @param [Object] sell_rate Value to be assigned
209
+ def sell_rate=(sell_rate)
210
+ if sell_rate.nil?
211
+ fail ArgumentError, 'sell_rate cannot be nil'
212
+ end
213
+
214
+ @sell_rate = sell_rate
215
+ end
216
+
142
217
  # Checks equality by comparing each attribute.
143
218
  # @param [Object] Object to be compared
144
219
  def ==(o)
@@ -168,82 +243,23 @@ module DevDraftAI
168
243
  # @param [Hash] attributes Model attributes in the form of hash
169
244
  # @return [Object] Returns the model itself
170
245
  def self.build_from_hash(attributes)
171
- new.build_from_hash(attributes)
172
- end
173
-
174
- # Builds the object from hash
175
- # @param [Hash] attributes Model attributes in the form of hash
176
- # @return [Object] Returns the model itself
177
- def build_from_hash(attributes)
178
246
  return nil unless attributes.is_a?(Hash)
179
- self.class.openapi_types.each_pair do |key, type|
180
- if type =~ /\AArray<(.*)>/i
247
+ attributes = attributes.transform_keys(&:to_sym)
248
+ transformed_hash = {}
249
+ openapi_types.each_pair do |key, type|
250
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
251
+ transformed_hash["#{key}"] = nil
252
+ elsif type =~ /\AArray<(.*)>/i
181
253
  # check to ensure the input is an array given that the attribute
182
254
  # is documented as an array but the input is not
183
- if attributes[self.class.attribute_map[key]].is_a?(Array)
184
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
185
- end
186
- elsif !attributes[self.class.attribute_map[key]].nil?
187
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
188
- elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
189
- self.send("#{key}=", nil)
190
- end
191
- end
192
-
193
- self
194
- end
195
-
196
- # Deserializes the data based on type
197
- # @param string type Data type
198
- # @param string value Value to be deserialized
199
- # @return [Object] Deserialized data
200
- def _deserialize(type, value)
201
- case type.to_sym
202
- when :DateTime
203
- DateTime.parse(value)
204
- when :Date
205
- Date.parse(value)
206
- when :String
207
- value.to_s
208
- when :Integer
209
- value.to_i
210
- when :Float
211
- value.to_f
212
- when :Boolean
213
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
214
- true
215
- else
216
- false
217
- end
218
- when :Object
219
- # generic object (usually a Hash), return directly
220
- value
221
- when /\AArray<(?<inner_type>.+)>\z/
222
- inner_type = Regexp.last_match[:inner_type]
223
- value.map { |v| _deserialize(inner_type, v) }
224
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
225
- k_type = Regexp.last_match[:k_type]
226
- v_type = Regexp.last_match[:v_type]
227
- {}.tap do |hash|
228
- value.each do |k, v|
229
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
255
+ if attributes[attribute_map[key]].is_a?(Array)
256
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
230
257
  end
258
+ elsif !attributes[attribute_map[key]].nil?
259
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
231
260
  end
232
- else # model
233
- DevDraftAI.const_get(type).build_from_hash(value)
234
261
  end
235
- end
236
-
237
- # Returns the string representation of the object
238
- # @return [String] String presentation of the object
239
- def to_s
240
- to_hash.to_s
241
- end
242
-
243
- # to_body is an alias to to_hash (backward compatibility)
244
- # @return [Hash] Returns the object in the form of hash
245
- def to_body
246
- to_hash
262
+ new(transformed_hash)
247
263
  end
248
264
 
249
265
  # Returns the object in the form of hash
@@ -262,21 +278,6 @@ module DevDraftAI
262
278
  hash
263
279
  end
264
280
 
265
- # Outputs non-array value in the form of hash
266
- # For object, use to_hash. Otherwise, just return the value
267
- # @param [Object] value Any valid value
268
- # @return [Hash] Returns the value in the form of hash
269
- def _to_hash(value)
270
- if value.is_a?(Array)
271
- value.compact.map { |v| _to_hash(v) }
272
- elsif value.is_a?(Hash)
273
- {}.tap do |hash|
274
- value.each { |k, v| hash[k] = _to_hash(v) }
275
- end
276
- elsif value.respond_to? :to_hash
277
- value.to_hash
278
- else
279
- value
280
- end
281
- end end
281
+ end
282
+
282
283
  end
@@ -3,27 +3,39 @@
3
3
 
4
4
  # A comprehensive payment processing and business management API that enables seamless integration of cryptocurrency and traditional payment methods.
5
5
 
6
- OpenAPI spec version: 1.0.0
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.17.0
7
10
 
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 3.0.65
10
11
  =end
11
12
 
12
13
  require 'date'
14
+ require 'time'
13
15
 
14
- module DevDraftAI
16
+ module Devdraft
15
17
  class FiatCurrency
16
- USD = 'usd'.freeze
17
- EUR = 'eur'.freeze
18
- MXN = 'mxn'.freeze
18
+ USD = "usd".freeze
19
+ EUR = "eur".freeze
20
+ MXN = "mxn".freeze
21
+
22
+ def self.all_vars
23
+ @all_vars ||= [USD, EUR, MXN].freeze
24
+ end
25
+
26
+ # Builds the enum from string
27
+ # @param [String] The enum value in the form of the string
28
+ # @return [String] The enum value
29
+ def self.build_from_hash(value)
30
+ new.build_from_hash(value)
31
+ end
19
32
 
20
33
  # Builds the enum from string
21
34
  # @param [String] The enum value in the form of the string
22
35
  # @return [String] The enum value
23
36
  def build_from_hash(value)
24
- constantValues = FiatCurrency.constants.select { |c| FiatCurrency::const_get(c) == value }
25
- raise "Invalid ENUM value #{value} for class #FiatCurrency" if constantValues.empty?
26
- value
37
+ return value if FiatCurrency.all_vars.include?(value)
38
+ raise "Invalid ENUM value #{value} for class #FiatCurrency"
27
39
  end
28
40
  end
29
41
  end
@@ -3,16 +3,18 @@
3
3
 
4
4
  # A comprehensive payment processing and business management API that enables seamless integration of cryptocurrency and traditional payment methods.
5
5
 
6
- OpenAPI spec version: 1.0.0
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.17.0
7
10
 
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 3.0.65
10
11
  =end
11
12
 
12
13
  require 'date'
14
+ require 'time'
13
15
 
14
- module DevDraftAI
15
- class HealthResponseDto
16
+ module Devdraft
17
+ class HealthResponseDto < ApiModelBase
16
18
  # Overall health status of the service. Returns \"ok\" when healthy, \"error\" when issues detected.
17
19
  attr_accessor :status
18
20
 
@@ -65,15 +67,25 @@ module DevDraftAI
65
67
  }
66
68
  end
67
69
 
70
+ # Returns attribute mapping this model knows about
71
+ def self.acceptable_attribute_map
72
+ attribute_map
73
+ end
74
+
75
+ # Returns all the JSON keys this model knows about
76
+ def self.acceptable_attributes
77
+ acceptable_attribute_map.values
78
+ end
79
+
68
80
  # Attribute type mapping.
69
81
  def self.openapi_types
70
82
  {
71
- :'status' => :'Object',
72
- :'timestamp' => :'Object',
73
- :'version' => :'Object',
74
- :'database' => :'Object',
75
- :'message' => :'Object',
76
- :'authenticated' => :'Object'
83
+ :'status' => :'String',
84
+ :'timestamp' => :'Time',
85
+ :'version' => :'String',
86
+ :'database' => :'String',
87
+ :'message' => :'String',
88
+ :'authenticated' => :'Boolean'
77
89
  }
78
90
  end
79
91
 
@@ -82,50 +94,64 @@ module DevDraftAI
82
94
  Set.new([
83
95
  ])
84
96
  end
85
-
97
+
86
98
  # Initializes the object
87
99
  # @param [Hash] attributes Model attributes in the form of hash
88
100
  def initialize(attributes = {})
89
101
  if (!attributes.is_a?(Hash))
90
- fail ArgumentError, "The input argument (attributes) must be a hash in `DevDraftAI::HealthResponseDto` initialize method"
102
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Devdraft::HealthResponseDto` initialize method"
91
103
  end
92
104
 
93
105
  # check to see if the attribute exists and convert string to symbol for hash key
106
+ acceptable_attribute_map = self.class.acceptable_attribute_map
94
107
  attributes = attributes.each_with_object({}) { |(k, v), h|
95
- if (!self.class.attribute_map.key?(k.to_sym))
96
- fail ArgumentError, "`#{k}` is not a valid attribute in `DevDraftAI::HealthResponseDto`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
108
+ if (!acceptable_attribute_map.key?(k.to_sym))
109
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Devdraft::HealthResponseDto`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
97
110
  end
98
111
  h[k.to_sym] = v
99
112
  }
100
113
 
101
114
  if attributes.key?(:'status')
102
115
  self.status = attributes[:'status']
116
+ else
117
+ self.status = nil
103
118
  end
104
119
 
105
120
  if attributes.key?(:'timestamp')
106
121
  self.timestamp = attributes[:'timestamp']
122
+ else
123
+ self.timestamp = nil
107
124
  end
108
125
 
109
126
  if attributes.key?(:'version')
110
127
  self.version = attributes[:'version']
128
+ else
129
+ self.version = nil
111
130
  end
112
131
 
113
132
  if attributes.key?(:'database')
114
133
  self.database = attributes[:'database']
134
+ else
135
+ self.database = nil
115
136
  end
116
137
 
117
138
  if attributes.key?(:'message')
118
139
  self.message = attributes[:'message']
140
+ else
141
+ self.message = nil
119
142
  end
120
143
 
121
144
  if attributes.key?(:'authenticated')
122
145
  self.authenticated = attributes[:'authenticated']
146
+ else
147
+ self.authenticated = nil
123
148
  end
124
149
  end
125
150
 
126
151
  # Show invalid properties with the reasons. Usually used together with valid?
127
152
  # @return Array for valid properties with the reasons
128
153
  def list_invalid_properties
154
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
129
155
  invalid_properties = Array.new
130
156
  if @status.nil?
131
157
  invalid_properties.push('invalid value for "status", status cannot be nil.')
@@ -157,13 +183,14 @@ module DevDraftAI
157
183
  # Check to see if the all the properties in the model are valid
158
184
  # @return true if the model is valid
159
185
  def valid?
186
+ warn '[DEPRECATED] the `valid?` method is obsolete'
160
187
  return false if @status.nil?
161
- status_validator = EnumAttributeValidator.new('Object', ['ok', 'error'])
188
+ status_validator = EnumAttributeValidator.new('String', ["ok", "error"])
162
189
  return false unless status_validator.valid?(@status)
163
190
  return false if @timestamp.nil?
164
191
  return false if @version.nil?
165
192
  return false if @database.nil?
166
- database_validator = EnumAttributeValidator.new('Object', ['connected', 'error'])
193
+ database_validator = EnumAttributeValidator.new('String', ["connected", "error"])
167
194
  return false unless database_validator.valid?(@database)
168
195
  return false if @message.nil?
169
196
  return false if @authenticated.nil?
@@ -173,23 +200,63 @@ module DevDraftAI
173
200
  # Custom attribute writer method checking allowed values (enum).
174
201
  # @param [Object] status Object to be assigned
175
202
  def status=(status)
176
- validator = EnumAttributeValidator.new('Object', ['ok', 'error'])
203
+ validator = EnumAttributeValidator.new('String', ["ok", "error"])
177
204
  unless validator.valid?(status)
178
205
  fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
179
206
  end
180
207
  @status = status
181
208
  end
182
209
 
210
+ # Custom attribute writer method with validation
211
+ # @param [Object] timestamp Value to be assigned
212
+ def timestamp=(timestamp)
213
+ if timestamp.nil?
214
+ fail ArgumentError, 'timestamp cannot be nil'
215
+ end
216
+
217
+ @timestamp = timestamp
218
+ end
219
+
220
+ # Custom attribute writer method with validation
221
+ # @param [Object] version Value to be assigned
222
+ def version=(version)
223
+ if version.nil?
224
+ fail ArgumentError, 'version cannot be nil'
225
+ end
226
+
227
+ @version = version
228
+ end
229
+
183
230
  # Custom attribute writer method checking allowed values (enum).
184
231
  # @param [Object] database Object to be assigned
185
232
  def database=(database)
186
- validator = EnumAttributeValidator.new('Object', ['connected', 'error'])
233
+ validator = EnumAttributeValidator.new('String', ["connected", "error"])
187
234
  unless validator.valid?(database)
188
235
  fail ArgumentError, "invalid value for \"database\", must be one of #{validator.allowable_values}."
189
236
  end
190
237
  @database = database
191
238
  end
192
239
 
240
+ # Custom attribute writer method with validation
241
+ # @param [Object] message Value to be assigned
242
+ def message=(message)
243
+ if message.nil?
244
+ fail ArgumentError, 'message cannot be nil'
245
+ end
246
+
247
+ @message = message
248
+ end
249
+
250
+ # Custom attribute writer method with validation
251
+ # @param [Object] authenticated Value to be assigned
252
+ def authenticated=(authenticated)
253
+ if authenticated.nil?
254
+ fail ArgumentError, 'authenticated cannot be nil'
255
+ end
256
+
257
+ @authenticated = authenticated
258
+ end
259
+
193
260
  # Checks equality by comparing each attribute.
194
261
  # @param [Object] Object to be compared
195
262
  def ==(o)
@@ -219,82 +286,23 @@ module DevDraftAI
219
286
  # @param [Hash] attributes Model attributes in the form of hash
220
287
  # @return [Object] Returns the model itself
221
288
  def self.build_from_hash(attributes)
222
- new.build_from_hash(attributes)
223
- end
224
-
225
- # Builds the object from hash
226
- # @param [Hash] attributes Model attributes in the form of hash
227
- # @return [Object] Returns the model itself
228
- def build_from_hash(attributes)
229
289
  return nil unless attributes.is_a?(Hash)
230
- self.class.openapi_types.each_pair do |key, type|
231
- if type =~ /\AArray<(.*)>/i
290
+ attributes = attributes.transform_keys(&:to_sym)
291
+ transformed_hash = {}
292
+ openapi_types.each_pair do |key, type|
293
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
294
+ transformed_hash["#{key}"] = nil
295
+ elsif type =~ /\AArray<(.*)>/i
232
296
  # check to ensure the input is an array given that the attribute
233
297
  # is documented as an array but the input is not
234
- if attributes[self.class.attribute_map[key]].is_a?(Array)
235
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
236
- end
237
- elsif !attributes[self.class.attribute_map[key]].nil?
238
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
239
- elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
240
- self.send("#{key}=", nil)
241
- end
242
- end
243
-
244
- self
245
- end
246
-
247
- # Deserializes the data based on type
248
- # @param string type Data type
249
- # @param string value Value to be deserialized
250
- # @return [Object] Deserialized data
251
- def _deserialize(type, value)
252
- case type.to_sym
253
- when :DateTime
254
- DateTime.parse(value)
255
- when :Date
256
- Date.parse(value)
257
- when :String
258
- value.to_s
259
- when :Integer
260
- value.to_i
261
- when :Float
262
- value.to_f
263
- when :Boolean
264
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
265
- true
266
- else
267
- false
268
- end
269
- when :Object
270
- # generic object (usually a Hash), return directly
271
- value
272
- when /\AArray<(?<inner_type>.+)>\z/
273
- inner_type = Regexp.last_match[:inner_type]
274
- value.map { |v| _deserialize(inner_type, v) }
275
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
276
- k_type = Regexp.last_match[:k_type]
277
- v_type = Regexp.last_match[:v_type]
278
- {}.tap do |hash|
279
- value.each do |k, v|
280
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
298
+ if attributes[attribute_map[key]].is_a?(Array)
299
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
281
300
  end
301
+ elsif !attributes[attribute_map[key]].nil?
302
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
282
303
  end
283
- else # model
284
- DevDraftAI.const_get(type).build_from_hash(value)
285
304
  end
286
- end
287
-
288
- # Returns the string representation of the object
289
- # @return [String] String presentation of the object
290
- def to_s
291
- to_hash.to_s
292
- end
293
-
294
- # to_body is an alias to to_hash (backward compatibility)
295
- # @return [Hash] Returns the object in the form of hash
296
- def to_body
297
- to_hash
305
+ new(transformed_hash)
298
306
  end
299
307
 
300
308
  # Returns the object in the form of hash
@@ -313,21 +321,6 @@ module DevDraftAI
313
321
  hash
314
322
  end
315
323
 
316
- # Outputs non-array value in the form of hash
317
- # For object, use to_hash. Otherwise, just return the value
318
- # @param [Object] value Any valid value
319
- # @return [Hash] Returns the value in the form of hash
320
- def _to_hash(value)
321
- if value.is_a?(Array)
322
- value.compact.map { |v| _to_hash(v) }
323
- elsif value.is_a?(Hash)
324
- {}.tap do |hash|
325
- value.each { |k, v| hash[k] = _to_hash(v) }
326
- end
327
- elsif value.respond_to? :to_hash
328
- value.to_hash
329
- else
330
- value
331
- end
332
- end end
324
+ end
325
+
333
326
  end