Added get calls for service and templates, as this will be removed from client.

This commit is contained in:
Nicholas Staples
2016-01-19 10:23:08 +00:00
parent a9fead0d82
commit e2f5d64695

View File

@@ -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.