in CBHelper-scheduleCall/lambda_function.py [0:0]
def add_to_queue(phone, wakeTime,contactId, table):
dynamodb = boto3.resource('dynamodb')
table = dynamodb.Table(table)
try:
response = table.update_item(
Key={
'phoneNumber': phone
},
UpdateExpression='SET #item = :newState, #item2 = :newState2',
ExpressionAttributeNames={
'#item': 'contactId',
'#item2': 'wakeTime',
},
ExpressionAttributeValues={
':newState': contactId,
':newState2': str(wakeTime),
},
ReturnValues="UPDATED_NEW")
print (response)
except Exception as e:
print (e)
else:
return response