{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data PublishFindingToSnsParams = PublishFindingToSnsParams'
{
PublishFindingToSnsParams -> Text
topicArn :: Prelude.Text
}
deriving (PublishFindingToSnsParams -> PublishFindingToSnsParams -> Bool
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]
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
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.
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' {$sel:topicArn:PublishFindingToSnsParams' :: Text
topicArn = Text
pTopicArn_}
publishFindingToSnsParams_topicArn :: Lens.Lens' PublishFindingToSnsParams Prelude.Text
publishFindingToSnsParams_topicArn :: Lens' PublishFindingToSnsParams Text
publishFindingToSnsParams_topicArn = 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 Data.FromJSON PublishFindingToSnsParams where
parseJSON :: Value -> Parser PublishFindingToSnsParams
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"PublishFindingToSnsParams"
( \Object
x ->
Text -> PublishFindingToSnsParams
PublishFindingToSnsParams'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"topicArn")
)
instance Prelude.Hashable PublishFindingToSnsParams where
hashWithSalt :: Int -> PublishFindingToSnsParams -> Int
hashWithSalt Int
_salt PublishFindingToSnsParams' {Text
topicArn :: Text
$sel:topicArn:PublishFindingToSnsParams' :: PublishFindingToSnsParams -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
topicArn
instance Prelude.NFData PublishFindingToSnsParams where
rnf :: PublishFindingToSnsParams -> ()
rnf PublishFindingToSnsParams' {Text
topicArn :: Text
$sel:topicArn:PublishFindingToSnsParams' :: PublishFindingToSnsParams -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
topicArn
instance Data.ToJSON PublishFindingToSnsParams where
toJSON :: PublishFindingToSnsParams -> Value
toJSON PublishFindingToSnsParams' {Text
topicArn :: Text
$sel:topicArn:PublishFindingToSnsParams' :: PublishFindingToSnsParams -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[forall a. a -> Maybe a
Prelude.Just (Key
"topicArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
topicArn)]
)