Allow a platform admin user to set flexible data retention for a service for a specified notification type.

Still a work in progress
This commit is contained in:
Rebecca Law
2018-07-13 16:47:26 +01:00
parent c4b5e0c4b6
commit 13d05c5461
4 changed files with 67 additions and 0 deletions

View File

@@ -480,3 +480,23 @@ class ServiceAPIClient(NotifyAdminAPIClient):
"updated_by_id": user_id
}
return self.post("/service/{}/delivery-receipt-api".format(service_id), data)
def create_service_data_retention(self, service_id, notification_type, days_of_retention):
data = {
"notification_type": notification_type,
"days_of_retention": days_of_retention
}
return self.post("/service/{}/data-retention".format(service_id), data)
def update_service_data_retention(self, service_id, data_retention_id, days_of_retention):
data = {
"days_of_retention": days_of_retention
}
return self.post("/service/{}/data-retention/{}".format(service_id, data_retention_id), data)
def get_service_data_retention(self, service_id):
return self.get("/service/{}/data-retention".format(service_id))
def get_service_data_retention_by_id(self, service_id, data_retention_id):
return self.get("service/{}/data-retention/{}".format(service_id, data_retention_id))