@@ -37,30 +37,30 @@ def __init__(self):
3737 self .models_dict : dict [str , BaseModel ] = {}
3838
3939 def __enter__ (self ):
40- """Allows the backend to be used as a context manager.
40+ """Allow the backend to be used as a context manager.
4141
4242 This enables support for transactions.
4343 """
4444 return self
4545
4646 def __exit__ (self , exc_type , exc_val , exc_tb ):
47- """Exits the transaction."""
47+ """Exit the transaction."""
4848 pass
4949
5050 def register_schema (self , schema : Schema ):
51- """Registers a Schema for use with the backend."""
51+ """Register a Schema for use with the backend."""
5252 self .schemas [schema .id ] = schema
5353
5454 def get_schemas (self ):
55- """Returns all schemas registered with the backend."""
55+ """Return all schemas registered with the backend."""
5656 return self .schemas .values ()
5757
5858 def get_schema (self , schema_id : str ) -> Schema | None :
59- """Gets a schema by its id."""
59+ """Get a schema by its id."""
6060 return self .schemas .get (schema_id )
6161
6262 def register_resource_type (self , resource_type : ResourceType ):
63- """Registers a ResourceType for use with the backend.
63+ """Register a ResourceType for use with the backend.
6464
6565 The schemas used for the resource and its extensions must have
6666 been registered with the Backend beforehand.
@@ -86,31 +86,31 @@ def register_resource_type(self, resource_type: ResourceType):
8686 ]
8787
8888 def get_resource_types (self ):
89- """Returns all resource types registered with the backend."""
89+ """Return all resource types registered with the backend."""
9090 return self .resource_types .values ()
9191
9292 def get_resource_type (self , resource_type_id : str ) -> ResourceType | None :
93- """Returns the resource type by its id."""
93+ """Return the resource type by its id."""
9494 return self .resource_types .get (resource_type_id )
9595
9696 def get_resource_type_by_endpoint (self , endpoint : str ) -> ResourceType | None :
97- """Returns the resource type by its endpoint."""
97+ """Return the resource type by its endpoint."""
9898 return self .resource_types_by_endpoint .get (endpoint .lower ())
9999
100100 def get_model (self , resource_type_id : str ) -> BaseModel | None :
101- """Returns the Pydantic Python model for a given resource type."""
101+ """Return the Pydantic Python model for a given resource type."""
102102 return self .models_dict .get (resource_type_id )
103103
104104 def get_models (self ):
105- """Returns all Pydantic Python models for all known resource types."""
105+ """Return all Pydantic Python models for all known resource types."""
106106 return self .models_dict .values ()
107107
108108 def query_resources (
109109 self ,
110110 search_request : SearchRequest ,
111111 resource_type_id : str | None = None ,
112112 ) -> tuple [int , list [Resource ]]:
113- """Queries the backend for a set of resources.
113+ """Query the backend for a set of resources.
114114
115115 :param search_request: SearchRequest instance describing the
116116 query.
@@ -128,7 +128,7 @@ def query_resources(
128128 raise NotImplementedError
129129
130130 def get_resource (self , resource_type_id : str , object_id : str ) -> Resource | None :
131- """Queries the backend for a resources by its ID.
131+ """Query the backend for a resources by its ID.
132132
133133 :param resource_type_id: ID of the resource type to get the
134134 object from.
@@ -140,7 +140,7 @@ def get_resource(self, resource_type_id: str, object_id: str) -> Resource | None
140140 raise NotImplementedError
141141
142142 def delete_resource (self , resource_type_id : str , object_id : str ) -> bool :
143- """Deletes a resource.
143+ """Delete a resource.
144144
145145 :param resource_type_id: ID of the resource type to delete the
146146 object from.
@@ -152,7 +152,7 @@ def delete_resource(self, resource_type_id: str, object_id: str) -> bool:
152152 def create_resource (
153153 self , resource_type_id : str , resource : Resource
154154 ) -> Resource | None :
155- """Creates a resource.
155+ """Create a resource.
156156
157157 :param resource_type_id: ID of the resource type to create.
158158 :param resource: Resource to create.
@@ -165,7 +165,7 @@ def create_resource(
165165 def update_resource (
166166 self , resource_type_id : str , resource : Resource
167167 ) -> Resource | None :
168- """Updates a resource. The resource is identified by its ID.
168+ """Update a resource. The resource is identified by its ID.
169169
170170 :param resource_type_id: ID of the resource type to update.
171171 :param resource: Resource to update.
@@ -177,7 +177,7 @@ def update_resource(
177177
178178
179179class InMemoryBackend (Backend ):
180- """This is an example in-memory backend for the SCIM provider.
180+ """An example in-memory backend for the SCIM provider.
181181
182182 It is not optimized for performance. Many operations are O(n) or
183183 worse, whereas they would perform better with an actual production
0 commit comments