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,13 +3,16 @@
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
- module DevDraftAI
13
+ require 'cgi'
14
+
15
+ module Devdraft
13
16
  class TaxesApi
14
17
  attr_accessor :api_client
15
18
 
@@ -17,25 +20,27 @@ module DevDraftAI
17
20
  @api_client = api_client
18
21
  end
19
22
  # Create a new tax
20
- # @param body
23
+ # Creates a new tax rate that can be applied to products, invoices, and payment links. ## Use Cases - Set up sales tax for different regions - Create VAT rates for international customers - Configure state and local tax rates - Manage tax compliance requirements ## Example: Create Basic Sales Tax ```json { \"name\": \"Sales Tax\", \"description\": \"Standard sales tax for retail transactions\", \"percentage\": 8.5, \"active\": true } ``` ## Required Fields - `name`: Tax name for identification (1-100 characters) - `percentage`: Tax rate percentage (0-100) ## Optional Fields - `description`: Explanation of what this tax covers (max 255 characters) - `active`: Whether this tax is currently active (default: true) - `appIds`: Array of app IDs where this tax should be available
24
+ # @param create_tax_dto [CreateTaxDto] Tax creation data
21
25
  # @param [Hash] opts the optional parameters
22
- # @return [nil]
23
- def tax_controller_create(body, opts = {})
24
- tax_controller_create_with_http_info(body, opts)
25
- nil
26
+ # @return [TaxControllerCreate201Response]
27
+ def tax_controller_create(create_tax_dto, opts = {})
28
+ data, _status_code, _headers = tax_controller_create_with_http_info(create_tax_dto, opts)
29
+ data
26
30
  end
27
31
 
28
32
  # Create a new tax
29
- # @param body
33
+ # Creates a new tax rate that can be applied to products, invoices, and payment links. ## Use Cases - Set up sales tax for different regions - Create VAT rates for international customers - Configure state and local tax rates - Manage tax compliance requirements ## Example: Create Basic Sales Tax ```json { \"name\": \"Sales Tax\", \"description\": \"Standard sales tax for retail transactions\", \"percentage\": 8.5, \"active\": true } ``` ## Required Fields - `name`: Tax name for identification (1-100 characters) - `percentage`: Tax rate percentage (0-100) ## Optional Fields - `description`: Explanation of what this tax covers (max 255 characters) - `active`: Whether this tax is currently active (default: true) - `appIds`: Array of app IDs where this tax should be available
34
+ # @param create_tax_dto [CreateTaxDto] Tax creation data
30
35
  # @param [Hash] opts the optional parameters
31
- # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
32
- def tax_controller_create_with_http_info(body, opts = {})
36
+ # @return [Array<(TaxControllerCreate201Response, Integer, Hash)>] TaxControllerCreate201Response data, response status code and response headers
37
+ def tax_controller_create_with_http_info(create_tax_dto, opts = {})
33
38
  if @api_client.config.debugging
34
39
  @api_client.config.logger.debug 'Calling API: TaxesApi.tax_controller_create ...'
35
40
  end
36
- # verify the required parameter 'body' is set
37
- if @api_client.config.client_side_validation && body.nil?
38
- fail ArgumentError, "Missing the required parameter 'body' when calling TaxesApi.tax_controller_create"
41
+ # verify the required parameter 'create_tax_dto' is set
42
+ if @api_client.config.client_side_validation && create_tax_dto.nil?
43
+ fail ArgumentError, "Missing the required parameter 'create_tax_dto' when calling TaxesApi.tax_controller_create"
39
44
  end
40
45
  # resource path
41
46
  local_var_path = '/api/v0/taxes'
@@ -45,50 +50,141 @@ module DevDraftAI
45
50
 
46
51
  # header parameters
47
52
  header_params = opts[:header_params] || {}
53
+ # HTTP header 'Accept' (if needed)
54
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
48
55
  # HTTP header 'Content-Type'
49
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
56
+ content_type = @api_client.select_header_content_type(['application/json'])
57
+ if !content_type.nil?
58
+ header_params['Content-Type'] = content_type
59
+ end
50
60
 
51
61
  # form parameters
52
62
  form_params = opts[:form_params] || {}
53
63
 
54
64
  # http body (model)
55
- post_body = opts[:body] || @api_client.object_to_http_body(body)
65
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_tax_dto)
66
+
67
+ # return_type
68
+ return_type = opts[:debug_return_type] || 'TaxControllerCreate201Response'
56
69
 
57
- return_type = opts[:return_type]
70
+ # auth_names
71
+ auth_names = opts[:debug_auth_names] || ['x-client-secret', 'x-client-key']
58
72
 
59
- auth_names = opts[:auth_names] || ['x-client-key', 'x-client-secret']
60
- data, status_code, headers = @api_client.call_api(:POST, local_var_path,
73
+ new_options = opts.merge(
74
+ :operation => :"TaxesApi.tax_controller_create",
61
75
  :header_params => header_params,
62
76
  :query_params => query_params,
63
77
  :form_params => form_params,
64
78
  :body => post_body,
65
79
  :auth_names => auth_names,
66
- :return_type => return_type)
80
+ :return_type => return_type
81
+ )
67
82
 
83
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
68
84
  if @api_client.config.debugging
69
85
  @api_client.config.logger.debug "API called: TaxesApi#tax_controller_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
70
86
  end
71
87
  return data, status_code, headers
72
88
  end
73
- # Get all taxes
89
+
90
+ # Tax ID required for deletion
91
+ # This endpoint requires a tax ID in the URL path. Use DELETE /api/v0/taxes/{id} instead.
74
92
  # @param [Hash] opts the optional parameters
75
- # @option opts [String] :skip Number of records to skip
76
- # @option opts [String] :take Number of records to take
93
+ # @return [nil]
94
+ def tax_controller_delete_without_id(opts = {})
95
+ tax_controller_delete_without_id_with_http_info(opts)
96
+ nil
97
+ end
98
+
99
+ # Tax ID required for deletion
100
+ # This endpoint requires a tax ID in the URL path. Use DELETE /api/v0/taxes/{id} instead.
101
+ # @param [Hash] opts the optional parameters
102
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
103
+ def tax_controller_delete_without_id_with_http_info(opts = {})
104
+ if @api_client.config.debugging
105
+ @api_client.config.logger.debug 'Calling API: TaxesApi.tax_controller_delete_without_id ...'
106
+ end
107
+ # resource path
108
+ local_var_path = '/api/v0/taxes'
109
+
110
+ # query parameters
111
+ query_params = opts[:query_params] || {}
112
+
113
+ # header parameters
114
+ header_params = opts[:header_params] || {}
115
+ # HTTP header 'Accept' (if needed)
116
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
117
+
118
+ # form parameters
119
+ form_params = opts[:form_params] || {}
120
+
121
+ # http body (model)
122
+ post_body = opts[:debug_body]
123
+
124
+ # return_type
125
+ return_type = opts[:debug_return_type]
126
+
127
+ # auth_names
128
+ auth_names = opts[:debug_auth_names] || ['x-client-secret', 'x-client-key']
129
+
130
+ new_options = opts.merge(
131
+ :operation => :"TaxesApi.tax_controller_delete_without_id",
132
+ :header_params => header_params,
133
+ :query_params => query_params,
134
+ :form_params => form_params,
135
+ :body => post_body,
136
+ :auth_names => auth_names,
137
+ :return_type => return_type
138
+ )
139
+
140
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
141
+ if @api_client.config.debugging
142
+ @api_client.config.logger.debug "API called: TaxesApi#tax_controller_delete_without_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
143
+ end
144
+ return data, status_code, headers
145
+ end
146
+
147
+ # Get all taxes with filters
148
+ # Retrieves a list of taxes with optional filtering and pagination. ## Use Cases - List all available tax rates - Search taxes by name - Filter active/inactive taxes - Export tax configuration ## Query Parameters - `skip`: Number of records to skip (default: 0, min: 0) - `take`: Number of records to return (default: 10, min: 1, max: 100) - `name`: Filter taxes by name (partial match, case-insensitive) - `active`: Filter by active status (true/false) ## Example Request `GET /api/v0/taxes?skip=0&take=20&active=true&name=Sales` ## Example Response ```json [ { \"id\": \"tax_123456\", \"name\": \"Sales Tax\", \"description\": \"Standard sales tax for retail transactions\", \"percentage\": 8.5, \"active\": true, \"created_at\": \"2024-03-20T10:00:00Z\", \"updated_at\": \"2024-03-20T10:00:00Z\" } ] ```
149
+ # @param [Hash] opts the optional parameters
150
+ # @option opts [Float] :skip Number of records to skip for pagination (default to 0)
151
+ # @option opts [Float] :take Number of records to return (max 100) (default to 10)
152
+ # @option opts [String] :name Filter taxes by name (partial match, case-insensitive)
153
+ # @option opts [Boolean] :active Filter by active status
77
154
  # @return [nil]
78
155
  def tax_controller_find_all(opts = {})
79
156
  tax_controller_find_all_with_http_info(opts)
80
157
  nil
81
158
  end
82
159
 
83
- # Get all taxes
160
+ # Get all taxes with filters
161
+ # Retrieves a list of taxes with optional filtering and pagination. ## Use Cases - List all available tax rates - Search taxes by name - Filter active/inactive taxes - Export tax configuration ## Query Parameters - &#x60;skip&#x60;: Number of records to skip (default: 0, min: 0) - &#x60;take&#x60;: Number of records to return (default: 10, min: 1, max: 100) - &#x60;name&#x60;: Filter taxes by name (partial match, case-insensitive) - &#x60;active&#x60;: Filter by active status (true/false) ## Example Request &#x60;GET /api/v0/taxes?skip&#x3D;0&amp;take&#x3D;20&amp;active&#x3D;true&amp;name&#x3D;Sales&#x60; ## Example Response &#x60;&#x60;&#x60;json [ { \&quot;id\&quot;: \&quot;tax_123456\&quot;, \&quot;name\&quot;: \&quot;Sales Tax\&quot;, \&quot;description\&quot;: \&quot;Standard sales tax for retail transactions\&quot;, \&quot;percentage\&quot;: 8.5, \&quot;active\&quot;: true, \&quot;created_at\&quot;: \&quot;2024-03-20T10:00:00Z\&quot;, \&quot;updated_at\&quot;: \&quot;2024-03-20T10:00:00Z\&quot; } ] &#x60;&#x60;&#x60;
84
162
  # @param [Hash] opts the optional parameters
85
- # @option opts [String] :skip Number of records to skip
86
- # @option opts [String] :take Number of records to take
163
+ # @option opts [Float] :skip Number of records to skip for pagination (default to 0)
164
+ # @option opts [Float] :take Number of records to return (max 100) (default to 10)
165
+ # @option opts [String] :name Filter taxes by name (partial match, case-insensitive)
166
+ # @option opts [Boolean] :active Filter by active status
87
167
  # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
88
168
  def tax_controller_find_all_with_http_info(opts = {})
89
169
  if @api_client.config.debugging
90
170
  @api_client.config.logger.debug 'Calling API: TaxesApi.tax_controller_find_all ...'
91
171
  end
172
+ if @api_client.config.client_side_validation && !opts[:'skip'].nil? && opts[:'skip'] < 0
173
+ fail ArgumentError, 'invalid value for "opts[:"skip"]" when calling TaxesApi.tax_controller_find_all, must be greater than or equal to 0.'
174
+ end
175
+
176
+ if @api_client.config.client_side_validation && !opts[:'take'].nil? && opts[:'take'] > 100
177
+ fail ArgumentError, 'invalid value for "opts[:"take"]" when calling TaxesApi.tax_controller_find_all, must be smaller than or equal to 100.'
178
+ end
179
+
180
+ if @api_client.config.client_side_validation && !opts[:'take'].nil? && opts[:'take'] < 1
181
+ fail ArgumentError, 'invalid value for "opts[:"take"]" when calling TaxesApi.tax_controller_find_all, must be greater than or equal to 1.'
182
+ end
183
+
184
+ if @api_client.config.client_side_validation && !opts[:'name'].nil? && opts[:'name'].to_s.length > 100
185
+ fail ArgumentError, 'invalid value for "opts[:"name"]" when calling TaxesApi.tax_controller_find_all, the character length must be smaller than or equal to 100.'
186
+ end
187
+
92
188
  # resource path
93
189
  local_var_path = '/api/v0/taxes'
94
190
 
@@ -96,6 +192,8 @@ module DevDraftAI
96
192
  query_params = opts[:query_params] || {}
97
193
  query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil?
98
194
  query_params[:'take'] = opts[:'take'] if !opts[:'take'].nil?
195
+ query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
196
+ query_params[:'active'] = opts[:'active'] if !opts[:'active'].nil?
99
197
 
100
198
  # header parameters
101
199
  header_params = opts[:header_params] || {}
@@ -104,26 +202,34 @@ module DevDraftAI
104
202
  form_params = opts[:form_params] || {}
105
203
 
106
204
  # http body (model)
107
- post_body = opts[:body]
205
+ post_body = opts[:debug_body]
206
+
207
+ # return_type
208
+ return_type = opts[:debug_return_type]
108
209
 
109
- return_type = opts[:return_type]
210
+ # auth_names
211
+ auth_names = opts[:debug_auth_names] || ['x-client-secret', 'x-client-key']
110
212
 
111
- auth_names = opts[:auth_names] || ['x-client-key', 'x-client-secret']
112
- data, status_code, headers = @api_client.call_api(:GET, local_var_path,
213
+ new_options = opts.merge(
214
+ :operation => :"TaxesApi.tax_controller_find_all",
113
215
  :header_params => header_params,
114
216
  :query_params => query_params,
115
217
  :form_params => form_params,
116
218
  :body => post_body,
117
219
  :auth_names => auth_names,
118
- :return_type => return_type)
220
+ :return_type => return_type
221
+ )
119
222
 
223
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
120
224
  if @api_client.config.debugging
121
225
  @api_client.config.logger.debug "API called: TaxesApi#tax_controller_find_all\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
122
226
  end
123
227
  return data, status_code, headers
124
228
  end
229
+
125
230
  # Get a tax by ID
126
- # @param id Tax ID
231
+ # Retrieves detailed information about a specific tax. ## Use Cases - View tax details - Verify tax configuration - Check tax status before applying to products ## Path Parameters - `id`: Tax UUID (required) - Must be a valid UUID format ## Example Request `GET /api/v0/taxes/123e4567-e89b-12d3-a456-426614174000` ## Example Response ```json { \"id\": \"tax_123456\", \"name\": \"Sales Tax\", \"description\": \"Standard sales tax for retail transactions\", \"percentage\": 8.5, \"active\": true, \"created_at\": \"2024-03-20T10:00:00Z\", \"updated_at\": \"2024-03-20T10:00:00Z\" } ```
232
+ # @param id [String] Tax unique identifier (UUID)
127
233
  # @param [Hash] opts the optional parameters
128
234
  # @return [nil]
129
235
  def tax_controller_find_one(id, opts = {})
@@ -132,7 +238,8 @@ module DevDraftAI
132
238
  end
133
239
 
134
240
  # Get a tax by ID
135
- # @param id Tax ID
241
+ # Retrieves detailed information about a specific tax. ## Use Cases - View tax details - Verify tax configuration - Check tax status before applying to products ## Path Parameters - &#x60;id&#x60;: Tax UUID (required) - Must be a valid UUID format ## Example Request &#x60;GET /api/v0/taxes/123e4567-e89b-12d3-a456-426614174000&#x60; ## Example Response &#x60;&#x60;&#x60;json { \&quot;id\&quot;: \&quot;tax_123456\&quot;, \&quot;name\&quot;: \&quot;Sales Tax\&quot;, \&quot;description\&quot;: \&quot;Standard sales tax for retail transactions\&quot;, \&quot;percentage\&quot;: 8.5, \&quot;active\&quot;: true, \&quot;created_at\&quot;: \&quot;2024-03-20T10:00:00Z\&quot;, \&quot;updated_at\&quot;: \&quot;2024-03-20T10:00:00Z\&quot; } &#x60;&#x60;&#x60;
242
+ # @param id [String] Tax unique identifier (UUID)
136
243
  # @param [Hash] opts the optional parameters
137
244
  # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
138
245
  def tax_controller_find_one_with_http_info(id, opts = {})
@@ -144,7 +251,7 @@ module DevDraftAI
144
251
  fail ArgumentError, "Missing the required parameter 'id' when calling TaxesApi.tax_controller_find_one"
145
252
  end
146
253
  # resource path
147
- local_var_path = '/api/v0/taxes/{id}'.sub('{' + 'id' + '}', id.to_s)
254
+ local_var_path = '/api/v0/taxes/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
148
255
 
149
256
  # query parameters
150
257
  query_params = opts[:query_params] || {}
@@ -156,26 +263,34 @@ module DevDraftAI
156
263
  form_params = opts[:form_params] || {}
157
264
 
158
265
  # http body (model)
159
- post_body = opts[:body]
266
+ post_body = opts[:debug_body]
267
+
268
+ # return_type
269
+ return_type = opts[:debug_return_type]
160
270
 
161
- return_type = opts[:return_type]
271
+ # auth_names
272
+ auth_names = opts[:debug_auth_names] || ['x-client-secret', 'x-client-key']
162
273
 
163
- auth_names = opts[:auth_names] || ['x-client-key', 'x-client-secret']
164
- data, status_code, headers = @api_client.call_api(:GET, local_var_path,
274
+ new_options = opts.merge(
275
+ :operation => :"TaxesApi.tax_controller_find_one",
165
276
  :header_params => header_params,
166
277
  :query_params => query_params,
167
278
  :form_params => form_params,
168
279
  :body => post_body,
169
280
  :auth_names => auth_names,
170
- :return_type => return_type)
281
+ :return_type => return_type
282
+ )
171
283
 
284
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
172
285
  if @api_client.config.debugging
173
286
  @api_client.config.logger.debug "API called: TaxesApi#tax_controller_find_one\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
174
287
  end
175
288
  return data, status_code, headers
176
289
  end
290
+
177
291
  # Delete a tax
178
- # @param id Tax ID
292
+ # Deletes an existing tax. ## Use Cases - Remove obsolete tax rates - Clean up unused taxes - Comply with regulatory changes ## Path Parameters - `id`: Tax UUID (required) - Must be a valid UUID format ## Example Request `DELETE /api/v0/taxes/123e4567-e89b-12d3-a456-426614174000` ## Warning This action cannot be undone. Consider deactivating the tax instead of deleting it if it has been used in transactions.
293
+ # @param id [String] Tax unique identifier (UUID)
179
294
  # @param [Hash] opts the optional parameters
180
295
  # @return [nil]
181
296
  def tax_controller_remove(id, opts = {})
@@ -184,7 +299,8 @@ module DevDraftAI
184
299
  end
185
300
 
186
301
  # Delete a tax
187
- # @param id Tax ID
302
+ # Deletes an existing tax. ## Use Cases - Remove obsolete tax rates - Clean up unused taxes - Comply with regulatory changes ## Path Parameters - &#x60;id&#x60;: Tax UUID (required) - Must be a valid UUID format ## Example Request &#x60;DELETE /api/v0/taxes/123e4567-e89b-12d3-a456-426614174000&#x60; ## Warning This action cannot be undone. Consider deactivating the tax instead of deleting it if it has been used in transactions.
303
+ # @param id [String] Tax unique identifier (UUID)
188
304
  # @param [Hash] opts the optional parameters
189
305
  # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
190
306
  def tax_controller_remove_with_http_info(id, opts = {})
@@ -196,7 +312,7 @@ module DevDraftAI
196
312
  fail ArgumentError, "Missing the required parameter 'id' when calling TaxesApi.tax_controller_remove"
197
313
  end
198
314
  # resource path
199
- local_var_path = '/api/v0/taxes/{id}'.sub('{' + 'id' + '}', id.to_s)
315
+ local_var_path = '/api/v0/taxes/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
200
316
 
201
317
  # query parameters
202
318
  query_params = opts[:query_params] || {}
@@ -208,53 +324,62 @@ module DevDraftAI
208
324
  form_params = opts[:form_params] || {}
209
325
 
210
326
  # http body (model)
211
- post_body = opts[:body]
327
+ post_body = opts[:debug_body]
212
328
 
213
- return_type = opts[:return_type]
329
+ # return_type
330
+ return_type = opts[:debug_return_type]
214
331
 
215
- auth_names = opts[:auth_names] || ['x-client-key', 'x-client-secret']
216
- data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
332
+ # auth_names
333
+ auth_names = opts[:debug_auth_names] || ['x-client-secret', 'x-client-key']
334
+
335
+ new_options = opts.merge(
336
+ :operation => :"TaxesApi.tax_controller_remove",
217
337
  :header_params => header_params,
218
338
  :query_params => query_params,
219
339
  :form_params => form_params,
220
340
  :body => post_body,
221
341
  :auth_names => auth_names,
222
- :return_type => return_type)
342
+ :return_type => return_type
343
+ )
223
344
 
345
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
224
346
  if @api_client.config.debugging
225
347
  @api_client.config.logger.debug "API called: TaxesApi#tax_controller_remove\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
226
348
  end
227
349
  return data, status_code, headers
228
350
  end
351
+
229
352
  # Update a tax
230
- # @param body
231
- # @param id Tax ID
353
+ # Updates an existing tax's information. ## Use Cases - Modify tax percentage rates - Update tax descriptions - Activate/deactivate taxes - Change tax names ## Path Parameters - `id`: Tax UUID (required) - Must be a valid UUID format ## Example Request `PUT /api/v0/taxes/123e4567-e89b-12d3-a456-426614174000` ## Example Request Body ```json { \"name\": \"Updated Sales Tax\", \"description\": \"Updated sales tax rate\", \"percentage\": 9.0, \"active\": true } ``` ## Notes - Only include fields that need to be updated - All fields are optional in updates - Percentage changes affect future calculations only
354
+ # @param id [String] Tax unique identifier (UUID)
355
+ # @param update_tax_dto [UpdateTaxDto] Tax update data - only include fields you want to update
232
356
  # @param [Hash] opts the optional parameters
233
357
  # @return [nil]
234
- def tax_controller_update(body, id, opts = {})
235
- tax_controller_update_with_http_info(body, id, opts)
358
+ def tax_controller_update(id, update_tax_dto, opts = {})
359
+ tax_controller_update_with_http_info(id, update_tax_dto, opts)
236
360
  nil
237
361
  end
238
362
 
239
363
  # Update a tax
240
- # @param body
241
- # @param id Tax ID
364
+ # Updates an existing tax&#39;s information. ## Use Cases - Modify tax percentage rates - Update tax descriptions - Activate/deactivate taxes - Change tax names ## Path Parameters - &#x60;id&#x60;: Tax UUID (required) - Must be a valid UUID format ## Example Request &#x60;PUT /api/v0/taxes/123e4567-e89b-12d3-a456-426614174000&#x60; ## Example Request Body &#x60;&#x60;&#x60;json { \&quot;name\&quot;: \&quot;Updated Sales Tax\&quot;, \&quot;description\&quot;: \&quot;Updated sales tax rate\&quot;, \&quot;percentage\&quot;: 9.0, \&quot;active\&quot;: true } &#x60;&#x60;&#x60; ## Notes - Only include fields that need to be updated - All fields are optional in updates - Percentage changes affect future calculations only
365
+ # @param id [String] Tax unique identifier (UUID)
366
+ # @param update_tax_dto [UpdateTaxDto] Tax update data - only include fields you want to update
242
367
  # @param [Hash] opts the optional parameters
243
368
  # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
244
- def tax_controller_update_with_http_info(body, id, opts = {})
369
+ def tax_controller_update_with_http_info(id, update_tax_dto, opts = {})
245
370
  if @api_client.config.debugging
246
371
  @api_client.config.logger.debug 'Calling API: TaxesApi.tax_controller_update ...'
247
372
  end
248
- # verify the required parameter 'body' is set
249
- if @api_client.config.client_side_validation && body.nil?
250
- fail ArgumentError, "Missing the required parameter 'body' when calling TaxesApi.tax_controller_update"
251
- end
252
373
  # verify the required parameter 'id' is set
253
374
  if @api_client.config.client_side_validation && id.nil?
254
375
  fail ArgumentError, "Missing the required parameter 'id' when calling TaxesApi.tax_controller_update"
255
376
  end
377
+ # verify the required parameter 'update_tax_dto' is set
378
+ if @api_client.config.client_side_validation && update_tax_dto.nil?
379
+ fail ArgumentError, "Missing the required parameter 'update_tax_dto' when calling TaxesApi.tax_controller_update"
380
+ end
256
381
  # resource path
257
- local_var_path = '/api/v0/taxes/{id}'.sub('{' + 'id' + '}', id.to_s)
382
+ local_var_path = '/api/v0/taxes/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
258
383
 
259
384
  # query parameters
260
385
  query_params = opts[:query_params] || {}
@@ -262,29 +387,95 @@ module DevDraftAI
262
387
  # header parameters
263
388
  header_params = opts[:header_params] || {}
264
389
  # HTTP header 'Content-Type'
265
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
390
+ content_type = @api_client.select_header_content_type(['application/json'])
391
+ if !content_type.nil?
392
+ header_params['Content-Type'] = content_type
393
+ end
266
394
 
267
395
  # form parameters
268
396
  form_params = opts[:form_params] || {}
269
397
 
270
398
  # http body (model)
271
- post_body = opts[:body] || @api_client.object_to_http_body(body)
399
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(update_tax_dto)
400
+
401
+ # return_type
402
+ return_type = opts[:debug_return_type]
272
403
 
273
- return_type = opts[:return_type]
404
+ # auth_names
405
+ auth_names = opts[:debug_auth_names] || ['x-client-secret', 'x-client-key']
274
406
 
275
- auth_names = opts[:auth_names] || ['x-client-key', 'x-client-secret']
276
- data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
407
+ new_options = opts.merge(
408
+ :operation => :"TaxesApi.tax_controller_update",
277
409
  :header_params => header_params,
278
410
  :query_params => query_params,
279
411
  :form_params => form_params,
280
412
  :body => post_body,
281
413
  :auth_names => auth_names,
282
- :return_type => return_type)
414
+ :return_type => return_type
415
+ )
283
416
 
417
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
284
418
  if @api_client.config.debugging
285
419
  @api_client.config.logger.debug "API called: TaxesApi#tax_controller_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
286
420
  end
287
421
  return data, status_code, headers
288
422
  end
423
+
424
+ # Tax ID required for updates
425
+ # This endpoint requires a tax ID in the URL path. Use PUT /api/v0/taxes/{id} instead.
426
+ # @param [Hash] opts the optional parameters
427
+ # @return [nil]
428
+ def tax_controller_update_without_id(opts = {})
429
+ tax_controller_update_without_id_with_http_info(opts)
430
+ nil
431
+ end
432
+
433
+ # Tax ID required for updates
434
+ # This endpoint requires a tax ID in the URL path. Use PUT /api/v0/taxes/{id} instead.
435
+ # @param [Hash] opts the optional parameters
436
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
437
+ def tax_controller_update_without_id_with_http_info(opts = {})
438
+ if @api_client.config.debugging
439
+ @api_client.config.logger.debug 'Calling API: TaxesApi.tax_controller_update_without_id ...'
440
+ end
441
+ # resource path
442
+ local_var_path = '/api/v0/taxes'
443
+
444
+ # query parameters
445
+ query_params = opts[:query_params] || {}
446
+
447
+ # header parameters
448
+ header_params = opts[:header_params] || {}
449
+ # HTTP header 'Accept' (if needed)
450
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
451
+
452
+ # form parameters
453
+ form_params = opts[:form_params] || {}
454
+
455
+ # http body (model)
456
+ post_body = opts[:debug_body]
457
+
458
+ # return_type
459
+ return_type = opts[:debug_return_type]
460
+
461
+ # auth_names
462
+ auth_names = opts[:debug_auth_names] || ['x-client-secret', 'x-client-key']
463
+
464
+ new_options = opts.merge(
465
+ :operation => :"TaxesApi.tax_controller_update_without_id",
466
+ :header_params => header_params,
467
+ :query_params => query_params,
468
+ :form_params => form_params,
469
+ :body => post_body,
470
+ :auth_names => auth_names,
471
+ :return_type => return_type
472
+ )
473
+
474
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
475
+ if @api_client.config.debugging
476
+ @api_client.config.logger.debug "API called: TaxesApi#tax_controller_update_without_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
477
+ end
478
+ return data, status_code, headers
479
+ end
289
480
  end
290
481
  end