diff --git a/README.md b/README.md index dcc5c53..022866a 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,9 @@ import trustcafeapiwrapper, os API = trustcafeapiwrapper.APIClient( client_id=os.getenv("client_id"), - client_secret=os.getenv("client_secret") + client_secret=os.getenv("client_secret"), + env="alpha" # alpha | production. + debug=False ) profile = API.run_job('userprofile.get', "simon-little") diff --git a/documentation.md b/documentation.md index 36027e5..6363b30 100644 --- a/documentation.md +++ b/documentation.md @@ -90,7 +90,31 @@ print(postlist) ## mute ## notifcation ### `listnotifications` +```python +API.run_job('notification.listnotifications') +``` +### `markallasread` +```python +API.run_job('notification.markallasread') +``` ## post +### create +```python +API.run_job('post.create', { + "postText": "This is a test post created via the API wrapper.", + "parent": { + "pk": "maintrunk#maintrunk", + "sk": "maintrunk#maintrunk" + } +}) +``` +### get +### listall +### listbybranch +### listbyuserprofile +### listpublic +### listremove +### update ## reaction ## trust ## userprofile diff --git a/pyproject.toml b/pyproject.toml index 95e3b1d..9fb9206 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "trustcafeapiwrapper" -version = "0.1.0.7" +version = "0.1.0.8" description = "Wraps the Trust Cafe API" readme = "README.md" requires-python = ">=3.13" diff --git a/src/trustcafeapiwrapper/jobs/notification/__init__.py b/src/trustcafeapiwrapper/jobs/notification/__init__.py index 30c1ec2..a95c165 100644 --- a/src/trustcafeapiwrapper/jobs/notification/__init__.py +++ b/src/trustcafeapiwrapper/jobs/notification/__init__.py @@ -1 +1,2 @@ -from .listnotifications import listnotifications \ No newline at end of file +from .listnotifications import listnotifications +from .markallasread import markallasread \ No newline at end of file diff --git a/src/trustcafeapiwrapper/jobs/notification/markallasread.py b/src/trustcafeapiwrapper/jobs/notification/markallasread.py new file mode 100644 index 0000000..e70bf66 --- /dev/null +++ b/src/trustcafeapiwrapper/jobs/notification/markallasread.py @@ -0,0 +1,8 @@ +def markallasread(API): + """ + Mark all notifications as read. + + Returns: + + """ + API.make_request("POST", "megaphone", "inbox/markallread", authenticate=True) \ No newline at end of file diff --git a/testing.py b/testing.py index 57f2ab5..ef2be5f 100644 --- a/testing.py +++ b/testing.py @@ -138,6 +138,7 @@ def save_response(response): # x += 1 # save_response(API.run_job('notification.listnotifications')) +save_response(API.run_job('notification.markallasread')) # save_response(API.run_job('feed.cafefeed')) @@ -149,7 +150,7 @@ def save_response(response): # })) # save_response(API.run_job('post.listall')) -save_response(API.run_job('post.listpublic')) +# save_response(API.run_job('post.listpublic')) # from trustcafeapiwrapper.wrappers.post.create_post import create_post