devdraft 1.0.1 → 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 +160 -191
  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 -94
  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 CreateCustomerDto
16
+ module Devdraft
17
+ class CreateCustomerDto < ApiModelBase
16
18
  # Customer's first name. Used for personalization and legal documentation.
17
19
  attr_accessor :first_name
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
- :'first_name' => :'Object',
72
- :'last_name' => :'Object',
73
- :'email' => :'Object',
74
- :'phone_number' => :'Object',
75
- :'customer_type' => :'Object',
76
- :'status' => :'Object'
83
+ :'first_name' => :'String',
84
+ :'last_name' => :'String',
85
+ :'email' => :'String',
86
+ :'phone_number' => :'String',
87
+ :'customer_type' => :'CustomerType',
88
+ :'status' => :'CustomerStatus'
77
89
  }
78
90
  end
79
91
 
@@ -82,28 +94,33 @@ 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::CreateCustomerDto` initialize method"
102
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Devdraft::CreateCustomerDto` 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::CreateCustomerDto`. 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::CreateCustomerDto`. 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?(:'first_name')
102
115
  self.first_name = attributes[:'first_name']
116
+ else
117
+ self.first_name = nil
103
118
  end
104
119
 
105
120
  if attributes.key?(:'last_name')
106
121
  self.last_name = attributes[:'last_name']
122
+ else
123
+ self.last_name = nil
107
124
  end
108
125
 
109
126
  if attributes.key?(:'email')
@@ -112,12 +129,12 @@ module DevDraftAI
112
129
 
113
130
  if attributes.key?(:'phone_number')
114
131
  self.phone_number = attributes[:'phone_number']
132
+ else
133
+ self.phone_number = nil
115
134
  end
116
135
 
117
136
  if attributes.key?(:'customer_type')
118
137
  self.customer_type = attributes[:'customer_type']
119
- else
120
- self.customer_type = 'Individual'
121
138
  end
122
139
 
123
140
  if attributes.key?(:'status')
@@ -128,41 +145,108 @@ module DevDraftAI
128
145
  # Show invalid properties with the reasons. Usually used together with valid?
129
146
  # @return Array for valid properties with the reasons
130
147
  def list_invalid_properties
148
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
131
149
  invalid_properties = Array.new
132
150
  if @first_name.nil?
133
151
  invalid_properties.push('invalid value for "first_name", first_name cannot be nil.')
134
152
  end
135
153
 
154
+ if @first_name.to_s.length > 100
155
+ invalid_properties.push('invalid value for "first_name", the character length must be smaller than or equal to 100.')
156
+ end
157
+
158
+ if @first_name.to_s.length < 1
159
+ invalid_properties.push('invalid value for "first_name", the character length must be greater than or equal to 1.')
160
+ end
161
+
136
162
  if @last_name.nil?
137
163
  invalid_properties.push('invalid value for "last_name", last_name cannot be nil.')
138
164
  end
139
165
 
166
+ if @last_name.to_s.length > 100
167
+ invalid_properties.push('invalid value for "last_name", the character length must be smaller than or equal to 100.')
168
+ end
169
+
170
+ if @last_name.to_s.length < 1
171
+ invalid_properties.push('invalid value for "last_name", the character length must be greater than or equal to 1.')
172
+ end
173
+
140
174
  if @phone_number.nil?
141
175
  invalid_properties.push('invalid value for "phone_number", phone_number cannot be nil.')
142
176
  end
143
177
 
178
+ pattern = Regexp.new(/^[+]?[1-9]\d{1,14}$/)
179
+ if @phone_number !~ pattern
180
+ invalid_properties.push("invalid value for \"phone_number\", must conform to the pattern #{pattern}.")
181
+ end
182
+
144
183
  invalid_properties
145
184
  end
146
185
 
147
186
  # Check to see if the all the properties in the model are valid
148
187
  # @return true if the model is valid
149
188
  def valid?
189
+ warn '[DEPRECATED] the `valid?` method is obsolete'
150
190
  return false if @first_name.nil?
191
+ return false if @first_name.to_s.length > 100
192
+ return false if @first_name.to_s.length < 1
151
193
  return false if @last_name.nil?
194
+ return false if @last_name.to_s.length > 100
195
+ return false if @last_name.to_s.length < 1
152
196
  return false if @phone_number.nil?
153
- customer_type_validator = EnumAttributeValidator.new('Object', ['Individual', 'Business', 'Enterprise', 'Non-Profit'])
154
- return false unless customer_type_validator.valid?(@customer_type)
197
+ return false if @phone_number !~ Regexp.new(/^[+]?[1-9]\d{1,14}$/)
155
198
  true
156
199
  end
157
200
 
158
- # Custom attribute writer method checking allowed values (enum).
159
- # @param [Object] customer_type Object to be assigned
160
- def customer_type=(customer_type)
161
- validator = EnumAttributeValidator.new('Object', ['Individual', 'Business', 'Enterprise', 'Non-Profit'])
162
- unless validator.valid?(customer_type)
163
- fail ArgumentError, "invalid value for \"customer_type\", must be one of #{validator.allowable_values}."
201
+ # Custom attribute writer method with validation
202
+ # @param [Object] first_name Value to be assigned
203
+ def first_name=(first_name)
204
+ if first_name.nil?
205
+ fail ArgumentError, 'first_name cannot be nil'
206
+ end
207
+
208
+ if first_name.to_s.length > 100
209
+ fail ArgumentError, 'invalid value for "first_name", the character length must be smaller than or equal to 100.'
210
+ end
211
+
212
+ if first_name.to_s.length < 1
213
+ fail ArgumentError, 'invalid value for "first_name", the character length must be greater than or equal to 1.'
214
+ end
215
+
216
+ @first_name = first_name
217
+ end
218
+
219
+ # Custom attribute writer method with validation
220
+ # @param [Object] last_name Value to be assigned
221
+ def last_name=(last_name)
222
+ if last_name.nil?
223
+ fail ArgumentError, 'last_name cannot be nil'
224
+ end
225
+
226
+ if last_name.to_s.length > 100
227
+ fail ArgumentError, 'invalid value for "last_name", the character length must be smaller than or equal to 100.'
228
+ end
229
+
230
+ if last_name.to_s.length < 1
231
+ fail ArgumentError, 'invalid value for "last_name", the character length must be greater than or equal to 1.'
232
+ end
233
+
234
+ @last_name = last_name
235
+ end
236
+
237
+ # Custom attribute writer method with validation
238
+ # @param [Object] phone_number Value to be assigned
239
+ def phone_number=(phone_number)
240
+ if phone_number.nil?
241
+ fail ArgumentError, 'phone_number cannot be nil'
242
+ end
243
+
244
+ pattern = Regexp.new(/^[+]?[1-9]\d{1,14}$/)
245
+ if phone_number !~ pattern
246
+ fail ArgumentError, "invalid value for \"phone_number\", must conform to the pattern #{pattern}."
164
247
  end
165
- @customer_type = customer_type
248
+
249
+ @phone_number = phone_number
166
250
  end
167
251
 
168
252
  # Checks equality by comparing each attribute.
@@ -194,82 +278,23 @@ module DevDraftAI
194
278
  # @param [Hash] attributes Model attributes in the form of hash
195
279
  # @return [Object] Returns the model itself
196
280
  def self.build_from_hash(attributes)
197
- new.build_from_hash(attributes)
198
- end
199
-
200
- # Builds the object from hash
201
- # @param [Hash] attributes Model attributes in the form of hash
202
- # @return [Object] Returns the model itself
203
- def build_from_hash(attributes)
204
281
  return nil unless attributes.is_a?(Hash)
205
- self.class.openapi_types.each_pair do |key, type|
206
- if type =~ /\AArray<(.*)>/i
282
+ attributes = attributes.transform_keys(&:to_sym)
283
+ transformed_hash = {}
284
+ openapi_types.each_pair do |key, type|
285
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
286
+ transformed_hash["#{key}"] = nil
287
+ elsif type =~ /\AArray<(.*)>/i
207
288
  # check to ensure the input is an array given that the attribute
208
289
  # is documented as an array but the input is not
209
- if attributes[self.class.attribute_map[key]].is_a?(Array)
210
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
211
- end
212
- elsif !attributes[self.class.attribute_map[key]].nil?
213
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
214
- elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
215
- self.send("#{key}=", nil)
216
- end
217
- end
218
-
219
- self
220
- end
221
-
222
- # Deserializes the data based on type
223
- # @param string type Data type
224
- # @param string value Value to be deserialized
225
- # @return [Object] Deserialized data
226
- def _deserialize(type, value)
227
- case type.to_sym
228
- when :DateTime
229
- DateTime.parse(value)
230
- when :Date
231
- Date.parse(value)
232
- when :String
233
- value.to_s
234
- when :Integer
235
- value.to_i
236
- when :Float
237
- value.to_f
238
- when :Boolean
239
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
240
- true
241
- else
242
- false
243
- end
244
- when :Object
245
- # generic object (usually a Hash), return directly
246
- value
247
- when /\AArray<(?<inner_type>.+)>\z/
248
- inner_type = Regexp.last_match[:inner_type]
249
- value.map { |v| _deserialize(inner_type, v) }
250
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
251
- k_type = Regexp.last_match[:k_type]
252
- v_type = Regexp.last_match[:v_type]
253
- {}.tap do |hash|
254
- value.each do |k, v|
255
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
290
+ if attributes[attribute_map[key]].is_a?(Array)
291
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
256
292
  end
293
+ elsif !attributes[attribute_map[key]].nil?
294
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
257
295
  end
258
- else # model
259
- DevDraftAI.const_get(type).build_from_hash(value)
260
296
  end
261
- end
262
-
263
- # Returns the string representation of the object
264
- # @return [String] String presentation of the object
265
- def to_s
266
- to_hash.to_s
267
- end
268
-
269
- # to_body is an alias to to_hash (backward compatibility)
270
- # @return [Hash] Returns the object in the form of hash
271
- def to_body
272
- to_hash
297
+ new(transformed_hash)
273
298
  end
274
299
 
275
300
  # Returns the object in the form of hash
@@ -288,21 +313,6 @@ module DevDraftAI
288
313
  hash
289
314
  end
290
315
 
291
- # Outputs non-array value in the form of hash
292
- # For object, use to_hash. Otherwise, just return the value
293
- # @param [Object] value Any valid value
294
- # @return [Hash] Returns the value in the form of hash
295
- def _to_hash(value)
296
- if value.is_a?(Array)
297
- value.compact.map { |v| _to_hash(v) }
298
- elsif value.is_a?(Hash)
299
- {}.tap do |hash|
300
- value.each { |k, v| hash[k] = _to_hash(v) }
301
- end
302
- elsif value.respond_to? :to_hash
303
- value.to_hash
304
- else
305
- value
306
- end
307
- end end
316
+ end
317
+
308
318
  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 CreateDirectBankTransferDto
16
+ module Devdraft
17
+ class CreateDirectBankTransferDto < ApiModelBase
16
18
  # The ID of the bridge wallet to transfer from
17
19
  attr_accessor :wallet_id
18
20
 
@@ -51,17 +53,27 @@ module DevDraftAI
51
53
  }
52
54
  end
53
55
 
56
+ # Returns attribute mapping this model knows about
57
+ def self.acceptable_attribute_map
58
+ attribute_map
59
+ end
60
+
61
+ # Returns all the JSON keys this model knows about
62
+ def self.acceptable_attributes
63
+ acceptable_attribute_map.values
64
+ end
65
+
54
66
  # Attribute type mapping.
55
67
  def self.openapi_types
56
68
  {
57
- :'wallet_id' => :'Object',
58
- :'payment_rail' => :'Object',
59
- :'destination_currency' => :'Object',
60
- :'source_currency' => :'Object',
61
- :'amount' => :'Object',
62
- :'wire_message' => :'Object',
63
- :'sepa_reference' => :'Object',
64
- :'ach_reference' => :'Object'
69
+ :'wallet_id' => :'String',
70
+ :'payment_rail' => :'String',
71
+ :'destination_currency' => :'String',
72
+ :'source_currency' => :'String',
73
+ :'amount' => :'Float',
74
+ :'wire_message' => :'String',
75
+ :'sepa_reference' => :'String',
76
+ :'ach_reference' => :'String'
65
77
  }
66
78
  end
67
79
 
@@ -70,40 +82,51 @@ module DevDraftAI
70
82
  Set.new([
71
83
  ])
72
84
  end
73
-
85
+
74
86
  # Initializes the object
75
87
  # @param [Hash] attributes Model attributes in the form of hash
76
88
  def initialize(attributes = {})
77
89
  if (!attributes.is_a?(Hash))
78
- fail ArgumentError, "The input argument (attributes) must be a hash in `DevDraftAI::CreateDirectBankTransferDto` initialize method"
90
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Devdraft::CreateDirectBankTransferDto` initialize method"
79
91
  end
80
92
 
81
93
  # check to see if the attribute exists and convert string to symbol for hash key
94
+ acceptable_attribute_map = self.class.acceptable_attribute_map
82
95
  attributes = attributes.each_with_object({}) { |(k, v), h|
83
- if (!self.class.attribute_map.key?(k.to_sym))
84
- fail ArgumentError, "`#{k}` is not a valid attribute in `DevDraftAI::CreateDirectBankTransferDto`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
96
+ if (!acceptable_attribute_map.key?(k.to_sym))
97
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Devdraft::CreateDirectBankTransferDto`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
85
98
  end
86
99
  h[k.to_sym] = v
87
100
  }
88
101
 
89
102
  if attributes.key?(:'wallet_id')
90
103
  self.wallet_id = attributes[:'wallet_id']
104
+ else
105
+ self.wallet_id = nil
91
106
  end
92
107
 
93
108
  if attributes.key?(:'payment_rail')
94
109
  self.payment_rail = attributes[:'payment_rail']
110
+ else
111
+ self.payment_rail = nil
95
112
  end
96
113
 
97
114
  if attributes.key?(:'destination_currency')
98
115
  self.destination_currency = attributes[:'destination_currency']
116
+ else
117
+ self.destination_currency = nil
99
118
  end
100
119
 
101
120
  if attributes.key?(:'source_currency')
102
121
  self.source_currency = attributes[:'source_currency']
122
+ else
123
+ self.source_currency = nil
103
124
  end
104
125
 
105
126
  if attributes.key?(:'amount')
106
127
  self.amount = attributes[:'amount']
128
+ else
129
+ self.amount = nil
107
130
  end
108
131
 
109
132
  if attributes.key?(:'wire_message')
@@ -122,6 +145,7 @@ module DevDraftAI
122
145
  # Show invalid properties with the reasons. Usually used together with valid?
123
146
  # @return Array for valid properties with the reasons
124
147
  def list_invalid_properties
148
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
125
149
  invalid_properties = Array.new
126
150
  if @wallet_id.nil?
127
151
  invalid_properties.push('invalid value for "wallet_id", wallet_id cannot be nil.')
@@ -149,6 +173,7 @@ module DevDraftAI
149
173
  # Check to see if the all the properties in the model are valid
150
174
  # @return true if the model is valid
151
175
  def valid?
176
+ warn '[DEPRECATED] the `valid?` method is obsolete'
152
177
  return false if @wallet_id.nil?
153
178
  return false if @payment_rail.nil?
154
179
  return false if @destination_currency.nil?
@@ -157,6 +182,56 @@ module DevDraftAI
157
182
  true
158
183
  end
159
184
 
185
+ # Custom attribute writer method with validation
186
+ # @param [Object] wallet_id Value to be assigned
187
+ def wallet_id=(wallet_id)
188
+ if wallet_id.nil?
189
+ fail ArgumentError, 'wallet_id cannot be nil'
190
+ end
191
+
192
+ @wallet_id = wallet_id
193
+ end
194
+
195
+ # Custom attribute writer method with validation
196
+ # @param [Object] payment_rail Value to be assigned
197
+ def payment_rail=(payment_rail)
198
+ if payment_rail.nil?
199
+ fail ArgumentError, 'payment_rail cannot be nil'
200
+ end
201
+
202
+ @payment_rail = payment_rail
203
+ end
204
+
205
+ # Custom attribute writer method with validation
206
+ # @param [Object] destination_currency Value to be assigned
207
+ def destination_currency=(destination_currency)
208
+ if destination_currency.nil?
209
+ fail ArgumentError, 'destination_currency cannot be nil'
210
+ end
211
+
212
+ @destination_currency = destination_currency
213
+ end
214
+
215
+ # Custom attribute writer method with validation
216
+ # @param [Object] source_currency Value to be assigned
217
+ def source_currency=(source_currency)
218
+ if source_currency.nil?
219
+ fail ArgumentError, 'source_currency cannot be nil'
220
+ end
221
+
222
+ @source_currency = source_currency
223
+ end
224
+
225
+ # Custom attribute writer method with validation
226
+ # @param [Object] amount Value to be assigned
227
+ def amount=(amount)
228
+ if amount.nil?
229
+ fail ArgumentError, 'amount cannot be nil'
230
+ end
231
+
232
+ @amount = amount
233
+ end
234
+
160
235
  # Checks equality by comparing each attribute.
161
236
  # @param [Object] Object to be compared
162
237
  def ==(o)
@@ -188,82 +263,23 @@ module DevDraftAI
188
263
  # @param [Hash] attributes Model attributes in the form of hash
189
264
  # @return [Object] Returns the model itself
190
265
  def self.build_from_hash(attributes)
191
- new.build_from_hash(attributes)
192
- end
193
-
194
- # Builds the object from hash
195
- # @param [Hash] attributes Model attributes in the form of hash
196
- # @return [Object] Returns the model itself
197
- def build_from_hash(attributes)
198
266
  return nil unless attributes.is_a?(Hash)
199
- self.class.openapi_types.each_pair do |key, type|
200
- if type =~ /\AArray<(.*)>/i
267
+ attributes = attributes.transform_keys(&:to_sym)
268
+ transformed_hash = {}
269
+ openapi_types.each_pair do |key, type|
270
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
271
+ transformed_hash["#{key}"] = nil
272
+ elsif type =~ /\AArray<(.*)>/i
201
273
  # check to ensure the input is an array given that the attribute
202
274
  # is documented as an array but the input is not
203
- if attributes[self.class.attribute_map[key]].is_a?(Array)
204
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
205
- end
206
- elsif !attributes[self.class.attribute_map[key]].nil?
207
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
208
- elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
209
- self.send("#{key}=", nil)
210
- end
211
- end
212
-
213
- self
214
- end
215
-
216
- # Deserializes the data based on type
217
- # @param string type Data type
218
- # @param string value Value to be deserialized
219
- # @return [Object] Deserialized data
220
- def _deserialize(type, value)
221
- case type.to_sym
222
- when :DateTime
223
- DateTime.parse(value)
224
- when :Date
225
- Date.parse(value)
226
- when :String
227
- value.to_s
228
- when :Integer
229
- value.to_i
230
- when :Float
231
- value.to_f
232
- when :Boolean
233
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
234
- true
235
- else
236
- false
237
- end
238
- when :Object
239
- # generic object (usually a Hash), return directly
240
- value
241
- when /\AArray<(?<inner_type>.+)>\z/
242
- inner_type = Regexp.last_match[:inner_type]
243
- value.map { |v| _deserialize(inner_type, v) }
244
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
245
- k_type = Regexp.last_match[:k_type]
246
- v_type = Regexp.last_match[:v_type]
247
- {}.tap do |hash|
248
- value.each do |k, v|
249
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
275
+ if attributes[attribute_map[key]].is_a?(Array)
276
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
250
277
  end
278
+ elsif !attributes[attribute_map[key]].nil?
279
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
251
280
  end
252
- else # model
253
- DevDraftAI.const_get(type).build_from_hash(value)
254
281
  end
255
- end
256
-
257
- # Returns the string representation of the object
258
- # @return [String] String presentation of the object
259
- def to_s
260
- to_hash.to_s
261
- end
262
-
263
- # to_body is an alias to to_hash (backward compatibility)
264
- # @return [Hash] Returns the object in the form of hash
265
- def to_body
266
- to_hash
282
+ new(transformed_hash)
267
283
  end
268
284
 
269
285
  # Returns the object in the form of hash
@@ -282,21 +298,6 @@ module DevDraftAI
282
298
  hash
283
299
  end
284
300
 
285
- # Outputs non-array value in the form of hash
286
- # For object, use to_hash. Otherwise, just return the value
287
- # @param [Object] value Any valid value
288
- # @return [Hash] Returns the value in the form of hash
289
- def _to_hash(value)
290
- if value.is_a?(Array)
291
- value.compact.map { |v| _to_hash(v) }
292
- elsif value.is_a?(Hash)
293
- {}.tap do |hash|
294
- value.each { |k, v| hash[k] = _to_hash(v) }
295
- end
296
- elsif value.respond_to? :to_hash
297
- value.to_hash
298
- else
299
- value
300
- end
301
- end end
301
+ end
302
+
302
303
  end