From 2dd96ee65ecc6ab61fab0243821e0a06bb0a4c92 Mon Sep 17 00:00:00 2001 From: 650elx Date: Mon, 23 Oct 2023 16:04:48 +0200 Subject: [PATCH] feat(MyPy): Endpoint annontations --- sinch/core/endpoint.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/sinch/core/endpoint.py b/sinch/core/endpoint.py index e5b0889..0b36d4e 100644 --- a/sinch/core/endpoint.py +++ b/sinch/core/endpoint.py @@ -1,6 +1,12 @@ from abc import ABC, abstractmethod from sinch.core.models.http_response import HTTPResponse +from sinch.core.models.http_request import HttpRequest +from sinch.core.models.base_model import SinchBaseModel from sinch.core.enums import HTTPAuthentication, HTTPMethod +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from sinch.core.clients.sinch_client_base import ClientBase class HTTPEndpoint(ABC): @@ -8,10 +14,10 @@ class HTTPEndpoint(ABC): HTTP_METHOD: HTTPMethod HTTP_AUTHENTICATION: HTTPAuthentication - def __init__(self, project_id, request_data): + def __init__(self, project_id: str, request_data: 'HttpRequest'): pass - def build_url(self, sinch) -> str: + def build_url(self, sinch: 'ClientBase') -> str: return '' def build_query_params(self) -> dict: @@ -21,5 +27,5 @@ def request_body(self) -> dict: return {} @abstractmethod - def handle_response(self, response: HTTPResponse): + def handle_response(self, response: HTTPResponse) -> SinchBaseModel: pass