scim2-models 0.2.10__py3-none-any.whl → 0.2.12__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_models/rfc7643/schema.py +14 -0
- scim2_models/rfc7644/search_request.py +14 -0
- {scim2_models-0.2.10.dist-info → scim2_models-0.2.12.dist-info}/METADATA +1 -1
- {scim2_models-0.2.10.dist-info → scim2_models-0.2.12.dist-info}/RECORD +6 -6
- {scim2_models-0.2.10.dist-info → scim2_models-0.2.12.dist-info}/WHEEL +0 -0
- {scim2_models-0.2.10.dist-info → scim2_models-0.2.12.dist-info}/licenses/LICENSE +0 -0
scim2_models/rfc7643/schema.py
CHANGED
|
@@ -238,6 +238,13 @@ class Attribute(ComplexAttribute):
|
|
|
238
238
|
|
|
239
239
|
return annotation, field
|
|
240
240
|
|
|
241
|
+
def get_attribute(self, attribute_name: str) -> Optional["Attribute"]:
|
|
242
|
+
"""Find an attribute by its name."""
|
|
243
|
+
for sub_attribute in self.sub_attributes or []:
|
|
244
|
+
if sub_attribute.name == attribute_name:
|
|
245
|
+
return sub_attribute
|
|
246
|
+
return None
|
|
247
|
+
|
|
241
248
|
|
|
242
249
|
class Schema(Resource):
|
|
243
250
|
schemas: Annotated[list[str], Required.true] = [
|
|
@@ -266,3 +273,10 @@ class Schema(Resource):
|
|
|
266
273
|
def urn_id(cls, value: str) -> str:
|
|
267
274
|
"""Ensure that schema ids are URI, as defined in RFC7643 §7."""
|
|
268
275
|
return str(Url(value))
|
|
276
|
+
|
|
277
|
+
def get_attribute(self, attribute_name: str) -> Optional[Attribute]:
|
|
278
|
+
"""Find an attribute by its name."""
|
|
279
|
+
for attribute in self.attributes or []:
|
|
280
|
+
if attribute.name == attribute_name:
|
|
281
|
+
return attribute
|
|
282
|
+
return None
|
|
@@ -76,3 +76,17 @@ class SearchRequest(Message):
|
|
|
76
76
|
)
|
|
77
77
|
|
|
78
78
|
return self
|
|
79
|
+
|
|
80
|
+
@property
|
|
81
|
+
def start_index_0(self):
|
|
82
|
+
"""The 0 indexed start index."""
|
|
83
|
+
return self.start_index - 1 if self.start_index is not None else None
|
|
84
|
+
|
|
85
|
+
@property
|
|
86
|
+
def stop_index_0(self):
|
|
87
|
+
"""The 0 indexed stop index."""
|
|
88
|
+
return (
|
|
89
|
+
self.start_index_0 + self.count
|
|
90
|
+
if self.start_index_0 is not None and self.count is not None
|
|
91
|
+
else None
|
|
92
|
+
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: scim2-models
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.12
|
|
4
4
|
Summary: SCIM2 models serialization and validation with pydantic
|
|
5
5
|
Project-URL: documentation, https://scim2-models.readthedocs.io
|
|
6
6
|
Project-URL: repository, https://github.com/python-scim/scim2-models
|
|
@@ -8,7 +8,7 @@ scim2_models/rfc7643/enterprise_user.py,sha256=EaxdHH2dcBrwWwGpaZC6iZ9dbcaVN1Npo
|
|
|
8
8
|
scim2_models/rfc7643/group.py,sha256=CBmSnlzd4JktCpOmg4XkfJJUd8oD6KbYFRTt0dSdixE,1302
|
|
9
9
|
scim2_models/rfc7643/resource.py,sha256=zMyk02Traoq6XNBcS_fSnXIOadZwxTdA9CV4vLuy38k,12648
|
|
10
10
|
scim2_models/rfc7643/resource_type.py,sha256=p8IKV5IakPMBX6d2Fv2MFqaQL5iTw152vmozVVSC8gU,3196
|
|
11
|
-
scim2_models/rfc7643/schema.py,sha256=
|
|
11
|
+
scim2_models/rfc7643/schema.py,sha256=aC4wUNBdZ8USpvhCGyGQ97T40VhrL1Pl3VnB3zS1PfE,9929
|
|
12
12
|
scim2_models/rfc7643/service_provider_config.py,sha256=deMNCXlqiNzuLcVRN9mdHiTUxhczDnvi-oO6k-Anj8U,5402
|
|
13
13
|
scim2_models/rfc7643/user.py,sha256=-wlO2IC0MxFWUJpaddEwAG5LsEcORnbHfkRwGG3fVSk,9942
|
|
14
14
|
scim2_models/rfc7644/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -17,8 +17,8 @@ scim2_models/rfc7644/error.py,sha256=l4-vtGQYm5u13-ParhbHSeqXEil0E09QXSO9twAT3SU
|
|
|
17
17
|
scim2_models/rfc7644/list_response.py,sha256=Zh8Od2iOd3kinwLP-PHQMEbfM1tdl111Qap9DR8DHc4,4251
|
|
18
18
|
scim2_models/rfc7644/message.py,sha256=F4kPqbHAka3-wZzap9a45noQZw-o1vznTJypNABBF7w,253
|
|
19
19
|
scim2_models/rfc7644/patch_op.py,sha256=OE-ixDanTkY5zQP7EK7OAp88uE_fMk03mqmaZHxgJ-g,2210
|
|
20
|
-
scim2_models/rfc7644/search_request.py,sha256=
|
|
21
|
-
scim2_models-0.2.
|
|
22
|
-
scim2_models-0.2.
|
|
23
|
-
scim2_models-0.2.
|
|
24
|
-
scim2_models-0.2.
|
|
20
|
+
scim2_models/rfc7644/search_request.py,sha256=X3DZQOtLu8EWYvkNfNOcFlGtx3TGNEkpL59dAdut7Sc,3006
|
|
21
|
+
scim2_models-0.2.12.dist-info/METADATA,sha256=ifbETwkgl1cZNInG66HBGtJW4ANs_WpvtxZQ9__yAXE,16267
|
|
22
|
+
scim2_models-0.2.12.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
|
23
|
+
scim2_models-0.2.12.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
24
|
+
scim2_models-0.2.12.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|