{-# 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.AccessAnalyzer.Types.SnsTopicConfiguration 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 SnsTopicConfiguration = SnsTopicConfiguration'
{
SnsTopicConfiguration -> Maybe Text
topicPolicy :: Prelude.Maybe Prelude.Text
}
deriving (SnsTopicConfiguration -> SnsTopicConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SnsTopicConfiguration -> SnsTopicConfiguration -> Bool
$c/= :: SnsTopicConfiguration -> SnsTopicConfiguration -> Bool
== :: SnsTopicConfiguration -> SnsTopicConfiguration -> Bool
$c== :: SnsTopicConfiguration -> SnsTopicConfiguration -> Bool
Prelude.Eq, ReadPrec [SnsTopicConfiguration]
ReadPrec SnsTopicConfiguration
Int -> ReadS SnsTopicConfiguration
ReadS [SnsTopicConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SnsTopicConfiguration]
$creadListPrec :: ReadPrec [SnsTopicConfiguration]
readPrec :: ReadPrec SnsTopicConfiguration
$creadPrec :: ReadPrec SnsTopicConfiguration
readList :: ReadS [SnsTopicConfiguration]
$creadList :: ReadS [SnsTopicConfiguration]
readsPrec :: Int -> ReadS SnsTopicConfiguration
$creadsPrec :: Int -> ReadS SnsTopicConfiguration
Prelude.Read, Int -> SnsTopicConfiguration -> ShowS
[SnsTopicConfiguration] -> ShowS
SnsTopicConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SnsTopicConfiguration] -> ShowS
$cshowList :: [SnsTopicConfiguration] -> ShowS
show :: SnsTopicConfiguration -> String
$cshow :: SnsTopicConfiguration -> String
showsPrec :: Int -> SnsTopicConfiguration -> ShowS
$cshowsPrec :: Int -> SnsTopicConfiguration -> ShowS
Prelude.Show, forall x. Rep SnsTopicConfiguration x -> SnsTopicConfiguration
forall x. SnsTopicConfiguration -> Rep SnsTopicConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SnsTopicConfiguration x -> SnsTopicConfiguration
$cfrom :: forall x. SnsTopicConfiguration -> Rep SnsTopicConfiguration x
Prelude.Generic)
newSnsTopicConfiguration ::
SnsTopicConfiguration
newSnsTopicConfiguration :: SnsTopicConfiguration
newSnsTopicConfiguration =
SnsTopicConfiguration'
{ $sel:topicPolicy:SnsTopicConfiguration' :: Maybe Text
topicPolicy =
forall a. Maybe a
Prelude.Nothing
}
snsTopicConfiguration_topicPolicy :: Lens.Lens' SnsTopicConfiguration (Prelude.Maybe Prelude.Text)
snsTopicConfiguration_topicPolicy :: Lens' SnsTopicConfiguration (Maybe Text)
snsTopicConfiguration_topicPolicy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SnsTopicConfiguration' {Maybe Text
topicPolicy :: Maybe Text
$sel:topicPolicy:SnsTopicConfiguration' :: SnsTopicConfiguration -> Maybe Text
topicPolicy} -> Maybe Text
topicPolicy) (\s :: SnsTopicConfiguration
s@SnsTopicConfiguration' {} Maybe Text
a -> SnsTopicConfiguration
s {$sel:topicPolicy:SnsTopicConfiguration' :: Maybe Text
topicPolicy = Maybe Text
a} :: SnsTopicConfiguration)
instance Data.FromJSON SnsTopicConfiguration where
parseJSON :: Value -> Parser SnsTopicConfiguration
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"SnsTopicConfiguration"
( \Object
x ->
Maybe Text -> SnsTopicConfiguration
SnsTopicConfiguration'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"topicPolicy")
)
instance Prelude.Hashable SnsTopicConfiguration where
hashWithSalt :: Int -> SnsTopicConfiguration -> Int
hashWithSalt Int
_salt SnsTopicConfiguration' {Maybe Text
topicPolicy :: Maybe Text
$sel:topicPolicy:SnsTopicConfiguration' :: SnsTopicConfiguration -> Maybe Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
topicPolicy
instance Prelude.NFData SnsTopicConfiguration where
rnf :: SnsTopicConfiguration -> ()
rnf SnsTopicConfiguration' {Maybe Text
topicPolicy :: Maybe Text
$sel:topicPolicy:SnsTopicConfiguration' :: SnsTopicConfiguration -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
topicPolicy
instance Data.ToJSON SnsTopicConfiguration where
toJSON :: SnsTopicConfiguration -> Value
toJSON SnsTopicConfiguration' {Maybe Text
topicPolicy :: Maybe Text
$sel:topicPolicy:SnsTopicConfiguration' :: SnsTopicConfiguration -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Key
"topicPolicy" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
topicPolicy]
)