devdraft 1.0.0
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.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/README.md +1246 -0
- data/Rakefile +8 -0
- data/devdraft_ai_sdk.gemspec +38 -0
- data/docs/APIHealthApi.md +87 -0
- data/docs/AggregatedBalanceResponse.md +9 -0
- data/docs/AllBalancesResponse.md +9 -0
- data/docs/AllOfAllBalancesResponseEurc.md +9 -0
- data/docs/AllOfAllBalancesResponseUsdc.md +9 -0
- data/docs/AllOfCreateBankPaymentIntentDtoDestinationCurrency.md +6 -0
- data/docs/AllOfCreateBankPaymentIntentDtoDestinationNetwork.md +6 -0
- data/docs/AllOfCreateBankPaymentIntentDtoSourceCurrency.md +6 -0
- data/docs/AllOfCreateBankPaymentIntentDtoSourcePaymentRail.md +6 -0
- data/docs/AllOfCreateCustomerDtoStatus.md +6 -0
- data/docs/AllOfCreateLiquidationAddressDtoDestinationCurrency.md +6 -0
- data/docs/AllOfCreateLiquidationAddressDtoDestinationPaymentRail.md +6 -0
- data/docs/AllOfCreateStablePaymentIntentDtoDestinationCurrency.md +6 -0
- data/docs/AllOfCreateStablePaymentIntentDtoDestinationNetwork.md +6 -0
- data/docs/AllOfCreateStablePaymentIntentDtoSourceCurrency.md +6 -0
- data/docs/AllOfCreateStablePaymentIntentDtoSourceNetwork.md +6 -0
- data/docs/AllOfUpdateCustomerDtoStatus.md +6 -0
- data/docs/AppBalancesApi.md +169 -0
- data/docs/BridgePaymentRail.md +6 -0
- data/docs/CreateBankPaymentIntentDto.md +24 -0
- data/docs/CreateCustomerDto.md +12 -0
- data/docs/CreateDirectBankTransferDto.md +14 -0
- data/docs/CreateDirectWalletTransferDto.md +10 -0
- data/docs/CreateInvoiceDto.md +22 -0
- data/docs/CreateLiquidationAddressDto.md +21 -0
- data/docs/CreatePaymentLinkDto.md +31 -0
- data/docs/CreateProductDto.md +18 -0
- data/docs/CreateStablePaymentIntentDto.md +21 -0
- data/docs/CreateStablecoinConversionDto.md +11 -0
- data/docs/CreateTaxInput.md +6 -0
- data/docs/CreateWebhookDto.md +11 -0
- data/docs/CustomerStatus.md +6 -0
- data/docs/CustomersApi.md +250 -0
- data/docs/DestinationCurrency.md +6 -0
- data/docs/ExchangeRateResponseDto.md +12 -0
- data/docs/ExchangeRatesApi.md +176 -0
- data/docs/FiatCurrency.md +6 -0
- data/docs/HealthResponseDto.md +12 -0
- data/docs/InvoiceProductDto.md +8 -0
- data/docs/InvoicesApi.md +236 -0
- data/docs/LiquidationAddressResponseDto.md +20 -0
- data/docs/LiquidationAddressesApi.md +152 -0
- data/docs/PaymentIntentsApi.md +127 -0
- data/docs/PaymentLinkProductDto.md +8 -0
- data/docs/PaymentLinksApi.md +238 -0
- data/docs/PaymentRequestDto.md +10 -0
- data/docs/PaymentResponseDto.md +11 -0
- data/docs/ProductsApi.md +404 -0
- data/docs/PublicHealthResponseDto.md +9 -0
- data/docs/RefundResponseDto.md +11 -0
- data/docs/StableCoinCurrency.md +6 -0
- data/docs/TaxesApi.md +292 -0
- data/docs/TestPaymentsApi.md +150 -0
- data/docs/TransfersApi.md +175 -0
- data/docs/UpdateCustomerDto.md +12 -0
- data/docs/UpdatePaymentLinkDto.md +6 -0
- data/docs/UpdatePreferenceInput.md +6 -0
- data/docs/UpdateProductDto.md +18 -0
- data/docs/UpdateTaxInput.md +6 -0
- data/docs/UpdateWebhookDto.md +11 -0
- data/docs/WalletsApi.md +58 -0
- data/docs/WebhookResponseDto.md +14 -0
- data/docs/WebhooksApi.md +307 -0
- data/git_push.sh +44 -0
- data/lib/devdraft/api/api_health_api.rb +116 -0
- data/lib/devdraft/api/app_balances_api.rb +170 -0
- data/lib/devdraft/api/customers_api.rb +258 -0
- data/lib/devdraft/api/exchange_rates_api.rb +184 -0
- data/lib/devdraft/api/invoices_api.rb +238 -0
- data/lib/devdraft/api/liquidation_addresses_api.rb +202 -0
- data/lib/devdraft/api/payment_intents_api.rb +150 -0
- data/lib/devdraft/api/payment_links_api.rb +240 -0
- data/lib/devdraft/api/products_api.rb +518 -0
- data/lib/devdraft/api/taxes_api.rb +290 -0
- data/lib/devdraft/api/test_payments_api.rb +202 -0
- data/lib/devdraft/api/transfers_api.rb +182 -0
- data/lib/devdraft/api/wallets_api.rb +66 -0
- data/lib/devdraft/api/webhooks_api.rb +310 -0
- data/lib/devdraft/api_client.rb +388 -0
- data/lib/devdraft/api_error.rb +57 -0
- data/lib/devdraft/configuration.rb +219 -0
- data/lib/devdraft/models/aggregated_balance_response.rb +278 -0
- data/lib/devdraft/models/all_balances_response.rb +242 -0
- data/lib/devdraft/models/all_of_all_balances_response_eurc.rb +283 -0
- data/lib/devdraft/models/all_of_all_balances_response_usdc.rb +283 -0
- data/lib/devdraft/models/all_of_create_bank_payment_intent_dto_destination_currency.rb +202 -0
- data/lib/devdraft/models/all_of_create_bank_payment_intent_dto_destination_network.rb +202 -0
- data/lib/devdraft/models/all_of_create_bank_payment_intent_dto_source_currency.rb +202 -0
- data/lib/devdraft/models/all_of_create_bank_payment_intent_dto_source_payment_rail.rb +202 -0
- data/lib/devdraft/models/all_of_create_customer_dto_status.rb +202 -0
- data/lib/devdraft/models/all_of_create_liquidation_address_dto_destination_currency.rb +202 -0
- data/lib/devdraft/models/all_of_create_liquidation_address_dto_destination_payment_rail.rb +202 -0
- data/lib/devdraft/models/all_of_create_stable_payment_intent_dto_destination_currency.rb +202 -0
- data/lib/devdraft/models/all_of_create_stable_payment_intent_dto_destination_network.rb +202 -0
- data/lib/devdraft/models/all_of_create_stable_payment_intent_dto_source_currency.rb +202 -0
- data/lib/devdraft/models/all_of_create_stable_payment_intent_dto_source_network.rb +202 -0
- data/lib/devdraft/models/all_of_update_customer_dto_status.rb +202 -0
- data/lib/devdraft/models/bridge_payment_rail.rb +43 -0
- data/lib/devdraft/models/create_bank_payment_intent_dto.rb +397 -0
- data/lib/devdraft/models/create_customer_dto.rb +308 -0
- data/lib/devdraft/models/create_direct_bank_transfer_dto.rb +302 -0
- data/lib/devdraft/models/create_direct_wallet_transfer_dto.rb +257 -0
- data/lib/devdraft/models/create_invoice_dto.rb +474 -0
- data/lib/devdraft/models/create_liquidation_address_dto.rb +408 -0
- data/lib/devdraft/models/create_payment_link_dto.rb +603 -0
- data/lib/devdraft/models/create_product_dto.rb +370 -0
- data/lib/devdraft/models/create_stable_payment_intent_dto.rb +362 -0
- data/lib/devdraft/models/create_stablecoin_conversion_dto.rb +272 -0
- data/lib/devdraft/models/create_tax_input.rb +197 -0
- data/lib/devdraft/models/create_webhook_dto.rb +271 -0
- data/lib/devdraft/models/customer_status.rb +29 -0
- data/lib/devdraft/models/destination_currency.rb +34 -0
- data/lib/devdraft/models/exchange_rate_response_dto.rb +282 -0
- data/lib/devdraft/models/fiat_currency.rb +29 -0
- data/lib/devdraft/models/health_response_dto.rb +333 -0
- data/lib/devdraft/models/invoice_product_dto.rb +227 -0
- data/lib/devdraft/models/liquidation_address_response_dto.rb +377 -0
- data/lib/devdraft/models/payment_link_product_dto.rb +229 -0
- data/lib/devdraft/models/payment_request_dto.rb +252 -0
- data/lib/devdraft/models/payment_response_dto.rb +272 -0
- data/lib/devdraft/models/public_health_response_dto.rb +276 -0
- data/lib/devdraft/models/refund_response_dto.rb +272 -0
- data/lib/devdraft/models/stable_coin_currency.rb +28 -0
- data/lib/devdraft/models/update_customer_dto.rb +293 -0
- data/lib/devdraft/models/update_payment_link_dto.rb +197 -0
- data/lib/devdraft/models/update_preference_input.rb +197 -0
- data/lib/devdraft/models/update_product_dto.rb +355 -0
- data/lib/devdraft/models/update_tax_input.rb +197 -0
- data/lib/devdraft/models/update_webhook_dto.rb +251 -0
- data/lib/devdraft/models/webhook_response_dto.rb +317 -0
- data/lib/devdraft/version.rb +14 -0
- data/lib/devdraft.rb +101 -0
- data/spec/api/api_health_api_spec.rb +54 -0
- data/spec/api/app_balances_api_spec.rb +67 -0
- data/spec/api/customers_api_spec.rb +87 -0
- data/spec/api/exchange_rates_api_spec.rb +69 -0
- data/spec/api/invoices_api_spec.rb +80 -0
- data/spec/api/liquidation_addresses_api_spec.rb +72 -0
- data/spec/api/payment_intents_api_spec.rb +60 -0
- data/spec/api/payment_links_api_spec.rb +81 -0
- data/spec/api/products_api_spec.rb +130 -0
- data/spec/api/taxes_api_spec.rb +91 -0
- data/spec/api/test_payments_api_spec.rb +71 -0
- data/spec/api/transfers_api_spec.rb +67 -0
- data/spec/api/wallets_api_spec.rb +44 -0
- data/spec/api/webhooks_api_spec.rb +96 -0
- data/spec/api_client_spec.rb +225 -0
- data/spec/base_object_spec.rb +109 -0
- data/spec/configuration_spec.rb +41 -0
- data/spec/models/aggregated_balance_response_spec.rb +56 -0
- data/spec/models/all_balances_response_spec.rb +52 -0
- data/spec/models/all_of_all_balances_response_eurc_spec.rb +56 -0
- data/spec/models/all_of_all_balances_response_usdc_spec.rb +56 -0
- data/spec/models/all_of_create_bank_payment_intent_dto_destination_currency_spec.rb +34 -0
- data/spec/models/all_of_create_bank_payment_intent_dto_destination_network_spec.rb +34 -0
- data/spec/models/all_of_create_bank_payment_intent_dto_source_currency_spec.rb +34 -0
- data/spec/models/all_of_create_bank_payment_intent_dto_source_payment_rail_spec.rb +34 -0
- data/spec/models/all_of_create_customer_dto_status_spec.rb +34 -0
- data/spec/models/all_of_create_liquidation_address_dto_destination_currency_spec.rb +34 -0
- data/spec/models/all_of_create_liquidation_address_dto_destination_payment_rail_spec.rb +34 -0
- data/spec/models/all_of_create_stable_payment_intent_dto_destination_currency_spec.rb +34 -0
- data/spec/models/all_of_create_stable_payment_intent_dto_destination_network_spec.rb +34 -0
- data/spec/models/all_of_create_stable_payment_intent_dto_source_currency_spec.rb +34 -0
- data/spec/models/all_of_create_stable_payment_intent_dto_source_network_spec.rb +34 -0
- data/spec/models/all_of_update_customer_dto_status_spec.rb +34 -0
- data/spec/models/bridge_payment_rail_spec.rb +34 -0
- data/spec/models/create_bank_payment_intent_dto_spec.rb +142 -0
- data/spec/models/create_customer_dto_spec.rb +74 -0
- data/spec/models/create_direct_bank_transfer_dto_spec.rb +82 -0
- data/spec/models/create_direct_wallet_transfer_dto_spec.rb +58 -0
- data/spec/models/create_invoice_dto_spec.rb +146 -0
- data/spec/models/create_liquidation_address_dto_spec.rb +132 -0
- data/spec/models/create_payment_link_dto_spec.rb +200 -0
- data/spec/models/create_product_dto_spec.rb +110 -0
- data/spec/models/create_stable_payment_intent_dto_spec.rb +124 -0
- data/spec/models/create_stablecoin_conversion_dto_spec.rb +64 -0
- data/spec/models/create_tax_input_spec.rb +34 -0
- data/spec/models/create_webhook_dto_spec.rb +64 -0
- data/spec/models/customer_status_spec.rb +34 -0
- data/spec/models/destination_currency_spec.rb +34 -0
- data/spec/models/exchange_rate_response_dto_spec.rb +70 -0
- data/spec/models/fiat_currency_spec.rb +34 -0
- data/spec/models/health_response_dto_spec.rb +78 -0
- data/spec/models/invoice_product_dto_spec.rb +46 -0
- data/spec/models/liquidation_address_response_dto_spec.rb +118 -0
- data/spec/models/payment_link_product_dto_spec.rb +46 -0
- data/spec/models/payment_request_dto_spec.rb +58 -0
- data/spec/models/payment_response_dto_spec.rb +64 -0
- data/spec/models/public_health_response_dto_spec.rb +56 -0
- data/spec/models/refund_response_dto_spec.rb +64 -0
- data/spec/models/stable_coin_currency_spec.rb +34 -0
- data/spec/models/update_customer_dto_spec.rb +74 -0
- data/spec/models/update_payment_link_dto_spec.rb +34 -0
- data/spec/models/update_preference_input_spec.rb +34 -0
- data/spec/models/update_product_dto_spec.rb +110 -0
- data/spec/models/update_tax_input_spec.rb +34 -0
- data/spec/models/update_webhook_dto_spec.rb +64 -0
- data/spec/models/webhook_response_dto_spec.rb +82 -0
- data/spec/spec_helper.rb +110 -0
- metadata +375 -0
@@ -0,0 +1,518 @@
|
|
1
|
+
=begin
|
2
|
+
#Devdraft AI Payment & Business Management API
|
3
|
+
|
4
|
+
# A comprehensive payment processing and business management API that enables seamless integration of cryptocurrency and traditional payment methods.
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0.0
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 3.0.65
|
10
|
+
=end
|
11
|
+
|
12
|
+
module DevDraftAI
|
13
|
+
class ProductsApi
|
14
|
+
attr_accessor :api_client
|
15
|
+
|
16
|
+
def initialize(api_client = ApiClient.default)
|
17
|
+
@api_client = api_client
|
18
|
+
end
|
19
|
+
# Create a new product
|
20
|
+
# 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
|
33
|
+
# @param [Hash] opts the optional parameters
|
34
|
+
# @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)
|
37
|
+
nil
|
38
|
+
end
|
39
|
+
|
40
|
+
# Create a new product
|
41
|
+
# 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)
|
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
|
54
|
+
# @param [Hash] opts the optional parameters
|
55
|
+
# @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 = {})
|
57
|
+
if @api_client.config.debugging
|
58
|
+
@api_client.config.logger.debug 'Calling API: ProductsApi.product_controller_create ...'
|
59
|
+
end
|
60
|
+
# verify the required parameter 'name' is set
|
61
|
+
if @api_client.config.client_side_validation && name.nil?
|
62
|
+
fail ArgumentError, "Missing the required parameter 'name' when calling ProductsApi.product_controller_create"
|
63
|
+
end
|
64
|
+
# verify the required parameter 'description' is set
|
65
|
+
if @api_client.config.client_side_validation && description.nil?
|
66
|
+
fail ArgumentError, "Missing the required parameter 'description' when calling ProductsApi.product_controller_create"
|
67
|
+
end
|
68
|
+
# verify the required parameter 'price' is set
|
69
|
+
if @api_client.config.client_side_validation && price.nil?
|
70
|
+
fail ArgumentError, "Missing the required parameter 'price' when calling ProductsApi.product_controller_create"
|
71
|
+
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"
|
103
|
+
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"
|
111
|
+
end
|
112
|
+
# resource path
|
113
|
+
local_var_path = '/api/v0/products'
|
114
|
+
|
115
|
+
# query parameters
|
116
|
+
query_params = opts[:query_params] || {}
|
117
|
+
|
118
|
+
# header parameters
|
119
|
+
header_params = opts[:header_params] || {}
|
120
|
+
# HTTP header 'Content-Type'
|
121
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
|
122
|
+
|
123
|
+
# form parameters
|
124
|
+
form_params = opts[:form_params] || {}
|
125
|
+
form_params['name'] = name
|
126
|
+
form_params['description'] = description
|
127
|
+
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)
|
137
|
+
|
138
|
+
# http body (model)
|
139
|
+
post_body = opts[:body]
|
140
|
+
|
141
|
+
return_type = opts[:return_type]
|
142
|
+
|
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,
|
145
|
+
:header_params => header_params,
|
146
|
+
:query_params => query_params,
|
147
|
+
:form_params => form_params,
|
148
|
+
:body => post_body,
|
149
|
+
:auth_names => auth_names,
|
150
|
+
:return_type => return_type)
|
151
|
+
|
152
|
+
if @api_client.config.debugging
|
153
|
+
@api_client.config.logger.debug "API called: ProductsApi#product_controller_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
154
|
+
end
|
155
|
+
return data, status_code, headers
|
156
|
+
end
|
157
|
+
# Get all products
|
158
|
+
# 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
|
+
# @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
|
162
|
+
# @return [nil]
|
163
|
+
def product_controller_find_all(opts = {})
|
164
|
+
product_controller_find_all_with_http_info(opts)
|
165
|
+
nil
|
166
|
+
end
|
167
|
+
|
168
|
+
# Get all products
|
169
|
+
# 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 } ```
|
170
|
+
# @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
|
173
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
174
|
+
def product_controller_find_all_with_http_info(opts = {})
|
175
|
+
if @api_client.config.debugging
|
176
|
+
@api_client.config.logger.debug 'Calling API: ProductsApi.product_controller_find_all ...'
|
177
|
+
end
|
178
|
+
# resource path
|
179
|
+
local_var_path = '/api/v0/products'
|
180
|
+
|
181
|
+
# query parameters
|
182
|
+
query_params = opts[:query_params] || {}
|
183
|
+
query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil?
|
184
|
+
query_params[:'take'] = opts[:'take'] if !opts[:'take'].nil?
|
185
|
+
|
186
|
+
# header parameters
|
187
|
+
header_params = opts[:header_params] || {}
|
188
|
+
|
189
|
+
# form parameters
|
190
|
+
form_params = opts[:form_params] || {}
|
191
|
+
|
192
|
+
# http body (model)
|
193
|
+
post_body = opts[:body]
|
194
|
+
|
195
|
+
return_type = opts[:return_type]
|
196
|
+
|
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,
|
199
|
+
:header_params => header_params,
|
200
|
+
:query_params => query_params,
|
201
|
+
:form_params => form_params,
|
202
|
+
:body => post_body,
|
203
|
+
:auth_names => auth_names,
|
204
|
+
:return_type => return_type)
|
205
|
+
|
206
|
+
if @api_client.config.debugging
|
207
|
+
@api_client.config.logger.debug "API called: ProductsApi#product_controller_find_all\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
208
|
+
end
|
209
|
+
return data, status_code, headers
|
210
|
+
end
|
211
|
+
# Get a product by ID
|
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
|
214
|
+
# @param [Hash] opts the optional parameters
|
215
|
+
# @return [nil]
|
216
|
+
def product_controller_find_one(id, opts = {})
|
217
|
+
product_controller_find_one_with_http_info(id, opts)
|
218
|
+
nil
|
219
|
+
end
|
220
|
+
|
221
|
+
# Get a product by ID
|
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 ```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\" } ```
|
223
|
+
# @param id Product ID
|
224
|
+
# @param [Hash] opts the optional parameters
|
225
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
226
|
+
def product_controller_find_one_with_http_info(id, opts = {})
|
227
|
+
if @api_client.config.debugging
|
228
|
+
@api_client.config.logger.debug 'Calling API: ProductsApi.product_controller_find_one ...'
|
229
|
+
end
|
230
|
+
# verify the required parameter 'id' is set
|
231
|
+
if @api_client.config.client_side_validation && id.nil?
|
232
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling ProductsApi.product_controller_find_one"
|
233
|
+
end
|
234
|
+
# resource path
|
235
|
+
local_var_path = '/api/v0/products/{id}'.sub('{' + 'id' + '}', id.to_s)
|
236
|
+
|
237
|
+
# query parameters
|
238
|
+
query_params = opts[:query_params] || {}
|
239
|
+
|
240
|
+
# header parameters
|
241
|
+
header_params = opts[:header_params] || {}
|
242
|
+
|
243
|
+
# form parameters
|
244
|
+
form_params = opts[:form_params] || {}
|
245
|
+
|
246
|
+
# http body (model)
|
247
|
+
post_body = opts[:body]
|
248
|
+
|
249
|
+
return_type = opts[:return_type]
|
250
|
+
|
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,
|
253
|
+
:header_params => header_params,
|
254
|
+
:query_params => query_params,
|
255
|
+
:form_params => form_params,
|
256
|
+
:body => post_body,
|
257
|
+
:auth_names => auth_names,
|
258
|
+
:return_type => return_type)
|
259
|
+
|
260
|
+
if @api_client.config.debugging
|
261
|
+
@api_client.config.logger.debug "API called: ProductsApi#product_controller_find_one\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
262
|
+
end
|
263
|
+
return data, status_code, headers
|
264
|
+
end
|
265
|
+
# Delete a product
|
266
|
+
# 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
|
268
|
+
# @param [Hash] opts the optional parameters
|
269
|
+
# @return [nil]
|
270
|
+
def product_controller_remove(id, opts = {})
|
271
|
+
product_controller_remove_with_http_info(id, opts)
|
272
|
+
nil
|
273
|
+
end
|
274
|
+
|
275
|
+
# Delete a product
|
276
|
+
# 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
|
278
|
+
# @param [Hash] opts the optional parameters
|
279
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
280
|
+
def product_controller_remove_with_http_info(id, opts = {})
|
281
|
+
if @api_client.config.debugging
|
282
|
+
@api_client.config.logger.debug 'Calling API: ProductsApi.product_controller_remove ...'
|
283
|
+
end
|
284
|
+
# verify the required parameter 'id' is set
|
285
|
+
if @api_client.config.client_side_validation && id.nil?
|
286
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling ProductsApi.product_controller_remove"
|
287
|
+
end
|
288
|
+
# resource path
|
289
|
+
local_var_path = '/api/v0/products/{id}'.sub('{' + 'id' + '}', id.to_s)
|
290
|
+
|
291
|
+
# query parameters
|
292
|
+
query_params = opts[:query_params] || {}
|
293
|
+
|
294
|
+
# header parameters
|
295
|
+
header_params = opts[:header_params] || {}
|
296
|
+
|
297
|
+
# form parameters
|
298
|
+
form_params = opts[:form_params] || {}
|
299
|
+
|
300
|
+
# http body (model)
|
301
|
+
post_body = opts[:body]
|
302
|
+
|
303
|
+
return_type = opts[:return_type]
|
304
|
+
|
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,
|
307
|
+
:header_params => header_params,
|
308
|
+
:query_params => query_params,
|
309
|
+
:form_params => form_params,
|
310
|
+
:body => post_body,
|
311
|
+
:auth_names => auth_names,
|
312
|
+
:return_type => return_type)
|
313
|
+
|
314
|
+
if @api_client.config.debugging
|
315
|
+
@api_client.config.logger.debug "API called: ProductsApi#product_controller_remove\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
316
|
+
end
|
317
|
+
return data, status_code, headers
|
318
|
+
end
|
319
|
+
# Update a product
|
320
|
+
# 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
|
334
|
+
# @param [Hash] opts the optional parameters
|
335
|
+
# @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)
|
338
|
+
nil
|
339
|
+
end
|
340
|
+
|
341
|
+
# Update a product
|
342
|
+
# 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
|
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
|
+
# @param [Hash] opts the optional parameters
|
357
|
+
# @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 = {})
|
359
|
+
if @api_client.config.debugging
|
360
|
+
@api_client.config.logger.debug 'Calling API: ProductsApi.product_controller_update ...'
|
361
|
+
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"
|
397
|
+
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"
|
401
|
+
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"
|
405
|
+
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"
|
409
|
+
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"
|
413
|
+
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"
|
417
|
+
end
|
418
|
+
# resource path
|
419
|
+
local_var_path = '/api/v0/products/{id}'.sub('{' + 'id' + '}', id.to_s)
|
420
|
+
|
421
|
+
# query parameters
|
422
|
+
query_params = opts[:query_params] || {}
|
423
|
+
|
424
|
+
# header parameters
|
425
|
+
header_params = opts[:header_params] || {}
|
426
|
+
# HTTP header 'Content-Type'
|
427
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
|
428
|
+
|
429
|
+
# form parameters
|
430
|
+
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)
|
443
|
+
|
444
|
+
# http body (model)
|
445
|
+
post_body = opts[:body]
|
446
|
+
|
447
|
+
return_type = opts[:return_type]
|
448
|
+
|
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,
|
451
|
+
:header_params => header_params,
|
452
|
+
:query_params => query_params,
|
453
|
+
:form_params => form_params,
|
454
|
+
:body => post_body,
|
455
|
+
:auth_names => auth_names,
|
456
|
+
:return_type => return_type)
|
457
|
+
|
458
|
+
if @api_client.config.debugging
|
459
|
+
@api_client.config.logger.debug "API called: ProductsApi#product_controller_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
460
|
+
end
|
461
|
+
return data, status_code, headers
|
462
|
+
end
|
463
|
+
# Upload images for a product
|
464
|
+
# 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
|
466
|
+
# @param [Hash] opts the optional parameters
|
467
|
+
# @return [nil]
|
468
|
+
def product_controller_upload_image(id, opts = {})
|
469
|
+
product_controller_upload_image_with_http_info(id, opts)
|
470
|
+
nil
|
471
|
+
end
|
472
|
+
|
473
|
+
# Upload images for a product
|
474
|
+
# 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
|
475
|
+
# @param id Product ID
|
476
|
+
# @param [Hash] opts the optional parameters
|
477
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
478
|
+
def product_controller_upload_image_with_http_info(id, opts = {})
|
479
|
+
if @api_client.config.debugging
|
480
|
+
@api_client.config.logger.debug 'Calling API: ProductsApi.product_controller_upload_image ...'
|
481
|
+
end
|
482
|
+
# verify the required parameter 'id' is set
|
483
|
+
if @api_client.config.client_side_validation && id.nil?
|
484
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling ProductsApi.product_controller_upload_image"
|
485
|
+
end
|
486
|
+
# resource path
|
487
|
+
local_var_path = '/api/v0/products/{id}/images'.sub('{' + 'id' + '}', id.to_s)
|
488
|
+
|
489
|
+
# query parameters
|
490
|
+
query_params = opts[:query_params] || {}
|
491
|
+
|
492
|
+
# header parameters
|
493
|
+
header_params = opts[:header_params] || {}
|
494
|
+
|
495
|
+
# form parameters
|
496
|
+
form_params = opts[:form_params] || {}
|
497
|
+
|
498
|
+
# http body (model)
|
499
|
+
post_body = opts[:body]
|
500
|
+
|
501
|
+
return_type = opts[:return_type]
|
502
|
+
|
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,
|
505
|
+
:header_params => header_params,
|
506
|
+
:query_params => query_params,
|
507
|
+
:form_params => form_params,
|
508
|
+
:body => post_body,
|
509
|
+
:auth_names => auth_names,
|
510
|
+
:return_type => return_type)
|
511
|
+
|
512
|
+
if @api_client.config.debugging
|
513
|
+
@api_client.config.logger.debug "API called: ProductsApi#product_controller_upload_image\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
514
|
+
end
|
515
|
+
return data, status_code, headers
|
516
|
+
end
|
517
|
+
end
|
518
|
+
end
|