mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-31 23:26:23 -05:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user