{-# 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.BotMetadata where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.LexModels.Types.LexStatus
import qualified Amazonka.Prelude as Prelude
data BotMetadata = BotMetadata'
{
BotMetadata -> Maybe LexStatus
status :: Prelude.Maybe LexStatus,
BotMetadata -> Maybe POSIX
createdDate :: Prelude.Maybe Core.POSIX,
BotMetadata -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
BotMetadata -> Maybe Text
version :: Prelude.Maybe Prelude.Text,
BotMetadata -> Maybe POSIX
lastUpdatedDate :: Prelude.Maybe Core.POSIX,
BotMetadata -> Maybe Text
description :: Prelude.Maybe Prelude.Text
}
deriving (BotMetadata -> BotMetadata -> Bool
(BotMetadata -> BotMetadata -> Bool)
-> (BotMetadata -> BotMetadata -> Bool) -> Eq BotMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BotMetadata -> BotMetadata -> Bool
$c/= :: BotMetadata -> BotMetadata -> Bool
== :: BotMetadata -> BotMetadata -> Bool
$c== :: BotMetadata -> BotMetadata -> Bool
Prelude.Eq, ReadPrec [BotMetadata]
ReadPrec BotMetadata
Int -> ReadS BotMetadata
ReadS [BotMetadata]
(Int -> ReadS BotMetadata)
-> ReadS [BotMetadata]
-> ReadPrec BotMetadata
-> ReadPrec [BotMetadata]
-> Read BotMetadata
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BotMetadata]
$creadListPrec :: ReadPrec [BotMetadata]
readPrec :: ReadPrec BotMetadata
$creadPrec :: ReadPrec BotMetadata
readList :: ReadS [BotMetadata]
$creadList :: ReadS [BotMetadata]
readsPrec :: Int -> ReadS BotMetadata
$creadsPrec :: Int -> ReadS BotMetadata
Prelude.Read, Int -> BotMetadata -> ShowS
[BotMetadata] -> ShowS
BotMetadata -> String
(Int -> BotMetadata -> ShowS)
-> (BotMetadata -> String)
-> ([BotMetadata] -> ShowS)
-> Show BotMetadata
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BotMetadata] -> ShowS
$cshowList :: [BotMetadata] -> ShowS
show :: BotMetadata -> String
$cshow :: BotMetadata -> String
showsPrec :: Int -> BotMetadata -> ShowS
$cshowsPrec :: Int -> BotMetadata -> ShowS
Prelude.Show, (forall x. BotMetadata -> Rep BotMetadata x)
-> (forall x. Rep BotMetadata x -> BotMetadata)
-> Generic BotMetadata
forall x. Rep BotMetadata x -> BotMetadata
forall x. BotMetadata -> Rep BotMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BotMetadata x -> BotMetadata
$cfrom :: forall x. BotMetadata -> Rep BotMetadata x
Prelude.Generic)
newBotMetadata ::
BotMetadata
newBotMetadata :: BotMetadata
newBotMetadata =
BotMetadata' :: Maybe LexStatus
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> BotMetadata
BotMetadata'
{ $sel:status:BotMetadata' :: Maybe LexStatus
status = Maybe LexStatus
forall a. Maybe a
Prelude.Nothing,
$sel:createdDate:BotMetadata' :: Maybe POSIX
createdDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:name:BotMetadata' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:version:BotMetadata' :: Maybe Text
version = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:lastUpdatedDate:BotMetadata' :: Maybe POSIX
lastUpdatedDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:description:BotMetadata' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
botMetadata_status :: Lens.Lens' BotMetadata (Prelude.Maybe LexStatus)
botMetadata_status :: (Maybe LexStatus -> f (Maybe LexStatus))
-> BotMetadata -> f BotMetadata
botMetadata_status = (BotMetadata -> Maybe LexStatus)
-> (BotMetadata -> Maybe LexStatus -> BotMetadata)
-> Lens BotMetadata BotMetadata (Maybe LexStatus) (Maybe LexStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BotMetadata' {Maybe LexStatus
status :: Maybe LexStatus
$sel:status:BotMetadata' :: BotMetadata -> Maybe LexStatus
status} -> Maybe LexStatus
status) (\s :: BotMetadata
s@BotMetadata' {} Maybe LexStatus
a -> BotMetadata
s {$sel:status:BotMetadata' :: Maybe LexStatus
status = Maybe LexStatus
a} :: BotMetadata)
botMetadata_createdDate :: Lens.Lens' BotMetadata (Prelude.Maybe Prelude.UTCTime)
botMetadata_createdDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> BotMetadata -> f BotMetadata
botMetadata_createdDate = (BotMetadata -> Maybe POSIX)
-> (BotMetadata -> Maybe POSIX -> BotMetadata)
-> Lens BotMetadata BotMetadata (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BotMetadata' {Maybe POSIX
createdDate :: Maybe POSIX
$sel:createdDate:BotMetadata' :: BotMetadata -> Maybe POSIX
createdDate} -> Maybe POSIX
createdDate) (\s :: BotMetadata
s@BotMetadata' {} Maybe POSIX
a -> BotMetadata
s {$sel:createdDate:BotMetadata' :: Maybe POSIX
createdDate = Maybe POSIX
a} :: BotMetadata) ((Maybe POSIX -> f (Maybe POSIX)) -> BotMetadata -> f BotMetadata)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> BotMetadata
-> f BotMetadata
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
botMetadata_name :: Lens.Lens' BotMetadata (Prelude.Maybe Prelude.Text)
botMetadata_name :: (Maybe Text -> f (Maybe Text)) -> BotMetadata -> f BotMetadata
botMetadata_name = (BotMetadata -> Maybe Text)
-> (BotMetadata -> Maybe Text -> BotMetadata)
-> Lens BotMetadata BotMetadata (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BotMetadata' {Maybe Text
name :: Maybe Text
$sel:name:BotMetadata' :: BotMetadata -> Maybe Text
name} -> Maybe Text
name) (\s :: BotMetadata
s@BotMetadata' {} Maybe Text
a -> BotMetadata
s {$sel:name:BotMetadata' :: Maybe Text
name = Maybe Text
a} :: BotMetadata)
botMetadata_version :: Lens.Lens' BotMetadata (Prelude.Maybe Prelude.Text)
botMetadata_version :: (Maybe Text -> f (Maybe Text)) -> BotMetadata -> f BotMetadata
botMetadata_version = (BotMetadata -> Maybe Text)
-> (BotMetadata -> Maybe Text -> BotMetadata)
-> Lens BotMetadata BotMetadata (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BotMetadata' {Maybe Text
version :: Maybe Text
$sel:version:BotMetadata' :: BotMetadata -> Maybe Text
version} -> Maybe Text
version) (\s :: BotMetadata
s@BotMetadata' {} Maybe Text
a -> BotMetadata
s {$sel:version:BotMetadata' :: Maybe Text
version = Maybe Text
a} :: BotMetadata)
botMetadata_lastUpdatedDate :: Lens.Lens' BotMetadata (Prelude.Maybe Prelude.UTCTime)
botMetadata_lastUpdatedDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> BotMetadata -> f BotMetadata
botMetadata_lastUpdatedDate = (BotMetadata -> Maybe POSIX)
-> (BotMetadata -> Maybe POSIX -> BotMetadata)
-> Lens BotMetadata BotMetadata (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BotMetadata' {Maybe POSIX
lastUpdatedDate :: Maybe POSIX
$sel:lastUpdatedDate:BotMetadata' :: BotMetadata -> Maybe POSIX
lastUpdatedDate} -> Maybe POSIX
lastUpdatedDate) (\s :: BotMetadata
s@BotMetadata' {} Maybe POSIX
a -> BotMetadata
s {$sel:lastUpdatedDate:BotMetadata' :: Maybe POSIX
lastUpdatedDate = Maybe POSIX
a} :: BotMetadata) ((Maybe POSIX -> f (Maybe POSIX)) -> BotMetadata -> f BotMetadata)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> BotMetadata
-> f BotMetadata
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
botMetadata_description :: Lens.Lens' BotMetadata (Prelude.Maybe Prelude.Text)
botMetadata_description :: (Maybe Text -> f (Maybe Text)) -> BotMetadata -> f BotMetadata
botMetadata_description = (BotMetadata -> Maybe Text)
-> (BotMetadata -> Maybe Text -> BotMetadata)
-> Lens BotMetadata BotMetadata (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BotMetadata' {Maybe Text
description :: Maybe Text
$sel:description:BotMetadata' :: BotMetadata -> Maybe Text
description} -> Maybe Text
description) (\s :: BotMetadata
s@BotMetadata' {} Maybe Text
a -> BotMetadata
s {$sel:description:BotMetadata' :: Maybe Text
description = Maybe Text
a} :: BotMetadata)
instance Core.FromJSON BotMetadata where
parseJSON :: Value -> Parser BotMetadata
parseJSON =
String
-> (Object -> Parser BotMetadata) -> Value -> Parser BotMetadata
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"BotMetadata"
( \Object
x ->
Maybe LexStatus
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> BotMetadata
BotMetadata'
(Maybe LexStatus
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> BotMetadata)
-> Parser (Maybe LexStatus)
-> Parser
(Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> BotMetadata)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe LexStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"status")
Parser
(Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> BotMetadata)
-> Parser (Maybe POSIX)
-> Parser
(Maybe Text
-> Maybe Text -> Maybe POSIX -> Maybe Text -> BotMetadata)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"createdDate")
Parser
(Maybe Text
-> Maybe Text -> Maybe POSIX -> Maybe Text -> BotMetadata)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe POSIX -> Maybe Text -> BotMetadata)
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
"name")
Parser (Maybe Text -> Maybe POSIX -> Maybe Text -> BotMetadata)
-> Parser (Maybe Text)
-> Parser (Maybe POSIX -> Maybe Text -> BotMetadata)
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
"version")
Parser (Maybe POSIX -> Maybe Text -> BotMetadata)
-> Parser (Maybe POSIX) -> Parser (Maybe Text -> BotMetadata)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"lastUpdatedDate")
Parser (Maybe Text -> BotMetadata)
-> Parser (Maybe Text) -> Parser BotMetadata
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
"description")
)
instance Prelude.Hashable BotMetadata
instance Prelude.NFData BotMetadata