{-# 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.LexModels.Types.MigrationAlert where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.LexModels.Types.MigrationAlertType
import qualified Amazonka.Prelude as Prelude
data MigrationAlert = MigrationAlert'
{
MigrationAlert -> Maybe [Text]
referenceURLs :: Prelude.Maybe [Prelude.Text],
MigrationAlert -> Maybe [Text]
details :: Prelude.Maybe [Prelude.Text],
MigrationAlert -> Maybe MigrationAlertType
type' :: Prelude.Maybe MigrationAlertType,
MigrationAlert -> Maybe Text
message :: Prelude.Maybe Prelude.Text
}
deriving (MigrationAlert -> MigrationAlert -> Bool
(MigrationAlert -> MigrationAlert -> Bool)
-> (MigrationAlert -> MigrationAlert -> Bool) -> Eq MigrationAlert
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MigrationAlert -> MigrationAlert -> Bool
$c/= :: MigrationAlert -> MigrationAlert -> Bool
== :: MigrationAlert -> MigrationAlert -> Bool
$c== :: MigrationAlert -> MigrationAlert -> Bool
Prelude.Eq, ReadPrec [MigrationAlert]
ReadPrec MigrationAlert
Int -> ReadS MigrationAlert
ReadS [MigrationAlert]
(Int -> ReadS MigrationAlert)
-> ReadS [MigrationAlert]
-> ReadPrec MigrationAlert
-> ReadPrec [MigrationAlert]
-> Read MigrationAlert
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MigrationAlert]
$creadListPrec :: ReadPrec [MigrationAlert]
readPrec :: ReadPrec MigrationAlert
$creadPrec :: ReadPrec MigrationAlert
readList :: ReadS [MigrationAlert]
$creadList :: ReadS [MigrationAlert]
readsPrec :: Int -> ReadS MigrationAlert
$creadsPrec :: Int -> ReadS MigrationAlert
Prelude.Read, Int -> MigrationAlert -> ShowS
[MigrationAlert] -> ShowS
MigrationAlert -> String
(Int -> MigrationAlert -> ShowS)
-> (MigrationAlert -> String)
-> ([MigrationAlert] -> ShowS)
-> Show MigrationAlert
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MigrationAlert] -> ShowS
$cshowList :: [MigrationAlert] -> ShowS
show :: MigrationAlert -> String
$cshow :: MigrationAlert -> String
showsPrec :: Int -> MigrationAlert -> ShowS
$cshowsPrec :: Int -> MigrationAlert -> ShowS
Prelude.Show, (forall x. MigrationAlert -> Rep MigrationAlert x)
-> (forall x. Rep MigrationAlert x -> MigrationAlert)
-> Generic MigrationAlert
forall x. Rep MigrationAlert x -> MigrationAlert
forall x. MigrationAlert -> Rep MigrationAlert x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MigrationAlert x -> MigrationAlert
$cfrom :: forall x. MigrationAlert -> Rep MigrationAlert x
Prelude.Generic)
newMigrationAlert ::
MigrationAlert
newMigrationAlert :: MigrationAlert
newMigrationAlert =
MigrationAlert' :: Maybe [Text]
-> Maybe [Text]
-> Maybe MigrationAlertType
-> Maybe Text
-> MigrationAlert
MigrationAlert'
{ $sel:referenceURLs:MigrationAlert' :: Maybe [Text]
referenceURLs = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:details:MigrationAlert' :: Maybe [Text]
details = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:type':MigrationAlert' :: Maybe MigrationAlertType
type' = Maybe MigrationAlertType
forall a. Maybe a
Prelude.Nothing,
$sel:message:MigrationAlert' :: Maybe Text
message = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
migrationAlert_referenceURLs :: Lens.Lens' MigrationAlert (Prelude.Maybe [Prelude.Text])
migrationAlert_referenceURLs :: (Maybe [Text] -> f (Maybe [Text]))
-> MigrationAlert -> f MigrationAlert
migrationAlert_referenceURLs = (MigrationAlert -> Maybe [Text])
-> (MigrationAlert -> Maybe [Text] -> MigrationAlert)
-> Lens MigrationAlert MigrationAlert (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MigrationAlert' {Maybe [Text]
referenceURLs :: Maybe [Text]
$sel:referenceURLs:MigrationAlert' :: MigrationAlert -> Maybe [Text]
referenceURLs} -> Maybe [Text]
referenceURLs) (\s :: MigrationAlert
s@MigrationAlert' {} Maybe [Text]
a -> MigrationAlert
s {$sel:referenceURLs:MigrationAlert' :: Maybe [Text]
referenceURLs = Maybe [Text]
a} :: MigrationAlert) ((Maybe [Text] -> f (Maybe [Text]))
-> MigrationAlert -> f MigrationAlert)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> MigrationAlert
-> f MigrationAlert
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
migrationAlert_details :: Lens.Lens' MigrationAlert (Prelude.Maybe [Prelude.Text])
migrationAlert_details :: (Maybe [Text] -> f (Maybe [Text]))
-> MigrationAlert -> f MigrationAlert
migrationAlert_details = (MigrationAlert -> Maybe [Text])
-> (MigrationAlert -> Maybe [Text] -> MigrationAlert)
-> Lens MigrationAlert MigrationAlert (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MigrationAlert' {Maybe [Text]
details :: Maybe [Text]
$sel:details:MigrationAlert' :: MigrationAlert -> Maybe [Text]
details} -> Maybe [Text]
details) (\s :: MigrationAlert
s@MigrationAlert' {} Maybe [Text]
a -> MigrationAlert
s {$sel:details:MigrationAlert' :: Maybe [Text]
details = Maybe [Text]
a} :: MigrationAlert) ((Maybe [Text] -> f (Maybe [Text]))
-> MigrationAlert -> f MigrationAlert)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> MigrationAlert
-> f MigrationAlert
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
migrationAlert_type :: Lens.Lens' MigrationAlert (Prelude.Maybe MigrationAlertType)
migrationAlert_type :: (Maybe MigrationAlertType -> f (Maybe MigrationAlertType))
-> MigrationAlert -> f MigrationAlert
migrationAlert_type = (MigrationAlert -> Maybe MigrationAlertType)
-> (MigrationAlert -> Maybe MigrationAlertType -> MigrationAlert)
-> Lens
MigrationAlert
MigrationAlert
(Maybe MigrationAlertType)
(Maybe MigrationAlertType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MigrationAlert' {Maybe MigrationAlertType
type' :: Maybe MigrationAlertType
$sel:type':MigrationAlert' :: MigrationAlert -> Maybe MigrationAlertType
type'} -> Maybe MigrationAlertType
type') (\s :: MigrationAlert
s@MigrationAlert' {} Maybe MigrationAlertType
a -> MigrationAlert
s {$sel:type':MigrationAlert' :: Maybe MigrationAlertType
type' = Maybe MigrationAlertType
a} :: MigrationAlert)
migrationAlert_message :: Lens.Lens' MigrationAlert (Prelude.Maybe Prelude.Text)
migrationAlert_message :: (Maybe Text -> f (Maybe Text))
-> MigrationAlert -> f MigrationAlert
migrationAlert_message = (MigrationAlert -> Maybe Text)
-> (MigrationAlert -> Maybe Text -> MigrationAlert)
-> Lens MigrationAlert MigrationAlert (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MigrationAlert' {Maybe Text
message :: Maybe Text
$sel:message:MigrationAlert' :: MigrationAlert -> Maybe Text
message} -> Maybe Text
message) (\s :: MigrationAlert
s@MigrationAlert' {} Maybe Text
a -> MigrationAlert
s {$sel:message:MigrationAlert' :: Maybe Text
message = Maybe Text
a} :: MigrationAlert)
instance Core.FromJSON MigrationAlert where
parseJSON :: Value -> Parser MigrationAlert
parseJSON =
String
-> (Object -> Parser MigrationAlert)
-> Value
-> Parser MigrationAlert
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"MigrationAlert"
( \Object
x ->
Maybe [Text]
-> Maybe [Text]
-> Maybe MigrationAlertType
-> Maybe Text
-> MigrationAlert
MigrationAlert'
(Maybe [Text]
-> Maybe [Text]
-> Maybe MigrationAlertType
-> Maybe Text
-> MigrationAlert)
-> Parser (Maybe [Text])
-> Parser
(Maybe [Text]
-> Maybe MigrationAlertType -> Maybe Text -> MigrationAlert)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"referenceURLs" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
Parser
(Maybe [Text]
-> Maybe MigrationAlertType -> Maybe Text -> MigrationAlert)
-> Parser (Maybe [Text])
-> Parser
(Maybe MigrationAlertType -> Maybe Text -> MigrationAlert)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"details" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
Parser (Maybe MigrationAlertType -> Maybe Text -> MigrationAlert)
-> Parser (Maybe MigrationAlertType)
-> Parser (Maybe Text -> MigrationAlert)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe MigrationAlertType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"type")
Parser (Maybe Text -> MigrationAlert)
-> Parser (Maybe Text) -> Parser MigrationAlert
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
"message")
)
instance Prelude.Hashable MigrationAlert
instance Prelude.NFData MigrationAlert