def writeToDynamoDB()

in associated-press/app/config/AWS.scala [56:81]


  def writeToDynamoDB(
      table: String,
      keyName: String,
      keyValue: String,
      content: String
  ): Try[UpdateItemResponse] = {
    Try {
      dynamoDbClient.updateItem(
        UpdateItemRequest
          .builder()
          .tableName(table)
          .key(
            Map(keyName -> AttributeValue.builder().s(keyValue).build()).asJava
          )
          .attributeUpdates(
            Map(
              keyValue -> AttributeValueUpdate
                .builder()
                .value(AttributeValue.builder().s(content).build())
                .build()
            ).asJava
          )
          .build()
      )
    }
  }