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