{-# 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.MQ.Types.SanitizationWarning where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MQ.Types.SanitizationWarningReason
import qualified Amazonka.Prelude as Prelude
data SanitizationWarning = SanitizationWarning'
{
SanitizationWarning -> Maybe Text
attributeName :: Prelude.Maybe Prelude.Text,
SanitizationWarning -> Maybe Text
elementName :: Prelude.Maybe Prelude.Text,
SanitizationWarning -> SanitizationWarningReason
reason :: SanitizationWarningReason
}
deriving (SanitizationWarning -> SanitizationWarning -> Bool
(SanitizationWarning -> SanitizationWarning -> Bool)
-> (SanitizationWarning -> SanitizationWarning -> Bool)
-> Eq SanitizationWarning
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SanitizationWarning -> SanitizationWarning -> Bool
$c/= :: SanitizationWarning -> SanitizationWarning -> Bool
== :: SanitizationWarning -> SanitizationWarning -> Bool
$c== :: SanitizationWarning -> SanitizationWarning -> Bool
Prelude.Eq, ReadPrec [SanitizationWarning]
ReadPrec SanitizationWarning
Int -> ReadS SanitizationWarning
ReadS [SanitizationWarning]
(Int -> ReadS SanitizationWarning)
-> ReadS [SanitizationWarning]
-> ReadPrec SanitizationWarning
-> ReadPrec [SanitizationWarning]
-> Read SanitizationWarning
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SanitizationWarning]
$creadListPrec :: ReadPrec [SanitizationWarning]
readPrec :: ReadPrec SanitizationWarning
$creadPrec :: ReadPrec SanitizationWarning
readList :: ReadS [SanitizationWarning]
$creadList :: ReadS [SanitizationWarning]
readsPrec :: Int -> ReadS SanitizationWarning
$creadsPrec :: Int -> ReadS SanitizationWarning
Prelude.Read, Int -> SanitizationWarning -> ShowS
[SanitizationWarning] -> ShowS
SanitizationWarning -> String
(Int -> SanitizationWarning -> ShowS)
-> (SanitizationWarning -> String)
-> ([SanitizationWarning] -> ShowS)
-> Show SanitizationWarning
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SanitizationWarning] -> ShowS
$cshowList :: [SanitizationWarning] -> ShowS
show :: SanitizationWarning -> String
$cshow :: SanitizationWarning -> String
showsPrec :: Int -> SanitizationWarning -> ShowS
$cshowsPrec :: Int -> SanitizationWarning -> ShowS
Prelude.Show, (forall x. SanitizationWarning -> Rep SanitizationWarning x)
-> (forall x. Rep SanitizationWarning x -> SanitizationWarning)
-> Generic SanitizationWarning
forall x. Rep SanitizationWarning x -> SanitizationWarning
forall x. SanitizationWarning -> Rep SanitizationWarning x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SanitizationWarning x -> SanitizationWarning
$cfrom :: forall x. SanitizationWarning -> Rep SanitizationWarning x
Prelude.Generic)
newSanitizationWarning ::
SanitizationWarningReason ->
SanitizationWarning
newSanitizationWarning :: SanitizationWarningReason -> SanitizationWarning
newSanitizationWarning SanitizationWarningReason
pReason_ =
SanitizationWarning' :: Maybe Text
-> Maybe Text -> SanitizationWarningReason -> SanitizationWarning
SanitizationWarning'
{ $sel:attributeName:SanitizationWarning' :: Maybe Text
attributeName =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:elementName:SanitizationWarning' :: Maybe Text
elementName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:reason:SanitizationWarning' :: SanitizationWarningReason
reason = SanitizationWarningReason
pReason_
}
sanitizationWarning_attributeName :: Lens.Lens' SanitizationWarning (Prelude.Maybe Prelude.Text)
sanitizationWarning_attributeName :: (Maybe Text -> f (Maybe Text))
-> SanitizationWarning -> f SanitizationWarning
sanitizationWarning_attributeName = (SanitizationWarning -> Maybe Text)
-> (SanitizationWarning -> Maybe Text -> SanitizationWarning)
-> Lens
SanitizationWarning SanitizationWarning (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SanitizationWarning' {Maybe Text
attributeName :: Maybe Text
$sel:attributeName:SanitizationWarning' :: SanitizationWarning -> Maybe Text
attributeName} -> Maybe Text
attributeName) (\s :: SanitizationWarning
s@SanitizationWarning' {} Maybe Text
a -> SanitizationWarning
s {$sel:attributeName:SanitizationWarning' :: Maybe Text
attributeName = Maybe Text
a} :: SanitizationWarning)
sanitizationWarning_elementName :: Lens.Lens' SanitizationWarning (Prelude.Maybe Prelude.Text)
sanitizationWarning_elementName :: (Maybe Text -> f (Maybe Text))
-> SanitizationWarning -> f SanitizationWarning
sanitizationWarning_elementName = (SanitizationWarning -> Maybe Text)
-> (SanitizationWarning -> Maybe Text -> SanitizationWarning)
-> Lens
SanitizationWarning SanitizationWarning (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SanitizationWarning' {Maybe Text
elementName :: Maybe Text
$sel:elementName:SanitizationWarning' :: SanitizationWarning -> Maybe Text
elementName} -> Maybe Text
elementName) (\s :: SanitizationWarning
s@SanitizationWarning' {} Maybe Text
a -> SanitizationWarning
s {$sel:elementName:SanitizationWarning' :: Maybe Text
elementName = Maybe Text
a} :: SanitizationWarning)
sanitizationWarning_reason :: Lens.Lens' SanitizationWarning SanitizationWarningReason
sanitizationWarning_reason :: (SanitizationWarningReason -> f SanitizationWarningReason)
-> SanitizationWarning -> f SanitizationWarning
sanitizationWarning_reason = (SanitizationWarning -> SanitizationWarningReason)
-> (SanitizationWarning
-> SanitizationWarningReason -> SanitizationWarning)
-> Lens
SanitizationWarning
SanitizationWarning
SanitizationWarningReason
SanitizationWarningReason
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SanitizationWarning' {SanitizationWarningReason
reason :: SanitizationWarningReason
$sel:reason:SanitizationWarning' :: SanitizationWarning -> SanitizationWarningReason
reason} -> SanitizationWarningReason
reason) (\s :: SanitizationWarning
s@SanitizationWarning' {} SanitizationWarningReason
a -> SanitizationWarning
s {$sel:reason:SanitizationWarning' :: SanitizationWarningReason
reason = SanitizationWarningReason
a} :: SanitizationWarning)
instance Core.FromJSON SanitizationWarning where
parseJSON :: Value -> Parser SanitizationWarning
parseJSON =
String
-> (Object -> Parser SanitizationWarning)
-> Value
-> Parser SanitizationWarning
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SanitizationWarning"
( \Object
x ->
Maybe Text
-> Maybe Text -> SanitizationWarningReason -> SanitizationWarning
SanitizationWarning'
(Maybe Text
-> Maybe Text -> SanitizationWarningReason -> SanitizationWarning)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> SanitizationWarningReason -> SanitizationWarning)
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
"attributeName")
Parser
(Maybe Text -> SanitizationWarningReason -> SanitizationWarning)
-> Parser (Maybe Text)
-> Parser (SanitizationWarningReason -> SanitizationWarning)
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
"elementName")
Parser (SanitizationWarningReason -> SanitizationWarning)
-> Parser SanitizationWarningReason -> Parser SanitizationWarning
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser SanitizationWarningReason
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"reason")
)
instance Prelude.Hashable SanitizationWarning
instance Prelude.NFData SanitizationWarning