-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Webhook create and delete API (#108)
* webhook api added * indentation fixed * indentaion fixed * minor fix * Fields get API (#109) * Fields get API * added timeoff instead of fields and tested
- Loading branch information
1 parent
2a729af
commit 100ce17
Showing
4 changed files
with
58 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from .api_base import ApiBase | ||
|
||
class TimeOff(ApiBase): | ||
CHECK_URL = '/v1/meta/time_off/types/' | ||
|
||
def get(self): | ||
""" | ||
Get method to get the different fields, | ||
used here for checking connection. | ||
Returns: | ||
""" | ||
return self._get_request(self.CHECK_URL) |
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,22 @@ | ||
from .api_base import ApiBase | ||
|
||
|
||
class Webhook(ApiBase): | ||
""" Class for webhook APIs for bamboohr """ | ||
|
||
POST_WEBHOOK = '/v1/webhooks/' | ||
DELETE_WEBHOOK = '/v1/webhooks/{}' | ||
|
||
def post(self, payload): | ||
""" | ||
Post webhook url to bamboohr for employee update or create | ||
Returns: | ||
""" | ||
return self._post_request(self.POST_WEBHOOK, payload) | ||
|
||
def delete(self, id): | ||
""" | ||
Delete Webhook | ||
Returns: | ||
""" | ||
return self._delete_request(self.DELETE_WEBHOOK.format(id)) |
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