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 ProductsApi
14
17
  attr_accessor :api_client
15
18
 
@@ -18,42 +21,42 @@ module DevDraftAI
18
21
  end
19
22
  # Create a new product
20
23
  # Creates a new product with optional image uploads. This endpoint allows you to create products with detailed information and multiple images. ## Use Cases - Add new products to your catalog - Create products with multiple images - Set up product pricing and descriptions ## Supported Image Formats - JPEG/JPG - PNG - WebP - Maximum 10 images per product - Maximum file size: 5MB per image ## Example Request (multipart/form-data) ``` name: \"Premium Widget\" description: \"High-quality widget for all your needs\" price: \"99.99\" images: [file1.jpg, file2.jpg] // Optional, up to 10 images ``` ## Required Fields - `name`: Product name - `price`: Product price (decimal number) ## Optional Fields - `description`: Detailed product description - `images`: Product images (up to 10 files)
21
- # @param name
22
- # @param description
23
- # @param price
24
- # @param currency
25
- # @param type
26
- # @param weight
27
- # @param unit
28
- # @param quantity
29
- # @param stock_count
30
- # @param status
31
- # @param product_type
32
- # @param images
24
+ # @param name [String] Product name as it will appear to customers. Should be clear and descriptive.
25
+ # @param description [String] Detailed description of the product. Supports markdown formatting for rich text display.
26
+ # @param price [Float] Product price in the specified currency. Must be greater than 0.
33
27
  # @param [Hash] opts the optional parameters
28
+ # @option opts [String] :currency Currency code for the price. Defaults to USD if not specified. (default to 'USD')
29
+ # @option opts [String] :type Product type
30
+ # @option opts [Float] :weight Weight of the product
31
+ # @option opts [String] :unit Unit of measurement
32
+ # @option opts [Float] :quantity Quantity available
33
+ # @option opts [Float] :stock_count Stock count
34
+ # @option opts [String] :status Product status
35
+ # @option opts [String] :product_type Product type
36
+ # @option opts [Array<String>] :images Array of image URLs
34
37
  # @return [nil]
35
- def product_controller_create(name, description, price, currency, type, weight, unit, quantity, stock_count, status, product_type, images, opts = {})
36
- product_controller_create_with_http_info(name, description, price, currency, type, weight, unit, quantity, stock_count, status, product_type, images, opts)
38
+ def product_controller_create(name, description, price, opts = {})
39
+ product_controller_create_with_http_info(name, description, price, opts)
37
40
  nil
38
41
  end
39
42
 
40
43
  # Create a new product
41
44
  # Creates a new product with optional image uploads. This endpoint allows you to create products with detailed information and multiple images. ## Use Cases - Add new products to your catalog - Create products with multiple images - Set up product pricing and descriptions ## Supported Image Formats - JPEG/JPG - PNG - WebP - Maximum 10 images per product - Maximum file size: 5MB per image ## Example Request (multipart/form-data) &#x60;&#x60;&#x60; name: \&quot;Premium Widget\&quot; description: \&quot;High-quality widget for all your needs\&quot; price: \&quot;99.99\&quot; images: [file1.jpg, file2.jpg] // Optional, up to 10 images &#x60;&#x60;&#x60; ## Required Fields - &#x60;name&#x60;: Product name - &#x60;price&#x60;: Product price (decimal number) ## Optional Fields - &#x60;description&#x60;: Detailed product description - &#x60;images&#x60;: Product images (up to 10 files)
42
- # @param name
43
- # @param description
44
- # @param price
45
- # @param currency
46
- # @param type
47
- # @param weight
48
- # @param unit
49
- # @param quantity
50
- # @param stock_count
51
- # @param status
52
- # @param product_type
53
- # @param images
45
+ # @param name [String] Product name as it will appear to customers. Should be clear and descriptive.
46
+ # @param description [String] Detailed description of the product. Supports markdown formatting for rich text display.
47
+ # @param price [Float] Product price in the specified currency. Must be greater than 0.
54
48
  # @param [Hash] opts the optional parameters
49
+ # @option opts [String] :currency Currency code for the price. Defaults to USD if not specified. (default to 'USD')
50
+ # @option opts [String] :type Product type
51
+ # @option opts [Float] :weight Weight of the product
52
+ # @option opts [String] :unit Unit of measurement
53
+ # @option opts [Float] :quantity Quantity available
54
+ # @option opts [Float] :stock_count Stock count
55
+ # @option opts [String] :status Product status
56
+ # @option opts [String] :product_type Product type
57
+ # @option opts [Array<String>] :images Array of image URLs
55
58
  # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
56
- def product_controller_create_with_http_info(name, description, price, currency, type, weight, unit, quantity, stock_count, status, product_type, images, opts = {})
59
+ def product_controller_create_with_http_info(name, description, price, opts = {})
57
60
  if @api_client.config.debugging
58
61
  @api_client.config.logger.debug 'Calling API: ProductsApi.product_controller_create ...'
59
62
  end
@@ -61,53 +64,33 @@ module DevDraftAI
61
64
  if @api_client.config.client_side_validation && name.nil?
62
65
  fail ArgumentError, "Missing the required parameter 'name' when calling ProductsApi.product_controller_create"
63
66
  end
67
+ if @api_client.config.client_side_validation && name.to_s.length > 200
68
+ fail ArgumentError, 'invalid value for "name" when calling ProductsApi.product_controller_create, the character length must be smaller than or equal to 200.'
69
+ end
70
+
71
+ if @api_client.config.client_side_validation && name.to_s.length < 1
72
+ fail ArgumentError, 'invalid value for "name" when calling ProductsApi.product_controller_create, the character length must be greater than or equal to 1.'
73
+ end
74
+
64
75
  # verify the required parameter 'description' is set
65
76
  if @api_client.config.client_side_validation && description.nil?
66
77
  fail ArgumentError, "Missing the required parameter 'description' when calling ProductsApi.product_controller_create"
67
78
  end
79
+ if @api_client.config.client_side_validation && description.to_s.length > 2000
80
+ fail ArgumentError, 'invalid value for "description" when calling ProductsApi.product_controller_create, the character length must be smaller than or equal to 2000.'
81
+ end
82
+
68
83
  # verify the required parameter 'price' is set
69
84
  if @api_client.config.client_side_validation && price.nil?
70
85
  fail ArgumentError, "Missing the required parameter 'price' when calling ProductsApi.product_controller_create"
71
86
  end
72
- # verify the required parameter 'currency' is set
73
- if @api_client.config.client_side_validation && currency.nil?
74
- fail ArgumentError, "Missing the required parameter 'currency' when calling ProductsApi.product_controller_create"
75
- end
76
- # verify enum value
77
- if @api_client.config.client_side_validation && !['USD', 'EUR', 'GBP', 'CAD', 'AUD', 'JPY'].include?(currency)
78
- fail ArgumentError, "invalid value for 'currency', must be one of USD, EUR, GBP, CAD, AUD, JPY"
79
- end
80
- # verify the required parameter 'type' is set
81
- if @api_client.config.client_side_validation && type.nil?
82
- fail ArgumentError, "Missing the required parameter 'type' when calling ProductsApi.product_controller_create"
83
- end
84
- # verify the required parameter 'weight' is set
85
- if @api_client.config.client_side_validation && weight.nil?
86
- fail ArgumentError, "Missing the required parameter 'weight' when calling ProductsApi.product_controller_create"
87
- end
88
- # verify the required parameter 'unit' is set
89
- if @api_client.config.client_side_validation && unit.nil?
90
- fail ArgumentError, "Missing the required parameter 'unit' when calling ProductsApi.product_controller_create"
91
- end
92
- # verify the required parameter 'quantity' is set
93
- if @api_client.config.client_side_validation && quantity.nil?
94
- fail ArgumentError, "Missing the required parameter 'quantity' when calling ProductsApi.product_controller_create"
95
- end
96
- # verify the required parameter 'stock_count' is set
97
- if @api_client.config.client_side_validation && stock_count.nil?
98
- fail ArgumentError, "Missing the required parameter 'stock_count' when calling ProductsApi.product_controller_create"
99
- end
100
- # verify the required parameter 'status' is set
101
- if @api_client.config.client_side_validation && status.nil?
102
- fail ArgumentError, "Missing the required parameter 'status' when calling ProductsApi.product_controller_create"
87
+ if @api_client.config.client_side_validation && price < 0.01
88
+ fail ArgumentError, 'invalid value for "price" when calling ProductsApi.product_controller_create, must be greater than or equal to 0.01.'
103
89
  end
104
- # verify the required parameter 'product_type' is set
105
- if @api_client.config.client_side_validation && product_type.nil?
106
- fail ArgumentError, "Missing the required parameter 'product_type' when calling ProductsApi.product_controller_create"
107
- end
108
- # verify the required parameter 'images' is set
109
- if @api_client.config.client_side_validation && images.nil?
110
- fail ArgumentError, "Missing the required parameter 'images' when calling ProductsApi.product_controller_create"
90
+
91
+ allowable_values = ["USD", "EUR", "GBP", "CAD", "AUD", "JPY"]
92
+ if @api_client.config.client_side_validation && opts[:'currency'] && !allowable_values.include?(opts[:'currency'])
93
+ fail ArgumentError, "invalid value for \"currency\", must be one of #{allowable_values}"
111
94
  end
112
95
  # resource path
113
96
  local_var_path = '/api/v0/products'
@@ -118,47 +101,57 @@ module DevDraftAI
118
101
  # header parameters
119
102
  header_params = opts[:header_params] || {}
120
103
  # HTTP header 'Content-Type'
121
- header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
104
+ content_type = @api_client.select_header_content_type(['multipart/form-data'])
105
+ if !content_type.nil?
106
+ header_params['Content-Type'] = content_type
107
+ end
122
108
 
123
109
  # form parameters
124
110
  form_params = opts[:form_params] || {}
125
111
  form_params['name'] = name
126
112
  form_params['description'] = description
127
113
  form_params['price'] = price
128
- form_params['currency'] = currency
129
- form_params['type'] = type
130
- form_params['weight'] = weight
131
- form_params['unit'] = unit
132
- form_params['quantity'] = quantity
133
- form_params['stockCount'] = stock_count
134
- form_params['status'] = status
135
- form_params['productType'] = product_type
136
- form_params['images'] = @api_client.build_collection_param(images, :multi)
114
+ form_params['currency'] = opts[:'currency'] if !opts[:'currency'].nil?
115
+ form_params['type'] = opts[:'type'] if !opts[:'type'].nil?
116
+ form_params['weight'] = opts[:'weight'] if !opts[:'weight'].nil?
117
+ form_params['unit'] = opts[:'unit'] if !opts[:'unit'].nil?
118
+ form_params['quantity'] = opts[:'quantity'] if !opts[:'quantity'].nil?
119
+ form_params['stockCount'] = opts[:'stock_count'] if !opts[:'stock_count'].nil?
120
+ form_params['status'] = opts[:'status'] if !opts[:'status'].nil?
121
+ form_params['productType'] = opts[:'product_type'] if !opts[:'product_type'].nil?
122
+ form_params['images'] = @api_client.build_collection_param(opts[:'images'], :csv) if !opts[:'images'].nil?
137
123
 
138
124
  # http body (model)
139
- post_body = opts[:body]
125
+ post_body = opts[:debug_body]
126
+
127
+ # return_type
128
+ return_type = opts[:debug_return_type]
140
129
 
141
- return_type = opts[:return_type]
130
+ # auth_names
131
+ auth_names = opts[:debug_auth_names] || ['x-client-secret', 'x-client-key']
142
132
 
143
- auth_names = opts[:auth_names] || ['x-client-key', 'x-client-secret']
144
- data, status_code, headers = @api_client.call_api(:POST, local_var_path,
133
+ new_options = opts.merge(
134
+ :operation => :"ProductsApi.product_controller_create",
145
135
  :header_params => header_params,
146
136
  :query_params => query_params,
147
137
  :form_params => form_params,
148
138
  :body => post_body,
149
139
  :auth_names => auth_names,
150
- :return_type => return_type)
140
+ :return_type => return_type
141
+ )
151
142
 
143
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
152
144
  if @api_client.config.debugging
153
145
  @api_client.config.logger.debug "API called: ProductsApi#product_controller_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
154
146
  end
155
147
  return data, status_code, headers
156
148
  end
149
+
157
150
  # Get all products
158
151
  # Retrieves a list of products with pagination. This endpoint allows you to fetch products with optional pagination. ## Use Cases - List all products - Browse product catalog - Implement product search ## Query Parameters - `skip`: Number of records to skip (default: 0) - `take`: Number of records to take (default: 10) ## Example Response ```json { \"data\": [ { \"id\": \"prod_123456\", \"name\": \"Premium Widget\", \"description\": \"High-quality widget for all your needs\", \"price\": \"99.99\", \"images\": [ \"https://storage.example.com/images/file1.jpg\", \"https://storage.example.com/images/file2.jpg\" ], \"createdAt\": \"2024-03-20T10:00:00Z\" } ], \"total\": 100, \"skip\": 0, \"take\": 10 } ```
159
152
  # @param [Hash] opts the optional parameters
160
- # @option opts [BigDecimal] :skip Number of records to skip
161
- # @option opts [BigDecimal] :take Number of records to take
153
+ # @option opts [Float] :skip Number of records to skip
154
+ # @option opts [Float] :take Number of records to take
162
155
  # @return [nil]
163
156
  def product_controller_find_all(opts = {})
164
157
  product_controller_find_all_with_http_info(opts)
@@ -168,8 +161,8 @@ module DevDraftAI
168
161
  # Get all products
169
162
  # Retrieves a list of products with pagination. This endpoint allows you to fetch products with optional pagination. ## Use Cases - List all products - Browse product catalog - Implement product search ## Query Parameters - &#x60;skip&#x60;: Number of records to skip (default: 0) - &#x60;take&#x60;: Number of records to take (default: 10) ## Example Response &#x60;&#x60;&#x60;json { \&quot;data\&quot;: [ { \&quot;id\&quot;: \&quot;prod_123456\&quot;, \&quot;name\&quot;: \&quot;Premium Widget\&quot;, \&quot;description\&quot;: \&quot;High-quality widget for all your needs\&quot;, \&quot;price\&quot;: \&quot;99.99\&quot;, \&quot;images\&quot;: [ \&quot;https://storage.example.com/images/file1.jpg\&quot;, \&quot;https://storage.example.com/images/file2.jpg\&quot; ], \&quot;createdAt\&quot;: \&quot;2024-03-20T10:00:00Z\&quot; } ], \&quot;total\&quot;: 100, \&quot;skip\&quot;: 0, \&quot;take\&quot;: 10 } &#x60;&#x60;&#x60;
170
163
  # @param [Hash] opts the optional parameters
171
- # @option opts [BigDecimal] :skip Number of records to skip
172
- # @option opts [BigDecimal] :take Number of records to take
164
+ # @option opts [Float] :skip Number of records to skip
165
+ # @option opts [Float] :take Number of records to take
173
166
  # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
174
167
  def product_controller_find_all_with_http_info(opts = {})
175
168
  if @api_client.config.debugging
@@ -190,27 +183,34 @@ module DevDraftAI
190
183
  form_params = opts[:form_params] || {}
191
184
 
192
185
  # http body (model)
193
- post_body = opts[:body]
186
+ post_body = opts[:debug_body]
187
+
188
+ # return_type
189
+ return_type = opts[:debug_return_type]
194
190
 
195
- return_type = opts[:return_type]
191
+ # auth_names
192
+ auth_names = opts[:debug_auth_names] || ['x-client-secret', 'x-client-key']
196
193
 
197
- auth_names = opts[:auth_names] || ['x-client-key', 'x-client-secret']
198
- data, status_code, headers = @api_client.call_api(:GET, local_var_path,
194
+ new_options = opts.merge(
195
+ :operation => :"ProductsApi.product_controller_find_all",
199
196
  :header_params => header_params,
200
197
  :query_params => query_params,
201
198
  :form_params => form_params,
202
199
  :body => post_body,
203
200
  :auth_names => auth_names,
204
- :return_type => return_type)
201
+ :return_type => return_type
202
+ )
205
203
 
204
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
206
205
  if @api_client.config.debugging
207
206
  @api_client.config.logger.debug "API called: ProductsApi#product_controller_find_all\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
208
207
  end
209
208
  return data, status_code, headers
210
209
  end
210
+
211
211
  # Get a product by ID
212
212
  # Retrieves detailed information about a specific product. This endpoint allows you to fetch complete product details including all images. ## Use Cases - View product details - Display product information - Check product availability ## Example Response ```json { \"id\": \"prod_123456\", \"name\": \"Premium Widget\", \"description\": \"High-quality widget for all your needs\", \"price\": \"99.99\", \"images\": [ \"https://storage.example.com/images/file1.jpg\", \"https://storage.example.com/images/file2.jpg\" ], \"createdAt\": \"2024-03-20T10:00:00Z\", \"updatedAt\": \"2024-03-20T10:00:00Z\" } ```
213
- # @param id Product ID
213
+ # @param id [String] Product ID
214
214
  # @param [Hash] opts the optional parameters
215
215
  # @return [nil]
216
216
  def product_controller_find_one(id, opts = {})
@@ -220,7 +220,7 @@ module DevDraftAI
220
220
 
221
221
  # Get a product by ID
222
222
  # Retrieves detailed information about a specific product. This endpoint allows you to fetch complete product details including all images. ## Use Cases - View product details - Display product information - Check product availability ## Example Response &#x60;&#x60;&#x60;json { \&quot;id\&quot;: \&quot;prod_123456\&quot;, \&quot;name\&quot;: \&quot;Premium Widget\&quot;, \&quot;description\&quot;: \&quot;High-quality widget for all your needs\&quot;, \&quot;price\&quot;: \&quot;99.99\&quot;, \&quot;images\&quot;: [ \&quot;https://storage.example.com/images/file1.jpg\&quot;, \&quot;https://storage.example.com/images/file2.jpg\&quot; ], \&quot;createdAt\&quot;: \&quot;2024-03-20T10:00:00Z\&quot;, \&quot;updatedAt\&quot;: \&quot;2024-03-20T10:00:00Z\&quot; } &#x60;&#x60;&#x60;
223
- # @param id Product ID
223
+ # @param id [String] Product ID
224
224
  # @param [Hash] opts the optional parameters
225
225
  # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
226
226
  def product_controller_find_one_with_http_info(id, opts = {})
@@ -232,7 +232,7 @@ module DevDraftAI
232
232
  fail ArgumentError, "Missing the required parameter 'id' when calling ProductsApi.product_controller_find_one"
233
233
  end
234
234
  # resource path
235
- local_var_path = '/api/v0/products/{id}'.sub('{' + 'id' + '}', id.to_s)
235
+ local_var_path = '/api/v0/products/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
236
236
 
237
237
  # query parameters
238
238
  query_params = opts[:query_params] || {}
@@ -244,27 +244,34 @@ module DevDraftAI
244
244
  form_params = opts[:form_params] || {}
245
245
 
246
246
  # http body (model)
247
- post_body = opts[:body]
247
+ post_body = opts[:debug_body]
248
248
 
249
- return_type = opts[:return_type]
249
+ # return_type
250
+ return_type = opts[:debug_return_type]
250
251
 
251
- auth_names = opts[:auth_names] || ['x-client-key', 'x-client-secret']
252
- data, status_code, headers = @api_client.call_api(:GET, local_var_path,
252
+ # auth_names
253
+ auth_names = opts[:debug_auth_names] || ['x-client-secret', 'x-client-key']
254
+
255
+ new_options = opts.merge(
256
+ :operation => :"ProductsApi.product_controller_find_one",
253
257
  :header_params => header_params,
254
258
  :query_params => query_params,
255
259
  :form_params => form_params,
256
260
  :body => post_body,
257
261
  :auth_names => auth_names,
258
- :return_type => return_type)
262
+ :return_type => return_type
263
+ )
259
264
 
265
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
260
266
  if @api_client.config.debugging
261
267
  @api_client.config.logger.debug "API called: ProductsApi#product_controller_find_one\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
262
268
  end
263
269
  return data, status_code, headers
264
270
  end
271
+
265
272
  # Delete a product
266
273
  # Deletes a product and its associated images. This endpoint allows you to remove a product and all its associated data. ## Use Cases - Remove discontinued products - Clean up product catalog - Delete test products ## Notes - This action cannot be undone - All product images will be deleted - Associated data will be removed
267
- # @param id Product ID
274
+ # @param id [String] Product ID
268
275
  # @param [Hash] opts the optional parameters
269
276
  # @return [nil]
270
277
  def product_controller_remove(id, opts = {})
@@ -274,7 +281,7 @@ module DevDraftAI
274
281
 
275
282
  # Delete a product
276
283
  # Deletes a product and its associated images. This endpoint allows you to remove a product and all its associated data. ## Use Cases - Remove discontinued products - Clean up product catalog - Delete test products ## Notes - This action cannot be undone - All product images will be deleted - Associated data will be removed
277
- # @param id Product ID
284
+ # @param id [String] Product ID
278
285
  # @param [Hash] opts the optional parameters
279
286
  # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
280
287
  def product_controller_remove_with_http_info(id, opts = {})
@@ -286,7 +293,7 @@ module DevDraftAI
286
293
  fail ArgumentError, "Missing the required parameter 'id' when calling ProductsApi.product_controller_remove"
287
294
  end
288
295
  # resource path
289
- local_var_path = '/api/v0/products/{id}'.sub('{' + 'id' + '}', id.to_s)
296
+ local_var_path = '/api/v0/products/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
290
297
 
291
298
  # query parameters
292
299
  query_params = opts[:query_params] || {}
@@ -298,125 +305,100 @@ module DevDraftAI
298
305
  form_params = opts[:form_params] || {}
299
306
 
300
307
  # http body (model)
301
- post_body = opts[:body]
308
+ post_body = opts[:debug_body]
302
309
 
303
- return_type = opts[:return_type]
310
+ # return_type
311
+ return_type = opts[:debug_return_type]
304
312
 
305
- auth_names = opts[:auth_names] || ['x-client-key', 'x-client-secret']
306
- data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
313
+ # auth_names
314
+ auth_names = opts[:debug_auth_names] || ['x-client-secret', 'x-client-key']
315
+
316
+ new_options = opts.merge(
317
+ :operation => :"ProductsApi.product_controller_remove",
307
318
  :header_params => header_params,
308
319
  :query_params => query_params,
309
320
  :form_params => form_params,
310
321
  :body => post_body,
311
322
  :auth_names => auth_names,
312
- :return_type => return_type)
323
+ :return_type => return_type
324
+ )
313
325
 
326
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
314
327
  if @api_client.config.debugging
315
328
  @api_client.config.logger.debug "API called: ProductsApi#product_controller_remove\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
316
329
  end
317
330
  return data, status_code, headers
318
331
  end
332
+
319
333
  # Update a product
320
334
  # Updates an existing product's information and optionally adds new images. This endpoint allows you to modify product details and manage product images. ## Use Cases - Update product information - Change product pricing - Modify product images - Update product description ## Example Request (multipart/form-data) ``` name: \"Updated Premium Widget\" description: \"Updated description\" price: \"129.99\" images: [file1.jpg, file2.jpg] // Optional, up to 10 images ``` ## Notes - Only include fields that need to be updated - New images will replace existing images - Maximum 10 images per product - Images are automatically optimized
321
- # @param name
322
- # @param description
323
- # @param price
324
- # @param currency
325
- # @param type
326
- # @param weight
327
- # @param unit
328
- # @param quantity
329
- # @param stock_count
330
- # @param status
331
- # @param product_type
332
- # @param images
333
- # @param id Product ID
335
+ # @param id [String] Product ID
334
336
  # @param [Hash] opts the optional parameters
337
+ # @option opts [String] :name Product name as it will appear to customers. Should be clear and descriptive.
338
+ # @option opts [String] :description Detailed description of the product. Supports markdown formatting for rich text display.
339
+ # @option opts [Float] :price Product price in the specified currency. Must be greater than 0.
340
+ # @option opts [String] :currency Currency code for the price. Defaults to USD if not specified. (default to 'USD')
341
+ # @option opts [String] :type Product type
342
+ # @option opts [Float] :weight Weight of the product
343
+ # @option opts [String] :unit Unit of measurement
344
+ # @option opts [Float] :quantity Quantity available
345
+ # @option opts [Float] :stock_count Stock count
346
+ # @option opts [String] :status Product status
347
+ # @option opts [String] :product_type Product type
348
+ # @option opts [Array<String>] :images Array of image URLs
335
349
  # @return [nil]
336
- def product_controller_update(name, description, price, currency, type, weight, unit, quantity, stock_count, status, product_type, images, id, opts = {})
337
- product_controller_update_with_http_info(name, description, price, currency, type, weight, unit, quantity, stock_count, status, product_type, images, id, opts)
350
+ def product_controller_update(id, opts = {})
351
+ product_controller_update_with_http_info(id, opts)
338
352
  nil
339
353
  end
340
354
 
341
355
  # Update a product
342
- # Updates an existing product&#x27;s information and optionally adds new images. This endpoint allows you to modify product details and manage product images. ## Use Cases - Update product information - Change product pricing - Modify product images - Update product description ## Example Request (multipart/form-data) &#x60;&#x60;&#x60; name: \&quot;Updated Premium Widget\&quot; description: \&quot;Updated description\&quot; price: \&quot;129.99\&quot; images: [file1.jpg, file2.jpg] // Optional, up to 10 images &#x60;&#x60;&#x60; ## Notes - Only include fields that need to be updated - New images will replace existing images - Maximum 10 images per product - Images are automatically optimized
343
- # @param name
344
- # @param description
345
- # @param price
346
- # @param currency
347
- # @param type
348
- # @param weight
349
- # @param unit
350
- # @param quantity
351
- # @param stock_count
352
- # @param status
353
- # @param product_type
354
- # @param images
355
- # @param id Product ID
356
+ # Updates an existing product&#39;s information and optionally adds new images. This endpoint allows you to modify product details and manage product images. ## Use Cases - Update product information - Change product pricing - Modify product images - Update product description ## Example Request (multipart/form-data) &#x60;&#x60;&#x60; name: \&quot;Updated Premium Widget\&quot; description: \&quot;Updated description\&quot; price: \&quot;129.99\&quot; images: [file1.jpg, file2.jpg] // Optional, up to 10 images &#x60;&#x60;&#x60; ## Notes - Only include fields that need to be updated - New images will replace existing images - Maximum 10 images per product - Images are automatically optimized
357
+ # @param id [String] Product ID
356
358
  # @param [Hash] opts the optional parameters
359
+ # @option opts [String] :name Product name as it will appear to customers. Should be clear and descriptive.
360
+ # @option opts [String] :description Detailed description of the product. Supports markdown formatting for rich text display.
361
+ # @option opts [Float] :price Product price in the specified currency. Must be greater than 0.
362
+ # @option opts [String] :currency Currency code for the price. Defaults to USD if not specified. (default to 'USD')
363
+ # @option opts [String] :type Product type
364
+ # @option opts [Float] :weight Weight of the product
365
+ # @option opts [String] :unit Unit of measurement
366
+ # @option opts [Float] :quantity Quantity available
367
+ # @option opts [Float] :stock_count Stock count
368
+ # @option opts [String] :status Product status
369
+ # @option opts [String] :product_type Product type
370
+ # @option opts [Array<String>] :images Array of image URLs
357
371
  # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
358
- def product_controller_update_with_http_info(name, description, price, currency, type, weight, unit, quantity, stock_count, status, product_type, images, id, opts = {})
372
+ def product_controller_update_with_http_info(id, opts = {})
359
373
  if @api_client.config.debugging
360
374
  @api_client.config.logger.debug 'Calling API: ProductsApi.product_controller_update ...'
361
375
  end
362
- # verify the required parameter 'name' is set
363
- if @api_client.config.client_side_validation && name.nil?
364
- fail ArgumentError, "Missing the required parameter 'name' when calling ProductsApi.product_controller_update"
365
- end
366
- # verify the required parameter 'description' is set
367
- if @api_client.config.client_side_validation && description.nil?
368
- fail ArgumentError, "Missing the required parameter 'description' when calling ProductsApi.product_controller_update"
369
- end
370
- # verify the required parameter 'price' is set
371
- if @api_client.config.client_side_validation && price.nil?
372
- fail ArgumentError, "Missing the required parameter 'price' when calling ProductsApi.product_controller_update"
373
- end
374
- # verify the required parameter 'currency' is set
375
- if @api_client.config.client_side_validation && currency.nil?
376
- fail ArgumentError, "Missing the required parameter 'currency' when calling ProductsApi.product_controller_update"
377
- end
378
- # verify enum value
379
- if @api_client.config.client_side_validation && !['USD', 'EUR', 'GBP', 'CAD', 'AUD', 'JPY'].include?(currency)
380
- fail ArgumentError, "invalid value for 'currency', must be one of USD, EUR, GBP, CAD, AUD, JPY"
381
- end
382
- # verify the required parameter 'type' is set
383
- if @api_client.config.client_side_validation && type.nil?
384
- fail ArgumentError, "Missing the required parameter 'type' when calling ProductsApi.product_controller_update"
385
- end
386
- # verify the required parameter 'weight' is set
387
- if @api_client.config.client_side_validation && weight.nil?
388
- fail ArgumentError, "Missing the required parameter 'weight' when calling ProductsApi.product_controller_update"
389
- end
390
- # verify the required parameter 'unit' is set
391
- if @api_client.config.client_side_validation && unit.nil?
392
- fail ArgumentError, "Missing the required parameter 'unit' when calling ProductsApi.product_controller_update"
393
- end
394
- # verify the required parameter 'quantity' is set
395
- if @api_client.config.client_side_validation && quantity.nil?
396
- fail ArgumentError, "Missing the required parameter 'quantity' when calling ProductsApi.product_controller_update"
376
+ # verify the required parameter 'id' is set
377
+ if @api_client.config.client_side_validation && id.nil?
378
+ fail ArgumentError, "Missing the required parameter 'id' when calling ProductsApi.product_controller_update"
397
379
  end
398
- # verify the required parameter 'stock_count' is set
399
- if @api_client.config.client_side_validation && stock_count.nil?
400
- fail ArgumentError, "Missing the required parameter 'stock_count' when calling ProductsApi.product_controller_update"
380
+ if @api_client.config.client_side_validation && !opts[:'name'].nil? && opts[:'name'].to_s.length > 200
381
+ fail ArgumentError, 'invalid value for "opts[:"name"]" when calling ProductsApi.product_controller_update, the character length must be smaller than or equal to 200.'
401
382
  end
402
- # verify the required parameter 'status' is set
403
- if @api_client.config.client_side_validation && status.nil?
404
- fail ArgumentError, "Missing the required parameter 'status' when calling ProductsApi.product_controller_update"
383
+
384
+ if @api_client.config.client_side_validation && !opts[:'name'].nil? && opts[:'name'].to_s.length < 1
385
+ fail ArgumentError, 'invalid value for "opts[:"name"]" when calling ProductsApi.product_controller_update, the character length must be greater than or equal to 1.'
405
386
  end
406
- # verify the required parameter 'product_type' is set
407
- if @api_client.config.client_side_validation && product_type.nil?
408
- fail ArgumentError, "Missing the required parameter 'product_type' when calling ProductsApi.product_controller_update"
387
+
388
+ if @api_client.config.client_side_validation && !opts[:'description'].nil? && opts[:'description'].to_s.length > 2000
389
+ fail ArgumentError, 'invalid value for "opts[:"description"]" when calling ProductsApi.product_controller_update, the character length must be smaller than or equal to 2000.'
409
390
  end
410
- # verify the required parameter 'images' is set
411
- if @api_client.config.client_side_validation && images.nil?
412
- fail ArgumentError, "Missing the required parameter 'images' when calling ProductsApi.product_controller_update"
391
+
392
+ if @api_client.config.client_side_validation && !opts[:'price'].nil? && opts[:'price'] < 0.01
393
+ fail ArgumentError, 'invalid value for "opts[:"price"]" when calling ProductsApi.product_controller_update, must be greater than or equal to 0.01.'
413
394
  end
414
- # verify the required parameter 'id' is set
415
- if @api_client.config.client_side_validation && id.nil?
416
- fail ArgumentError, "Missing the required parameter 'id' when calling ProductsApi.product_controller_update"
395
+
396
+ allowable_values = ["USD", "EUR", "GBP", "CAD", "AUD", "JPY"]
397
+ if @api_client.config.client_side_validation && opts[:'currency'] && !allowable_values.include?(opts[:'currency'])
398
+ fail ArgumentError, "invalid value for \"currency\", must be one of #{allowable_values}"
417
399
  end
418
400
  # resource path
419
- local_var_path = '/api/v0/products/{id}'.sub('{' + 'id' + '}', id.to_s)
401
+ local_var_path = '/api/v0/products/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
420
402
 
421
403
  # query parameters
422
404
  query_params = opts[:query_params] || {}
@@ -424,45 +406,55 @@ module DevDraftAI
424
406
  # header parameters
425
407
  header_params = opts[:header_params] || {}
426
408
  # HTTP header 'Content-Type'
427
- header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
409
+ content_type = @api_client.select_header_content_type(['multipart/form-data'])
410
+ if !content_type.nil?
411
+ header_params['Content-Type'] = content_type
412
+ end
428
413
 
429
414
  # form parameters
430
415
  form_params = opts[:form_params] || {}
431
- form_params['name'] = name
432
- form_params['description'] = description
433
- form_params['price'] = price
434
- form_params['currency'] = currency
435
- form_params['type'] = type
436
- form_params['weight'] = weight
437
- form_params['unit'] = unit
438
- form_params['quantity'] = quantity
439
- form_params['stockCount'] = stock_count
440
- form_params['status'] = status
441
- form_params['productType'] = product_type
442
- form_params['images'] = @api_client.build_collection_param(images, :multi)
416
+ form_params['name'] = opts[:'name'] if !opts[:'name'].nil?
417
+ form_params['description'] = opts[:'description'] if !opts[:'description'].nil?
418
+ form_params['price'] = opts[:'price'] if !opts[:'price'].nil?
419
+ form_params['currency'] = opts[:'currency'] if !opts[:'currency'].nil?
420
+ form_params['type'] = opts[:'type'] if !opts[:'type'].nil?
421
+ form_params['weight'] = opts[:'weight'] if !opts[:'weight'].nil?
422
+ form_params['unit'] = opts[:'unit'] if !opts[:'unit'].nil?
423
+ form_params['quantity'] = opts[:'quantity'] if !opts[:'quantity'].nil?
424
+ form_params['stockCount'] = opts[:'stock_count'] if !opts[:'stock_count'].nil?
425
+ form_params['status'] = opts[:'status'] if !opts[:'status'].nil?
426
+ form_params['productType'] = opts[:'product_type'] if !opts[:'product_type'].nil?
427
+ form_params['images'] = @api_client.build_collection_param(opts[:'images'], :csv) if !opts[:'images'].nil?
443
428
 
444
429
  # http body (model)
445
- post_body = opts[:body]
430
+ post_body = opts[:debug_body]
446
431
 
447
- return_type = opts[:return_type]
432
+ # return_type
433
+ return_type = opts[:debug_return_type]
448
434
 
449
- auth_names = opts[:auth_names] || ['x-client-key', 'x-client-secret']
450
- data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
435
+ # auth_names
436
+ auth_names = opts[:debug_auth_names] || ['x-client-secret', 'x-client-key']
437
+
438
+ new_options = opts.merge(
439
+ :operation => :"ProductsApi.product_controller_update",
451
440
  :header_params => header_params,
452
441
  :query_params => query_params,
453
442
  :form_params => form_params,
454
443
  :body => post_body,
455
444
  :auth_names => auth_names,
456
- :return_type => return_type)
445
+ :return_type => return_type
446
+ )
457
447
 
448
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
458
449
  if @api_client.config.debugging
459
450
  @api_client.config.logger.debug "API called: ProductsApi#product_controller_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
460
451
  end
461
452
  return data, status_code, headers
462
453
  end
454
+
463
455
  # Upload images for a product
464
456
  # Adds new images to an existing product. This endpoint allows you to upload additional images for a product that already exists. ## Use Cases - Add more product images - Update product gallery - Enhance product presentation ## Supported Image Formats - JPEG/JPG - PNG - WebP - Maximum 10 images per upload - Maximum file size: 5MB per image ## Example Request (multipart/form-data) ``` images: [file1.jpg, file2.jpg] // Up to 10 images ``` ## Notes - Images are appended to existing product images - Total images per product cannot exceed 10 - Images are automatically optimized and resized
465
- # @param id Product ID
457
+ # @param id [String] Product ID
466
458
  # @param [Hash] opts the optional parameters
467
459
  # @return [nil]
468
460
  def product_controller_upload_image(id, opts = {})
@@ -472,7 +464,7 @@ module DevDraftAI
472
464
 
473
465
  # Upload images for a product
474
466
  # Adds new images to an existing product. This endpoint allows you to upload additional images for a product that already exists. ## Use Cases - Add more product images - Update product gallery - Enhance product presentation ## Supported Image Formats - JPEG/JPG - PNG - WebP - Maximum 10 images per upload - Maximum file size: 5MB per image ## Example Request (multipart/form-data) &#x60;&#x60;&#x60; images: [file1.jpg, file2.jpg] // Up to 10 images &#x60;&#x60;&#x60; ## Notes - Images are appended to existing product images - Total images per product cannot exceed 10 - Images are automatically optimized and resized
475
- # @param id Product ID
467
+ # @param id [String] Product ID
476
468
  # @param [Hash] opts the optional parameters
477
469
  # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
478
470
  def product_controller_upload_image_with_http_info(id, opts = {})
@@ -484,7 +476,7 @@ module DevDraftAI
484
476
  fail ArgumentError, "Missing the required parameter 'id' when calling ProductsApi.product_controller_upload_image"
485
477
  end
486
478
  # resource path
487
- local_var_path = '/api/v0/products/{id}/images'.sub('{' + 'id' + '}', id.to_s)
479
+ local_var_path = '/api/v0/products/{id}/images'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
488
480
 
489
481
  # query parameters
490
482
  query_params = opts[:query_params] || {}
@@ -496,19 +488,25 @@ module DevDraftAI
496
488
  form_params = opts[:form_params] || {}
497
489
 
498
490
  # http body (model)
499
- post_body = opts[:body]
491
+ post_body = opts[:debug_body]
492
+
493
+ # return_type
494
+ return_type = opts[:debug_return_type]
500
495
 
501
- return_type = opts[:return_type]
496
+ # auth_names
497
+ auth_names = opts[:debug_auth_names] || ['x-client-secret', 'x-client-key']
502
498
 
503
- auth_names = opts[:auth_names] || ['x-client-key', 'x-client-secret']
504
- data, status_code, headers = @api_client.call_api(:POST, local_var_path,
499
+ new_options = opts.merge(
500
+ :operation => :"ProductsApi.product_controller_upload_image",
505
501
  :header_params => header_params,
506
502
  :query_params => query_params,
507
503
  :form_params => form_params,
508
504
  :body => post_body,
509
505
  :auth_names => auth_names,
510
- :return_type => return_type)
506
+ :return_type => return_type
507
+ )
511
508
 
509
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
512
510
  if @api_client.config.debugging
513
511
  @api_client.config.logger.debug "API called: ProductsApi#product_controller_upload_image\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
514
512
  end