finalsa-common-http-client 0.1.3__py3-none-any.whl → 0.1.4__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.
finalsa/http/_shared.py CHANGED
@@ -77,9 +77,9 @@ def parse_params(params: Mapping[str, Any] | None ) -> dict[str, str | int | flo
77
77
  if value is not None:
78
78
  result[key] = value
79
79
  if isinstance(value, dict):
80
- result[key] = dumps(value).decode('utf-8')
80
+ result[key] = dumps(value)
81
81
  if isinstance(value, list):
82
- result[key] = dumps(value).decode('utf-8')
82
+ result[key] = dumps(value)
83
83
  return result
84
84
 
85
85
 
@@ -186,8 +186,7 @@ class BaseAsyncHttpClient:
186
186
  pagination_request_dict.pop('exclusive_start_key')
187
187
  response = await self.get(path, params=pagination_request_dict, **kwargs)
188
188
  data = await response.json()
189
- items = [response_model.model_validate_json(
190
- item) for item in data["items"]]
189
+ items = [response_model.model_validate(item) for item in data["items"]]
191
190
  data["items"] = items
192
191
  return PaginationResponse[response_model](**data)
193
192
 
@@ -158,10 +158,13 @@ class BaseSyncHttpClient:
158
158
  self._session = None
159
159
 
160
160
  def get_paginated(self, path: str, pagination_request: PaginationRequest, response_model: Type[BaseModel], **kwargs: Any) -> PaginationResponse[Type[BaseModel]]:
161
- response = self.get(path, params=pagination_request.model_dump(), **kwargs)
161
+ pagination_request_dict = pagination_request.model_dump()
162
+ if 'exclusive_start_key' in pagination_request_dict:
163
+ pagination_request_dict['from'] = pagination_request_dict['exclusive_start_key']
164
+ pagination_request_dict.pop('exclusive_start_key')
165
+ response = self.get(path, params=pagination_request_dict, **kwargs)
162
166
  data = response.json()
163
- items = [response_model.model_validate_json(
164
- item) for item in data["items"]]
167
+ items = [response_model.model_validate(item) for item in data["items"]]
165
168
  data["items"] = items
166
169
  return PaginationResponse[response_model](**data)
167
170
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: finalsa-common-http-client
3
- Version: 0.1.3
3
+ Version: 0.1.4
4
4
  Summary: HTTP client library for common data types used in business applications
5
5
  Project-URL: Homepage, https://github.com/finalsa/finalsa-http-client
6
6
  Project-URL: Documentation, https://github.com/finalsa/finalsa-http-client#readme
@@ -0,0 +1,10 @@
1
+ finalsa/http/__init__.py,sha256=w6M9CRcx2gCy1u-HLhLZ_0kQX92JEbFiGi4MBYqR3OI,498
2
+ finalsa/http/_shared.py,sha256=N3lH8m7hCHLTRCDASi2U8-TCweuEIfKQDVtMQgX_j38,5246
3
+ finalsa/http/async_client/__init__.py,sha256=L25WfVpUpPZlMv6-cgeWlNvmK5UJOhLZ1NOndcIsA9w,73
4
+ finalsa/http/async_client/base.py,sha256=PF6ELzWh79gv27Dx9ZogYwWVU9fGWp_4nOGzURZWSN4,7794
5
+ finalsa/http/sync_client/__init__.py,sha256=ocLE6dofwYCD9_rJpIP1KhlIujRFcaJfhoaeXVrSCVE,59
6
+ finalsa/http/sync_client/base.py,sha256=TLqyU7-dr0_zVj7gi6R6BeqZ_ZGnGzN3IGaEzl2kCRY,6881
7
+ finalsa_common_http_client-0.1.4.dist-info/METADATA,sha256=RXI5GGw7xfiADr6JZEHGqz3catKy54WjXmS6lXH8d9A,9102
8
+ finalsa_common_http_client-0.1.4.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
9
+ finalsa_common_http_client-0.1.4.dist-info/licenses/LICENSE.md,sha256=yqzhfnTBr2S4lUBx-yibVPOIXRUDPrSUN9-_7AsC6OU,1084
10
+ finalsa_common_http_client-0.1.4.dist-info/RECORD,,
@@ -1,10 +0,0 @@
1
- finalsa/http/__init__.py,sha256=w6M9CRcx2gCy1u-HLhLZ_0kQX92JEbFiGi4MBYqR3OI,498
2
- finalsa/http/_shared.py,sha256=lIUwPSg3uZY9viTJ_KDbhHLQGw8PiQGtINFGJekJkWc,5278
3
- finalsa/http/async_client/__init__.py,sha256=L25WfVpUpPZlMv6-cgeWlNvmK5UJOhLZ1NOndcIsA9w,73
4
- finalsa/http/async_client/base.py,sha256=XPgv3Ux3L9HZ166b6g2f7tbe5pnuBl5hKfOpX6TEBjU,7812
5
- finalsa/http/sync_client/__init__.py,sha256=ocLE6dofwYCD9_rJpIP1KhlIujRFcaJfhoaeXVrSCVE,59
6
- finalsa/http/sync_client/base.py,sha256=uH9CNAkg-Lyjoj_kx7mTEotcivYq7fQpHcWxWWM_Pro,6624
7
- finalsa_common_http_client-0.1.3.dist-info/METADATA,sha256=2hYnkJQ3fnIcaOEgW1xJzn-xy5Qyuf6lqm_poMLYigA,9102
8
- finalsa_common_http_client-0.1.3.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
9
- finalsa_common_http_client-0.1.3.dist-info/licenses/LICENSE.md,sha256=yqzhfnTBr2S4lUBx-yibVPOIXRUDPrSUN9-_7AsC6OU,1084
10
- finalsa_common_http_client-0.1.3.dist-info/RECORD,,