-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
from mipac.types.app import IApp | ||
|
||
|
||
class App: | ||
def __init__(self, raw_app: IApp) -> None: | ||
self.__raw_app: IApp = raw_app | ||
|
||
@property | ||
def id(self) -> str: | ||
"""The id of the app""" | ||
return self.__raw_app["id"] | ||
|
||
@property | ||
def name(self) -> str: | ||
"""The name of the app""" | ||
return self.__raw_app["name"] | ||
|
||
@property | ||
def callback_url(self) -> str | None: | ||
"""The callback url of the app""" | ||
return self.__raw_app["callback_url"] | ||
|
||
@property | ||
def permission(self) -> list[str]: | ||
"""The permissions the app has""" | ||
return self.__raw_app["permission"] | ||
|
||
@property | ||
def secret(self) -> str: | ||
"""The secret of the app""" | ||
return self.__raw_app["secret"] | ||
|
||
@property | ||
def is_authorized(self) -> bool: | ||
"""If the app is authorized or not""" | ||
return self.__raw_app["is_authorized"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from typing import TypedDict | ||
|
||
|
||
class IApp(TypedDict): | ||
id: str | ||
name: str | ||
callback_url: str | None | ||
permission: list[str] | ||
secret: str | ||
is_authorized: bool |