{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.LexModels.Types.MigrationAlertType
import qualified Amazonka.Prelude as Prelude
data MigrationAlert = MigrationAlert'
{
MigrationAlert -> Maybe [Text]
details :: Prelude.Maybe [Prelude.Text],
MigrationAlert -> Maybe Text
message :: Prelude.Maybe Prelude.Text,
MigrationAlert -> Maybe [Text]
referenceURLs :: Prelude.Maybe [Prelude.Text],
MigrationAlert -> Maybe MigrationAlertType
type' :: Prelude.Maybe MigrationAlertType
}
deriving (MigrationAlert -> MigrationAlert -> Bool
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]
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
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. 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'
{ $sel:details:MigrationAlert' :: Maybe [Text]
details = forall a. Maybe a
Prelude.Nothing,
$sel:message:MigrationAlert' :: Maybe Text
message = forall a. Maybe a
Prelude.Nothing,
$sel:referenceURLs:MigrationAlert' :: Maybe [Text]
referenceURLs = forall a. Maybe a
Prelude.Nothing,
$sel:type':MigrationAlert' :: Maybe MigrationAlertType
type' = forall a. Maybe a
Prelude.Nothing
}
migrationAlert_details :: Lens.Lens' MigrationAlert (Prelude.Maybe [Prelude.Text])
migrationAlert_details :: Lens' MigrationAlert (Maybe [Text])
migrationAlert_details = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
migrationAlert_message :: Lens.Lens' MigrationAlert (Prelude.Maybe Prelude.Text)
migrationAlert_message :: Lens' MigrationAlert (Maybe Text)
migrationAlert_message = 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)
migrationAlert_referenceURLs :: Lens.Lens' MigrationAlert (Prelude.Maybe [Prelude.Text])
migrationAlert_referenceURLs :: Lens' MigrationAlert (Maybe [Text])
migrationAlert_referenceURLs = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 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 :: Lens' MigrationAlert (Maybe MigrationAlertType)
migrationAlert_type = 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)
instance Data.FromJSON MigrationAlert where
parseJSON :: Value -> Parser MigrationAlert
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"MigrationAlert"
( \Object
x ->
Maybe [Text]
-> Maybe Text
-> Maybe [Text]
-> Maybe MigrationAlertType
-> MigrationAlert
MigrationAlert'
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
"details" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"message")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"referenceURLs" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"type")
)
instance Prelude.Hashable MigrationAlert where
hashWithSalt :: Int -> MigrationAlert -> Int
hashWithSalt Int
_salt MigrationAlert' {Maybe [Text]
Maybe Text
Maybe MigrationAlertType
type' :: Maybe MigrationAlertType
referenceURLs :: Maybe [Text]
message :: Maybe Text
details :: Maybe [Text]
$sel:type':MigrationAlert' :: MigrationAlert -> Maybe MigrationAlertType
$sel:referenceURLs:MigrationAlert' :: MigrationAlert -> Maybe [Text]
$sel:message:MigrationAlert' :: MigrationAlert -> Maybe Text
$sel:details:MigrationAlert' :: MigrationAlert -> Maybe [Text]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
details
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
message
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
referenceURLs
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe MigrationAlertType
type'
instance Prelude.NFData MigrationAlert where
rnf :: MigrationAlert -> ()
rnf MigrationAlert' {Maybe [Text]
Maybe Text
Maybe MigrationAlertType
type' :: Maybe MigrationAlertType
referenceURLs :: Maybe [Text]
message :: Maybe Text
details :: Maybe [Text]
$sel:type':MigrationAlert' :: MigrationAlert -> Maybe MigrationAlertType
$sel:referenceURLs:MigrationAlert' :: MigrationAlert -> Maybe [Text]
$sel:message:MigrationAlert' :: MigrationAlert -> Maybe Text
$sel:details:MigrationAlert' :: MigrationAlert -> Maybe [Text]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
details
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
message
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
referenceURLs
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe MigrationAlertType
type'