You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: scim2_models/base.py
+28Lines changed: 28 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -278,13 +278,40 @@ class Context(Enum):
278
278
- not dump attributes annotated with :attr:`~scim2_models.Returned.request` unless they are explicitly included.
279
279
"""
280
280
281
+
RESOURCE_PATCH_REQUEST=auto()
282
+
"""The resource patch request context.
283
+
284
+
Should be used for clients building a payload for a PATCH request,
285
+
and servers validating PATCH request payloads.
286
+
287
+
- When used for serialization, it will not dump attributes annotated with :attr:`~scim2_models.Mutability.read_only`.
288
+
- When used for validation, it will raise a :class:`~pydantic.ValidationError`:
289
+
- when finding attributes annotated with :attr:`~scim2_models.Mutability.read_only`,
290
+
- when attributes annotated with :attr:`Required.true <scim2_models.Required.true>` are missing or null.
291
+
"""
292
+
293
+
RESOURCE_PATCH_RESPONSE=auto()
294
+
"""The resource patch response context.
295
+
296
+
Should be used for servers building a payload for a PATCH response,
297
+
and clients validating patch response payloads.
298
+
299
+
- When used for validation, it will raise a :class:`~pydantic.ValidationError` when finding attributes annotated with :attr:`~scim2_models.Returned.never` or when attributes annotated with :attr:`~scim2_models.Returned.always` are missing or :data:`None`;
300
+
- When used for serialization, it will:
301
+
- always dump attributes annotated with :attr:`~scim2_models.Returned.always`;
302
+
- never dump attributes annotated with :attr:`~scim2_models.Returned.never`;
303
+
- dump attributes annotated with :attr:`~scim2_models.Returned.default` unless they are explicitly excluded;
304
+
- not dump attributes annotated with :attr:`~scim2_models.Returned.request` unless they are explicitly included.
0 commit comments