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