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