Notifications
This commit is contained in:
parent
c5d074d178
commit
9b4943c4d5
5 changed files with 16 additions and 2 deletions
|
|
@ -7,8 +7,10 @@ from pydantic import (
|
||||||
)
|
)
|
||||||
endpoints = {
|
endpoints = {
|
||||||
"alpha": {
|
"alpha": {
|
||||||
|
"audrey": "https://eso1of8gqd.execute-api.us-east-1.amazonaws.com/alpha/",
|
||||||
"auth": "https://oo0wks9pbi.execute-api.us-east-1.amazonaws.com/alpha/",
|
"auth": "https://oo0wks9pbi.execute-api.us-east-1.amazonaws.com/alpha/",
|
||||||
"content": "https://w1yygdhayc.execute-api.us-east-1.amazonaws.com/alpha/",
|
"content": "https://w1yygdhayc.execute-api.us-east-1.amazonaws.com/alpha/",
|
||||||
|
"megaphone": "https://opdhjaktnl.execute-api.us-east-1.amazonaws.com/alpha/",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
class APIClient(BaseModel):
|
class APIClient(BaseModel):
|
||||||
|
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
from .userprofile import get
|
|
||||||
1
jobs/notification/__init__.py
Normal file
1
jobs/notification/__init__.py
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
from .listnotifications import listnotifications
|
||||||
9
jobs/notification/listnotifications.py
Normal file
9
jobs/notification/listnotifications.py
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
def listnotifications(API):
|
||||||
|
"""
|
||||||
|
List all of a token's user's notifications.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
A list of notifications.
|
||||||
|
"""
|
||||||
|
notifications = API.make_request("GET", "megaphone", "inbox/notifications", authenticate=True)
|
||||||
|
return notifications
|
||||||
|
|
@ -14,7 +14,7 @@ if not os.getenv("client_id") or not os.getenv("client_secret"):
|
||||||
API = APIClient(
|
API = APIClient(
|
||||||
client_id=os.getenv("client_id"),
|
client_id=os.getenv("client_id"),
|
||||||
client_secret=os.getenv("client_secret"),
|
client_secret=os.getenv("client_secret"),
|
||||||
debug=True
|
debug=False
|
||||||
)
|
)
|
||||||
|
|
||||||
# Keep a token cache to avoid unnecessary sign-ins during development.
|
# Keep a token cache to avoid unnecessary sign-ins during development.
|
||||||
|
|
@ -98,3 +98,6 @@ if not API.is_token_valid():
|
||||||
# print(post)
|
# print(post)
|
||||||
# x += 1
|
# x += 1
|
||||||
# print("-----------------------------")
|
# print("-----------------------------")
|
||||||
|
notifications = API.run_job('notification.listnotifications')
|
||||||
|
print(notifications)
|
||||||
|
print("-----------------------------")
|
||||||
Loading…
Add table
Add a link
Reference in a new issue