From e2f5d646956ad420388195eabb6fc8c0722e6afd Mon Sep 17 00:00:00 2001 From: Nicholas Staples Date: Tue, 19 Jan 2016 10:23:08 +0000 Subject: [PATCH] Added get calls for service and templates, as this will be removed from client. --- app/notify_client/api_client.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/app/notify_client/api_client.py b/app/notify_client/api_client.py index 5a4a60dd4..50217721b 100644 --- a/app/notify_client/api_client.py +++ b/app/notify_client/api_client.py @@ -36,6 +36,19 @@ class NotificationsAdminAPIClient(NotificationsAPIClient): endpoint = "/service/{0}".format(service_id) return self.delete(endpoint) + def get_service(self, service_id, *params): + """ + Retrieve a service. + """ + return self.get( + '/service/{0}'.format(service_id)) + + def get_services(self, *params): + """ + Retrieve a list of services. + """ + return self.get('/service', *params) + def update_service(self, service_id, service_name, @@ -70,6 +83,23 @@ class NotificationsAdminAPIClient(NotificationsAPIClient): endpoint = "/service/{0}/template".format(service_id) return self.post(endpoint, data) + def get_service_template(self, service_id, template_id, *params): + """ + Retrieve a service template. + """ + endpoint = '/service/{service_id}/template/{template_id}'.format( + service_id=service_id, + template_id=template_id) + return self.get(endpoint, *params) + + def get_service_templates(self, service_id, *params): + """ + Retrieve all templates for service. + """ + endpoint = '/service/{service_id}/template'.format( + service_id=service_id) + return self.get(endpoint, *params) + def delete_service_template(self, service_id, template_id): """ Delete a service template.