Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make oAuth client related parameters optional #22

Merged
merged 8 commits into from
Mar 12, 2024
11 changes: 6 additions & 5 deletions sinch/core/clients/sinch_client_async.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from logging import Logger
from sinch.core.clients.sinch_client_base import ClientBase
from sinch.core.clients.sinch_client_configuration import Configuration
from sinch.core.token_manager import TokenManagerAsync
Expand All @@ -17,11 +18,11 @@ class ClientAsync(ClientBase):
"""
def __init__(
self,
key_id,
key_secret,
project_id,
logger_name=None,
logger=None,
key_id: str = None,
key_secret: str = None,
project_id: str = None,
logger_name: str = None,
logger: Logger = None,
application_key: str = None,
application_secret: str = None
):
Expand Down
13 changes: 7 additions & 6 deletions sinch/core/clients/sinch_client_base.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from logging import Logger
from abc import ABC, abstractmethod
from sinch.core.clients.sinch_client_configuration import Configuration
from sinch.domains.authentication import AuthenticationBase
Expand All @@ -21,15 +22,15 @@ class ClientBase(ABC):
@abstractmethod
def __init__(
self,
key_id,
key_secret,
project_id,
logger_name=None,
logger=None,
key_id: str = None,
key_secret: str = None,
project_id: str = None,
logger_name: str = None,
logger: Logger = None,
application_key: str = None,
application_secret: str = None
):
pass

def __repr__(self):
return f"Sinch SDK client for project_id: {self.configuration.project_id}"
return "Sinch SDK client"
3 changes: 2 additions & 1 deletion sinch/core/clients/sinch_client_configuration.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import logging
from logging import Logger
from typing import Union

from sinch.core.ports.http_transport import HTTPTransport
Expand All @@ -16,7 +17,7 @@ def __init__(
project_id: str,
transport: HTTPTransport,
token_manager: Union[TokenManager, TokenManagerAsync],
logger=None,
logger: Logger = None,
logger_name: str = None,
disable_https=False,
connection_timeout=10,
Expand Down
11 changes: 6 additions & 5 deletions sinch/core/clients/sinch_client_sync.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from logging import Logger
from sinch.core.clients.sinch_client_base import ClientBase
from sinch.core.clients.sinch_client_configuration import Configuration
from sinch.core.token_manager import TokenManager
Expand All @@ -17,11 +18,11 @@ class Client(ClientBase):
"""
def __init__(
self,
key_id,
key_secret,
project_id,
logger_name=None,
logger=None,
key_id: str = None,
key_secret: str = None,
project_id: str = None,
logger_name: str = None,
logger: Logger = None,
application_key: str = None,
application_secret: str = None
):
Expand Down
Loading