-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #51 from shaurya-blip/master
Added Notification Resource to the package.
- Loading branch information
Showing
7 changed files
with
56 additions
and
6 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
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
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
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
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,14 @@ | ||
from monday.resources.base import BaseResource | ||
from monday.query_joins import create_notification_query | ||
|
||
|
||
class NotificationResource(BaseResource): | ||
def __init__(self, token): | ||
super().__init__(token) | ||
|
||
def create_notification(self, user_id, target_id, text, target_type): | ||
""" | ||
Refer to here for more information -> https://api.developer.monday.com/docs/notification-queries | ||
""" | ||
query = create_notification_query(user_id, target_id, text, target_type) | ||
return self.client.execute(query) |
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
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,15 @@ | ||
from monday.tests.test_case_resource import BaseTestCase | ||
from monday.query_joins import create_notification_query | ||
|
||
|
||
class NotificationsTestCase(BaseTestCase): | ||
def setUp(self): | ||
super(NotificationsTestCase, self).setUp() | ||
|
||
def test_create_notification_query(self): | ||
query = create_notification_query(self.user_ids[0], self.item_id, self.notification_text, self.notification_target_type) | ||
self.assertIn(str(self.user_ids[0]), query) | ||
self.assertIn(str(self.item_id), query) | ||
self.assertIn(str(self.notification_text), query) | ||
self.assertIn(str(self.notification_target_type), query) | ||
|