Skip to content

Commit

Permalink
Update org everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
Regis Kuckaertz committed Dec 26, 2018
1 parent 7481d49 commit aeb7662
Show file tree
Hide file tree
Showing 59 changed files with 284 additions and 284 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ Basic Usage
Note: the `LocalDynamoDB` object is provided by the `scanamo-testkit` package.

```scala
scala> import com.gu.scanamo._
scala> import com.gu.scanamo.syntax._
scala> import com.gu.scanamo.auto._
scala> import org.scanamo._
scala> import org.scanamo.syntax._
scala> import org.scanamo.auto._

scala> val client = LocalDynamoDB.client()
scala> import com.amazonaws.services.dynamodbv2.model.ScalarAttributeType._
Expand Down
6 changes: 3 additions & 3 deletions alpakka/src/main/scala/com/gu/scanamo/ScanamoAlpakka.scala
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.gu.scanamo
package org.scanamo

import akka.stream.alpakka.dynamodb.scaladsl.DynamoClient
import com.gu.scanamo.ops.{AlpakkaInterpreter, ScanamoOps}
import org.scanamo.ops.{AlpakkaInterpreter, ScanamoOps}
import scala.concurrent.{ExecutionContext, Future}

/**
* Provides the same interface as [[com.gu.scanamo.Scanamo]], except that it requires an
* Provides the same interface as [[org.scanamo.Scanamo]], except that it requires an
* [[https://github.com/akka/alpakka Alpakka]] client
* and an implicit [[scala.concurrent.ExecutionContext]] and returns a [[scala.concurrent.Future]]
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.gu.scanamo.ops
package org.scanamo.ops

import akka.stream.alpakka.dynamodb.scaladsl.DynamoClient
import cats.~>
Expand Down
10 changes: 5 additions & 5 deletions alpakka/src/test/scala/com/gu/scanamo/ScanamoAlpakkaSpec.scala
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package com.gu.scanamo
package org.scanamo

import akka.actor.ActorSystem
import akka.stream.ActorMaterializer
import akka.stream.alpakka.dynamodb.impl.DynamoSettings
import akka.stream.alpakka.dynamodb.scaladsl.DynamoClient
import com.amazonaws.auth.{AWSStaticCredentialsProvider, BasicAWSCredentials}
import com.amazonaws.services.dynamodbv2.model.ScalarAttributeType._
import com.gu.scanamo.ops.ScanamoOps
import com.gu.scanamo.query._
import com.gu.scanamo.syntax._
import com.gu.scanamo.auto._
import org.scanamo.ops.ScanamoOps
import org.scanamo.query._
import org.scanamo.syntax._
import org.scanamo.auto._
import org.scalatest.concurrent.ScalaFutures
import org.scalatest.time.{Millis, Seconds, Span}
import org.scalatest.{BeforeAndAfterAll, FunSpecLike, Matchers}
Expand Down
4 changes: 2 additions & 2 deletions cats/src/main/scala/com/gu/scanamo/ScanamoCats.scala
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.gu.scanamo
package org.scanamo

import cats.effect.Async
import com.amazonaws.services.dynamodbv2.AmazonDynamoDBAsync
import com.gu.scanamo.ops.{CatsInterpreter, ScanamoOps}
import org.scanamo.ops.{CatsInterpreter, ScanamoOps}

object ScanamoCats {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.gu.scanamo.ops
package org.scanamo.ops

import cats.effect.Async
import cats.implicits._
Expand Down
32 changes: 16 additions & 16 deletions cats/src/test/scala/com/gu/scanamo/ScanamoCatsSpec.scala
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.gu.scanamo
package org.scanamo

import cats.effect.IO
import cats.implicits._
Expand All @@ -7,11 +7,11 @@ import org.scalatest.concurrent.ScalaFutures
import org.scalatest.time.{Millis, Seconds, Span}
import org.scalatest.{FunSpec, Matchers}
import com.amazonaws.services.dynamodbv2.model.ScalarAttributeType._
import com.gu.scanamo.error.DynamoReadError
import com.gu.scanamo.ops.ScanamoOps
import com.gu.scanamo.query._
import com.gu.scanamo.syntax._
import com.gu.scanamo.auto._
import org.scanamo.error.DynamoReadError
import org.scanamo.ops.ScanamoOps
import org.scanamo.query._
import org.scanamo.syntax._
import org.scanamo.auto._

class ScanamoCatsSpec extends FunSpec with Matchers {

Expand Down Expand Up @@ -268,11 +268,11 @@ class ScanamoCatsSpec extends FunSpec with Matchers {
.exec[
IO,
(
List[Either[com.gu.scanamo.error.DynamoReadError, Animal]],
List[Either[com.gu.scanamo.error.DynamoReadError, Animal]],
List[Either[com.gu.scanamo.error.DynamoReadError, Animal]],
List[Either[com.gu.scanamo.error.DynamoReadError, Animal]],
List[Either[com.gu.scanamo.error.DynamoReadError, Animal]]
List[Either[org.scanamo.error.DynamoReadError, Animal]],
List[Either[org.scanamo.error.DynamoReadError, Animal]],
List[Either[org.scanamo.error.DynamoReadError, Animal]],
List[Either[org.scanamo.error.DynamoReadError, Animal]],
List[Either[org.scanamo.error.DynamoReadError, Animal]]
)
](client)(ops)
.unsafeRunSync should equal(
Expand Down Expand Up @@ -389,11 +389,11 @@ class ScanamoCatsSpec extends FunSpec with Matchers {
.exec[
IO,
(
List[Either[com.gu.scanamo.error.DynamoReadError, Station]],
List[Either[com.gu.scanamo.error.DynamoReadError, Station]],
List[Either[com.gu.scanamo.error.DynamoReadError, Station]],
List[Either[com.gu.scanamo.error.DynamoReadError, Station]],
List[Either[com.gu.scanamo.error.DynamoReadError, Station]]
List[Either[org.scanamo.error.DynamoReadError, Station]],
List[Either[org.scanamo.error.DynamoReadError, Station]],
List[Either[org.scanamo.error.DynamoReadError, Station]],
List[Either[org.scanamo.error.DynamoReadError, Station]],
List[Either[org.scanamo.error.DynamoReadError, Station]]
)
](client)(ops)
.unsafeRunSync should equal(
Expand Down
10 changes: 5 additions & 5 deletions docs/src/main/tut/asynchronous.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ requests to DynamoDB, Scanamo supports making the requests asynchronously with
a client that implements the `AmazonDynamoDBAsync` interface:

```tut:silent
import com.gu.scanamo._
import com.gu.scanamo.syntax._
import com.gu.scanamo.auto._
import org.scanamo._
import org.scanamo.syntax._
import org.scanamo.auto._
import scala.concurrent.duration._
import scala.concurrent.ExecutionContext.Implicits.global
Expand Down Expand Up @@ -55,8 +55,8 @@ Using the Alpakka client means you need an `ActorSystem` and an
that the Alpakka interpreter uses behind the scenes:

```tut:silent
import com.gu.scanamo._
import com.gu.scanamo.syntax._
import org.scanamo._
import org.scanamo.syntax._
import akka.actor.ActorSystem
import akka.stream.ActorMaterializer
import akka.stream.alpakka.dynamodb.scaladsl.DynamoClient
Expand Down
6 changes: 3 additions & 3 deletions docs/src/main/tut/batch-operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ Many operations against Dynamo can be performed in batches. Scanamo
has support for putting, getting and deleting in batches

```tut:silent
import com.gu.scanamo._
import com.gu.scanamo.syntax._
import com.gu.scanamo.auto._
import org.scanamo._
import org.scanamo.syntax._
import org.scanamo.auto._
import scala.concurrent.duration._
import scala.concurrent.ExecutionContext.Implicits.global
Expand Down
8 changes: 4 additions & 4 deletions docs/src/main/tut/conditional-operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ only have an effect if some state of the DynamoDB table is true at the time of
execution.

```tut:silent
import com.gu.scanamo._
import com.gu.scanamo.syntax._
import com.gu.scanamo.auto._
import org.scanamo._
import org.scanamo.syntax._
import org.scanamo.auto._
import com.amazonaws.services.dynamodbv2.model.ScalarAttributeType._
val client = LocalDynamoDB.client()
case class Gremlin(number: Int, name: String, wet: Boolean, friendly: Boolean)
Expand Down Expand Up @@ -45,4 +45,4 @@ LocalDynamoDB.withTable(client)("gremlins")('number -> N) {
}
```

More examples can be found in the [Table ScalaDoc](/latest/api/com/gu/scanamo/Table.html#given[T](condition:T)(implicitevidence$2:com.gu.scanamo.query.ConditionExpression[T]):com.gu.scanamo.query.ConditionalOperation[V,T]).
More examples can be found in the [Table ScalaDoc](/latest/api/com/gu/scanamo/Table.html#given[T](condition:T)(implicitevidence$2:org.scanamo.query.ConditionExpression[T]):org.scanamo.query.ConditionalOperation[V,T]).
34 changes: 17 additions & 17 deletions docs/src/main/tut/dynamo-format.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ sealed trait families where all the contained types have a defined or derivable
Scanamo can automatically derive `DynamoFormat` for case classes (as long as all its members can also be derived). Ex:

```tut:silent
import com.gu.scanamo._
import com.gu.scanamo.syntax._
import com.gu.scanamo.auto._
import org.scanamo._
import org.scanamo.syntax._
import org.scanamo.auto._
case class Farm(animals: List[String])
case class Farmer(name: String, age: Long, farm: Farm)
Expand All @@ -43,9 +43,9 @@ Scanamo offers a convenient way (semi-automoatic) to derive `DynamoFormat` in yo
Ex:

```tut:silent
import com.gu.scanamo._
import com.gu.scanamo.syntax._
import com.gu.scanamo.semiauto._
import org.scanamo._
import org.scanamo.syntax._
import org.scanamo.semiauto._
case class Farm(animals: List[String])
case class Farmer(name: String, age: Long, farm: Farm)
Expand All @@ -58,18 +58,18 @@ implicit val formatFarmer: DynamoFormat[Farmer] = deriveDynamoFormat

It's also possible to define a serialisation format for types which Scanamo
doesn't already support and can't derive. Normally this involves using the
[xmap](latest/api/com/gu/scanamo/DynamoFormat$.html#xmap[A,B](r:B=>Either[com.gu.scanamo.error.DynamoReadError,A])(w:A=>B)(implicitf:com.gu.scanamo.DynamoFormat[B]):com.gu.scanamo.DynamoFormat[A])
or [coercedXmap](latest/api/com/gu/scanamo/DynamoFormat$.html#coercedXmap[A,B,T>:Null<:Throwable](read:B=>A)(write:A=>B)(implicitf:com.gu.scanamo.DynamoFormat[B],implicitT:scala.reflect.ClassTag[T],implicitNT:cats.NotNull[T]):com.gu.scanamo.DynamoFormat[A])
[xmap](latest/api/com/gu/scanamo/DynamoFormat$.html#xmap[A,B](r:B=>Either[org.scanamo.error.DynamoReadError,A])(w:A=>B)(implicitf:org.scanamo.DynamoFormat[B]):org.scanamo.DynamoFormat[A])
or [coercedXmap](latest/api/com/gu/scanamo/DynamoFormat$.html#coercedXmap[A,B,T>:Null<:Throwable](read:B=>A)(write:A=>B)(implicitf:org.scanamo.DynamoFormat[B],implicitT:scala.reflect.ClassTag[T],implicitNT:cats.NotNull[T]):org.scanamo.DynamoFormat[A])
to translate between the type and one Scanamo does already know about.

For example, to store Joda `DateTime` objects as ISO `String`s in Dynamo:

```tut:silent
import org.joda.time._
import com.gu.scanamo._
import com.gu.scanamo.syntax._
import com.gu.scanamo.auto._
import org.scanamo._
import org.scanamo.syntax._
import org.scanamo.auto._
case class Foo(dateTime: DateTime)
Expand Down Expand Up @@ -108,9 +108,9 @@ libraryDependencies += "com.gu" %% "scanamo-refined" % "x.y.z"
And then import the support for refined types and define your model:

```tut:silent
import com.gu.scanamo._
import com.gu.scanamo.refined._
import com.gu.scanamo.auto._
import org.scanamo._
import org.scanamo.refined._
import org.scanamo.auto._
import eu.timepit.refined._
import eu.timepit.refined.api.Refined
import eu.timepit.refined.auto._
Expand Down Expand Up @@ -142,9 +142,9 @@ Scanamo uses [shapeless](https://github.com/milessabin/shapeless) and implicit d
```tut:silent
import java.util.UUID
import com.gu.scanamo._
import com.gu.scanamo.syntax._
import com.gu.scanamo.auto._
import org.scanamo._
import org.scanamo.syntax._
import org.scanamo.auto._
// Sealed trait family for events.
sealed trait Event
Expand Down
8 changes: 4 additions & 4 deletions docs/src/main/tut/filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ returned, it could still exhaust the provisioned capacity or force the
provisioned capacity to autoscale up to an expensive level.

```tut:silent
import com.gu.scanamo._
import com.gu.scanamo.syntax._
import com.gu.scanamo.auto._
import org.scanamo._
import org.scanamo.syntax._
import org.scanamo.auto._
import com.amazonaws.services.dynamodbv2.model.ScalarAttributeType._
val client = LocalDynamoDB.client()
Expand All @@ -44,4 +44,4 @@ LocalDynamoDB.withTable(client)("Station")('line -> S, 'name -> S) {
}
```

More examples can be found in the [Table ScalaDoc](/latest/api/com/gu/scanamo/Table.html#filter[C](condition:C)(implicitevidence$3:com.gu.scanamo.query.ConditionExpression[C]):com.gu.scanamo.TableWithOptions[V]).
More examples can be found in the [Table ScalaDoc](/latest/api/com/gu/scanamo/Table.html#filter[C](condition:C)(implicitevidence$3:org.scanamo.query.ConditionExpression[C]):org.scanamo.TableWithOptions[V]).
6 changes: 3 additions & 3 deletions docs/src/main/tut/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ libraryDependencies += "com.gu" %% "scanamo" % "1.0.0-M8"
then, given a table and some case classes

```tut:silent
import com.gu.scanamo._
import com.gu.scanamo.syntax._
import com.gu.scanamo.auto._
import org.scanamo._
import org.scanamo.syntax._
import org.scanamo.auto._
val client = LocalDynamoDB.client()
import com.amazonaws.services.dynamodbv2.model.ScalarAttributeType._
Expand Down
28 changes: 14 additions & 14 deletions docs/src/main/tut/operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ Often when using DynamoDB, the primary use case is simply putting objects into
Dynamo and subsequently retrieving them:

```tut:silent
import com.gu.scanamo._
import com.gu.scanamo.syntax._
import com.gu.scanamo.auto._
import org.scanamo._
import org.scanamo.syntax._
import org.scanamo.auto._
val client = LocalDynamoDB.client()
import com.amazonaws.services.dynamodbv2.model.ScalarAttributeType._
Expand All @@ -55,8 +55,8 @@ Note that when using `Table` no operations are actually executed against DynamoD
To remove an item in it's entirety, we can use delete:

```tut:silent
import com.gu.scanamo._
import com.gu.scanamo.syntax._
import org.scanamo._
import org.scanamo.syntax._
val client = LocalDynamoDB.client()
import com.amazonaws.services.dynamodbv2.model.ScalarAttributeType._
Expand All @@ -82,8 +82,8 @@ If you want to change some of the fields of an item, that don't form part of it'
without replacing the item entirely, you can use the `update` operation:

```tut:silent
import com.gu.scanamo._
import com.gu.scanamo.syntax._
import org.scanamo._
import org.scanamo.syntax._
val client = LocalDynamoDB.client()
import com.amazonaws.services.dynamodbv2.model.ScalarAttributeType._
Expand All @@ -105,8 +105,8 @@ Which fields are updated can be based on incoming data:
```tut:silent
import cats.data.NonEmptyList
import cats.implicits._
import com.gu.scanamo.ops.ScanamoOps
import com.gu.scanamo.error.DynamoReadError
import org.scanamo.ops.ScanamoOps
import org.scanamo.error.DynamoReadError
LocalDynamoDB.createTable(client)("favourites")('name -> S)
case class Favourites(name: String, colour: String, number: Long)
Expand Down Expand Up @@ -142,16 +142,16 @@ Scanamo.exec(client)(
```

Further examples, showcasing different types of update can be found in the
[scaladoc for the `update` method on `Table`](/latest/api/com/gu/scanamo/Table.html#update(key:com.gu.scanamo.query.UniqueKey[_],expression:com.gu.scanamo.update.UpdateExpression):com.gu.scanamo.ops.ScanamoOps[Either[com.gu.scanamo.error.DynamoReadError,V]])
[scaladoc for the `update` method on `Table`](/latest/api/com/gu/scanamo/Table.html#update(key:org.scanamo.query.UniqueKey[_],expression:org.scanamo.update.UpdateExpression):org.scanamo.ops.ScanamoOps[Either[org.scanamo.error.DynamoReadError,V]])

### Scan

If you want to go through all elements of a table, or index, Scanamo
supports scanning it:

```tut:silent
import com.gu.scanamo._
import com.gu.scanamo.syntax._
import org.scanamo._
import org.scanamo.syntax._
val client = LocalDynamoDB.client()
import com.amazonaws.services.dynamodbv2.model.ScalarAttributeType._
Expand Down Expand Up @@ -179,8 +179,8 @@ Scanamo.exec(client)(operations)
Scanamo can be used to perform most queries that can be made against DynamoDB

```tut:silent
import com.gu.scanamo._
import com.gu.scanamo.syntax._
import org.scanamo._
import org.scanamo.syntax._
val client = LocalDynamoDB.client()
import com.amazonaws.services.dynamodbv2.model.ScalarAttributeType._
Expand Down
6 changes: 3 additions & 3 deletions docs/src/main/tut/using-indexes.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ of `mode` and range key of `line` and a global secondary called `colour-index`
with only a hash key on the `colour` attribute:

```tut:silent
import com.gu.scanamo._
import com.gu.scanamo.syntax._
import com.gu.scanamo.auto._
import org.scanamo._
import org.scanamo.syntax._
import org.scanamo.auto._
case class Transport(mode: String, line: String, colour: String)
val transport = Table[Transport]("transport")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.gu.scanamo.Derivation
package org.scanamo.Derivation

import com.gu.scanamo.{DerivedDynamoFormat, DynamoFormat}
import com.gu.scanamo.export.Exported
import org.scanamo.{DerivedDynamoFormat, DynamoFormat}
import org.scanamo.export.Exported

trait SemiAutoDerivation extends DerivedDynamoFormat {

Expand Down
Loading

0 comments on commit aeb7662

Please sign in to comment.