fix compilation

This commit is contained in:
Will Freeman
2025-06-01 20:49:50 -06:00
parent 9101c375c9
commit 2a8e2467db
2 changed files with 9 additions and 87 deletions

View File

@@ -1,77 +0,0 @@
package services
import software.amazon.awssdk.auth.credentials.DefaultCredentialsProvider
import software.amazon.awssdk.regions.Region
import software.amazon.awssdk.services.dynamodb.DynamoDbClient
import software.amazon.awssdk.services.dynamodb.model._
import scala.concurrent.{ExecutionContext, Future}
import scala.collection.JavaConverters._
import scala.util.Try
class DynamoDBClient(region: Region = Region.US_EAST_1)(implicit ec: ExecutionContext) {
// Create the base DynamoDB client
private val dynamoDbClient = DynamoDbClient.builder()
.region(region)
.credentialsProvider(DefaultCredentialsProvider.create())
.build()
// Get an item using the standard client
private def getItem(tableName: String, key: java.util.Map[String, AttributeValue]): Future[Option[java.util.Map[String, AttributeValue]]] = Future {
val request = GetItemRequest.builder()
.tableName(tableName)
.key(key)
.build()
dynamoDbClient.getItem(request).item() match {
case item if item.isEmpty => None
case item => Some(item)
}
}
// Get item with Scala Map instead of Java Map
def getItem(tableName: String, key: Map[String, AttributeValue]): Future[Option[Map[String, AttributeValue]]] = {
getItem(tableName, key.asJava).map {
_.map(_.asScala.toMap)
}
}
// Put an item
def putItem(tableName: String, item: Map[String, AttributeValue]): Future[PutItemResponse] = Future {
val request = PutItemRequest.builder()
.tableName(tableName)
.item(item.asJava)
.build()
dynamoDbClient.putItem(request)
}
// Delete an item
def deleteItem(tableName: String, key: Map[String, AttributeValue]): Future[DeleteItemResponse] = Future {
val request = DeleteItemRequest.builder()
.tableName(tableName)
.key(key.asJava)
.build()
dynamoDbClient.deleteItem(request)
}
// Scan items
def scanItems(tableName: String): Future[List[Map[String, AttributeValue]]] = Future {
val request = ScanRequest.builder()
.tableName(tableName)
.build()
dynamoDbClient.scan(request)
.items()
.asScala
.map(_.asScala.toMap)
.toList
}
// Close resources
def close(): Unit = {
dynamoDbClient.close()
}
}

View File

@@ -14,11 +14,10 @@
</p>
<p>
Your help is crucial. Filing a public records request is easy, and your contribution will help us build a complete map of these surveillance networks. We'll even link you to several hundred <a target="_blank" href="https://www.muckrock.com/search/?q=Flock">examples to follow</a>.<sup>[1]</sup>
<footer class="text-grey-darken-2 mt-4">
<small><sup>[1]</sup> While these examples focus on Flock Safety, the process applies to all ALPR vendors. Flock is highlighted here because it is the most widely reported ALPR vendor in the US on OpenStreetMap at the time this was written.</small>
</footer>
</p>
<footer class="serif text-grey-darken-2 mt-4">
<small><sup>[1]</sup> While these examples focus on Flock Safety, the process applies to all ALPR vendors. Flock is highlighted here because it is the most widely reported ALPR vendor in the US on OpenStreetMap at the time this was written.</small>
</footer>
<v-divider class="my-8" />
@@ -33,13 +32,13 @@
<li class="mb-4">
<p>
Browse <a href="https://www.muckrock.com/search/?q=Flock" target="_blank">Muckrock</a> for examples of public records requests related to ALPRs. Use these as templates to draft your own request. Here are some common requests you can adapt:
<ul>
<li>Right-of-Way Installation Permits (typically include a map of locations)</li>
<li>Invoices for ALPRs (contain count of cameras)</li>
<li>Contracts with ALPR vendors (show proof of usage)</li>
<li>Emails discussing ALPR installations</li>
</ul>
</p>
<ul>
<li>Right-of-Way Installation Permits (typically include a map of locations)</li>
<li>Invoices for ALPRs (contain count of cameras)</li>
<li>Contracts with ALPR vendors (show proof of usage)</li>
<li>Emails discussing ALPR installations</li>
</ul>
<p><b>If you need help tailoring this to your situation, appealing rejections, etc., ChatGPT is a great resource.</b></p>
</li>