{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.LexModels.Types.BotMetadata
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.LexModels.Types.BotMetadata 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.LexStatus
import qualified Amazonka.Prelude as Prelude

-- | Provides information about a bot. .
--
-- /See:/ 'newBotMetadata' smart constructor.
data BotMetadata = BotMetadata'
  { -- | The date that the bot was created.
    BotMetadata -> Maybe POSIX
createdDate :: Prelude.Maybe Data.POSIX,
    -- | A description of the bot.
    BotMetadata -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The date that the bot was updated. When you create a bot, the creation
    -- date and last updated date are the same.
    BotMetadata -> Maybe POSIX
lastUpdatedDate :: Prelude.Maybe Data.POSIX,
    -- | The name of the bot.
    BotMetadata -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The status of the bot.
    BotMetadata -> Maybe LexStatus
status :: Prelude.Maybe LexStatus,
    -- | The version of the bot. For a new bot, the version is always @$LATEST@.
    BotMetadata -> Maybe Text
version :: Prelude.Maybe Prelude.Text
  }
  deriving (BotMetadata -> BotMetadata -> Bool
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]
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
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. 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)

-- |
-- Create a value of 'BotMetadata' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'createdDate', 'botMetadata_createdDate' - The date that the bot was created.
--
-- 'description', 'botMetadata_description' - A description of the bot.
--
-- 'lastUpdatedDate', 'botMetadata_lastUpdatedDate' - The date that the bot was updated. When you create a bot, the creation
-- date and last updated date are the same.
--
-- 'name', 'botMetadata_name' - The name of the bot.
--
-- 'status', 'botMetadata_status' - The status of the bot.
--
-- 'version', 'botMetadata_version' - The version of the bot. For a new bot, the version is always @$LATEST@.
newBotMetadata ::
  BotMetadata
newBotMetadata :: BotMetadata
newBotMetadata =
  BotMetadata'
    { $sel:createdDate:BotMetadata' :: Maybe POSIX
createdDate = forall a. Maybe a
Prelude.Nothing,
      $sel:description:BotMetadata' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedDate:BotMetadata' :: Maybe POSIX
lastUpdatedDate = forall a. Maybe a
Prelude.Nothing,
      $sel:name:BotMetadata' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:status:BotMetadata' :: Maybe LexStatus
status = forall a. Maybe a
Prelude.Nothing,
      $sel:version:BotMetadata' :: Maybe Text
version = forall a. Maybe a
Prelude.Nothing
    }

-- | The date that the bot was created.
botMetadata_createdDate :: Lens.Lens' BotMetadata (Prelude.Maybe Prelude.UTCTime)
botMetadata_createdDate :: Lens' BotMetadata (Maybe UTCTime)
botMetadata_createdDate = 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) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | A description of the bot.
botMetadata_description :: Lens.Lens' BotMetadata (Prelude.Maybe Prelude.Text)
botMetadata_description :: Lens' BotMetadata (Maybe Text)
botMetadata_description = 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)

-- | The date that the bot was updated. When you create a bot, the creation
-- date and last updated date are the same.
botMetadata_lastUpdatedDate :: Lens.Lens' BotMetadata (Prelude.Maybe Prelude.UTCTime)
botMetadata_lastUpdatedDate :: Lens' BotMetadata (Maybe UTCTime)
botMetadata_lastUpdatedDate = 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) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The name of the bot.
botMetadata_name :: Lens.Lens' BotMetadata (Prelude.Maybe Prelude.Text)
botMetadata_name :: Lens' BotMetadata (Maybe Text)
botMetadata_name = 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)

-- | The status of the bot.
botMetadata_status :: Lens.Lens' BotMetadata (Prelude.Maybe LexStatus)
botMetadata_status :: Lens' BotMetadata (Maybe LexStatus)
botMetadata_status = 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)

-- | The version of the bot. For a new bot, the version is always @$LATEST@.
botMetadata_version :: Lens.Lens' BotMetadata (Prelude.Maybe Prelude.Text)
botMetadata_version :: Lens' BotMetadata (Maybe Text)
botMetadata_version = 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)

instance Data.FromJSON BotMetadata where
  parseJSON :: Value -> Parser BotMetadata
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"BotMetadata"
      ( \Object
x ->
          Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe LexStatus
-> Maybe Text
-> BotMetadata
BotMetadata'
            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
"createdDate")
            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
"description")
            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
"lastUpdatedDate")
            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
"name")
            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
"status")
            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
"version")
      )

instance Prelude.Hashable BotMetadata where
  hashWithSalt :: Int -> BotMetadata -> Int
hashWithSalt Int
_salt BotMetadata' {Maybe Text
Maybe POSIX
Maybe LexStatus
version :: Maybe Text
status :: Maybe LexStatus
name :: Maybe Text
lastUpdatedDate :: Maybe POSIX
description :: Maybe Text
createdDate :: Maybe POSIX
$sel:version:BotMetadata' :: BotMetadata -> Maybe Text
$sel:status:BotMetadata' :: BotMetadata -> Maybe LexStatus
$sel:name:BotMetadata' :: BotMetadata -> Maybe Text
$sel:lastUpdatedDate:BotMetadata' :: BotMetadata -> Maybe POSIX
$sel:description:BotMetadata' :: BotMetadata -> Maybe Text
$sel:createdDate:BotMetadata' :: BotMetadata -> Maybe POSIX
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
createdDate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastUpdatedDate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe LexStatus
status
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
version

instance Prelude.NFData BotMetadata where
  rnf :: BotMetadata -> ()
rnf BotMetadata' {Maybe Text
Maybe POSIX
Maybe LexStatus
version :: Maybe Text
status :: Maybe LexStatus
name :: Maybe Text
lastUpdatedDate :: Maybe POSIX
description :: Maybe Text
createdDate :: Maybe POSIX
$sel:version:BotMetadata' :: BotMetadata -> Maybe Text
$sel:status:BotMetadata' :: BotMetadata -> Maybe LexStatus
$sel:name:BotMetadata' :: BotMetadata -> Maybe Text
$sel:lastUpdatedDate:BotMetadata' :: BotMetadata -> Maybe POSIX
$sel:description:BotMetadata' :: BotMetadata -> Maybe Text
$sel:createdDate:BotMetadata' :: BotMetadata -> Maybe POSIX
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
createdDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastUpdatedDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe LexStatus
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
version