clients: cbc_proxy actions accepts areas param

related:
https://github.com/alphagov/notifications-broadcasts-infra/pull/23

Signed-off-by: Toby Lorne <toby.lornewelch-richards@digital.cabinet-office.gov.uk>
This commit is contained in:
Toby Lorne
2020-10-23 16:44:11 +01:00
parent d9ceed55b5
commit aa002afd31
4 changed files with 72 additions and 6 deletions

View File

@@ -9,6 +9,10 @@ import boto3
# headline is a field which we are not sure if we will use
#
# description is the body of the message
# areas is a list of dicts, with the following items
# * description is a string which populates the areaDesc field
# * polygon is a list of lat/long pairs
#
# references is a whitespace separated list of message identifiers
# where each identifier is a previous sent message
@@ -24,21 +28,21 @@ class CBCProxyNoopClient:
def create_and_send_broadcast(
self,
identifier, headline, description,
identifier, headline, description, areas
):
pass
# We have not implementated updating a broadcast
def update_and_send_broadcast(
self,
identifier, references, headline, description,
identifier, references, headline, description, areas
):
pass
# We have not implemented cancelling a broadcast
def cancel_broadcast(
self,
identifier, references, headline, description,
identifier, references, headline, description, areas
):
pass
@@ -55,12 +59,13 @@ class CBCProxyClient:
def create_and_send_broadcast(
self,
identifier, headline, description,
identifier, headline, description, areas,
):
payload_bytes = bytes(json.dumps({
'identifier': identifier,
'headline': headline,
'description': description,
'areas': areas,
}), encoding='utf8')
result = self._lambda_client.invoke(
@@ -78,13 +83,13 @@ class CBCProxyClient:
# We have not implementated updating a broadcast
def update_and_send_broadcast(
self,
identifier, references, headline, description,
identifier, references, headline, description, areas,
):
pass
# We have not implemented cancelling a broadcast
def cancel_broadcast(
self,
identifier, references, headline, description,
identifier, references, headline, description, areas,
):
pass