Skip to content

Commit

Permalink
feat(MyPy): Endpoint annontations
Browse files Browse the repository at this point in the history
  • Loading branch information
650elx committed Oct 23, 2023
1 parent 3de5319 commit 2dd96ee
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions sinch/core/endpoint.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
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):
ENDPOINT_URL: str
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:
Expand All @@ -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

0 comments on commit 2dd96ee

Please sign in to comment.