{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.CloudWatchEvents.Types.SqsParameters where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data SqsParameters = SqsParameters'
{
SqsParameters -> Maybe Text
messageGroupId :: Prelude.Maybe Prelude.Text
}
deriving (SqsParameters -> SqsParameters -> Bool
(SqsParameters -> SqsParameters -> Bool)
-> (SqsParameters -> SqsParameters -> Bool) -> Eq SqsParameters
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SqsParameters -> SqsParameters -> Bool
$c/= :: SqsParameters -> SqsParameters -> Bool
== :: SqsParameters -> SqsParameters -> Bool
$c== :: SqsParameters -> SqsParameters -> Bool
Prelude.Eq, ReadPrec [SqsParameters]
ReadPrec SqsParameters
Int -> ReadS SqsParameters
ReadS [SqsParameters]
(Int -> ReadS SqsParameters)
-> ReadS [SqsParameters]
-> ReadPrec SqsParameters
-> ReadPrec [SqsParameters]
-> Read SqsParameters
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SqsParameters]
$creadListPrec :: ReadPrec [SqsParameters]
readPrec :: ReadPrec SqsParameters
$creadPrec :: ReadPrec SqsParameters
readList :: ReadS [SqsParameters]
$creadList :: ReadS [SqsParameters]
readsPrec :: Int -> ReadS SqsParameters
$creadsPrec :: Int -> ReadS SqsParameters
Prelude.Read, Int -> SqsParameters -> ShowS
[SqsParameters] -> ShowS
SqsParameters -> String
(Int -> SqsParameters -> ShowS)
-> (SqsParameters -> String)
-> ([SqsParameters] -> ShowS)
-> Show SqsParameters
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SqsParameters] -> ShowS
$cshowList :: [SqsParameters] -> ShowS
show :: SqsParameters -> String
$cshow :: SqsParameters -> String
showsPrec :: Int -> SqsParameters -> ShowS
$cshowsPrec :: Int -> SqsParameters -> ShowS
Prelude.Show, (forall x. SqsParameters -> Rep SqsParameters x)
-> (forall x. Rep SqsParameters x -> SqsParameters)
-> Generic SqsParameters
forall x. Rep SqsParameters x -> SqsParameters
forall x. SqsParameters -> Rep SqsParameters x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SqsParameters x -> SqsParameters
$cfrom :: forall x. SqsParameters -> Rep SqsParameters x
Prelude.Generic)
newSqsParameters ::
SqsParameters
newSqsParameters :: SqsParameters
newSqsParameters =
SqsParameters' :: Maybe Text -> SqsParameters
SqsParameters' {$sel:messageGroupId:SqsParameters' :: Maybe Text
messageGroupId = Maybe Text
forall a. Maybe a
Prelude.Nothing}
sqsParameters_messageGroupId :: Lens.Lens' SqsParameters (Prelude.Maybe Prelude.Text)
sqsParameters_messageGroupId :: (Maybe Text -> f (Maybe Text)) -> SqsParameters -> f SqsParameters
sqsParameters_messageGroupId = (SqsParameters -> Maybe Text)
-> (SqsParameters -> Maybe Text -> SqsParameters)
-> Lens SqsParameters SqsParameters (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SqsParameters' {Maybe Text
messageGroupId :: Maybe Text
$sel:messageGroupId:SqsParameters' :: SqsParameters -> Maybe Text
messageGroupId} -> Maybe Text
messageGroupId) (\s :: SqsParameters
s@SqsParameters' {} Maybe Text
a -> SqsParameters
s {$sel:messageGroupId:SqsParameters' :: Maybe Text
messageGroupId = Maybe Text
a} :: SqsParameters)
instance Core.FromJSON SqsParameters where
parseJSON :: Value -> Parser SqsParameters
parseJSON =
String
-> (Object -> Parser SqsParameters)
-> Value
-> Parser SqsParameters
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SqsParameters"
( \Object
x ->
Maybe Text -> SqsParameters
SqsParameters'
(Maybe Text -> SqsParameters)
-> Parser (Maybe Text) -> Parser SqsParameters
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MessageGroupId")
)
instance Prelude.Hashable SqsParameters
instance Prelude.NFData SqsParameters
instance Core.ToJSON SqsParameters where
toJSON :: SqsParameters -> Value
toJSON SqsParameters' {Maybe Text
messageGroupId :: Maybe Text
$sel:messageGroupId:SqsParameters' :: SqsParameters -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"MessageGroupId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
messageGroupId
]
)