in api/wheel_participant.py [0:0]
def rig_participant(event):
"""
Rig the specified wheel for the specified participant. Default behavior is comical rigging (hidden == False)
but hidden can be specified to indicate deceptive rigging (hidden == True)
:param event: Lambda event containing the API Gateway request path parameters wheel_id and participant_id
{
"pathParameters":
{
"wheel_id": string ID of the wheel to rig (DDB Hash Key)
"participant_id": string ID of the participant to rig (DDB Hash Key)
},
"body":
{
"hidden": boolean indicates deceptive rigging if True, comical if False
}
}
:return: response dictionary
"""
# By default, rigging the wheel isn't hidden but they can be
wheel_id = event['pathParameters']['wheel_id']
participant_id = event['pathParameters']['participant_id']
hidden = bool(event['body'].get('hidden', False))
update = {'rigging': {'participant_id': participant_id, 'hidden': hidden}}
Wheel.update_item(Key={'id': wheel_id}, **to_update_kwargs(update))