Add form to set service broadcast account type

Note, no option at the moment to set the service broadcast account type
as None, or back to without the broadcast permission. This has been done
for speed of development given the chance of us needing this is very
low. We can add it later if we need to.
This commit is contained in:
David McDonald
2021-02-15 21:02:37 +00:00
parent 6837b76d44
commit f8f3d44511
12 changed files with 393 additions and 1 deletions

View File

@@ -616,5 +616,22 @@ class ServiceAPIClient(NotifyAdminAPIClient):
def get_returned_letters(self, service_id, reported_at):
return self.get("service/{}/returned-letters?reported_at={}".format(service_id, reported_at))
@cache.delete('service-{service_id}')
def set_service_broadcast_settings(
self, service_id, service_mode, broadcast_channel, provider_restriction
):
"""
service_mode is one of "training" or "live"
broadcast channel is one of "test" or "severe"
provider_restriction is one of None, "three", "o2", "vodafone", "ee"
"""
data = {
"service_mode": service_mode,
"broadcast_channel": broadcast_channel,
"provider_restriction": provider_restriction
}
return self.post("/service/{}/set-as-broadcast-service".format(service_id), data)
service_api_client = ServiceAPIClient()