{-# 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.LexV2Models.Types.BotSummary
-- 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.LexV2Models.Types.BotSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.LexV2Models.Types.BotStatus
import qualified Amazonka.Prelude as Prelude

-- | Summary information about a bot returned by the
-- <https://docs.aws.amazon.com/lexv2/latest/dg/API_ListBots.html ListBots>
-- operation.
--
-- /See:/ 'newBotSummary' smart constructor.
data BotSummary = BotSummary'
  { -- | The unique identifier assigned to the bot. Use this ID to get detailed
    -- information about the bot with the
    -- <https://docs.aws.amazon.com/lexv2/latest/dg/API_DescribeBot.html DescribeBot>
    -- operation.
    BotSummary -> Maybe Text
botId :: Prelude.Maybe Prelude.Text,
    -- | The name of the bot.
    BotSummary -> Maybe Text
botName :: Prelude.Maybe Prelude.Text,
    -- | The current status of the bot. When the status is @Available@ the bot is
    -- ready for use.
    BotSummary -> Maybe BotStatus
botStatus :: Prelude.Maybe BotStatus,
    -- | The description of the bot.
    BotSummary -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The date and time that the bot was last updated.
    BotSummary -> Maybe POSIX
lastUpdatedDateTime :: Prelude.Maybe Data.POSIX,
    -- | The latest numerical version in use for the bot.
    BotSummary -> Maybe Text
latestBotVersion :: Prelude.Maybe Prelude.Text
  }
  deriving (BotSummary -> BotSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BotSummary -> BotSummary -> Bool
$c/= :: BotSummary -> BotSummary -> Bool
== :: BotSummary -> BotSummary -> Bool
$c== :: BotSummary -> BotSummary -> Bool
Prelude.Eq, ReadPrec [BotSummary]
ReadPrec BotSummary
Int -> ReadS BotSummary
ReadS [BotSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BotSummary]
$creadListPrec :: ReadPrec [BotSummary]
readPrec :: ReadPrec BotSummary
$creadPrec :: ReadPrec BotSummary
readList :: ReadS [BotSummary]
$creadList :: ReadS [BotSummary]
readsPrec :: Int -> ReadS BotSummary
$creadsPrec :: Int -> ReadS BotSummary
Prelude.Read, Int -> BotSummary -> ShowS
[BotSummary] -> ShowS
BotSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BotSummary] -> ShowS
$cshowList :: [BotSummary] -> ShowS
show :: BotSummary -> String
$cshow :: BotSummary -> String
showsPrec :: Int -> BotSummary -> ShowS
$cshowsPrec :: Int -> BotSummary -> ShowS
Prelude.Show, forall x. Rep BotSummary x -> BotSummary
forall x. BotSummary -> Rep BotSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BotSummary x -> BotSummary
$cfrom :: forall x. BotSummary -> Rep BotSummary x
Prelude.Generic)

-- |
-- Create a value of 'BotSummary' 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:
--
-- 'botId', 'botSummary_botId' - The unique identifier assigned to the bot. Use this ID to get detailed
-- information about the bot with the
-- <https://docs.aws.amazon.com/lexv2/latest/dg/API_DescribeBot.html DescribeBot>
-- operation.
--
-- 'botName', 'botSummary_botName' - The name of the bot.
--
-- 'botStatus', 'botSummary_botStatus' - The current status of the bot. When the status is @Available@ the bot is
-- ready for use.
--
-- 'description', 'botSummary_description' - The description of the bot.
--
-- 'lastUpdatedDateTime', 'botSummary_lastUpdatedDateTime' - The date and time that the bot was last updated.
--
-- 'latestBotVersion', 'botSummary_latestBotVersion' - The latest numerical version in use for the bot.
newBotSummary ::
  BotSummary
newBotSummary :: BotSummary
newBotSummary =
  BotSummary'
    { $sel:botId:BotSummary' :: Maybe Text
botId = forall a. Maybe a
Prelude.Nothing,
      $sel:botName:BotSummary' :: Maybe Text
botName = forall a. Maybe a
Prelude.Nothing,
      $sel:botStatus:BotSummary' :: Maybe BotStatus
botStatus = forall a. Maybe a
Prelude.Nothing,
      $sel:description:BotSummary' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedDateTime:BotSummary' :: Maybe POSIX
lastUpdatedDateTime = forall a. Maybe a
Prelude.Nothing,
      $sel:latestBotVersion:BotSummary' :: Maybe Text
latestBotVersion = forall a. Maybe a
Prelude.Nothing
    }

-- | The unique identifier assigned to the bot. Use this ID to get detailed
-- information about the bot with the
-- <https://docs.aws.amazon.com/lexv2/latest/dg/API_DescribeBot.html DescribeBot>
-- operation.
botSummary_botId :: Lens.Lens' BotSummary (Prelude.Maybe Prelude.Text)
botSummary_botId :: Lens' BotSummary (Maybe Text)
botSummary_botId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BotSummary' {Maybe Text
botId :: Maybe Text
$sel:botId:BotSummary' :: BotSummary -> Maybe Text
botId} -> Maybe Text
botId) (\s :: BotSummary
s@BotSummary' {} Maybe Text
a -> BotSummary
s {$sel:botId:BotSummary' :: Maybe Text
botId = Maybe Text
a} :: BotSummary)

-- | The name of the bot.
botSummary_botName :: Lens.Lens' BotSummary (Prelude.Maybe Prelude.Text)
botSummary_botName :: Lens' BotSummary (Maybe Text)
botSummary_botName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BotSummary' {Maybe Text
botName :: Maybe Text
$sel:botName:BotSummary' :: BotSummary -> Maybe Text
botName} -> Maybe Text
botName) (\s :: BotSummary
s@BotSummary' {} Maybe Text
a -> BotSummary
s {$sel:botName:BotSummary' :: Maybe Text
botName = Maybe Text
a} :: BotSummary)

-- | The current status of the bot. When the status is @Available@ the bot is
-- ready for use.
botSummary_botStatus :: Lens.Lens' BotSummary (Prelude.Maybe BotStatus)
botSummary_botStatus :: Lens' BotSummary (Maybe BotStatus)
botSummary_botStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BotSummary' {Maybe BotStatus
botStatus :: Maybe BotStatus
$sel:botStatus:BotSummary' :: BotSummary -> Maybe BotStatus
botStatus} -> Maybe BotStatus
botStatus) (\s :: BotSummary
s@BotSummary' {} Maybe BotStatus
a -> BotSummary
s {$sel:botStatus:BotSummary' :: Maybe BotStatus
botStatus = Maybe BotStatus
a} :: BotSummary)

-- | The description of the bot.
botSummary_description :: Lens.Lens' BotSummary (Prelude.Maybe Prelude.Text)
botSummary_description :: Lens' BotSummary (Maybe Text)
botSummary_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BotSummary' {Maybe Text
description :: Maybe Text
$sel:description:BotSummary' :: BotSummary -> Maybe Text
description} -> Maybe Text
description) (\s :: BotSummary
s@BotSummary' {} Maybe Text
a -> BotSummary
s {$sel:description:BotSummary' :: Maybe Text
description = Maybe Text
a} :: BotSummary)

-- | The date and time that the bot was last updated.
botSummary_lastUpdatedDateTime :: Lens.Lens' BotSummary (Prelude.Maybe Prelude.UTCTime)
botSummary_lastUpdatedDateTime :: Lens' BotSummary (Maybe UTCTime)
botSummary_lastUpdatedDateTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BotSummary' {Maybe POSIX
lastUpdatedDateTime :: Maybe POSIX
$sel:lastUpdatedDateTime:BotSummary' :: BotSummary -> Maybe POSIX
lastUpdatedDateTime} -> Maybe POSIX
lastUpdatedDateTime) (\s :: BotSummary
s@BotSummary' {} Maybe POSIX
a -> BotSummary
s {$sel:lastUpdatedDateTime:BotSummary' :: Maybe POSIX
lastUpdatedDateTime = Maybe POSIX
a} :: BotSummary) 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 latest numerical version in use for the bot.
botSummary_latestBotVersion :: Lens.Lens' BotSummary (Prelude.Maybe Prelude.Text)
botSummary_latestBotVersion :: Lens' BotSummary (Maybe Text)
botSummary_latestBotVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BotSummary' {Maybe Text
latestBotVersion :: Maybe Text
$sel:latestBotVersion:BotSummary' :: BotSummary -> Maybe Text
latestBotVersion} -> Maybe Text
latestBotVersion) (\s :: BotSummary
s@BotSummary' {} Maybe Text
a -> BotSummary
s {$sel:latestBotVersion:BotSummary' :: Maybe Text
latestBotVersion = Maybe Text
a} :: BotSummary)

instance Data.FromJSON BotSummary where
  parseJSON :: Value -> Parser BotSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"BotSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe BotStatus
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> BotSummary
BotSummary'
            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
"botId")
            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
"botName")
            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
"botStatus")
            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
"lastUpdatedDateTime")
            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
"latestBotVersion")
      )

instance Prelude.Hashable BotSummary where
  hashWithSalt :: Int -> BotSummary -> Int
hashWithSalt Int
_salt BotSummary' {Maybe Text
Maybe POSIX
Maybe BotStatus
latestBotVersion :: Maybe Text
lastUpdatedDateTime :: Maybe POSIX
description :: Maybe Text
botStatus :: Maybe BotStatus
botName :: Maybe Text
botId :: Maybe Text
$sel:latestBotVersion:BotSummary' :: BotSummary -> Maybe Text
$sel:lastUpdatedDateTime:BotSummary' :: BotSummary -> Maybe POSIX
$sel:description:BotSummary' :: BotSummary -> Maybe Text
$sel:botStatus:BotSummary' :: BotSummary -> Maybe BotStatus
$sel:botName:BotSummary' :: BotSummary -> Maybe Text
$sel:botId:BotSummary' :: BotSummary -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
botId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
botName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe BotStatus
botStatus
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastUpdatedDateTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
latestBotVersion

instance Prelude.NFData BotSummary where
  rnf :: BotSummary -> ()
rnf BotSummary' {Maybe Text
Maybe POSIX
Maybe BotStatus
latestBotVersion :: Maybe Text
lastUpdatedDateTime :: Maybe POSIX
description :: Maybe Text
botStatus :: Maybe BotStatus
botName :: Maybe Text
botId :: Maybe Text
$sel:latestBotVersion:BotSummary' :: BotSummary -> Maybe Text
$sel:lastUpdatedDateTime:BotSummary' :: BotSummary -> Maybe POSIX
$sel:description:BotSummary' :: BotSummary -> Maybe Text
$sel:botStatus:BotSummary' :: BotSummary -> Maybe BotStatus
$sel:botName:BotSummary' :: BotSummary -> Maybe Text
$sel:botId:BotSummary' :: BotSummary -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
botId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
botName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe BotStatus
botStatus
      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
lastUpdatedDateTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
latestBotVersion