Skip to content

Commit

Permalink
Merge pull request #436 from etspaceman/deprecateKinesis
Browse files Browse the repository at this point in the history
Deprecate KinesisStreamEvent
  • Loading branch information
armanbilge authored Dec 1, 2023
2 parents c75dc86 + 6554db5 commit 39abcdf
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/src/main/scala/feral/examples/KinesisLambda.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package feral.examples
import cats.effect._
import cats.effect.std.Random
import feral.lambda._
import feral.lambda.events.KinesisStreamEvent
import feral.lambda.events.SqsEvent
import natchez.Trace
import natchez.xray.XRay
import skunk.Session
Expand All @@ -38,7 +38,7 @@ import skunk.Session
*
* For a more advanced example, see the `Http4sLambda` next.
*/
object kinesisHandler extends IOLambda.Simple[KinesisStreamEvent, INothing] {
object sqsHandler extends IOLambda.Simple[SqsEvent, INothing] {

/**
* Optional initialization section. This is a resource that will be acquired exactly once when
Expand Down Expand Up @@ -66,7 +66,7 @@ object kinesisHandler extends IOLambda.Simple[KinesisStreamEvent, INothing] {
* @param init
* in this example, the skunk session we setup above
*/
def apply(event: KinesisStreamEvent, context: Context[IO], init: Init) =
def apply(event: SqsEvent, context: Context[IO], init: Init) =
IO.println(s"Received event with ${event.records.size} records").as(None)

}
3 changes: 3 additions & 0 deletions lambda/shared/src/main/scala-2/feral/lambda/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ package object lambda {

type ApiGatewayProxyInvocation[F[_]] = Invocation[F, ApiGatewayProxyEventV2]
type DynamoDbStreamInvocation[F[_]] = Invocation[F, DynamoDbStreamEvent]
@deprecated(
"Moved to kinesis4cats. See https://etspaceman.github.io/kinesis4cats/feral/getting-started.html.",
since = "0.3.0")
type KinesisStreamInvocation[F[_]] = Invocation[F, KinesisStreamEvent]
type S3BatchInvocation[F[_]] = Invocation[F, S3BatchEvent]
type SnsInvocation[F[_]] = Invocation[F, SnsEvent]
Expand Down
3 changes: 3 additions & 0 deletions lambda/shared/src/main/scala-3/feral/lambda/invocations.scala
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ val LambdaEnv = Invocation

type ApiGatewayProxyInvocation[F[_]] = Invocation[F, ApiGatewayProxyEventV2]
type DynamoDbStreamInvocation[F[_]] = Invocation[F, DynamoDbStreamEvent]
@deprecated(
"Moved to kinesis4cats. See https://etspaceman.github.io/kinesis4cats/feral/getting-started.html.",
since = "0.3.0")
type KinesisStreamInvocation[F[_]] = Invocation[F, KinesisStreamEvent]
type S3BatchInvocation[F[_]] = Invocation[F, S3BatchEvent]
type SnsInvocation[F[_]] = Invocation[F, SnsEvent]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,16 @@ object KinesisStreamRecord {
}
}

@deprecated(
"Moved to kinesis4cats. See https://etspaceman.github.io/kinesis4cats/feral/getting-started.html.",
since = "0.3.0")
sealed abstract class KinesisStreamEvent {
def records: List[KinesisStreamRecord]
}

@deprecated(
"Moved to kinesis4cats. See https://etspaceman.github.io/kinesis4cats/feral/getting-started.html.",
since = "0.3.0")
object KinesisStreamEvent {
def apply(records: List[KinesisStreamRecord]): KinesisStreamEvent =
new Impl(records)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ package feral.lambda.events
import io.circe.literal._
import munit.FunSuite

@deprecated(
"Moved to kinesis4cats. See https://etspaceman.github.io/kinesis4cats/feral/getting-started.html.",
since = "0.3.0")
class KinesisStreamEventSuite extends FunSuite {

test("decoder") {
Expand Down

0 comments on commit 39abcdf

Please sign in to comment.