prepare session management from C#
This commit is contained in:
parent
7975ac44cf
commit
bb562d1aa6
@ -1,3 +0,0 @@
|
|||||||
from delta_barth.errors import STATUS_HANDLER
|
|
||||||
|
|
||||||
__all__ = ["STATUS_HANDLER"]
|
|
||||||
31
src/delta_barth/management.py
Normal file
31
src/delta_barth/management.py
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
"""module to wrap the session management in function calls to easily interact
|
||||||
|
with the current session from C#"""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from typing import Final
|
||||||
|
|
||||||
|
from delta_barth.api.common import Session
|
||||||
|
from delta_barth.constants import HTTP_BASE_CONTENT_HEADERS
|
||||||
|
|
||||||
|
SESSION: Final[Session] = Session(HTTP_BASE_CONTENT_HEADERS)
|
||||||
|
|
||||||
|
|
||||||
|
def set_credentials(
|
||||||
|
user_name: str,
|
||||||
|
password: str,
|
||||||
|
database: str,
|
||||||
|
mandant: str,
|
||||||
|
) -> None:
|
||||||
|
SESSION.set_credentials(
|
||||||
|
user_name=user_name,
|
||||||
|
password=password,
|
||||||
|
database=database,
|
||||||
|
mandant=mandant,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def set_base_url(
|
||||||
|
base_url: str,
|
||||||
|
) -> None:
|
||||||
|
SESSION.set_base_url(base_url=base_url)
|
||||||
Loading…
x
Reference in New Issue
Block a user