printful_client 1.0.1

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 (549) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/Gemfile.lock +72 -0
  4. data/LICENSE +21 -0
  5. data/README.md +43 -0
  6. data/docs/AddFile200Response.md +20 -0
  7. data/docs/Address.md +42 -0
  8. data/docs/AddressInfo.md +28 -0
  9. data/docs/ApprovalSheet.md +18 -0
  10. data/docs/ApprovalSheetChanges.md +20 -0
  11. data/docs/ApprovalSheetChangesFilesInner.md +18 -0
  12. data/docs/ApprovalSheetWebhookFile.md +24 -0
  13. data/docs/ApprovalSheetsAPIClient.md +216 -0
  14. data/docs/ApproveDesign200Response.md +20 -0
  15. data/docs/ApproveDesign200ResponseAllOfResult.md +18 -0
  16. data/docs/AvailabilityStatus.md +20 -0
  17. data/docs/AvailableTechnique.md +22 -0
  18. data/docs/AverageFulfillmentTime.md +20 -0
  19. data/docs/CalculateShippingRates.md +24 -0
  20. data/docs/CalculateShippingRates200Response.md +20 -0
  21. data/docs/CalculateTaxRates200Response.md +20 -0
  22. data/docs/CatalogAPIClient.md +400 -0
  23. data/docs/CatalogFileOption.md +24 -0
  24. data/docs/Category.md +26 -0
  25. data/docs/ChangePackingSlip200Response.md +20 -0
  26. data/docs/ChangePackingSlip200ResponseResult.md +18 -0
  27. data/docs/Costs.md +38 -0
  28. data/docs/CostsByAmountInner.md +34 -0
  29. data/docs/CostsByProductInner.md +26 -0
  30. data/docs/CostsByVariantInner.md +28 -0
  31. data/docs/Country.md +24 -0
  32. data/docs/CountryStateCodeAPIClient.md +69 -0
  33. data/docs/CreateGenerationTask.md +32 -0
  34. data/docs/CreateGeneratorTask200Response.md +20 -0
  35. data/docs/CreateOrder200Response.md +20 -0
  36. data/docs/CreateSyncProduct200Response.md +20 -0
  37. data/docs/CreateSyncProduct400Response.md +22 -0
  38. data/docs/CreateSyncProduct400ResponseError.md +20 -0
  39. data/docs/CreateWebhookRequest.md +22 -0
  40. data/docs/DeleteProductTemplate200Response.md +20 -0
  41. data/docs/DeleteProductTemplate200ResponseAllOfResult.md +18 -0
  42. data/docs/DeleteSyncVariant200Response.md +20 -0
  43. data/docs/EcommercePlatformSyncAPIClient.md +459 -0
  44. data/docs/EstimateOrderCosts200Response.md +20 -0
  45. data/docs/EstimateOrderCosts200ResponseAllOfResult.md +20 -0
  46. data/docs/File.md +50 -0
  47. data/docs/FileLibraryAPIClient.md +220 -0
  48. data/docs/FileOption.md +20 -0
  49. data/docs/FileType.md +26 -0
  50. data/docs/GenerationTask.md +26 -0
  51. data/docs/GenerationTaskExtraMockup.md +24 -0
  52. data/docs/GenerationTaskFile.md +24 -0
  53. data/docs/GenerationTaskFilePosition.md +28 -0
  54. data/docs/GenerationTaskMockup.md +24 -0
  55. data/docs/GenerationTaskTemplateFile.md +22 -0
  56. data/docs/GetApprovalSheets200Response.md +20 -0
  57. data/docs/GetCategories200Response.md +20 -0
  58. data/docs/GetCategoryById200Response.md +20 -0
  59. data/docs/GetCountries200Response.md +20 -0
  60. data/docs/GetOrderByIdIdParameter.md +49 -0
  61. data/docs/GetOrders200Response.md +22 -0
  62. data/docs/GetPrintfiles200Response.md +20 -0
  63. data/docs/GetProductById200Response.md +20 -0
  64. data/docs/GetProductSizeGuideById200Response.md +20 -0
  65. data/docs/GetProductSizeGuideById404Response.md +22 -0
  66. data/docs/GetProductSizeGuideById404ResponseError.md +20 -0
  67. data/docs/GetProductTemplateById200Response.md +20 -0
  68. data/docs/GetProductTemplates200Response.md +22 -0
  69. data/docs/GetProducts200Response.md +20 -0
  70. data/docs/GetProducts401Response.md +22 -0
  71. data/docs/GetProducts401ResponseError.md +20 -0
  72. data/docs/GetScopes200Response.md +20 -0
  73. data/docs/GetScopes200ResponseAllOfResult.md +18 -0
  74. data/docs/GetScopes200ResponseAllOfResultScopesInner.md +20 -0
  75. data/docs/GetStatistics200Response.md +20 -0
  76. data/docs/GetStore200Response.md +20 -0
  77. data/docs/GetStoreSyncVariantById200Response.md +20 -0
  78. data/docs/GetStores200Response.md +22 -0
  79. data/docs/GetStores403Response.md +22 -0
  80. data/docs/GetStores403ResponseError.md +20 -0
  81. data/docs/GetSyncProductById200Response.md +20 -0
  82. data/docs/GetSyncProductByIdIdParameter.md +49 -0
  83. data/docs/GetSyncProducts200Response.md +22 -0
  84. data/docs/GetSyncVariantById200Response.md +20 -0
  85. data/docs/GetTaxCountries200Response.md +20 -0
  86. data/docs/GetTaxCountries200ResponseResultInner.md +24 -0
  87. data/docs/GetTaxCountries200ResponseResultInnerAllOfStatesInner.md +18 -0
  88. data/docs/GetTemplates200Response.md +20 -0
  89. data/docs/GetVariantById200Response.md +20 -0
  90. data/docs/GetWarehouseProduct200Response.md +20 -0
  91. data/docs/GetWarehouseProducts200Response.md +22 -0
  92. data/docs/GetWebhooks200Response.md +20 -0
  93. data/docs/Gift.md +20 -0
  94. data/docs/IncompleteItem.md +26 -0
  95. data/docs/Item.md +52 -0
  96. data/docs/ItemFilesInner.md +52 -0
  97. data/docs/ItemFilesInnerAllOfPosition.md +30 -0
  98. data/docs/ItemInfo.md +26 -0
  99. data/docs/ItemOption.md +20 -0
  100. data/docs/Material.md +20 -0
  101. data/docs/Measurement.md +22 -0
  102. data/docs/MeasurementValue.md +24 -0
  103. data/docs/MockupGeneratorAPIClient.md +313 -0
  104. data/docs/OAuthAPIClient.md +74 -0
  105. data/docs/Option.md +20 -0
  106. data/docs/OptionType.md +28 -0
  107. data/docs/Order.md +52 -0
  108. data/docs/OrderCosts.md +38 -0
  109. data/docs/OrderEstimateCosts.md +36 -0
  110. data/docs/OrderEstimateRetailCosts.md +30 -0
  111. data/docs/OrderEvent.md +52 -0
  112. data/docs/OrderShipmentItem.md +24 -0
  113. data/docs/OrdersAPIClient.md +535 -0
  114. data/docs/PackingSlip.md +28 -0
  115. data/docs/Paging.md +22 -0
  116. data/docs/PricingBreakdown.md +24 -0
  117. data/docs/Printfile.md +28 -0
  118. data/docs/PrintfileInfo.md +28 -0
  119. data/docs/PrintfulCosts.md +20 -0
  120. data/docs/Product.md +50 -0
  121. data/docs/Product1.md +20 -0
  122. data/docs/Product1SyncVariantsInner.md +46 -0
  123. data/docs/ProductInfo.md +20 -0
  124. data/docs/ProductSizeGuide.md +22 -0
  125. data/docs/ProductTemplate.md +26 -0
  126. data/docs/ProductTemplatesAPIClient.md +221 -0
  127. data/docs/ProductVariant.md +24 -0
  128. data/docs/ProductsAPIClient.md +679 -0
  129. data/docs/Profit.md +20 -0
  130. data/docs/README.md +410 -0
  131. data/docs/ReportsAPIClient.md +87 -0
  132. data/docs/Response200.md +18 -0
  133. data/docs/Response200Paginated.md +20 -0
  134. data/docs/RetailCosts.md +30 -0
  135. data/docs/SalesAndCostsInner.md +32 -0
  136. data/docs/SalesAndCostsSummaryInner.md +24 -0
  137. data/docs/Shipment.md +36 -0
  138. data/docs/ShippingInfo.md +32 -0
  139. data/docs/ShippingRateAPIClient.md +81 -0
  140. data/docs/SizeTable.md +28 -0
  141. data/docs/State.md +20 -0
  142. data/docs/Statistics.md +18 -0
  143. data/docs/Store.md +22 -0
  144. data/docs/StoreInformationAPIClient.md +218 -0
  145. data/docs/StoreStatistics.md +38 -0
  146. data/docs/SubmitApprovalSheetChanges200Response.md +20 -0
  147. data/docs/SyncProduct.md +32 -0
  148. data/docs/SyncProductDeleted.md +22 -0
  149. data/docs/SyncProductEvent.md +32 -0
  150. data/docs/SyncProductInfo.md +20 -0
  151. data/docs/SyncVariant.md +46 -0
  152. data/docs/SyncVariantInfo.md +20 -0
  153. data/docs/SyncVariantProduct.md +24 -0
  154. data/docs/TaxAddressInfo.md +24 -0
  155. data/docs/TaxInfo.md +22 -0
  156. data/docs/TaxRateAPIClient.md +134 -0
  157. data/docs/TaxRequest.md +18 -0
  158. data/docs/Template.md +42 -0
  159. data/docs/TemplateById.md +42 -0
  160. data/docs/TemplateByIdColorsInner.md +20 -0
  161. data/docs/TemplateByIdOptionDataInner.md +20 -0
  162. data/docs/TemplateByIdPlacementOptionDataInner.md +20 -0
  163. data/docs/TemplateByIdPlacementOptionDataInnerOptionsInner.md +20 -0
  164. data/docs/TemplateByIdPlacementsInner.md +24 -0
  165. data/docs/TemplatePlacementConflict.md +20 -0
  166. data/docs/TemplateVariantMapping.md +20 -0
  167. data/docs/TemplateVariantMappingItem.md +20 -0
  168. data/docs/Templates.md +18 -0
  169. data/docs/ThreadColors200Response.md +20 -0
  170. data/docs/ThreadColorsRequest.md +18 -0
  171. data/docs/TotalPaidOrders.md +20 -0
  172. data/docs/UpdateSyncProductRequest.md +20 -0
  173. data/docs/UpdateSyncProductRequestSyncVariantsInner.md +46 -0
  174. data/docs/UpdateSyncVariantRequest.md +46 -0
  175. data/docs/Variant.md +42 -0
  176. data/docs/VariantInfo.md +20 -0
  177. data/docs/VariantPrintfile.md +20 -0
  178. data/docs/WarehouseProduct.md +30 -0
  179. data/docs/WarehouseProductVariant.md +36 -0
  180. data/docs/WarehouseProductsAPIClient.md +159 -0
  181. data/docs/Webhook.md +24 -0
  182. data/docs/WebhookAPIClient.md +225 -0
  183. data/docs/WebhookInfo.md +22 -0
  184. data/generate.sh +53 -0
  185. data/lib/printful_client/api/approval_sheets_api_client.rb +238 -0
  186. data/lib/printful_client/api/catalog_api_client.rb +394 -0
  187. data/lib/printful_client/api/country_state_code_api_client.rb +79 -0
  188. data/lib/printful_client/api/ecommerce_platform_sync_api_client.rb +435 -0
  189. data/lib/printful_client/api/file_library_api_client.rb +227 -0
  190. data/lib/printful_client/api/mockup_generator_api_client.rb +318 -0
  191. data/lib/printful_client/api/o_auth_api_client.rb +79 -0
  192. data/lib/printful_client/api/orders_api_client.rb +514 -0
  193. data/lib/printful_client/api/product_templates_api_client.rb +211 -0
  194. data/lib/printful_client/api/products_api_client.rb +651 -0
  195. data/lib/printful_client/api/reports_api_client.rb +106 -0
  196. data/lib/printful_client/api/shipping_rate_api_client.rb +93 -0
  197. data/lib/printful_client/api/store_information_api_client.rb +209 -0
  198. data/lib/printful_client/api/tax_rate_api_client.rb +147 -0
  199. data/lib/printful_client/api/warehouse_products_api_client.rb +157 -0
  200. data/lib/printful_client/api/webhook_api_client.rb +213 -0
  201. data/lib/printful_client/api_client.rb +392 -0
  202. data/lib/printful_client/api_error.rb +58 -0
  203. data/lib/printful_client/configuration.rb +297 -0
  204. data/lib/printful_client/models/add_file200_response.rb +231 -0
  205. data/lib/printful_client/models/address.rb +336 -0
  206. data/lib/printful_client/models/address_info.rb +287 -0
  207. data/lib/printful_client/models/approval_sheet.rb +256 -0
  208. data/lib/printful_client/models/approval_sheet_changes.rb +242 -0
  209. data/lib/printful_client/models/approval_sheet_changes_files_inner.rb +222 -0
  210. data/lib/printful_client/models/approval_sheet_webhook_file.rb +241 -0
  211. data/lib/printful_client/models/approve_design200_response.rb +231 -0
  212. data/lib/printful_client/models/approve_design200_response_all_of_result.rb +214 -0
  213. data/lib/printful_client/models/availability_status.rb +225 -0
  214. data/lib/printful_client/models/available_technique.rb +235 -0
  215. data/lib/printful_client/models/average_fulfillment_time.rb +226 -0
  216. data/lib/printful_client/models/calculate_shipping_rates.rb +261 -0
  217. data/lib/printful_client/models/calculate_shipping_rates200_response.rb +226 -0
  218. data/lib/printful_client/models/calculate_tax_rates200_response.rb +224 -0
  219. data/lib/printful_client/models/catalog_file_option.rb +244 -0
  220. data/lib/printful_client/models/category.rb +290 -0
  221. data/lib/printful_client/models/change_packing_slip200_response.rb +224 -0
  222. data/lib/printful_client/models/change_packing_slip200_response_result.rb +215 -0
  223. data/lib/printful_client/models/costs.rb +316 -0
  224. data/lib/printful_client/models/costs_by_amount_inner.rb +295 -0
  225. data/lib/printful_client/models/costs_by_product_inner.rb +255 -0
  226. data/lib/printful_client/models/costs_by_variant_inner.rb +265 -0
  227. data/lib/printful_client/models/country.rb +246 -0
  228. data/lib/printful_client/models/create_generation_task.rb +329 -0
  229. data/lib/printful_client/models/create_generator_task200_response.rb +231 -0
  230. data/lib/printful_client/models/create_order200_response.rb +231 -0
  231. data/lib/printful_client/models/create_sync_product200_response.rb +231 -0
  232. data/lib/printful_client/models/create_sync_product400_response.rb +234 -0
  233. data/lib/printful_client/models/create_sync_product400_response_error.rb +223 -0
  234. data/lib/printful_client/models/create_webhook_request.rb +259 -0
  235. data/lib/printful_client/models/delete_product_template200_response.rb +231 -0
  236. data/lib/printful_client/models/delete_product_template200_response_all_of_result.rb +215 -0
  237. data/lib/printful_client/models/delete_sync_variant200_response.rb +234 -0
  238. data/lib/printful_client/models/estimate_order_costs200_response.rb +231 -0
  239. data/lib/printful_client/models/estimate_order_costs200_response_all_of_result.rb +223 -0
  240. data/lib/printful_client/models/file.rb +385 -0
  241. data/lib/printful_client/models/file_option.rb +240 -0
  242. data/lib/printful_client/models/file_type.rb +257 -0
  243. data/lib/printful_client/models/generation_task.rb +294 -0
  244. data/lib/printful_client/models/generation_task_extra_mockup.rb +246 -0
  245. data/lib/printful_client/models/generation_task_file.rb +247 -0
  246. data/lib/printful_client/models/generation_task_file_position.rb +268 -0
  247. data/lib/printful_client/models/generation_task_mockup.rb +250 -0
  248. data/lib/printful_client/models/generation_task_template_file.rb +238 -0
  249. data/lib/printful_client/models/get_approval_sheets200_response.rb +233 -0
  250. data/lib/printful_client/models/get_categories200_response.rb +233 -0
  251. data/lib/printful_client/models/get_category_by_id200_response.rb +231 -0
  252. data/lib/printful_client/models/get_countries200_response.rb +233 -0
  253. data/lib/printful_client/models/get_order_by_id_id_parameter.rb +105 -0
  254. data/lib/printful_client/models/get_orders200_response.rb +242 -0
  255. data/lib/printful_client/models/get_printfiles200_response.rb +231 -0
  256. data/lib/printful_client/models/get_product_by_id200_response.rb +231 -0
  257. data/lib/printful_client/models/get_product_size_guide_by_id200_response.rb +231 -0
  258. data/lib/printful_client/models/get_product_size_guide_by_id404_response.rb +234 -0
  259. data/lib/printful_client/models/get_product_size_guide_by_id404_response_error.rb +223 -0
  260. data/lib/printful_client/models/get_product_template_by_id200_response.rb +231 -0
  261. data/lib/printful_client/models/get_product_templates200_response.rb +240 -0
  262. data/lib/printful_client/models/get_products200_response.rb +233 -0
  263. data/lib/printful_client/models/get_products401_response.rb +234 -0
  264. data/lib/printful_client/models/get_products401_response_error.rb +223 -0
  265. data/lib/printful_client/models/get_scopes200_response.rb +231 -0
  266. data/lib/printful_client/models/get_scopes200_response_all_of_result.rb +216 -0
  267. data/lib/printful_client/models/get_scopes200_response_all_of_result_scopes_inner.rb +223 -0
  268. data/lib/printful_client/models/get_statistics200_response.rb +224 -0
  269. data/lib/printful_client/models/get_store200_response.rb +231 -0
  270. data/lib/printful_client/models/get_store_sync_variant_by_id200_response.rb +231 -0
  271. data/lib/printful_client/models/get_stores200_response.rb +242 -0
  272. data/lib/printful_client/models/get_stores403_response.rb +234 -0
  273. data/lib/printful_client/models/get_stores403_response_error.rb +223 -0
  274. data/lib/printful_client/models/get_sync_product_by_id200_response.rb +231 -0
  275. data/lib/printful_client/models/get_sync_product_by_id_id_parameter.rb +105 -0
  276. data/lib/printful_client/models/get_sync_products200_response.rb +243 -0
  277. data/lib/printful_client/models/get_sync_variant_by_id200_response.rb +224 -0
  278. data/lib/printful_client/models/get_tax_countries200_response.rb +226 -0
  279. data/lib/printful_client/models/get_tax_countries200_response_result_inner.rb +252 -0
  280. data/lib/printful_client/models/get_tax_countries200_response_result_inner_all_of_states_inner.rb +215 -0
  281. data/lib/printful_client/models/get_templates200_response.rb +231 -0
  282. data/lib/printful_client/models/get_variant_by_id200_response.rb +231 -0
  283. data/lib/printful_client/models/get_warehouse_product200_response.rb +231 -0
  284. data/lib/printful_client/models/get_warehouse_products200_response.rb +243 -0
  285. data/lib/printful_client/models/get_webhooks200_response.rb +231 -0
  286. data/lib/printful_client/models/gift.rb +264 -0
  287. data/lib/printful_client/models/incomplete_item.rb +256 -0
  288. data/lib/printful_client/models/item.rb +389 -0
  289. data/lib/printful_client/models/item_files_inner.rb +400 -0
  290. data/lib/printful_client/models/item_files_inner_all_of_position.rb +286 -0
  291. data/lib/printful_client/models/item_info.rb +263 -0
  292. data/lib/printful_client/models/item_option.rb +240 -0
  293. data/lib/printful_client/models/material.rb +225 -0
  294. data/lib/printful_client/models/measurement.rb +245 -0
  295. data/lib/printful_client/models/measurement_value.rb +253 -0
  296. data/lib/printful_client/models/option.rb +226 -0
  297. data/lib/printful_client/models/option_type.rb +269 -0
  298. data/lib/printful_client/models/order.rb +406 -0
  299. data/lib/printful_client/models/order_costs.rb +322 -0
  300. data/lib/printful_client/models/order_estimate_costs.rb +306 -0
  301. data/lib/printful_client/models/order_estimate_retail_costs.rb +282 -0
  302. data/lib/printful_client/models/order_event.rb +396 -0
  303. data/lib/printful_client/models/order_shipment_item.rb +292 -0
  304. data/lib/printful_client/models/packing_slip.rb +266 -0
  305. data/lib/printful_client/models/paging.rb +236 -0
  306. data/lib/printful_client/models/pricing_breakdown.rb +246 -0
  307. data/lib/printful_client/models/printfile.rb +300 -0
  308. data/lib/printful_client/models/printfile_info.rb +270 -0
  309. data/lib/printful_client/models/printful_costs.rb +226 -0
  310. data/lib/printful_client/models/product.rb +383 -0
  311. data/lib/printful_client/models/product1.rb +241 -0
  312. data/lib/printful_client/models/product1_sync_variants_inner.rb +379 -0
  313. data/lib/printful_client/models/product_info.rb +225 -0
  314. data/lib/printful_client/models/product_size_guide.rb +261 -0
  315. data/lib/printful_client/models/product_template.rb +262 -0
  316. data/lib/printful_client/models/product_variant.rb +246 -0
  317. data/lib/printful_client/models/profit.rb +226 -0
  318. data/lib/printful_client/models/response200.rb +215 -0
  319. data/lib/printful_client/models/response200_paginated.rb +231 -0
  320. data/lib/printful_client/models/retail_costs.rb +282 -0
  321. data/lib/printful_client/models/sales_and_costs_inner.rb +285 -0
  322. data/lib/printful_client/models/sales_and_costs_summary_inner.rb +245 -0
  323. data/lib/printful_client/models/shipment.rb +308 -0
  324. data/lib/printful_client/models/shipping_info.rb +286 -0
  325. data/lib/printful_client/models/size_table.rb +328 -0
  326. data/lib/printful_client/models/state.rb +225 -0
  327. data/lib/printful_client/models/statistics.rb +218 -0
  328. data/lib/printful_client/models/store.rb +236 -0
  329. data/lib/printful_client/models/store_statistics.rb +322 -0
  330. data/lib/printful_client/models/submit_approval_sheet_changes200_response.rb +231 -0
  331. data/lib/printful_client/models/sync_product.rb +312 -0
  332. data/lib/printful_client/models/sync_product_deleted.rb +257 -0
  333. data/lib/printful_client/models/sync_product_event.rb +293 -0
  334. data/lib/printful_client/models/sync_product_info.rb +226 -0
  335. data/lib/printful_client/models/sync_variant.rb +359 -0
  336. data/lib/printful_client/models/sync_variant_info.rb +223 -0
  337. data/lib/printful_client/models/sync_variant_product.rb +252 -0
  338. data/lib/printful_client/models/tax_address_info.rb +274 -0
  339. data/lib/printful_client/models/tax_info.rb +236 -0
  340. data/lib/printful_client/models/tax_request.rb +222 -0
  341. data/lib/printful_client/models/template.rb +372 -0
  342. data/lib/printful_client/models/template_by_id.rb +335 -0
  343. data/lib/printful_client/models/template_by_id_colors_inner.rb +223 -0
  344. data/lib/printful_client/models/template_by_id_option_data_inner.rb +225 -0
  345. data/lib/printful_client/models/template_by_id_placement_option_data_inner.rb +225 -0
  346. data/lib/printful_client/models/template_by_id_placement_option_data_inner_options_inner.rb +224 -0
  347. data/lib/printful_client/models/template_by_id_placements_inner.rb +241 -0
  348. data/lib/printful_client/models/template_placement_conflict.rb +228 -0
  349. data/lib/printful_client/models/template_variant_mapping.rb +228 -0
  350. data/lib/printful_client/models/template_variant_mapping_item.rb +226 -0
  351. data/lib/printful_client/models/templates.rb +217 -0
  352. data/lib/printful_client/models/thread_colors200_response.rb +233 -0
  353. data/lib/printful_client/models/thread_colors_request.rb +215 -0
  354. data/lib/printful_client/models/total_paid_orders.rb +226 -0
  355. data/lib/printful_client/models/update_sync_product_request.rb +226 -0
  356. data/lib/printful_client/models/update_sync_product_request_sync_variants_inner.rb +365 -0
  357. data/lib/printful_client/models/update_sync_variant_request.rb +365 -0
  358. data/lib/printful_client/models/variant.rb +341 -0
  359. data/lib/printful_client/models/variant_info.rb +223 -0
  360. data/lib/printful_client/models/variant_printfile.rb +224 -0
  361. data/lib/printful_client/models/warehouse_product.rb +312 -0
  362. data/lib/printful_client/models/warehouse_product_variant.rb +306 -0
  363. data/lib/printful_client/models/webhook.rb +245 -0
  364. data/lib/printful_client/models/webhook_info.rb +238 -0
  365. data/lib/printful_client/version.rb +15 -0
  366. data/lib/printful_client.rb +216 -0
  367. data/printful_client.gemspec +38 -0
  368. data/spec/api/approval_sheets_api_client_spec.rb +75 -0
  369. data/spec/api/catalog_api_client_spec.rb +107 -0
  370. data/spec/api/country_state_code_api_client_spec.rb +46 -0
  371. data/spec/api/ecommerce_platform_sync_api_client_spec.rb +117 -0
  372. data/spec/api/file_library_api_client_spec.rb +73 -0
  373. data/spec/api/mockup_generator_api_client_spec.rb +92 -0
  374. data/spec/api/o_auth_api_client_spec.rb +46 -0
  375. data/spec/api/orders_api_client_spec.rb +131 -0
  376. data/spec/api/product_templates_api_client_spec.rb +72 -0
  377. data/spec/api/products_api_client_spec.rb +155 -0
  378. data/spec/api/reports_api_client_spec.rb +51 -0
  379. data/spec/api/shipping_rate_api_client_spec.rb +48 -0
  380. data/spec/api/store_information_api_client_spec.rb +71 -0
  381. data/spec/api/tax_rate_api_client_spec.rb +58 -0
  382. data/spec/api/warehouse_products_api_client_spec.rb +63 -0
  383. data/spec/api/webhook_api_client_spec.rb +72 -0
  384. data/spec/api_client_spec.rb +228 -0
  385. data/spec/configuration_spec.rb +42 -0
  386. data/spec/models/add_file200_response_spec.rb +40 -0
  387. data/spec/models/address_info_spec.rb +64 -0
  388. data/spec/models/address_spec.rb +106 -0
  389. data/spec/models/approval_sheet_changes_files_inner_spec.rb +34 -0
  390. data/spec/models/approval_sheet_changes_spec.rb +40 -0
  391. data/spec/models/approval_sheet_spec.rb +38 -0
  392. data/spec/models/approval_sheet_webhook_file_spec.rb +52 -0
  393. data/spec/models/approve_design200_response_all_of_result_spec.rb +34 -0
  394. data/spec/models/approve_design200_response_spec.rb +40 -0
  395. data/spec/models/availability_status_spec.rb +40 -0
  396. data/spec/models/available_technique_spec.rb +46 -0
  397. data/spec/models/average_fulfillment_time_spec.rb +40 -0
  398. data/spec/models/calculate_shipping_rates200_response_spec.rb +40 -0
  399. data/spec/models/calculate_shipping_rates_spec.rb +52 -0
  400. data/spec/models/calculate_tax_rates200_response_spec.rb +40 -0
  401. data/spec/models/catalog_file_option_spec.rb +52 -0
  402. data/spec/models/category_spec.rb +62 -0
  403. data/spec/models/change_packing_slip200_response_result_spec.rb +34 -0
  404. data/spec/models/change_packing_slip200_response_spec.rb +40 -0
  405. data/spec/models/costs_by_amount_inner_spec.rb +82 -0
  406. data/spec/models/costs_by_product_inner_spec.rb +58 -0
  407. data/spec/models/costs_by_variant_inner_spec.rb +64 -0
  408. data/spec/models/costs_spec.rb +94 -0
  409. data/spec/models/country_spec.rb +52 -0
  410. data/spec/models/create_generation_task_spec.rb +80 -0
  411. data/spec/models/create_generator_task200_response_spec.rb +40 -0
  412. data/spec/models/create_order200_response_spec.rb +40 -0
  413. data/spec/models/create_sync_product200_response_spec.rb +40 -0
  414. data/spec/models/create_sync_product400_response_error_spec.rb +40 -0
  415. data/spec/models/create_sync_product400_response_spec.rb +46 -0
  416. data/spec/models/create_webhook_request_spec.rb +46 -0
  417. data/spec/models/delete_product_template200_response_all_of_result_spec.rb +34 -0
  418. data/spec/models/delete_product_template200_response_spec.rb +40 -0
  419. data/spec/models/delete_sync_variant200_response_spec.rb +40 -0
  420. data/spec/models/estimate_order_costs200_response_all_of_result_spec.rb +40 -0
  421. data/spec/models/estimate_order_costs200_response_spec.rb +40 -0
  422. data/spec/models/file_option_spec.rb +40 -0
  423. data/spec/models/file_spec.rb +130 -0
  424. data/spec/models/file_type_spec.rb +58 -0
  425. data/spec/models/generation_task_extra_mockup_spec.rb +52 -0
  426. data/spec/models/generation_task_file_position_spec.rb +64 -0
  427. data/spec/models/generation_task_file_spec.rb +52 -0
  428. data/spec/models/generation_task_mockup_spec.rb +52 -0
  429. data/spec/models/generation_task_spec.rb +62 -0
  430. data/spec/models/generation_task_template_file_spec.rb +46 -0
  431. data/spec/models/get_approval_sheets200_response_spec.rb +40 -0
  432. data/spec/models/get_categories200_response_spec.rb +40 -0
  433. data/spec/models/get_category_by_id200_response_spec.rb +40 -0
  434. data/spec/models/get_countries200_response_spec.rb +40 -0
  435. data/spec/models/get_order_by_id_id_parameter_spec.rb +31 -0
  436. data/spec/models/get_orders200_response_spec.rb +46 -0
  437. data/spec/models/get_printfiles200_response_spec.rb +40 -0
  438. data/spec/models/get_product_by_id200_response_spec.rb +40 -0
  439. data/spec/models/get_product_size_guide_by_id200_response_spec.rb +40 -0
  440. data/spec/models/get_product_size_guide_by_id404_response_error_spec.rb +40 -0
  441. data/spec/models/get_product_size_guide_by_id404_response_spec.rb +46 -0
  442. data/spec/models/get_product_template_by_id200_response_spec.rb +40 -0
  443. data/spec/models/get_product_templates200_response_spec.rb +46 -0
  444. data/spec/models/get_products200_response_spec.rb +40 -0
  445. data/spec/models/get_products401_response_error_spec.rb +40 -0
  446. data/spec/models/get_products401_response_spec.rb +46 -0
  447. data/spec/models/get_scopes200_response_all_of_result_scopes_inner_spec.rb +40 -0
  448. data/spec/models/get_scopes200_response_all_of_result_spec.rb +34 -0
  449. data/spec/models/get_scopes200_response_spec.rb +40 -0
  450. data/spec/models/get_statistics200_response_spec.rb +40 -0
  451. data/spec/models/get_store200_response_spec.rb +40 -0
  452. data/spec/models/get_store_sync_variant_by_id200_response_spec.rb +40 -0
  453. data/spec/models/get_stores200_response_spec.rb +46 -0
  454. data/spec/models/get_stores403_response_error_spec.rb +40 -0
  455. data/spec/models/get_stores403_response_spec.rb +46 -0
  456. data/spec/models/get_sync_product_by_id200_response_spec.rb +40 -0
  457. data/spec/models/get_sync_product_by_id_id_parameter_spec.rb +31 -0
  458. data/spec/models/get_sync_products200_response_spec.rb +46 -0
  459. data/spec/models/get_sync_variant_by_id200_response_spec.rb +40 -0
  460. data/spec/models/get_tax_countries200_response_result_inner_all_of_states_inner_spec.rb +34 -0
  461. data/spec/models/get_tax_countries200_response_result_inner_spec.rb +52 -0
  462. data/spec/models/get_tax_countries200_response_spec.rb +40 -0
  463. data/spec/models/get_templates200_response_spec.rb +40 -0
  464. data/spec/models/get_variant_by_id200_response_spec.rb +40 -0
  465. data/spec/models/get_warehouse_product200_response_spec.rb +40 -0
  466. data/spec/models/get_warehouse_products200_response_spec.rb +46 -0
  467. data/spec/models/get_webhooks200_response_spec.rb +40 -0
  468. data/spec/models/gift_spec.rb +40 -0
  469. data/spec/models/incomplete_item_spec.rb +58 -0
  470. data/spec/models/item_files_inner_all_of_position_spec.rb +70 -0
  471. data/spec/models/item_files_inner_spec.rb +136 -0
  472. data/spec/models/item_info_spec.rb +58 -0
  473. data/spec/models/item_option_spec.rb +40 -0
  474. data/spec/models/item_spec.rb +136 -0
  475. data/spec/models/material_spec.rb +40 -0
  476. data/spec/models/measurement_spec.rb +46 -0
  477. data/spec/models/measurement_value_spec.rb +52 -0
  478. data/spec/models/option_spec.rb +40 -0
  479. data/spec/models/option_type_spec.rb +64 -0
  480. data/spec/models/order_costs_spec.rb +94 -0
  481. data/spec/models/order_estimate_costs_spec.rb +88 -0
  482. data/spec/models/order_estimate_retail_costs_spec.rb +70 -0
  483. data/spec/models/order_event_spec.rb +136 -0
  484. data/spec/models/order_shipment_item_spec.rb +60 -0
  485. data/spec/models/order_spec.rb +136 -0
  486. data/spec/models/packing_slip_spec.rb +64 -0
  487. data/spec/models/paging_spec.rb +46 -0
  488. data/spec/models/pricing_breakdown_spec.rb +52 -0
  489. data/spec/models/printfile_info_spec.rb +64 -0
  490. data/spec/models/printfile_spec.rb +68 -0
  491. data/spec/models/printful_costs_spec.rb +40 -0
  492. data/spec/models/product1_spec.rb +40 -0
  493. data/spec/models/product1_sync_variants_inner_spec.rb +118 -0
  494. data/spec/models/product_info_spec.rb +40 -0
  495. data/spec/models/product_size_guide_spec.rb +46 -0
  496. data/spec/models/product_spec.rb +130 -0
  497. data/spec/models/product_template_spec.rb +58 -0
  498. data/spec/models/product_variant_spec.rb +52 -0
  499. data/spec/models/profit_spec.rb +40 -0
  500. data/spec/models/response200_paginated_spec.rb +40 -0
  501. data/spec/models/response200_spec.rb +34 -0
  502. data/spec/models/retail_costs_spec.rb +70 -0
  503. data/spec/models/sales_and_costs_inner_spec.rb +76 -0
  504. data/spec/models/sales_and_costs_summary_inner_spec.rb +52 -0
  505. data/spec/models/shipment_spec.rb +88 -0
  506. data/spec/models/shipping_info_spec.rb +76 -0
  507. data/spec/models/size_table_spec.rb +72 -0
  508. data/spec/models/state_spec.rb +40 -0
  509. data/spec/models/statistics_spec.rb +34 -0
  510. data/spec/models/store_spec.rb +46 -0
  511. data/spec/models/store_statistics_spec.rb +94 -0
  512. data/spec/models/submit_approval_sheet_changes200_response_spec.rb +40 -0
  513. data/spec/models/sync_product_deleted_spec.rb +46 -0
  514. data/spec/models/sync_product_event_spec.rb +76 -0
  515. data/spec/models/sync_product_info_spec.rb +40 -0
  516. data/spec/models/sync_product_spec.rb +76 -0
  517. data/spec/models/sync_variant_info_spec.rb +40 -0
  518. data/spec/models/sync_variant_product_spec.rb +52 -0
  519. data/spec/models/sync_variant_spec.rb +118 -0
  520. data/spec/models/tax_address_info_spec.rb +52 -0
  521. data/spec/models/tax_info_spec.rb +46 -0
  522. data/spec/models/tax_request_spec.rb +34 -0
  523. data/spec/models/template_by_id_colors_inner_spec.rb +40 -0
  524. data/spec/models/template_by_id_option_data_inner_spec.rb +40 -0
  525. data/spec/models/template_by_id_placement_option_data_inner_options_inner_spec.rb +40 -0
  526. data/spec/models/template_by_id_placement_option_data_inner_spec.rb +40 -0
  527. data/spec/models/template_by_id_placements_inner_spec.rb +52 -0
  528. data/spec/models/template_by_id_spec.rb +106 -0
  529. data/spec/models/template_placement_conflict_spec.rb +40 -0
  530. data/spec/models/template_spec.rb +110 -0
  531. data/spec/models/template_variant_mapping_item_spec.rb +40 -0
  532. data/spec/models/template_variant_mapping_spec.rb +40 -0
  533. data/spec/models/templates_spec.rb +34 -0
  534. data/spec/models/thread_colors200_response_spec.rb +40 -0
  535. data/spec/models/thread_colors_request_spec.rb +34 -0
  536. data/spec/models/total_paid_orders_spec.rb +40 -0
  537. data/spec/models/update_sync_product_request_spec.rb +40 -0
  538. data/spec/models/update_sync_product_request_sync_variants_inner_spec.rb +118 -0
  539. data/spec/models/update_sync_variant_request_spec.rb +118 -0
  540. data/spec/models/variant_info_spec.rb +40 -0
  541. data/spec/models/variant_printfile_spec.rb +40 -0
  542. data/spec/models/variant_spec.rb +106 -0
  543. data/spec/models/warehouse_product_spec.rb +74 -0
  544. data/spec/models/warehouse_product_variant_spec.rb +88 -0
  545. data/spec/models/webhook_info_spec.rb +46 -0
  546. data/spec/models/webhook_spec.rb +52 -0
  547. data/spec/spec_helper.rb +111 -0
  548. data/swagger.json +8318 -0
  549. metadata +812 -0
@@ -0,0 +1,336 @@
1
+ =begin
2
+ #API Documentation | Printful
3
+
4
+ ## About the Printful API The Printful API is a RESTful API, that uses an HTTP protocol for communication. HTTP GET, POST, PUT and DELETE methods are used to access the API resources. ## Requests and responses ### Request endpoint All API requests have to be sent to this URL: ``` https://api.printful.com/ ``` If you are using a proxy, make sure that all requests have host header set to **api.printful.com**. ### Request parameters Some mandatory parameters (like object identifiers) must be included in the request URL path ``` GET /orders/123 ``` Additional parameters can be passed as GET variables: ``` GET /orders?offset=10&limit=5 ``` For POST and PUT requests, a more complex data structure can be passed as JSON encoded data in the request body: ``` POST /orders {\"recipient\":{...},\"items\":[...]} ``` ### Response body The response body is always a JSON object that contains a response status code (identical to the HTTP status code) and the result of the action. If the status code is 200, then the action was successful. ``` { \"code\": 200, //Response status code \"result\":{ //API method return data //... } } ``` Sometimes the response includes paging information to allow to browse larger result sets by adding offset and limit GET parameters to the request URL. ``` { \"code\": 200, //Response status code \"result\":[ { //Item 11 }, { //Item 12 } ] \"paging\": { \"total\": 12, //Total items available \"offset\": 10, //Items skipped from the beginning \"limit\": 20 //Number of items per page } } ``` ## Error response If the API call is not successful, then the response code is not in the 2xx range and the `result` attribute contains an error description. ``` { \"code\": 404, \"result\": \"Not Found\", \"error\": { \"reason\": \"NotFound\", \"message\": \"Not Found\" } } ``` In general, response codes in the 4xx range indicate an error that resulted from the provided information (e.g. a required parameter was missing, etc.), and codes in the 5xx range indicate an error with Printful's servers. ### Timestamps All timestamps from the API are returned as integers in UNIX timestamp format. ### Rate Limits Printful API has a general rate limit of 120 API calls per minute. Additionally, endpoints that perform resource intensive operations (such as mockup generator) have a lower allowed request limit. # Authentication <!-- ReDoc-Inject: <security-definitions> -->
5
+
6
+ The version of the OpenAPI document: 1.0
7
+ Contact: devsupport@printful.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 7.0.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Printful
17
+ # Information about the address
18
+ class Address
19
+ # Full name
20
+ attr_accessor :name
21
+
22
+ # Company name
23
+ attr_accessor :company
24
+
25
+ # Address line 1
26
+ attr_accessor :address1
27
+
28
+ # Address line 2
29
+ attr_accessor :address2
30
+
31
+ # City
32
+ attr_accessor :city
33
+
34
+ # State code
35
+ attr_accessor :state_code
36
+
37
+ # State name
38
+ attr_accessor :state_name
39
+
40
+ # Country code
41
+ attr_accessor :country_code
42
+
43
+ # Country name
44
+ attr_accessor :country_name
45
+
46
+ # ZIP/Postal code
47
+ attr_accessor :zip
48
+
49
+ # Phone number
50
+ attr_accessor :phone
51
+
52
+ # Email address
53
+ attr_accessor :email
54
+
55
+ # TAX number (`optional`, but in case of Brazil country this field becomes `required` and will be used as CPF/CNPJ number)<br> CPF format is 000.000.000-00 (14 characters);<br> CNPJ format is 00.000.000/0000-00 (18 characters).
56
+ attr_accessor :tax_number
57
+
58
+ # Attribute mapping from ruby-style variable name to JSON key.
59
+ def self.attribute_map
60
+ {
61
+ :'name' => :'name',
62
+ :'company' => :'company',
63
+ :'address1' => :'address1',
64
+ :'address2' => :'address2',
65
+ :'city' => :'city',
66
+ :'state_code' => :'state_code',
67
+ :'state_name' => :'state_name',
68
+ :'country_code' => :'country_code',
69
+ :'country_name' => :'country_name',
70
+ :'zip' => :'zip',
71
+ :'phone' => :'phone',
72
+ :'email' => :'email',
73
+ :'tax_number' => :'tax_number'
74
+ }
75
+ end
76
+
77
+ # Returns all the JSON keys this model knows about
78
+ def self.acceptable_attributes
79
+ attribute_map.values
80
+ end
81
+
82
+ # Attribute type mapping.
83
+ def self.openapi_types
84
+ {
85
+ :'name' => :'String',
86
+ :'company' => :'String',
87
+ :'address1' => :'String',
88
+ :'address2' => :'String',
89
+ :'city' => :'String',
90
+ :'state_code' => :'String',
91
+ :'state_name' => :'String',
92
+ :'country_code' => :'String',
93
+ :'country_name' => :'String',
94
+ :'zip' => :'String',
95
+ :'phone' => :'String',
96
+ :'email' => :'String',
97
+ :'tax_number' => :'String'
98
+ }
99
+ end
100
+
101
+ # List of attributes with nullable: true
102
+ def self.openapi_nullable
103
+ Set.new([
104
+ ])
105
+ end
106
+
107
+ # Initializes the object
108
+ # @param [Hash] attributes Model attributes in the form of hash
109
+ def initialize(attributes = {})
110
+ if (!attributes.is_a?(Hash))
111
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Printful::Address` initialize method"
112
+ end
113
+
114
+ # check to see if the attribute exists and convert string to symbol for hash key
115
+ attributes = attributes.each_with_object({}) { |(k, v), h|
116
+ if (!self.class.attribute_map.key?(k.to_sym))
117
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Printful::Address`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
118
+ end
119
+ h[k.to_sym] = v
120
+ }
121
+
122
+ if attributes.key?(:'name')
123
+ self.name = attributes[:'name']
124
+ end
125
+
126
+ if attributes.key?(:'company')
127
+ self.company = attributes[:'company']
128
+ end
129
+
130
+ if attributes.key?(:'address1')
131
+ self.address1 = attributes[:'address1']
132
+ end
133
+
134
+ if attributes.key?(:'address2')
135
+ self.address2 = attributes[:'address2']
136
+ end
137
+
138
+ if attributes.key?(:'city')
139
+ self.city = attributes[:'city']
140
+ end
141
+
142
+ if attributes.key?(:'state_code')
143
+ self.state_code = attributes[:'state_code']
144
+ end
145
+
146
+ if attributes.key?(:'state_name')
147
+ self.state_name = attributes[:'state_name']
148
+ end
149
+
150
+ if attributes.key?(:'country_code')
151
+ self.country_code = attributes[:'country_code']
152
+ end
153
+
154
+ if attributes.key?(:'country_name')
155
+ self.country_name = attributes[:'country_name']
156
+ end
157
+
158
+ if attributes.key?(:'zip')
159
+ self.zip = attributes[:'zip']
160
+ end
161
+
162
+ if attributes.key?(:'phone')
163
+ self.phone = attributes[:'phone']
164
+ end
165
+
166
+ if attributes.key?(:'email')
167
+ self.email = attributes[:'email']
168
+ end
169
+
170
+ if attributes.key?(:'tax_number')
171
+ self.tax_number = attributes[:'tax_number']
172
+ end
173
+ end
174
+
175
+ # Show invalid properties with the reasons. Usually used together with valid?
176
+ # @return Array for valid properties with the reasons
177
+ def list_invalid_properties
178
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
179
+ invalid_properties = Array.new
180
+ invalid_properties
181
+ end
182
+
183
+ # Check to see if the all the properties in the model are valid
184
+ # @return true if the model is valid
185
+ def valid?
186
+ warn '[DEPRECATED] the `valid?` method is obsolete'
187
+ true
188
+ end
189
+
190
+ # Checks equality by comparing each attribute.
191
+ # @param [Object] Object to be compared
192
+ def ==(o)
193
+ return true if self.equal?(o)
194
+ self.class == o.class &&
195
+ name == o.name &&
196
+ company == o.company &&
197
+ address1 == o.address1 &&
198
+ address2 == o.address2 &&
199
+ city == o.city &&
200
+ state_code == o.state_code &&
201
+ state_name == o.state_name &&
202
+ country_code == o.country_code &&
203
+ country_name == o.country_name &&
204
+ zip == o.zip &&
205
+ phone == o.phone &&
206
+ email == o.email &&
207
+ tax_number == o.tax_number
208
+ end
209
+
210
+ # @see the `==` method
211
+ # @param [Object] Object to be compared
212
+ def eql?(o)
213
+ self == o
214
+ end
215
+
216
+ # Calculates hash code according to all attributes.
217
+ # @return [Integer] Hash code
218
+ def hash
219
+ [name, company, address1, address2, city, state_code, state_name, country_code, country_name, zip, phone, email, tax_number].hash
220
+ end
221
+
222
+ # Builds the object from hash
223
+ # @param [Hash] attributes Model attributes in the form of hash
224
+ # @return [Object] Returns the model itself
225
+ def self.build_from_hash(attributes)
226
+ return nil unless attributes.is_a?(Hash)
227
+ attributes = attributes.transform_keys(&:to_sym)
228
+ transformed_hash = {}
229
+ openapi_types.each_pair do |key, type|
230
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
231
+ transformed_hash["#{key}"] = nil
232
+ elsif type =~ /\AArray<(.*)>/i
233
+ # check to ensure the input is an array given that the attribute
234
+ # is documented as an array but the input is not
235
+ if attributes[attribute_map[key]].is_a?(Array)
236
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
237
+ end
238
+ elsif !attributes[attribute_map[key]].nil?
239
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
240
+ end
241
+ end
242
+ new(transformed_hash)
243
+ end
244
+
245
+ # Deserializes the data based on type
246
+ # @param string type Data type
247
+ # @param string value Value to be deserialized
248
+ # @return [Object] Deserialized data
249
+ def self._deserialize(type, value)
250
+ case type.to_sym
251
+ when :Time
252
+ Time.parse(value)
253
+ when :Date
254
+ Date.parse(value)
255
+ when :String
256
+ value.to_s
257
+ when :Integer
258
+ value.to_i
259
+ when :Float
260
+ value.to_f
261
+ when :Boolean
262
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
263
+ true
264
+ else
265
+ false
266
+ end
267
+ when :Object
268
+ # generic object (usually a Hash), return directly
269
+ value
270
+ when /\AArray<(?<inner_type>.+)>\z/
271
+ inner_type = Regexp.last_match[:inner_type]
272
+ value.map { |v| _deserialize(inner_type, v) }
273
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
274
+ k_type = Regexp.last_match[:k_type]
275
+ v_type = Regexp.last_match[:v_type]
276
+ {}.tap do |hash|
277
+ value.each do |k, v|
278
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
279
+ end
280
+ end
281
+ else # model
282
+ # models (e.g. Pet) or oneOf
283
+ klass = Printful.const_get(type)
284
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
285
+ end
286
+ end
287
+
288
+ # Returns the string representation of the object
289
+ # @return [String] String presentation of the object
290
+ def to_s
291
+ to_hash.to_s
292
+ end
293
+
294
+ # to_body is an alias to to_hash (backward compatibility)
295
+ # @return [Hash] Returns the object in the form of hash
296
+ def to_body
297
+ to_hash
298
+ end
299
+
300
+ # Returns the object in the form of hash
301
+ # @return [Hash] Returns the object in the form of hash
302
+ def to_hash
303
+ hash = {}
304
+ self.class.attribute_map.each_pair do |attr, param|
305
+ value = self.send(attr)
306
+ if value.nil?
307
+ is_nullable = self.class.openapi_nullable.include?(attr)
308
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
309
+ end
310
+
311
+ hash[param] = _to_hash(value)
312
+ end
313
+ hash
314
+ end
315
+
316
+ # Outputs non-array value in the form of hash
317
+ # For object, use to_hash. Otherwise, just return the value
318
+ # @param [Object] value Any valid value
319
+ # @return [Hash] Returns the value in the form of hash
320
+ def _to_hash(value)
321
+ if value.is_a?(Array)
322
+ value.compact.map { |v| _to_hash(v) }
323
+ elsif value.is_a?(Hash)
324
+ {}.tap do |hash|
325
+ value.each { |k, v| hash[k] = _to_hash(v) }
326
+ end
327
+ elsif value.respond_to? :to_hash
328
+ value.to_hash
329
+ else
330
+ value
331
+ end
332
+ end
333
+
334
+ end
335
+
336
+ end
@@ -0,0 +1,287 @@
1
+ =begin
2
+ #API Documentation | Printful
3
+
4
+ ## About the Printful API The Printful API is a RESTful API, that uses an HTTP protocol for communication. HTTP GET, POST, PUT and DELETE methods are used to access the API resources. ## Requests and responses ### Request endpoint All API requests have to be sent to this URL: ``` https://api.printful.com/ ``` If you are using a proxy, make sure that all requests have host header set to **api.printful.com**. ### Request parameters Some mandatory parameters (like object identifiers) must be included in the request URL path ``` GET /orders/123 ``` Additional parameters can be passed as GET variables: ``` GET /orders?offset=10&limit=5 ``` For POST and PUT requests, a more complex data structure can be passed as JSON encoded data in the request body: ``` POST /orders {\"recipient\":{...},\"items\":[...]} ``` ### Response body The response body is always a JSON object that contains a response status code (identical to the HTTP status code) and the result of the action. If the status code is 200, then the action was successful. ``` { \"code\": 200, //Response status code \"result\":{ //API method return data //... } } ``` Sometimes the response includes paging information to allow to browse larger result sets by adding offset and limit GET parameters to the request URL. ``` { \"code\": 200, //Response status code \"result\":[ { //Item 11 }, { //Item 12 } ] \"paging\": { \"total\": 12, //Total items available \"offset\": 10, //Items skipped from the beginning \"limit\": 20 //Number of items per page } } ``` ## Error response If the API call is not successful, then the response code is not in the 2xx range and the `result` attribute contains an error description. ``` { \"code\": 404, \"result\": \"Not Found\", \"error\": { \"reason\": \"NotFound\", \"message\": \"Not Found\" } } ``` In general, response codes in the 4xx range indicate an error that resulted from the provided information (e.g. a required parameter was missing, etc.), and codes in the 5xx range indicate an error with Printful's servers. ### Timestamps All timestamps from the API are returned as integers in UNIX timestamp format. ### Rate Limits Printful API has a general rate limit of 120 API calls per minute. Additionally, endpoints that perform resource intensive operations (such as mockup generator) have a lower allowed request limit. # Authentication <!-- ReDoc-Inject: <security-definitions> -->
5
+
6
+ The version of the OpenAPI document: 1.0
7
+ Contact: devsupport@printful.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 7.0.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Printful
17
+ # Recipient location information
18
+ class AddressInfo
19
+ # Address line 1
20
+ attr_accessor :address1
21
+
22
+ # City
23
+ attr_accessor :city
24
+
25
+ # Country code
26
+ attr_accessor :country_code
27
+
28
+ # State code (optional, required for United States, Australia and Canada)
29
+ attr_accessor :state_code
30
+
31
+ # ZIP or postal code (optional, required for some countries to calculate expedited shipping rates)
32
+ attr_accessor :zip
33
+
34
+ # Phone number (optional)
35
+ attr_accessor :phone
36
+
37
+ # Attribute mapping from ruby-style variable name to JSON key.
38
+ def self.attribute_map
39
+ {
40
+ :'address1' => :'address1',
41
+ :'city' => :'city',
42
+ :'country_code' => :'country_code',
43
+ :'state_code' => :'state_code',
44
+ :'zip' => :'zip',
45
+ :'phone' => :'phone'
46
+ }
47
+ end
48
+
49
+ # Returns all the JSON keys this model knows about
50
+ def self.acceptable_attributes
51
+ attribute_map.values
52
+ end
53
+
54
+ # Attribute type mapping.
55
+ def self.openapi_types
56
+ {
57
+ :'address1' => :'String',
58
+ :'city' => :'String',
59
+ :'country_code' => :'String',
60
+ :'state_code' => :'String',
61
+ :'zip' => :'String',
62
+ :'phone' => :'String'
63
+ }
64
+ end
65
+
66
+ # List of attributes with nullable: true
67
+ def self.openapi_nullable
68
+ Set.new([
69
+ ])
70
+ end
71
+
72
+ # Initializes the object
73
+ # @param [Hash] attributes Model attributes in the form of hash
74
+ def initialize(attributes = {})
75
+ if (!attributes.is_a?(Hash))
76
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Printful::AddressInfo` initialize method"
77
+ end
78
+
79
+ # check to see if the attribute exists and convert string to symbol for hash key
80
+ attributes = attributes.each_with_object({}) { |(k, v), h|
81
+ if (!self.class.attribute_map.key?(k.to_sym))
82
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Printful::AddressInfo`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
83
+ end
84
+ h[k.to_sym] = v
85
+ }
86
+
87
+ if attributes.key?(:'address1')
88
+ self.address1 = attributes[:'address1']
89
+ else
90
+ self.address1 = nil
91
+ end
92
+
93
+ if attributes.key?(:'city')
94
+ self.city = attributes[:'city']
95
+ else
96
+ self.city = nil
97
+ end
98
+
99
+ if attributes.key?(:'country_code')
100
+ self.country_code = attributes[:'country_code']
101
+ else
102
+ self.country_code = nil
103
+ end
104
+
105
+ if attributes.key?(:'state_code')
106
+ self.state_code = attributes[:'state_code']
107
+ end
108
+
109
+ if attributes.key?(:'zip')
110
+ self.zip = attributes[:'zip']
111
+ end
112
+
113
+ if attributes.key?(:'phone')
114
+ self.phone = attributes[:'phone']
115
+ end
116
+ end
117
+
118
+ # Show invalid properties with the reasons. Usually used together with valid?
119
+ # @return Array for valid properties with the reasons
120
+ def list_invalid_properties
121
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
122
+ invalid_properties = Array.new
123
+ if @address1.nil?
124
+ invalid_properties.push('invalid value for "address1", address1 cannot be nil.')
125
+ end
126
+
127
+ if @city.nil?
128
+ invalid_properties.push('invalid value for "city", city cannot be nil.')
129
+ end
130
+
131
+ if @country_code.nil?
132
+ invalid_properties.push('invalid value for "country_code", country_code cannot be nil.')
133
+ end
134
+
135
+ invalid_properties
136
+ end
137
+
138
+ # Check to see if the all the properties in the model are valid
139
+ # @return true if the model is valid
140
+ def valid?
141
+ warn '[DEPRECATED] the `valid?` method is obsolete'
142
+ return false if @address1.nil?
143
+ return false if @city.nil?
144
+ return false if @country_code.nil?
145
+ true
146
+ end
147
+
148
+ # Checks equality by comparing each attribute.
149
+ # @param [Object] Object to be compared
150
+ def ==(o)
151
+ return true if self.equal?(o)
152
+ self.class == o.class &&
153
+ address1 == o.address1 &&
154
+ city == o.city &&
155
+ country_code == o.country_code &&
156
+ state_code == o.state_code &&
157
+ zip == o.zip &&
158
+ phone == o.phone
159
+ end
160
+
161
+ # @see the `==` method
162
+ # @param [Object] Object to be compared
163
+ def eql?(o)
164
+ self == o
165
+ end
166
+
167
+ # Calculates hash code according to all attributes.
168
+ # @return [Integer] Hash code
169
+ def hash
170
+ [address1, city, country_code, state_code, zip, phone].hash
171
+ end
172
+
173
+ # Builds the object from hash
174
+ # @param [Hash] attributes Model attributes in the form of hash
175
+ # @return [Object] Returns the model itself
176
+ def self.build_from_hash(attributes)
177
+ return nil unless attributes.is_a?(Hash)
178
+ attributes = attributes.transform_keys(&:to_sym)
179
+ transformed_hash = {}
180
+ openapi_types.each_pair do |key, type|
181
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
182
+ transformed_hash["#{key}"] = nil
183
+ elsif type =~ /\AArray<(.*)>/i
184
+ # check to ensure the input is an array given that the attribute
185
+ # is documented as an array but the input is not
186
+ if attributes[attribute_map[key]].is_a?(Array)
187
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
188
+ end
189
+ elsif !attributes[attribute_map[key]].nil?
190
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
191
+ end
192
+ end
193
+ new(transformed_hash)
194
+ end
195
+
196
+ # Deserializes the data based on type
197
+ # @param string type Data type
198
+ # @param string value Value to be deserialized
199
+ # @return [Object] Deserialized data
200
+ def self._deserialize(type, value)
201
+ case type.to_sym
202
+ when :Time
203
+ Time.parse(value)
204
+ when :Date
205
+ Date.parse(value)
206
+ when :String
207
+ value.to_s
208
+ when :Integer
209
+ value.to_i
210
+ when :Float
211
+ value.to_f
212
+ when :Boolean
213
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
214
+ true
215
+ else
216
+ false
217
+ end
218
+ when :Object
219
+ # generic object (usually a Hash), return directly
220
+ value
221
+ when /\AArray<(?<inner_type>.+)>\z/
222
+ inner_type = Regexp.last_match[:inner_type]
223
+ value.map { |v| _deserialize(inner_type, v) }
224
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
225
+ k_type = Regexp.last_match[:k_type]
226
+ v_type = Regexp.last_match[:v_type]
227
+ {}.tap do |hash|
228
+ value.each do |k, v|
229
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
230
+ end
231
+ end
232
+ else # model
233
+ # models (e.g. Pet) or oneOf
234
+ klass = Printful.const_get(type)
235
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
236
+ end
237
+ end
238
+
239
+ # Returns the string representation of the object
240
+ # @return [String] String presentation of the object
241
+ def to_s
242
+ to_hash.to_s
243
+ end
244
+
245
+ # to_body is an alias to to_hash (backward compatibility)
246
+ # @return [Hash] Returns the object in the form of hash
247
+ def to_body
248
+ to_hash
249
+ end
250
+
251
+ # Returns the object in the form of hash
252
+ # @return [Hash] Returns the object in the form of hash
253
+ def to_hash
254
+ hash = {}
255
+ self.class.attribute_map.each_pair do |attr, param|
256
+ value = self.send(attr)
257
+ if value.nil?
258
+ is_nullable = self.class.openapi_nullable.include?(attr)
259
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
260
+ end
261
+
262
+ hash[param] = _to_hash(value)
263
+ end
264
+ hash
265
+ end
266
+
267
+ # Outputs non-array value in the form of hash
268
+ # For object, use to_hash. Otherwise, just return the value
269
+ # @param [Object] value Any valid value
270
+ # @return [Hash] Returns the value in the form of hash
271
+ def _to_hash(value)
272
+ if value.is_a?(Array)
273
+ value.compact.map { |v| _to_hash(v) }
274
+ elsif value.is_a?(Hash)
275
+ {}.tap do |hash|
276
+ value.each { |k, v| hash[k] = _to_hash(v) }
277
+ end
278
+ elsif value.respond_to? :to_hash
279
+ value.to_hash
280
+ else
281
+ value
282
+ end
283
+ end
284
+
285
+ end
286
+
287
+ end