mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-16 20:49:00 -04:00
added new api for month, by year, previous 7 day stats
This commit is contained in:
@@ -43,6 +43,24 @@ class ServiceAPIClient(NotifyAdminAPIClient):
|
||||
params={"limit_days": limit_days},
|
||||
)["data"]
|
||||
|
||||
def get_service_notification_statistics_by_day(self, service_id, start_date=None, days=None):
|
||||
if start_date is None:
|
||||
start_date = datetime.now().strftime('%Y-%m-%d')
|
||||
|
||||
return self.get(
|
||||
"/service/{0}/statistics/{1}/{2}".format(service_id, start_date, days),
|
||||
)["data"]
|
||||
|
||||
def get_single_month_notification_stats(self, service_id, year, month):
|
||||
return self.get(
|
||||
"/service/{0}/notifications/month?year={1}&month={2}".format(service_id, year, month),
|
||||
)
|
||||
|
||||
# def get_single_month_notification_stats(self, service_id, user_id, year, month):
|
||||
# return self.get(
|
||||
# "/service/{0}/notifications/<uuid:user_id>/month?year={1}&month={2}".format(service_id, user_id, year, month),
|
||||
# )
|
||||
|
||||
def get_services(self, params_dict=None):
|
||||
"""
|
||||
Retrieve a list of services.
|
||||
|
||||
Reference in New Issue
Block a user