{-# 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.IoT.Types.SqsAction where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data SqsAction = SqsAction'
{
SqsAction -> Maybe Bool
useBase64 :: Prelude.Maybe Prelude.Bool,
SqsAction -> Text
roleArn :: Prelude.Text,
SqsAction -> Text
queueUrl :: Prelude.Text
}
deriving (SqsAction -> SqsAction -> Bool
(SqsAction -> SqsAction -> Bool)
-> (SqsAction -> SqsAction -> Bool) -> Eq SqsAction
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SqsAction -> SqsAction -> Bool
$c/= :: SqsAction -> SqsAction -> Bool
== :: SqsAction -> SqsAction -> Bool
$c== :: SqsAction -> SqsAction -> Bool
Prelude.Eq, ReadPrec [SqsAction]
ReadPrec SqsAction
Int -> ReadS SqsAction
ReadS [SqsAction]
(Int -> ReadS SqsAction)
-> ReadS [SqsAction]
-> ReadPrec SqsAction
-> ReadPrec [SqsAction]
-> Read SqsAction
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SqsAction]
$creadListPrec :: ReadPrec [SqsAction]
readPrec :: ReadPrec SqsAction
$creadPrec :: ReadPrec SqsAction
readList :: ReadS [SqsAction]
$creadList :: ReadS [SqsAction]
readsPrec :: Int -> ReadS SqsAction
$creadsPrec :: Int -> ReadS SqsAction
Prelude.Read, Int -> SqsAction -> ShowS
[SqsAction] -> ShowS
SqsAction -> String
(Int -> SqsAction -> ShowS)
-> (SqsAction -> String)
-> ([SqsAction] -> ShowS)
-> Show SqsAction
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SqsAction] -> ShowS
$cshowList :: [SqsAction] -> ShowS
show :: SqsAction -> String
$cshow :: SqsAction -> String
showsPrec :: Int -> SqsAction -> ShowS
$cshowsPrec :: Int -> SqsAction -> ShowS
Prelude.Show, (forall x. SqsAction -> Rep SqsAction x)
-> (forall x. Rep SqsAction x -> SqsAction) -> Generic SqsAction
forall x. Rep SqsAction x -> SqsAction
forall x. SqsAction -> Rep SqsAction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SqsAction x -> SqsAction
$cfrom :: forall x. SqsAction -> Rep SqsAction x
Prelude.Generic)
newSqsAction ::
Prelude.Text ->
Prelude.Text ->
SqsAction
newSqsAction :: Text -> Text -> SqsAction
newSqsAction Text
pRoleArn_ Text
pQueueUrl_ =
SqsAction' :: Maybe Bool -> Text -> Text -> SqsAction
SqsAction'
{ $sel:useBase64:SqsAction' :: Maybe Bool
useBase64 = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:roleArn:SqsAction' :: Text
roleArn = Text
pRoleArn_,
$sel:queueUrl:SqsAction' :: Text
queueUrl = Text
pQueueUrl_
}
sqsAction_useBase64 :: Lens.Lens' SqsAction (Prelude.Maybe Prelude.Bool)
sqsAction_useBase64 :: (Maybe Bool -> f (Maybe Bool)) -> SqsAction -> f SqsAction
sqsAction_useBase64 = (SqsAction -> Maybe Bool)
-> (SqsAction -> Maybe Bool -> SqsAction)
-> Lens SqsAction SqsAction (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SqsAction' {Maybe Bool
useBase64 :: Maybe Bool
$sel:useBase64:SqsAction' :: SqsAction -> Maybe Bool
useBase64} -> Maybe Bool
useBase64) (\s :: SqsAction
s@SqsAction' {} Maybe Bool
a -> SqsAction
s {$sel:useBase64:SqsAction' :: Maybe Bool
useBase64 = Maybe Bool
a} :: SqsAction)
sqsAction_roleArn :: Lens.Lens' SqsAction Prelude.Text
sqsAction_roleArn :: (Text -> f Text) -> SqsAction -> f SqsAction
sqsAction_roleArn = (SqsAction -> Text)
-> (SqsAction -> Text -> SqsAction)
-> Lens SqsAction SqsAction Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SqsAction' {Text
roleArn :: Text
$sel:roleArn:SqsAction' :: SqsAction -> Text
roleArn} -> Text
roleArn) (\s :: SqsAction
s@SqsAction' {} Text
a -> SqsAction
s {$sel:roleArn:SqsAction' :: Text
roleArn = Text
a} :: SqsAction)
sqsAction_queueUrl :: Lens.Lens' SqsAction Prelude.Text
sqsAction_queueUrl :: (Text -> f Text) -> SqsAction -> f SqsAction
sqsAction_queueUrl = (SqsAction -> Text)
-> (SqsAction -> Text -> SqsAction)
-> Lens SqsAction SqsAction Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SqsAction' {Text
queueUrl :: Text
$sel:queueUrl:SqsAction' :: SqsAction -> Text
queueUrl} -> Text
queueUrl) (\s :: SqsAction
s@SqsAction' {} Text
a -> SqsAction
s {$sel:queueUrl:SqsAction' :: Text
queueUrl = Text
a} :: SqsAction)
instance Core.FromJSON SqsAction where
parseJSON :: Value -> Parser SqsAction
parseJSON =
String -> (Object -> Parser SqsAction) -> Value -> Parser SqsAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SqsAction"
( \Object
x ->
Maybe Bool -> Text -> Text -> SqsAction
SqsAction'
(Maybe Bool -> Text -> Text -> SqsAction)
-> Parser (Maybe Bool) -> Parser (Text -> Text -> SqsAction)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"useBase64")
Parser (Text -> Text -> SqsAction)
-> Parser Text -> Parser (Text -> SqsAction)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"roleArn")
Parser (Text -> SqsAction) -> Parser Text -> Parser SqsAction
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"queueUrl")
)
instance Prelude.Hashable SqsAction
instance Prelude.NFData SqsAction
instance Core.ToJSON SqsAction where
toJSON :: SqsAction -> Value
toJSON SqsAction' {Maybe Bool
Text
queueUrl :: Text
roleArn :: Text
useBase64 :: Maybe Bool
$sel:queueUrl:SqsAction' :: SqsAction -> Text
$sel:roleArn:SqsAction' :: SqsAction -> Text
$sel:useBase64:SqsAction' :: SqsAction -> Maybe Bool
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"useBase64" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
useBase64,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"roleArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
roleArn),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"queueUrl" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
queueUrl)
]
)