projects/GetSetDataByID/getsetdatabyid.yml [22:61]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        table = ddb.Table(tb_name)    

        def expression_builder(params):
          exp = "set "
          exp_values = {}
          
          for key in params.keys():
            temp_key = ":{}".format(key)
            exp = exp + "{} = {},".format(key, temp_key)
            exp_values[temp_key] = params[key]
            
          return exp[:-1], exp_values
          

        def lambda_handler(event, context):
          print(event)

          now = int(time.time())
          params = event["Details"]["Parameters"] 
          key = params.pop('CustomerId', None)
          params["LastUpdateTime"] = now
          update_expression, update_expression_values = expression_builder(params)
          print(update_expression, update_expression_values)
          try:
            resp = table.update_item(
              Key={
                'CustomerId': key
              },
              UpdateExpression=update_expression,
              ExpressionAttributeValues = update_expression_values
            )

            return {"Success":"True"}
          except Exception as e:
            print(e)
            return {"Success":"False"}


      Policies:
        - DynamoDBCrudPolicy: 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



projects/LastAgentRouting/lastagentrouting.yml [22:61]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        table = ddb.Table(tb_name)    

        def expression_builder(params):
          exp = "set "
          exp_values = {}
          
          for key in params.keys():
            temp_key = ":{}".format(key)
            exp = exp + "{} = {},".format(key, temp_key)
            exp_values[temp_key] = params[key]
            
          return exp[:-1], exp_values
          

        def lambda_handler(event, context):
          print(event)

          now = int(time.time())
          params = event["Details"]["Parameters"] 
          key = params.pop('CustomerId', None)
          params["LastUpdateTime"] = now
          update_expression, update_expression_values = expression_builder(params)
          print(update_expression, update_expression_values)
          try:
            resp = table.update_item(
              Key={
                'CustomerId': key
              },
              UpdateExpression=update_expression,
              ExpressionAttributeValues = update_expression_values
            )

            return {"Success":"True"}
          except Exception as e:
            print(e)
            return {"Success":"False"}


      Policies:
        - DynamoDBCrudPolicy: 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



