scim2-client 0.3.0__py3-none-any.whl → 0.3.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.
scim2_client/client.py CHANGED
@@ -174,7 +174,7 @@ class BaseSCIMClient:
174
174
  scim_ctx: Optional[Context] = None,
175
175
  ) -> Union[Error, None, dict, type[Resource]]:
176
176
  if expected_status_codes and status_code not in expected_status_codes:
177
- raise UnexpectedStatusCode()
177
+ raise UnexpectedStatusCode(status_code)
178
178
 
179
179
  # Interoperability considerations: The "application/scim+json" media
180
180
  # type is intended to identify JSON structure data that conforms to
@@ -207,7 +207,7 @@ class BaseSCIMClient:
207
207
  ):
208
208
  error = Error.model_validate(response_payload)
209
209
  if raise_scim_errors:
210
- raise SCIMResponseErrorObject(source=error)
210
+ raise SCIMResponseErrorObject(obj=error.detail, source=error)
211
211
  return error
212
212
 
213
213
  if not expected_types:
scim2_client/errors.py CHANGED
@@ -69,12 +69,9 @@ class SCIMResponseErrorObject(SCIMResponseError):
69
69
  Those errors are only raised when the :code:`raise_scim_errors` parameter is :data:`True`.
70
70
  """
71
71
 
72
- def __init__(self, *args, **kwargs):
72
+ def __init__(self, obj, *args, **kwargs):
73
73
  message = kwargs.pop(
74
- "message",
75
- f"The server returned a SCIM Error object: {kwargs['source'].detail}"
76
- if kwargs.get("source")
77
- else "The server returned a SCIM Error object",
74
+ "message", f"The server returned a SCIM Error object: {obj}"
78
75
  )
79
76
  super().__init__(message, *args, **kwargs)
80
77
 
@@ -82,12 +79,9 @@ class SCIMResponseErrorObject(SCIMResponseError):
82
79
  class UnexpectedStatusCode(SCIMResponseError):
83
80
  """Error raised when a server returned an unexpected status code for a given :class:`~scim2_models.Context`."""
84
81
 
85
- def __init__(self, *args, **kwargs):
82
+ def __init__(self, status_code: int, *args, **kwargs):
86
83
  message = kwargs.pop(
87
- "message",
88
- f"Unexpected response status code: {kwargs['source'].status_code}"
89
- if kwargs.get("source")
90
- else "Unexpected response status code",
84
+ "message", f"Unexpected response status code: {status_code}"
91
85
  )
92
86
  super().__init__(message, *args, **kwargs)
93
87
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: scim2-client
3
- Version: 0.3.0
3
+ Version: 0.3.1
4
4
  Summary: Pythonically build SCIM requests and parse SCIM responses
5
5
  Project-URL: documentation, https://scim2-client.readthedocs.io
6
6
  Project-URL: repository, https://github.com/python-scim/scim2-client
@@ -1,11 +1,11 @@
1
1
  scim2_client/__init__.py,sha256=KpNDJW9e2WseqSsQ6FltkQzemHM52NACfpJTd3eSIuY,853
2
- scim2_client/client.py,sha256=CPXPqnmYNcXgn5ViPFpapI-oEg0oX8kXnwdWWmjm4eI,40130
3
- scim2_client/errors.py,sha256=VDomHej2WH07up6a2wr7q0BVdj6RG4MyrM2t9UHx0Iw,4623
2
+ scim2_client/client.py,sha256=CYZbkakM1dvcKO5wWMSRAMg2VfiYSI3_Ma7_fod169k,40159
3
+ scim2_client/errors.py,sha256=mxjUvarjvX3797w2NzdLqc6zxCQZlOga8cYABWpUAXM,4401
4
4
  scim2_client/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  scim2_client/engines/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  scim2_client/engines/httpx.py,sha256=uqONJhFUdFf8W-GndL-mB_Z33FRuwgXAb2PczTB7wLg,16268
7
7
  scim2_client/engines/werkzeug.py,sha256=9KcViIJVzSda6cpeiM-_dFjp5HFDBFkfiGRaUx4utrk,9107
8
- scim2_client-0.3.0.dist-info/METADATA,sha256=1aFhLfcE_1TXEI7iMjJUc8G99dmaViqJoN01BM8-_Rk,16997
9
- scim2_client-0.3.0.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
10
- scim2_client-0.3.0.dist-info/licenses/LICENSE.md,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
11
- scim2_client-0.3.0.dist-info/RECORD,,
8
+ scim2_client-0.3.1.dist-info/METADATA,sha256=uOKAfR90R1mbskVFqsLXvvyO-k0GclVt49ETK9WAiy4,16997
9
+ scim2_client-0.3.1.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
10
+ scim2_client-0.3.1.dist-info/licenses/LICENSE.md,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
11
+ scim2_client-0.3.1.dist-info/RECORD,,