scim2-client 0.6.0__py3-none-any.whl → 0.6.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
@@ -205,10 +205,13 @@ class SCIMClient:
205
205
  def _check_resource_model(
206
206
  self, resource_model: type[Resource], payload=None
207
207
  ) -> None:
208
- if (
209
- resource_model not in self.resource_models
210
- and resource_model not in CONFIG_RESOURCES
211
- ):
208
+ schema_to_check = resource_model.model_fields["schemas"].default[0]
209
+ for element in self.resource_models:
210
+ schema = element.model_fields["schemas"].default[0]
211
+ if schema_to_check == schema:
212
+ return
213
+
214
+ if resource_model not in CONFIG_RESOURCES:
212
215
  raise SCIMRequestError(
213
216
  f"Unknown resource type: '{resource_model}'", source=payload
214
217
  )
@@ -640,13 +643,13 @@ class SCIMClient:
640
643
  for schema, resource_type in resource_types_by_schema.items():
641
644
  schema_obj = schema_objs_by_schema[schema]
642
645
  model = Resource.from_schema(schema_obj)
643
- extensions = []
646
+ extensions: tuple[type[Extension], ...] = ()
644
647
  for ext_schema in resource_type.schema_extensions or []:
645
648
  schema_obj = schema_objs_by_schema[ext_schema.schema_]
646
649
  extension = Extension.from_schema(schema_obj)
647
- extensions.append(extension)
650
+ extensions = extensions + (extension,)
648
651
  if extensions:
649
- model = model[Union[tuple(extensions)]]
652
+ model = model[Union[extensions]]
650
653
  resource_models.append(model)
651
654
 
652
655
  return tuple(resource_models)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scim2-client
3
- Version: 0.6.0
3
+ Version: 0.6.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=l0pyBLiTpFA68ao98PqQLT_Xx0mw8BHumwrIHYCWa_M,845
2
- scim2_client/client.py,sha256=Kglw0HfWHaQQ9hLiaDN92KuEn2KGHWxykm_sWNoUg1c,54867
2
+ scim2_client/client.py,sha256=jtL0Lhy8USPECiAwVbD5grIVePFIIdfibVu0_5EQISQ,55067
3
3
  scim2_client/errors.py,sha256=LTTrjwTImKcPmeEcd_WqSphaGNf_2tlRA4V7UhndAE8,4572
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=vpMa6_1q8RsyZo1hCm8FOt5htbgiEW58LZ5EwkMu82s,20535
7
7
  scim2_client/engines/werkzeug.py,sha256=mszoQSneEH2SsewcG7Pq6hW-zFIeyreObFuO2K89ssc,12277
8
- scim2_client-0.6.0.dist-info/METADATA,sha256=vFPWc7J8NmtsibX_W-wZCvgRLMauHZX5lpCI4DxyCw4,16986
9
- scim2_client-0.6.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
10
- scim2_client-0.6.0.dist-info/licenses/LICENSE.md,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
11
- scim2_client-0.6.0.dist-info/RECORD,,
8
+ scim2_client-0.6.1.dist-info/METADATA,sha256=SVVX7EcdbqP_9jF9yS1CB2dsNrGidGKNctJAQ0U81Ws,16986
9
+ scim2_client-0.6.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
10
+ scim2_client-0.6.1.dist-info/licenses/LICENSE.md,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
11
+ scim2_client-0.6.1.dist-info/RECORD,,