shopware-api-client 1.0.112__py3-none-any.whl → 1.0.114__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.

Potentially problematic release.


This version of shopware-api-client might be problematic. Click here for more details.

@@ -277,7 +277,7 @@ class ClientBase:
277
277
  if not isinstance(errors, (list, tuple)):
278
278
  raise ValueError("`errors` attribute in json not a list/tuple!")
279
279
 
280
- error: SWAPIError | SWAPIErrorList = SWAPIError.from_errors(errors) # type: ignore
280
+ error: SWAPIError | SWAPIErrorList = SWAPIError.from_errors(errors, response) # type: ignore
281
281
  except ValueError:
282
282
  error: SWAPIError | SWAPIErrorList = SWAPIError.from_response(response) # type: ignore
283
283
 
@@ -523,6 +523,9 @@ class EndpointBase(Generic[ModelClass]):
523
523
  if not self.model_class.__pydantic_complete__:
524
524
  self.model_class.model_rebuild()
525
525
 
526
+ if name == getattr(self.model_class, "_identifier").get_default():
527
+ return name
528
+
526
529
  field = self.model_class.model_fields[name]
527
530
 
528
531
  if get_origin(field.annotation) in [ForeignRelation, ManyRelation]:
@@ -696,7 +699,9 @@ class EndpointBase(Generic[ModelClass]):
696
699
  return self
697
700
 
698
701
  def only(self, **kwargs: list[str]) -> Self:
699
- self._includes.update({self._serialize_field_name(field): data for field, data in kwargs.items()})
702
+ for field, data in kwargs.items():
703
+ self._includes[self._serialize_field_name(field)] = [self._serialize_field_name(d) for d in data]
704
+
700
705
  return self
701
706
 
702
707
  def filter(self, **kwargs: Any) -> Self:
@@ -47,6 +47,8 @@ class SWAPIError(SWAPIException):
47
47
  self.source = kwargs.get("source", {})
48
48
  self.meta = kwargs.get("meta", {})
49
49
  self.headers = kwargs.get("headers", {})
50
+ self.request = kwargs.get("request", None)
51
+ self.response = kwargs.get("response", None)
50
52
 
51
53
  def __str__(self) -> str:
52
54
  return f"Status: {self.status} {self.title} - {self.detail} - {self.source}"
@@ -87,10 +89,11 @@ class SWAPIError(SWAPIException):
87
89
  return SWAPIError
88
90
 
89
91
  @classmethod
90
- def from_errors(cls, errors: list[dict[str, Any]]) -> "SWAPIErrorList":
92
+ def from_errors(cls, errors: list[dict[str, Any]], response: Response) -> "SWAPIErrorList":
91
93
  errlist = []
92
94
 
93
95
  for error in errors:
96
+ error.update({"response": response, "request": response.request})
94
97
  exception_class = cls.get_exception_class(int(error["status"]))
95
98
  errlist.append(exception_class(**error))
96
99
 
@@ -111,6 +114,8 @@ class SWAPIError(SWAPIException):
111
114
  title=response.reason_phrase,
112
115
  detail=response.text,
113
116
  headers=response.headers,
117
+ request=response._request,
118
+ response=response,
114
119
  )
115
120
 
116
121
 
@@ -1,8 +1,9 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: shopware-api-client
3
- Version: 1.0.112
3
+ Version: 1.0.114
4
4
  Summary: An api client for the Shopware API
5
5
  License: MIT
6
+ License-File: LICENSE
6
7
  Keywords: shopware,api,client
7
8
  Author: GWS Gesellschaft für Warenwirtschafts-Systeme mbH
8
9
  Author-email: ebusiness@gws.ms
@@ -12,6 +13,7 @@ Classifier: Operating System :: OS Independent
12
13
  Classifier: Programming Language :: Python :: 3
13
14
  Classifier: Programming Language :: Python :: 3.12
14
15
  Classifier: Programming Language :: Python :: 3.13
16
+ Classifier: Programming Language :: Python :: 3.14
15
17
  Provides-Extra: redis
16
18
  Requires-Dist: httpx (>=0.26,<0.27)
17
19
  Requires-Dist: httpx-auth (>=0.21,<0.22)
@@ -1,5 +1,5 @@
1
1
  shopware_api_client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- shopware_api_client/base.py,sha256=fxqZX1648lltFj1nIRRvrLk5WmJxew0MQ9TWPutaAcM,30252
2
+ shopware_api_client/base.py,sha256=IidRcNtiGIFgGE6i1gQdngQHV2rYix1DSisqvSiR2C8,30409
3
3
  shopware_api_client/cache.py,sha256=JtojK7yDfAM937rDoqJj_FpNFf3zsfueTSyUX_Gsk4w,4997
4
4
  shopware_api_client/client.py,sha256=vkTZ8WLIu0Q3_73gXvidkTSpMJlWsJUjFyhDY2f2ISM,7583
5
5
  shopware_api_client/config.py,sha256=6IzpkuoYsh0d5c0BR453n1ijQwxB74HDYx1L6dmlJwQ,1623
@@ -106,10 +106,10 @@ shopware_api_client/endpoints/store/__init__.py,sha256=LE_GL4jYVGrRdp6M1cPURI-UJ
106
106
  shopware_api_client/endpoints/store/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
107
107
  shopware_api_client/endpoints/store/core/address.py,sha256=Tm7ri-i0zhyt4LVEHaQy3xEvjapCCPRsYAp5lOCDOew,2774
108
108
  shopware_api_client/endpoints/store/core/cart.py,sha256=34eNwuv7H9WZUtJGf4TkTGHiGynDT6xeAt0gIl7V4KI,2584
109
- shopware_api_client/exceptions.py,sha256=3F5hFaUh91zmeBniSKhPUxU7yNRDIfGWfGqgq52RW1A,4717
109
+ shopware_api_client/exceptions.py,sha256=sxQ1O_XSzmuEnuJkztnZ-zu-NCcOQ3kMWn_8M4j5YxA,4989
110
110
  shopware_api_client/logging.py,sha256=4QSTK1vcdBew4shvLG-fm-xDOlddhOZeyb5T9Og0fSA,251
111
111
  shopware_api_client/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
112
- shopware_api_client-1.0.112.dist-info/LICENSE,sha256=qTihFhbGE2ZJJ7Byc9hnEYBY33yDK2Jw87SpAm0IKUs,1107
113
- shopware_api_client-1.0.112.dist-info/METADATA,sha256=ynj2y6gw6blSCZepi1UmbQJKzAcRhOHsXZeRH76T1yg,24377
114
- shopware_api_client-1.0.112.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
115
- shopware_api_client-1.0.112.dist-info/RECORD,,
112
+ shopware_api_client-1.0.114.dist-info/METADATA,sha256=uibYK4OvISd5-2AlzY_Iljif_Ke0iFMh6e9ycuA6_Sc,24450
113
+ shopware_api_client-1.0.114.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
114
+ shopware_api_client-1.0.114.dist-info/licenses/LICENSE,sha256=qTihFhbGE2ZJJ7Byc9hnEYBY33yDK2Jw87SpAm0IKUs,1107
115
+ shopware_api_client-1.0.114.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 2.1.3
2
+ Generator: poetry-core 2.2.1
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any