Commit bb1320b9 authored by Michael Thies's avatar Michael Thies
Browse files

backend.couchdb: Improve docstrings and type hints

parent 6a49756a
Pipeline #369246 passed with stages
in 1 minute and 31 seconds
......@@ -40,8 +40,8 @@ class CouchDBBackend(backends.Backend):
"""
@classmethod
def update_object(cls,
updated_object: "Referable", # type: ignore
store_object: "Referable", # type: ignore
updated_object: model.Referable,
store_object: model.Referable,
relative_path: List[str]) -> None:
if not isinstance(store_object, model.Identifiable):
......@@ -61,8 +61,8 @@ class CouchDBBackend(backends.Backend):
@classmethod
def commit_object(cls,
committed_object: "Referable", # type: ignore
store_object: "Referable", # type: ignore
committed_object: model.Referable,
store_object: model.Referable,
relative_path: List[str]) -> None:
if not isinstance(store_object, model.Identifiable):
raise CouchDBSourceError("The given store_object is not Identifiable, therefore cannot be found "
......@@ -115,7 +115,7 @@ class CouchDBBackend(backends.Backend):
:param method: The HTTP method for the request
:param additional_headers: Additional headers to insert into the request. The default headers include
'connection: keep-alive', 'accept-encoding: ...', 'authorization: basic ...', 'Accept: ...'.
:param body: Request body for POST requests
:param body: Request body for POST, PUT, and PATCH requests
:return: The parsed JSON data if the request `method` is other than 'HEAD' or the response headers for 'HEAD'
requests
"""
......
......@@ -7,11 +7,11 @@ from aas.model import Referable
class ExampleBackend(backends.Backend):
@classmethod
def commit_object(cls, committed_object: "Referable", store_object: "Referable", relative_path: List[str]) -> None:
def commit_object(cls, committed_object: Referable, store_object: Referable, relative_path: List[str]) -> None:
raise NotImplementedError("This is a mock")
@classmethod
def update_object(cls, updated_object: "Referable", store_object: "Referable", relative_path: List[str]) -> None:
def update_object(cls, updated_object: Referable, store_object: Referable, relative_path: List[str]) -> None:
raise NotImplementedError("This is a mock")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment