Skip to content

Commit 6264760

Browse files
committed
refactor: rename modules rfc7643 in resources and rfc7644 in messages
1 parent f6e20f0 commit 6264760

31 files changed

+84
-84
lines changed

doc/tutorial.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,9 @@ If a response resource type cannot be found, a ``pydantic.ValidationError`` will
204204
>>> response = ListResponse[Union[User, Group]].model_validate(payload)
205205
>>> user, group = response.resources
206206
>>> type(user)
207-
<class 'scim2_models.rfc7643.user.User'>
207+
<class 'scim2_models.resources.user.User'>
208208
>>> type(group)
209-
<class 'scim2_models.rfc7643.group.Group'>
209+
<class 'scim2_models.resources.group.Group'>
210210
211211
212212
Schema extensions

scim2_models/__init__.py

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -7,50 +7,50 @@
77
from .attributes import MultiValuedComplexAttribute
88
from .base import BaseModel
99
from .context import Context
10+
from .messages.bulk import BulkOperation
11+
from .messages.bulk import BulkRequest
12+
from .messages.bulk import BulkResponse
13+
from .messages.error import Error
14+
from .messages.list_response import ListResponse
15+
from .messages.message import Message
16+
from .messages.patch_op import PatchOp
17+
from .messages.patch_op import PatchOperation
18+
from .messages.search_request import SearchRequest
1019
from .reference import ExternalReference
1120
from .reference import Reference
1221
from .reference import URIReference
13-
from .rfc7643.enterprise_user import EnterpriseUser
14-
from .rfc7643.enterprise_user import Manager
15-
from .rfc7643.group import Group
16-
from .rfc7643.group import GroupMember
17-
from .rfc7643.resource import AnyExtension
18-
from .rfc7643.resource import AnyResource
19-
from .rfc7643.resource import Extension
20-
from .rfc7643.resource import Meta
21-
from .rfc7643.resource import Resource
22-
from .rfc7643.resource_type import ResourceType
23-
from .rfc7643.resource_type import SchemaExtension
24-
from .rfc7643.schema import Attribute
25-
from .rfc7643.schema import Schema
26-
from .rfc7643.service_provider_config import AuthenticationScheme
27-
from .rfc7643.service_provider_config import Bulk
28-
from .rfc7643.service_provider_config import ChangePassword
29-
from .rfc7643.service_provider_config import ETag
30-
from .rfc7643.service_provider_config import Filter
31-
from .rfc7643.service_provider_config import Patch
32-
from .rfc7643.service_provider_config import ServiceProviderConfig
33-
from .rfc7643.service_provider_config import Sort
34-
from .rfc7643.user import Address
35-
from .rfc7643.user import Email
36-
from .rfc7643.user import Entitlement
37-
from .rfc7643.user import GroupMembership
38-
from .rfc7643.user import Im
39-
from .rfc7643.user import Name
40-
from .rfc7643.user import PhoneNumber
41-
from .rfc7643.user import Photo
42-
from .rfc7643.user import Role
43-
from .rfc7643.user import User
44-
from .rfc7643.user import X509Certificate
45-
from .rfc7644.bulk import BulkOperation
46-
from .rfc7644.bulk import BulkRequest
47-
from .rfc7644.bulk import BulkResponse
48-
from .rfc7644.error import Error
49-
from .rfc7644.list_response import ListResponse
50-
from .rfc7644.message import Message
51-
from .rfc7644.patch_op import PatchOp
52-
from .rfc7644.patch_op import PatchOperation
53-
from .rfc7644.search_request import SearchRequest
22+
from .resources.enterprise_user import EnterpriseUser
23+
from .resources.enterprise_user import Manager
24+
from .resources.group import Group
25+
from .resources.group import GroupMember
26+
from .resources.resource import AnyExtension
27+
from .resources.resource import AnyResource
28+
from .resources.resource import Extension
29+
from .resources.resource import Meta
30+
from .resources.resource import Resource
31+
from .resources.resource_type import ResourceType
32+
from .resources.resource_type import SchemaExtension
33+
from .resources.schema import Attribute
34+
from .resources.schema import Schema
35+
from .resources.service_provider_config import AuthenticationScheme
36+
from .resources.service_provider_config import Bulk
37+
from .resources.service_provider_config import ChangePassword
38+
from .resources.service_provider_config import ETag
39+
from .resources.service_provider_config import Filter
40+
from .resources.service_provider_config import Patch
41+
from .resources.service_provider_config import ServiceProviderConfig
42+
from .resources.service_provider_config import Sort
43+
from .resources.user import Address
44+
from .resources.user import Email
45+
from .resources.user import Entitlement
46+
from .resources.user import GroupMembership
47+
from .resources.user import Im
48+
from .resources.user import Name
49+
from .resources.user import PhoneNumber
50+
from .resources.user import Photo
51+
from .resources.user import Role
52+
from .resources.user import User
53+
from .resources.user import X509Certificate
5454

5555
__all__ = [
5656
"Address",

scim2_models/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ def check_replacement_request_mutability(
273273
cls, value: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo
274274
) -> Self:
275275
"""Check if 'immutable' attributes have been mutated in replacement requests."""
276-
from scim2_models.rfc7643.resource import Resource
276+
from scim2_models.resources.resource import Resource
277277

278278
obj = handler(value)
279279
assert isinstance(obj, cls)
@@ -462,7 +462,7 @@ def get_attribute_urn(self, field_name: str) -> str:
462462
463463
See :rfc:`RFC7644 §3.10 <7644#section-3.10>`.
464464
"""
465-
from scim2_models.rfc7643.resource import Extension
465+
from scim2_models.resources.resource import Extension
466466

467467
main_schema = self.__class__.model_fields["schemas"].default[0]
468468
field = self.__class__.model_fields[field_name]
File renamed without changes.
File renamed without changes.
File renamed without changes.

scim2_models/rfc7644/list_response.py renamed to scim2_models/messages/list_response.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
from ..annotations import Required
1414
from ..context import Context
15-
from ..rfc7643.resource import AnyResource
15+
from ..resources.resource import AnyResource
1616
from .message import GenericMessageMetaclass
1717
from .message import Message
1818

scim2_models/rfc7644/message.py renamed to scim2_models/messages/message.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from pydantic import Tag
1111
from pydantic._internal._model_construction import ModelMetaclass
1212

13-
from scim2_models.rfc7643.resource import Resource
13+
from scim2_models.resources.resource import Resource
1414

1515
from ..base import BaseModel
1616
from ..scim_object import ScimObject

scim2_models/rfc7644/patch_op.py renamed to scim2_models/messages/patch_op.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from ..attributes import ComplexAttribute
1818
from ..base import BaseModel
1919
from ..context import Context
20-
from ..rfc7643.resource import Resource
20+
from ..resources.resource import Resource
2121
from ..urn import resolve_path_to_target
2222
from ..utils import extract_field_name
2323
from ..utils import find_field_name

0 commit comments

Comments
 (0)