shopware-api-client 1.0.118__py3-none-any.whl → 1.1.1__py3-none-any.whl

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 (290) hide show
  1. shopware_api_client/base.py +338 -176
  2. shopware_api_client/cache.py +5 -10
  3. shopware_api_client/endpoints/admin/__init__.py +11 -4
  4. shopware_api_client/endpoints/admin/commercial/b2b_components_role.py +5 -20
  5. shopware_api_client/endpoints/admin/commercial/b2b_components_shopping_list.py +5 -25
  6. shopware_api_client/endpoints/admin/commercial/b2b_components_shopping_list_line_item.py +7 -24
  7. shopware_api_client/endpoints/admin/commercial/b2b_employee.py +5 -27
  8. shopware_api_client/endpoints/admin/commercial/dynamic_access.py +9 -19
  9. shopware_api_client/endpoints/admin/core/acl_role.py +5 -19
  10. shopware_api_client/endpoints/admin/core/api_info.py +11 -12
  11. shopware_api_client/endpoints/admin/core/app.py +5 -42
  12. shopware_api_client/endpoints/admin/core/app_script_condition.py +5 -24
  13. shopware_api_client/endpoints/admin/core/category.py +5 -56
  14. shopware_api_client/endpoints/admin/core/cms_block.py +5 -34
  15. shopware_api_client/endpoints/admin/core/cms_page.py +5 -26
  16. shopware_api_client/endpoints/admin/core/cms_section.py +5 -35
  17. shopware_api_client/endpoints/admin/core/cms_slot.py +5 -31
  18. shopware_api_client/endpoints/admin/core/country.py +5 -37
  19. shopware_api_client/endpoints/admin/core/country_state.py +5 -23
  20. shopware_api_client/endpoints/admin/core/currency.py +5 -33
  21. shopware_api_client/endpoints/admin/core/currency_country_rounding.py +5 -20
  22. shopware_api_client/endpoints/admin/core/custom_entity.py +4 -26
  23. shopware_api_client/endpoints/admin/core/custom_field.py +4 -14
  24. shopware_api_client/endpoints/admin/core/customer.py +5 -57
  25. shopware_api_client/endpoints/admin/core/customer_address.py +6 -33
  26. shopware_api_client/endpoints/admin/core/customer_group.py +5 -24
  27. shopware_api_client/endpoints/admin/core/customer_recovery.py +5 -16
  28. shopware_api_client/endpoints/admin/core/customer_wishlist.py +5 -19
  29. shopware_api_client/endpoints/admin/core/customer_wishlist_product.py +5 -19
  30. shopware_api_client/endpoints/admin/core/delivery_time.py +5 -21
  31. shopware_api_client/endpoints/admin/core/document.py +5 -28
  32. shopware_api_client/endpoints/admin/core/document_base_config.py +5 -27
  33. shopware_api_client/endpoints/admin/core/document_base_config_sales_channel.py +7 -20
  34. shopware_api_client/endpoints/admin/core/document_type.py +5 -19
  35. shopware_api_client/endpoints/admin/core/integration.py +5 -25
  36. shopware_api_client/endpoints/admin/core/landing_page.py +5 -28
  37. shopware_api_client/endpoints/admin/core/language.py +5 -21
  38. shopware_api_client/endpoints/admin/core/locale.py +5 -20
  39. shopware_api_client/endpoints/admin/core/main_category.py +5 -19
  40. shopware_api_client/endpoints/admin/core/media.py +25 -37
  41. shopware_api_client/endpoints/admin/core/media_default_folder.py +4 -17
  42. shopware_api_client/endpoints/admin/core/media_folder.py +5 -26
  43. shopware_api_client/endpoints/admin/core/media_folder_configuration.py +5 -21
  44. shopware_api_client/endpoints/admin/core/media_thumbnail.py +5 -26
  45. shopware_api_client/endpoints/admin/core/media_thumbnail_size.py +7 -18
  46. shopware_api_client/endpoints/admin/core/order.py +12 -48
  47. shopware_api_client/endpoints/admin/core/order_address.py +6 -34
  48. shopware_api_client/endpoints/admin/core/order_customer.py +6 -29
  49. shopware_api_client/endpoints/admin/core/order_delivery.py +5 -30
  50. shopware_api_client/endpoints/admin/core/order_delivery_position.py +5 -26
  51. shopware_api_client/endpoints/admin/core/order_line_item.py +7 -44
  52. shopware_api_client/endpoints/admin/core/order_line_item_download.py +5 -23
  53. shopware_api_client/endpoints/admin/core/order_transaction.py +5 -25
  54. shopware_api_client/endpoints/admin/core/order_transaction_capture.py +5 -27
  55. shopware_api_client/endpoints/admin/core/order_transaction_capture_refund.py +7 -28
  56. shopware_api_client/endpoints/admin/core/order_transaction_capture_refund_position.py +8 -29
  57. shopware_api_client/endpoints/admin/core/payment_method.py +5 -52
  58. shopware_api_client/endpoints/admin/core/product.py +24 -90
  59. shopware_api_client/endpoints/admin/core/product_configurator_setting.py +5 -26
  60. shopware_api_client/endpoints/admin/core/product_cross_selling.py +5 -27
  61. shopware_api_client/endpoints/admin/core/product_cross_selling_assigned_products.py +7 -21
  62. shopware_api_client/endpoints/admin/core/product_download.py +5 -22
  63. shopware_api_client/endpoints/admin/core/product_export.py +5 -34
  64. shopware_api_client/endpoints/admin/core/product_feature_set.py +5 -19
  65. shopware_api_client/endpoints/admin/core/product_manufacturer.py +5 -23
  66. shopware_api_client/endpoints/admin/core/product_media.py +5 -22
  67. shopware_api_client/endpoints/admin/core/product_price.py +5 -24
  68. shopware_api_client/endpoints/admin/core/product_review.py +5 -29
  69. shopware_api_client/endpoints/admin/core/product_search_keyword.py +5 -20
  70. shopware_api_client/endpoints/admin/core/product_stream.py +5 -23
  71. shopware_api_client/endpoints/admin/core/product_visibility.py +5 -18
  72. shopware_api_client/endpoints/admin/core/product_warehouse.py +5 -17
  73. shopware_api_client/endpoints/admin/core/promotion.py +5 -38
  74. shopware_api_client/endpoints/admin/core/promotion_discount.py +5 -24
  75. shopware_api_client/endpoints/admin/core/promotion_discount_prices.py +5 -19
  76. shopware_api_client/endpoints/admin/core/property_group.py +5 -24
  77. shopware_api_client/endpoints/admin/core/property_group_option.py +5 -23
  78. shopware_api_client/endpoints/admin/core/rule.py +5 -24
  79. shopware_api_client/endpoints/admin/core/rule_condition.py +5 -23
  80. shopware_api_client/endpoints/admin/core/sales_channel.py +6 -53
  81. shopware_api_client/endpoints/admin/core/sales_channel_domain.py +5 -23
  82. shopware_api_client/endpoints/admin/core/salutation.py +5 -20
  83. shopware_api_client/endpoints/admin/core/seo_url.py +5 -30
  84. shopware_api_client/endpoints/admin/core/shipping_method.py +8 -30
  85. shopware_api_client/endpoints/admin/core/shipping_method_price.py +20 -0
  86. shopware_api_client/endpoints/admin/core/state_machine.py +5 -21
  87. shopware_api_client/endpoints/admin/core/state_machine_history.py +5 -25
  88. shopware_api_client/endpoints/admin/core/state_machine_state.py +6 -20
  89. shopware_api_client/endpoints/admin/core/state_machine_transition.py +5 -23
  90. shopware_api_client/endpoints/admin/core/system_config.py +5 -19
  91. shopware_api_client/endpoints/admin/core/tag.py +5 -14
  92. shopware_api_client/endpoints/admin/core/tax.py +5 -21
  93. shopware_api_client/endpoints/admin/core/tax_rule.py +5 -22
  94. shopware_api_client/endpoints/admin/core/tax_rule_type.py +5 -21
  95. shopware_api_client/endpoints/admin/core/unit.py +5 -19
  96. shopware_api_client/endpoints/admin/core/user.py +5 -31
  97. shopware_api_client/endpoints/admin/core/warehouse.py +5 -15
  98. shopware_api_client/endpoints/admin/core/warehouse_group.py +6 -18
  99. shopware_api_client/endpoints/admin/core/warehouse_group_warehouse.py +6 -18
  100. shopware_api_client/endpoints/base_fields.py +13 -22
  101. shopware_api_client/endpoints/relations.py +36 -24
  102. shopware_api_client/endpoints/store/__init__.py +37 -4
  103. shopware_api_client/endpoints/store/core/address.py +51 -68
  104. shopware_api_client/endpoints/store/core/cart.py +39 -85
  105. shopware_api_client/endpoints/store/core/category.py +16 -0
  106. shopware_api_client/endpoints/store/core/cms_block.py +10 -0
  107. shopware_api_client/endpoints/store/core/cms_page.py +12 -0
  108. shopware_api_client/endpoints/store/core/cms_section.py +12 -0
  109. shopware_api_client/endpoints/store/core/cms_slot.py +8 -0
  110. shopware_api_client/endpoints/store/core/context.py +58 -0
  111. shopware_api_client/endpoints/store/core/country.py +15 -0
  112. shopware_api_client/endpoints/store/core/country_state.py +19 -0
  113. shopware_api_client/endpoints/store/core/currency.py +12 -0
  114. shopware_api_client/endpoints/store/core/customer.py +34 -0
  115. shopware_api_client/endpoints/store/core/customer_group.py +5 -0
  116. shopware_api_client/endpoints/store/core/delivery_time.py +5 -0
  117. shopware_api_client/endpoints/store/core/document.py +15 -0
  118. shopware_api_client/endpoints/store/core/document_type.py +5 -0
  119. shopware_api_client/endpoints/store/core/landing_page.py +10 -0
  120. shopware_api_client/endpoints/store/core/language.py +18 -0
  121. shopware_api_client/endpoints/store/core/locale.py +5 -0
  122. shopware_api_client/endpoints/store/core/main_category.py +5 -0
  123. shopware_api_client/endpoints/store/core/media.py +8 -0
  124. shopware_api_client/endpoints/store/core/media_thumbnail.py +5 -0
  125. shopware_api_client/endpoints/store/core/order.py +67 -0
  126. shopware_api_client/endpoints/store/core/order_address.py +12 -0
  127. shopware_api_client/endpoints/store/core/order_customer.py +8 -0
  128. shopware_api_client/endpoints/store/core/order_delivery.py +14 -0
  129. shopware_api_client/endpoints/store/core/order_delivery_position.py +5 -0
  130. shopware_api_client/endpoints/store/core/order_line_item.py +14 -0
  131. shopware_api_client/endpoints/store/core/order_transaction.py +12 -0
  132. shopware_api_client/endpoints/store/core/order_transaction_capture.py +12 -0
  133. shopware_api_client/endpoints/store/core/order_transaction_capture_refund.py +12 -0
  134. shopware_api_client/endpoints/store/core/order_transaction_capture_refund_position.py +11 -0
  135. shopware_api_client/endpoints/store/core/payment_method.py +8 -0
  136. shopware_api_client/endpoints/store/core/product.py +60 -0
  137. shopware_api_client/endpoints/store/core/product_configurator_setting.py +10 -0
  138. shopware_api_client/endpoints/store/core/product_cross_selling.py +5 -0
  139. shopware_api_client/endpoints/store/core/product_download.py +10 -0
  140. shopware_api_client/endpoints/store/core/product_manufacturer.py +8 -0
  141. shopware_api_client/endpoints/store/core/product_media.py +10 -0
  142. shopware_api_client/endpoints/store/core/product_review.py +5 -0
  143. shopware_api_client/endpoints/store/core/product_stream.py +5 -0
  144. shopware_api_client/endpoints/store/core/property_group.py +8 -0
  145. shopware_api_client/endpoints/store/core/property_group_option.py +10 -0
  146. shopware_api_client/endpoints/store/core/rule.py +5 -0
  147. shopware_api_client/endpoints/store/core/sales_channel.py +23 -0
  148. shopware_api_client/endpoints/store/core/sales_channel_domain.py +12 -0
  149. shopware_api_client/endpoints/store/core/salutation.py +12 -0
  150. shopware_api_client/endpoints/store/core/seo_url.py +5 -0
  151. shopware_api_client/endpoints/store/core/shipping_method.py +18 -0
  152. shopware_api_client/endpoints/store/core/shipping_method_price.py +5 -0
  153. shopware_api_client/endpoints/store/core/state_machine_state.py +5 -0
  154. shopware_api_client/endpoints/store/core/tag.py +5 -0
  155. shopware_api_client/endpoints/store/core/tax.py +5 -0
  156. shopware_api_client/endpoints/store/core/unit.py +5 -0
  157. shopware_api_client/exceptions.py +4 -0
  158. shopware_api_client/fieldsets.py +12 -0
  159. shopware_api_client/models/__init__.py +0 -0
  160. shopware_api_client/models/acl_role.py +11 -0
  161. shopware_api_client/models/app.py +33 -0
  162. shopware_api_client/models/app_script_condition.py +16 -0
  163. shopware_api_client/models/b2b_components_role.py +12 -0
  164. shopware_api_client/models/b2b_components_shopping_list.py +13 -0
  165. shopware_api_client/models/b2b_components_shopping_list_line_item.py +14 -0
  166. shopware_api_client/models/b2b_employee.py +17 -0
  167. shopware_api_client/models/category.py +44 -0
  168. shopware_api_client/models/cms_block.py +23 -0
  169. shopware_api_client/models/cms_page.py +15 -0
  170. shopware_api_client/models/cms_section.py +20 -0
  171. shopware_api_client/models/cms_slot.py +17 -0
  172. shopware_api_client/models/country.py +27 -0
  173. shopware_api_client/models/country_state.py +12 -0
  174. shopware_api_client/models/currency.py +20 -0
  175. shopware_api_client/models/currency_country_rounding.py +11 -0
  176. shopware_api_client/models/custom_entity.py +19 -0
  177. shopware_api_client/models/custom_field.py +8 -0
  178. shopware_api_client/models/customer.py +47 -0
  179. shopware_api_client/models/customer_address.py +22 -0
  180. shopware_api_client/models/customer_group.py +13 -0
  181. shopware_api_client/models/customer_recovery.py +9 -0
  182. shopware_api_client/models/customer_wishlist.py +9 -0
  183. shopware_api_client/models/customer_wishlist_product.py +10 -0
  184. shopware_api_client/models/delivery_time.py +12 -0
  185. shopware_api_client/models/document.py +20 -0
  186. shopware_api_client/models/document_base_config.py +19 -0
  187. shopware_api_client/models/document_base_config_sales_channel.py +10 -0
  188. shopware_api_client/models/document_type.py +8 -0
  189. shopware_api_client/models/dynamic_access.py +9 -0
  190. shopware_api_client/models/integration.py +15 -0
  191. shopware_api_client/models/landing_page.py +15 -0
  192. shopware_api_client/models/language.py +11 -0
  193. shopware_api_client/models/locale.py +9 -0
  194. shopware_api_client/models/main_category.py +12 -0
  195. shopware_api_client/models/media.py +26 -0
  196. shopware_api_client/models/media_default_folder.py +7 -0
  197. shopware_api_client/models/media_folder.py +16 -0
  198. shopware_api_client/models/media_folder_configuration.py +11 -0
  199. shopware_api_client/models/media_thumbnail.py +15 -0
  200. shopware_api_client/models/media_thumbnail_size.py +8 -0
  201. shopware_api_client/models/order.py +36 -0
  202. shopware_api_client/models/order_address.py +23 -0
  203. shopware_api_client/models/order_customer.py +18 -0
  204. shopware_api_client/models/order_delivery.py +19 -0
  205. shopware_api_client/models/order_delivery_position.py +15 -0
  206. shopware_api_client/models/order_line_item.py +34 -0
  207. shopware_api_client/models/order_line_item_download.py +12 -0
  208. shopware_api_client/models/order_transaction.py +15 -0
  209. shopware_api_client/models/order_transaction_capture.py +15 -0
  210. shopware_api_client/models/order_transaction_capture_refund.py +16 -0
  211. shopware_api_client/models/order_transaction_capture_refund_position.py +15 -0
  212. shopware_api_client/models/payment_method.py +29 -0
  213. shopware_api_client/models/product.py +72 -0
  214. shopware_api_client/models/product_configurator_setting.py +14 -0
  215. shopware_api_client/models/product_cross_selling.py +17 -0
  216. shopware_api_client/models/product_cross_selling_assigned_products.py +11 -0
  217. shopware_api_client/models/product_download.py +11 -0
  218. shopware_api_client/models/product_export.py +27 -0
  219. shopware_api_client/models/product_feature_set.py +11 -0
  220. shopware_api_client/models/product_manufacturer.py +11 -0
  221. shopware_api_client/models/product_media.py +11 -0
  222. shopware_api_client/models/product_price.py +15 -0
  223. shopware_api_client/models/product_review.py +19 -0
  224. shopware_api_client/models/product_search_keyword.py +13 -0
  225. shopware_api_client/models/product_stream.py +14 -0
  226. shopware_api_client/models/product_visibility.py +11 -0
  227. shopware_api_client/models/product_warehouse.py +10 -0
  228. shopware_api_client/models/promotion.py +29 -0
  229. shopware_api_client/models/promotion_discount.py +17 -0
  230. shopware_api_client/models/promotion_discount_prices.py +10 -0
  231. shopware_api_client/models/property_group.py +13 -0
  232. shopware_api_client/models/property_group_option.py +12 -0
  233. shopware_api_client/models/rule.py +16 -0
  234. shopware_api_client/models/rule_condition.py +15 -0
  235. shopware_api_client/models/sales_channel.py +44 -0
  236. shopware_api_client/models/sales_channel_domain.py +13 -0
  237. shopware_api_client/models/salutation.py +9 -0
  238. shopware_api_client/models/seo_url.py +19 -0
  239. shopware_api_client/models/shipping_method.py +18 -0
  240. shopware_api_client/models/shipping_method_price.py +15 -0
  241. shopware_api_client/models/state_machine.py +10 -0
  242. shopware_api_client/models/state_machine_history.py +18 -0
  243. shopware_api_client/models/state_machine_state.py +8 -0
  244. shopware_api_client/models/state_machine_transition.py +11 -0
  245. shopware_api_client/models/system_config.py +12 -0
  246. shopware_api_client/models/tag.py +7 -0
  247. shopware_api_client/models/tax.py +9 -0
  248. shopware_api_client/models/tax_rule.py +15 -0
  249. shopware_api_client/models/tax_rule_type.py +11 -0
  250. shopware_api_client/models/unit.py +8 -0
  251. shopware_api_client/models/user.py +21 -0
  252. shopware_api_client/models/warehouse.py +8 -0
  253. shopware_api_client/models/warehouse_group.py +11 -0
  254. shopware_api_client/models/warehouse_group_warehouse.py +11 -0
  255. shopware_api_client/structs/__init__.py +0 -0
  256. shopware_api_client/structs/absolute_price_definition.py +6 -0
  257. shopware_api_client/structs/calculated_cheapest_price.py +6 -0
  258. shopware_api_client/structs/calculated_price.py +17 -0
  259. shopware_api_client/structs/calculated_tax.py +8 -0
  260. shopware_api_client/structs/cart.py +21 -0
  261. shopware_api_client/structs/cart_price.py +15 -0
  262. shopware_api_client/structs/cash_rounding_config.py +7 -0
  263. shopware_api_client/structs/context.py +15 -0
  264. shopware_api_client/structs/delivery.py +16 -0
  265. shopware_api_client/structs/delivery_date.py +8 -0
  266. shopware_api_client/structs/delivery_information.py +13 -0
  267. shopware_api_client/structs/delivery_position.py +12 -0
  268. shopware_api_client/structs/delivery_time.py +8 -0
  269. shopware_api_client/structs/language_info.py +6 -0
  270. shopware_api_client/structs/line_item.py +39 -0
  271. shopware_api_client/structs/list_price.py +7 -0
  272. shopware_api_client/structs/measurement_units.py +8 -0
  273. shopware_api_client/structs/percentage_price_definition.py +6 -0
  274. shopware_api_client/structs/price.py +14 -0
  275. shopware_api_client/structs/quantity_information.py +7 -0
  276. shopware_api_client/structs/quantity_price_definition.py +14 -0
  277. shopware_api_client/structs/reference_price.py +5 -0
  278. shopware_api_client/structs/reference_price_definition.py +7 -0
  279. shopware_api_client/structs/regulation_price.py +5 -0
  280. shopware_api_client/structs/sales_channel_context.py +33 -0
  281. shopware_api_client/structs/shipping_location.py +12 -0
  282. shopware_api_client/structs/tax_free_config.py +8 -0
  283. shopware_api_client/structs/tax_rule.py +6 -0
  284. shopware_api_client/structs/transaction.py +8 -0
  285. shopware_api_client/structs/variant_listing_config.py +8 -0
  286. {shopware_api_client-1.0.118.dist-info → shopware_api_client-1.1.1.dist-info}/METADATA +45 -273
  287. shopware_api_client-1.1.1.dist-info/RECORD +298 -0
  288. shopware_api_client-1.0.118.dist-info/RECORD +0 -117
  289. {shopware_api_client-1.0.118.dist-info → shopware_api_client-1.1.1.dist-info}/WHEEL +0 -0
  290. {shopware_api_client-1.0.118.dist-info → shopware_api_client-1.1.1.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,7 @@
1
+ from shopware_api_client.fieldsets import FieldSetBase
2
+
3
+
4
+ class ReferencePriceDefinition(FieldSetBase):
5
+ purchase_unit: float
6
+ reference_unit: float
7
+ unit_name: str
@@ -0,0 +1,5 @@
1
+ from shopware_api_client.fieldsets import FieldSetBase
2
+
3
+
4
+ class RegulationPrice(FieldSetBase):
5
+ price: float
@@ -0,0 +1,33 @@
1
+ from shopware_api_client.fieldsets import FieldSetBase
2
+
3
+ from shopware_api_client.endpoints.store.core.currency import Currency
4
+ from shopware_api_client.endpoints.store.core.customer import Customer
5
+ from shopware_api_client.endpoints.store.core.customer_group import CustomerGroup
6
+ from shopware_api_client.endpoints.store.core.payment_method import PaymentMethod
7
+ from shopware_api_client.endpoints.store.core.sales_channel import SalesChannel
8
+ from shopware_api_client.endpoints.store.core.shipping_method import ShippingMethod
9
+ from shopware_api_client.endpoints.store.core.tax import Tax
10
+
11
+ from .cash_rounding_config import CashRoundingConfig
12
+ from .context import Context
13
+ from .language_info import LanguageInfo
14
+ from .measurement_units import MeasurementUnits
15
+ from .shipping_location import ShippingLocation
16
+
17
+
18
+ class SalesChannelContext(FieldSetBase):
19
+ token: str | None = None
20
+ current_customer_group: CustomerGroup | None = None
21
+ fallback_customer_group: CustomerGroup | None = None
22
+ currency: Currency | None = None
23
+ sales_channel: SalesChannel
24
+ measurementSystem: MeasurementUnits | None = None
25
+ tax_rules: list[Tax] | None = None
26
+ customer: Customer | None = None
27
+ payment_method: PaymentMethod | None = None
28
+ shipping_location: ShippingLocation | None = None
29
+ shipping_method: ShippingMethod | None = None
30
+ context: Context | None = None
31
+ item_rounding: CashRoundingConfig
32
+ total_rounding: CashRoundingConfig
33
+ language_info: LanguageInfo
@@ -0,0 +1,12 @@
1
+ from shopware_api_client.fieldsets import FieldSetBase
2
+
3
+
4
+ class ShippingLocation(FieldSetBase):
5
+ country: "Country | None" = None
6
+ address: "Address | None" = None
7
+ state: "CountryState | None" = None
8
+
9
+
10
+ from ..endpoints.store.core.address import Address # noqa: E402
11
+ from ..endpoints.store.core.country import Country # noqa: E402
12
+ from ..endpoints.store.core.country_state import CountryState # noqa: E402
@@ -0,0 +1,8 @@
1
+ from shopware_api_client.fieldsets import FieldSetBase
2
+ from shopware_api_client.endpoints.base_fields import IdField
3
+
4
+
5
+ class TaxFreeConfig(FieldSetBase):
6
+ enabled: bool = False
7
+ currency_id: IdField
8
+ amount: float = 0
@@ -0,0 +1,6 @@
1
+ from shopware_api_client.fieldsets import FieldSetBase
2
+
3
+
4
+ class TaxRule(FieldSetBase):
5
+ tax_rate: float
6
+ percentage: float = 100
@@ -0,0 +1,8 @@
1
+ from .calculated_price import CalculatedPrice
2
+ from ..endpoints.base_fields import IdField
3
+ from ..fieldsets import FieldSetBase
4
+
5
+
6
+ class Transaction(FieldSetBase):
7
+ payment_method_id: IdField | None = None
8
+ amount: CalculatedPrice | None = None
@@ -0,0 +1,8 @@
1
+ from typing import Any
2
+ from shopware_api_client.fieldsets import FieldSetBase
3
+
4
+
5
+ class VariantListingConfig(FieldSetBase):
6
+ display_parent: bool | None = None
7
+ main_variant_id: str | None = None
8
+ configurator_group_config: list[Any] | dict[str, Any] | None = None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: shopware-api-client
3
- Version: 1.0.118
3
+ Version: 1.1.1
4
4
  Summary: An api client for the Shopware API
5
5
  License: MIT
6
6
  License-File: LICENSE
@@ -15,8 +15,8 @@ Classifier: Programming Language :: Python :: 3.12
15
15
  Classifier: Programming Language :: Python :: 3.13
16
16
  Classifier: Programming Language :: Python :: 3.14
17
17
  Provides-Extra: redis
18
- Requires-Dist: httpx (>=0.26,<0.27)
19
- Requires-Dist: httpx-auth (>=0.21,<0.22)
18
+ Requires-Dist: httpx (>=0.28,<0.29)
19
+ Requires-Dist: httpx-auth (>=0.23,<0.24)
20
20
  Requires-Dist: pydantic (>=2.6,<3.0)
21
21
  Requires-Dist: pytest-random-order (>=1.1.1,<2.0.0)
22
22
  Requires-Dist: redis (>5.0,<7.0) ; extra == "redis"
@@ -105,7 +105,7 @@ Endpoint:
105
105
  customer = await client.customer.first()
106
106
  ```
107
107
 
108
- All available Endpoint functions can be found in the [EndpointBase](#list-of-available-functions) section.
108
+ All available Endpoint functions can be found in the [AdminEndpoint](#list-of-available-functions) section.
109
109
 
110
110
  There are two additional ways how the client can be utilized by using it with the Endpoint-Class directly or the
111
111
  associated Pydantic Model:
@@ -182,7 +182,9 @@ SHOP_URL = "https://pets24.shop"
182
182
  config = StoreConfig(url=SHOP_URL, access_key=STORE_API_ACCESS_KEY, context_token=CONTEXT_TOKEN)
183
183
  ```
184
184
 
185
- This config can be used with the `StoreClient`, which works exactly like the `AdminClient`.
185
+ This config can be used with the `StoreClient`, ~~which works exactly like the `AdminClient`~~.
186
+ The `StoreClient` has far less endpoints and does mostly not support full updated of models, but uses
187
+ helper-functions.
186
188
 
187
189
  ### Redis Caching for Rate Limits
188
190
 
@@ -217,20 +219,22 @@ store_client = StoreClient(config=config) # <- Works for store client as well (
217
219
 
218
220
  __Note:__ Shopware currently enforces rate limits on a per–public‑IP basis. As a result, you should only share Redis‑backed rate‑limit caching among clients that originate from the same public IP address.
219
221
 
220
- ## EndpointBase
221
- The `base.EndpointBase` class should be used for creating new Endpoints. It provides some usefull functions to call
222
+ ## AdminEndpoint
223
+ The `base.AdminEndpoint` class should be used for creating new Admin-Endpoints. It provides some usefull functions to call
222
224
  the Shopware-API.
223
225
 
224
226
  The base structure of an Endpoint is pretty simple:
225
227
 
226
228
  ```python
227
- from shopware_api_client.base import ApiModelBase, EndpointBase
229
+ from shopware_api_client.base import EndpointMixin, AdminEndpoint
228
230
 
229
- class CustomerGroup(ApiModelBase["CustomerGroupEndpoint"]):
231
+
232
+ class CustomerGroup(EndpointMixin["CustomerGroupEndpoint"]):
230
233
  # Model definition
231
234
  pass
232
235
 
233
- class CustomerGroupEndpoint(EndpointBase[CustomerGroup]):
236
+
237
+ class CustomerGroupEndpoint(AdminEndpoint[CustomerGroup]):
234
238
  name = "customer_group" # name of the Shopware-Endpoint (snaky)
235
239
  path = "/customer-group" # path of the Shopware-Endpoint
236
240
  model_class = CustomerGroup # Pydantic-Model of this Endpoint
@@ -254,6 +258,7 @@ class CustomerGroupEndpoint(EndpointBase[CustomerGroup]):
254
258
  - `bulk_delete(objs: list[ModelClass] | list[dict[str, Any]` deletes multiple objects. Does always return dict or plain response. (POST /_action/sync)
255
259
 
256
260
  Not all functions are available for the StoreClient-Endpoints. But some of them have some additional functions.
261
+ StoreClient-Endpoints using the `base.StoreSearchEndpoint` can use most of the filter functions, but not create/update/delete.
257
262
 
258
263
  ### Filter
259
264
 
@@ -290,18 +295,23 @@ The base structure of an Endpoint-Model looks like this. Field names are convert
290
295
  ```python
291
296
  from pydantic import Field
292
297
  from typing import Any
293
- from shopware_api_client.base import ApiModelBase
298
+ from shopware_api_client.base import ApiModelBase, CustomFieldsMixin
294
299
 
295
- class CustomerGroup(ApiModelBase["CustomerGroupEndpoint"]):
300
+
301
+ class CustomerGroup(ApiModelBase, CustomFieldsMixin):
296
302
  _identifier = "customer_group" # name of the Shopware-Endpoint (snaky)
297
303
 
298
304
  name: str # Field with type
299
305
  display_gross: bool | None = None
300
- custom_fields: dict[str, Any] | None = None
301
306
  # other fields...
302
307
  ```
303
308
 
304
- The `id`, `created_at` and `updated_at` attributes are provided in the ApiModelBase and must not be added.
309
+ This Base-Models live in `shopware_api_client.models`
310
+
311
+ The `id`, `version_id`, `created_at`, `updated_at` and `translated` attributes are provided in the ApiModelBase and
312
+ must not be added. This are default fields of Shopwares `Entity` class, even they are not always used.
313
+
314
+ If an entity supports the `EntityCustomFieldsTrait` you can add the `CustomFieldsMixin` to add the custom_fields field.
305
315
 
306
316
  ### List of available Function
307
317
 
@@ -309,7 +319,7 @@ The `id`, `created_at` and `updated_at` attributes are provided in the ApiModelB
309
319
  - `delete()` executes `Endpoint.delete()`
310
320
 
311
321
 
312
- ### Relations
322
+ ### AdminModel + Relations
313
323
 
314
324
  To make relations to other models work, we have to define them in the Model. There are two classes to make this work:
315
325
  `endpoints.relations.ForeignRelation` and `endpoints.relations.ManyRelation`.
@@ -322,39 +332,35 @@ relation links.
322
332
  - `class`: Class of the related model
323
333
 
324
334
  Example (Customer):
335
+
325
336
  ```python
326
337
  from pydantic import Field
327
- from typing import TYPE_CHECKING
328
338
 
329
- from shopware_api_client.base import ApiModelBase, EndpointClass
339
+ from shopware_api_client.base import AdminModel
340
+ from shopware_api_client.endpoints.base_fields import IdField
330
341
  from shopware_api_client.endpoints.relations import ForeignRelation, ManyRelation
342
+ from shopware_api_client.models.customer import Customer as CustomerBase
331
343
 
332
- from ...base_fields import IdField
333
-
334
- if TYPE_CHECKING:
335
- from shopware_api_client.endpoints.admin import CustomerAddress
336
-
337
- # Base-Class for the normal model fields
338
- class CustomerBase(ApiModelBase[EndpointClass]):
344
+ """
345
+ // shopware_api_client.models.customer.Customer:
346
+ class Customer(ApiModelBase):
339
347
  # we have an id so we can create a ForeignRelation to it
340
348
  default_billing_address_id: IdField
349
+ """
341
350
 
342
-
343
- # Relations-Class for the related fields
344
- class CustomerRelations:
351
+ # final model containing relations for admin api. Must be AdminModel
352
+ class Customer(CustomerBase, AdminModel["CustomerEndpoint"]):
345
353
  default_billing_address: ForeignRelation["CustomerAddress"]
346
354
 
347
355
  # We don't have a field for all addresses of a customer, but there is a relation for it!
348
356
  addresses: ManyRelation["CustomerAddress"]
349
357
 
358
+ # model relation classes have to be imported at the end. pydantic needs the full import (not just TYPE_CHECKING)
359
+ # and this saves us from circular imports
360
+ from shopware_api_client.endpoints.admin import CustomerAddress # noqa: E402
350
361
 
351
- # Final Class, that combines both of them
352
- class Customer(CustomerBase["CustomerEndpoint"], CustomerRelations):
353
- pass
354
362
  ```
355
363
 
356
- We have two classes `Base` and `Relations`. This way we can [reuse the Base-Model](#reusing-admin-models-for-store-endpoints).
357
-
358
364
  ## Development
359
365
 
360
366
  ### Testing
@@ -374,7 +380,7 @@ datamodel-codegen --input openapi3.json --output model_openapi3.py --snake-case-
374
380
 
375
381
  The file may look confusing at first, but you can search for Endpoint-Name + JsonApi (Example: class CustomerJsonApi)
376
382
  to get all returned fields + relationships class as an overview over the available Relations. However, the Models will
377
- need some Modifications. But it's a good start.
383
+ need some modifications. But it's a good start.
378
384
 
379
385
  Not all fields returned by the API are writeable and the API will throw an error when you try to set it. So this fields
380
386
  must have an `exclude=True` in their definition. To find out which fields need to be excluded check the Shopware
@@ -388,245 +394,8 @@ don't get cleaned away as unused imports by code-formaters/cleaners.
388
394
  We need to import all related models at the **end** of the file. If we don't add them, Pydantic fails to build the model. If we add them before
389
395
  our model definition, we run into circular imports.
390
396
 
391
- ### Step by Step Example (Admin Endpoint Media Thumbnail)
392
-
393
- 1. Create the file for the endpoint. Since Media Thumbnail is an Admin > Core Endpoint we create a file called `media_thumbnail.py` in `endpoints/admin/core/`
394
-
395
- 2. You can copy & paste the following example as a base for the new Endpoint:
396
-
397
- ```python
398
- from typing import Any
399
-
400
- from pydantic import Field
401
-
402
- from ....base import ApiModelBase, EndpointBase, EndpointClass
403
- from ...base_fields import IdField
404
- from ...relations import ForeignRelation, ManyRelation
405
-
406
-
407
- class YourModelBase(ApiModelBase[EndpointClass]):
408
- _identifier = "your_model"
409
-
410
- foreign_id: IdField
411
- # more direct fields
412
-
413
-
414
- class YourModelRelations:
415
- foreign: ForeignRelation["ForeignRelationModel"]
416
- many: ManyRelation["ManyRelationModel"]
417
-
418
-
419
- class YourModel(YourModelBase["YourModelEndpoint"], YourModelRelations):
420
- pass
421
-
422
-
423
- class YourModelEndpoint(EndpointBase[YourModel]):
424
- name = "your_model"
425
- path = "/your-model"
426
- model_class = YourModel
427
-
428
-
429
- from .foreign_relation_model import ForeignRelationModel # noqa: E402
430
- from .may_relation_model import ManyRelationModel # noqa: E402
431
-
432
- ```
433
-
434
- 3. Update the example to your needs (Media Thumbnail Example):
435
- * Replace `YourModel` with `MediaThumbnail`
436
- * Replace `your_model` with `media_thumbnail`
437
- * Replace `your-model` with `media-thumbnail`
438
-
439
- 4. Assuming you used the datamodel-codegen command above to generate datamodels you can search the file for
440
- `class MediaThumbnailJsonApi` and copy all fields except `id`, `created_at`, `updated_at` (included in ApiModelBase) and `relationships`.
441
- ID-Fields will use the type `constr(pattern=r"^[0-9a-f]{32}$")`. Replace it with `IdField` from `endpoints.base_fields`.
442
- Remove the generated alias entries, because we use a generator for this.
443
-
444
- 5. Now your `media_thumbnail.py` should look like this:
445
-
446
- ```python
447
- from typing import TYPE_CHECKING, Any, ClassVar
448
-
449
- from pydantic import Field
450
-
451
- from ....base import ApiModelBase, EndpointBase, EndpointClass
452
- from ....client import registry
453
- from ...base_fields import IdField
454
- from ...relations import ForeignRelation, ManyRelation
455
-
456
-
457
- class MediaThumbnailBase(ApiModelBase[EndpointClass]):
458
- _identifier = "media_thumbnail"
459
-
460
- media_id: IdField
461
- width: int
462
- height: int
463
- url: str | None = Field(
464
- None, description="Runtime field, cannot be used as part of the criteria."
465
- )
466
- path: str | None = None
467
- custom_fields: dict[str, Any] | None = None
468
-
469
-
470
- class MediaThumbnailRelations:
471
- foreign: ClassVar[ForeignRelation["ForeignRelationModel"]] = ForeignRelation("ForeignRelationModel", "foreign_id")
472
- many: ClassVar[ManyRelation["ManyRelationModel"]] = ManyRelation("ManyRelationModel", "manyRelation")
473
-
474
-
475
- class MediaThumbnail(MediaThumbnailBase["MediaThumbnailEndpoint"], MediaThumbnailRelations):
476
- pass
477
-
478
-
479
- class MediaThumbnailEndpoint(EndpointBase[MediaThumbnail]):
480
- name = "media_thumbnail"
481
- path = "/media-thumbnail"
482
- model_class = MediaThumbnail
483
-
484
-
485
- from .foreign_relation_model import ForeignRelationModel # noqa: E402
486
- from .may_relation_model import ManyRelationModel # noqa: E402
487
- ```
488
-
489
- 6. Next up: Relations. For this check the type of the `relationships`. `MediaThumbnail` has only one relation to `media`.
490
- If you follow the types of `media > data` you can see the actual model type in the `type` field as examples attribute: media.
491
- So it relates to the Media Endpoint.
492
- For this relation our related Field looks like this:
493
- `media: ForeignRelation["Media"]`.
494
- We add it to the Relations class.
495
-
496
- 7. Updated `media_thumbnails.py`:
497
- ```python
498
- from typing import Any
499
-
500
- from pydantic import Field
501
-
502
- from ....base import ApiModelBase, EndpointBase, EndpointClass
503
- from ...base_fields import IdField
504
- from ...relations import ForeignRelation
505
-
506
-
507
- class MediaThumbnailBase(ApiModelBase[EndpointClass]):
508
- _identifier = "media_thumbnail"
509
-
510
- media_id: IdField
511
- width: int
512
- height: int
513
- url: str | None = Field(
514
- None, description="Runtime field, cannot be used as part of the criteria."
515
- )
516
- path: str | None = None
517
- custom_fields: dict[str, Any] | None = None
518
-
519
-
520
- class MediaThumbnailRelations:
521
- media: ForeignRelation["Media"]
522
-
523
-
524
- class MediaThumbnail(MediaThumbnailBase["MediaThumbnailEndpoint"], MediaThumbnailRelations):
525
- pass
526
-
527
-
528
- class MediaThumbnailEndpoint(EndpointBase[MediaThumbnail]):
529
- name = "media_thumbnail"
530
- path = "/media-thumbnail"
531
- model_class = MediaThumbnail
532
-
533
-
534
- from .media import Media # noqa: E402
535
- ```
536
-
537
- 8. Now we have to check, which fields are read-only fields. The easiest way for this is to head to the POST section of the documentation of this Endpoint: https://shopware.stoplight.io/docs/admin-api/9724c473cce7d-create-a-new-media-thumbnail-resources
538
- All fields that aren't listed here are read-only fields. So for our example this are: width, height, path, created_at and updated_at. We need to add an `exclude=True` to this fields, to make Pydantic ignore this fields when we send them back to the
539
- API for saving or creating entries. We try to provide default values for excluded fields which are required, so we don't have to set them, when we create
540
- a new object.
541
-
542
- 9. After adding `exclude=True` our final file should look like this:
543
- ```python
544
- from typing import Any
545
-
546
- from pydantic import AwareDatetime, Field
547
-
548
- from ....base import ApiModelBase, EndpointBase, EndpointClass
549
- from ....client import registry
550
- from ...base_fields import IdField
551
- from ...relations import ForeignRelation
552
-
553
-
554
- class MediaThumbnailBase(ApiModelBase[EndpointClass]):
555
- _identifier = "media_thumbnail"
556
-
557
- media_id: IdField
558
- width: int = Field(default=0, exclude=True)
559
- height: int = Field(default=0, exclude=True)
560
- url: str | None = Field(
561
- None, description="Runtime field, cannot be used as part of the criteria."
562
- )
563
- path: str | None = Field(None, exclude=True)
564
- custom_fields: dict[str, Any] | None = None
565
-
566
-
567
- class MediaThumbnailRelations:
568
- media: ClassVar[ForeignRelation["Media"]] = ForeignRelation("Media", "media_id")
569
-
570
-
571
- class MediaThumbnail(MediaThumbnailBase["MediaThumbnailEndpoint"], MediaThumbnailRelations):
572
- pass
573
-
574
-
575
- class MediaThumbnailEndpoint(EndpointBase[MediaThumbnail]):
576
- name = "media_thumbnail"
577
- path = "/media-thumbnail"
578
- model_class = MediaThumbnail
579
-
580
-
581
- from .media import Media # noqa: E402
582
- ```
583
- 10. As final step we need to add an import for the Model to `endpoints/admin/__init__.py` and add the Model to `__all__` and to the `AdminEndpoints.init_endpoints`
584
- ```python
585
- # other imports
586
- from .core.admin.media_thumbnail import MediaThumbnail, MediaThumbnailEndpoint
587
- # more imports
588
-
589
- __all__ = [
590
- # other models
591
- "MediaThumbnail",
592
- # more models
593
- ]
594
-
595
- ...
596
-
597
- class AdminEndpoints:
598
- def init_endpoints(self, client: "AdminClient"):
599
- # other endpoints
600
- self.media_thumbnail = MediaThumbnailEndpoint(client)
601
- # more endpoints
602
- ```
603
-
604
- We are done and you are now ready to use your new endpoint! 🎉
605
-
606
- ### Reusing Admin-Models for Store-Endpoints
607
-
608
- The Store-Endpoints use the same Model structure as the Admin-Endpoints, but have no relations. Some of the related
609
- objects are added to the response directly. We can use the Base-Models from our Admin-Endpoints for this purpose:
610
-
611
- ```python
612
- from ...admin.core.country import CountryBase
613
- from ...admin.core.country_state import CountryStateBase
614
- from ...admin.core.customer_address import CustomerAddressBase
615
- from ...admin.core.salutation import SalutationBase
616
-
617
-
618
- class Address(CustomerAddressBase["AddressEndpoint"]):
619
- _identifier = "address"
620
-
621
- country: CountryBase | None = None
622
- customer_state: CountryStateBase | None = None
623
- salutation: SalutationBase | None = None
624
- ```
625
-
626
- Since country, customerState and salutation are returned in the response, we can use their Base-Models to define
627
- their types.
628
-
629
- This "related" fields should always be optional, because their value is not always returned (object-creation).
397
+ Every model has a base model that lives in `models/<model_file>.py`. This model only contains direct fields (no relations), which are used by
398
+ both endpoints (store & admin). This base models are extended in the endpoints to contain relations (`endpoints/admin/core/<model_file>.py` & `endpoints/store/core/<model_file>.py`).
630
399
 
631
400
  ### Structure
632
401
 
@@ -641,7 +410,10 @@ This "related" fields should always be optional, because their value is not alwa
641
410
  > core -- StoreAPI > Core
642
411
  > commercial -- StoreAPI > Commercial
643
412
  > digital_sales_rooms -- StoreAPI > Digital Sales Rooms
644
- base.py -- All the Base Classes
413
+ > models -- base models to be extended in admin/store endpoints (shopware => Entity)
414
+ > structs -- data structures that do not have a model (shopware => Struct)
415
+ base.py -- All the Base Classes (nearly)
416
+ fieldsets.py -- FieldSetBase has its own file to prevent pydantic problems
645
417
  client.py -- Clients & Registry
646
418
  config.py -- Configs
647
419
  exceptions.py -- Exceptions