com.nike.fleam.sqs.instances.ContainsMessage.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fleam-aws-sqs_2.12 Show documentation
Show all versions of fleam-aws-sqs_2.12 Show documentation
Fleam SQS is a library of classes to aid in processing AWS SQS messages in a functional manner
The newest version!
package com.nike.fleam.sqs
package instances
import software.amazon.awssdk.services.sqs.model.Message
import ContainsRetrievedMessage.ops._
import ContainsMessage.ops._
/** Copyright 2020-present, Nike, Inc.
* All rights reserved.
*
* This source code is licensed under the MIT license found in
* the LICENSE file in the root directory of this source tree.
**/
trait ContainsMessageInstances {
implicit val retrievedContainsMessage: ContainsMessage[RetrievedMessage] = ContainsMessage.lift[RetrievedMessage](_.message)
implicit val sqsRetryErrorContainsMessage: ContainsMessage[SqsRetryError[_]] = ContainsMessage.lift[SqsRetryError[_]](_.message)
implicit def messageFromRetrievedContainsMessage[T: ContainsRetrievedMessage]: ContainsMessage[T] = ContainsMessage.lift[T] {
_.getRetrievedMessage.getMessage
}
implicit val messageContainsMessage: ContainsMessage[Message] = ContainsMessage.lift[Message](identity)
}
object ContainsMessageInstances extends ContainsMessageInstances