Merge pull request #88 from alphagov/integrate_template_api

Mapped template actions to the api and mocked tests.
This commit is contained in:
Adam Shimali
2016-01-19 16:47:35 +00:00
13 changed files with 319 additions and 88 deletions

View File

@@ -83,6 +83,20 @@ class NotificationsAdminAPIClient(NotificationsAPIClient):
endpoint = "/service/{0}/template".format(service_id)
return self.post(endpoint, data)
def update_service_template(self, id_, name, type_, content, service_id):
"""
Update a service template.
"""
data = {
'id': id_,
'name': name,
'template_type': type_,
'content': content,
'service': service_id
}
endpoint = "/service/{0}/template/{1}".format(service_id, id_)
return self.put(endpoint, data)
def get_service_template(self, service_id, template_id, *params):
"""
Retrieve a service template.