You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by bo...@apache.org on 2022/12/31 13:54:30 UTC

[streampipes] branch chore/generalize-endpoint created (now ff05c09ab)

This is an automated email from the ASF dual-hosted git repository.

bossenti pushed a change to branch chore/generalize-endpoint
in repository https://gitbox.apache.org/repos/asf/streampipes.git


      at ff05c09ab introduce another layer of abstraction for endpoints

This branch includes the following new commits:

     new ff05c09ab introduce another layer of abstraction for endpoints

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[streampipes] 01/01: introduce another layer of abstraction for endpoints

Posted by bo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

bossenti pushed a commit to branch chore/generalize-endpoint
in repository https://gitbox.apache.org/repos/asf/streampipes.git

commit ff05c09ab59c89d866503a1f2a153715ec3cfb26
Author: bossenti <bo...@posteo.de>
AuthorDate: Sat Dec 31 14:54:18 2022 +0100

    introduce another layer of abstraction for endpoints
    
    Signed-off-by: bossenti <bo...@posteo.de>
---
 .../streampipes_client/endpoint/endpoint.py            | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/streampipes-client-python/streampipes_client/endpoint/endpoint.py b/streampipes-client-python/streampipes_client/endpoint/endpoint.py
index 708f6c609..911cb8ab1 100644
--- a/streampipes-client-python/streampipes_client/endpoint/endpoint.py
+++ b/streampipes-client-python/streampipes_client/endpoint/endpoint.py
@@ -56,9 +56,9 @@ _error_code_to_message = {
 }
 
 
-class APIEndpoint(ABC):
-    """Abstract implementation of an API endpoint.
-    Serves as template for all endpoints for the StreamPipes API.
+class Endpoint(ABC):
+    """Abstract implementation of an StreamPipes endpoint.
+    Serves as template for all endpoints used for interaction with a StreamPipes instance.
     By design, endpoints are only instantiated within the `__init__` method of the StreamPipesClient.
 
     Parameters
@@ -85,6 +85,18 @@ class APIEndpoint(ABC):
         """
         raise NotImplementedError  # pragma: no cover
 
+
+class APIEndpoint(Endpoint):
+    """Abstract implementation of an API endpoint.
+    Serves as template for all endpoints for the StreamPipes API.
+    By design, endpoints are only instantiated within the `__init__` method of the StreamPipesClient.
+
+    Parameters
+    ----------
+    parent_client: StreamPipesClient
+        This parameter expects the instance of the `client.StreamPipesClient` the endpoint is attached to.
+    """
+
     @property
     @abstractmethod
     def _relative_api_path(self) -> Tuple[str, ...]: