{-# 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.BotVersionSummary
-- 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.BotVersionSummary 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 version returned by the
-- <https://docs.aws.amazon.com/lexv2/latest/dg/API_ListBotVersions.html ListBotVersions>
-- operation.
--
-- /See:/ 'newBotVersionSummary' smart constructor.
data BotVersionSummary = BotVersionSummary'
  { -- | The name of the bot associated with the version.
    BotVersionSummary -> Maybe Text
botName :: Prelude.Maybe Prelude.Text,
    -- | The status of the bot. When the status is available, the version of the
    -- bot is ready for use.
    BotVersionSummary -> Maybe BotStatus
botStatus :: Prelude.Maybe BotStatus,
    -- | The numeric version of the bot, or @DRAFT@ to indicate that this is the
    -- version of the bot that can be updated..
    BotVersionSummary -> Maybe Text
botVersion :: Prelude.Maybe Prelude.Text,
    -- | A timestamp of the date and time that the version was created.
    BotVersionSummary -> Maybe POSIX
creationDateTime :: Prelude.Maybe Data.POSIX,
    -- | The description of the version.
    BotVersionSummary -> Maybe Text
description :: Prelude.Maybe Prelude.Text
  }
  deriving (BotVersionSummary -> BotVersionSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BotVersionSummary -> BotVersionSummary -> Bool
$c/= :: BotVersionSummary -> BotVersionSummary -> Bool
== :: BotVersionSummary -> BotVersionSummary -> Bool
$c== :: BotVersionSummary -> BotVersionSummary -> Bool
Prelude.Eq, ReadPrec [BotVersionSummary]
ReadPrec BotVersionSummary
Int -> ReadS BotVersionSummary
ReadS [BotVersionSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BotVersionSummary]
$creadListPrec :: ReadPrec [BotVersionSummary]
readPrec :: ReadPrec BotVersionSummary
$creadPrec :: ReadPrec BotVersionSummary
readList :: ReadS [BotVersionSummary]
$creadList :: ReadS [BotVersionSummary]
readsPrec :: Int -> ReadS BotVersionSummary
$creadsPrec :: Int -> ReadS BotVersionSummary
Prelude.Read, Int -> BotVersionSummary -> ShowS
[BotVersionSummary] -> ShowS
BotVersionSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BotVersionSummary] -> ShowS
$cshowList :: [BotVersionSummary] -> ShowS
show :: BotVersionSummary -> String
$cshow :: BotVersionSummary -> String
showsPrec :: Int -> BotVersionSummary -> ShowS
$cshowsPrec :: Int -> BotVersionSummary -> ShowS
Prelude.Show, forall x. Rep BotVersionSummary x -> BotVersionSummary
forall x. BotVersionSummary -> Rep BotVersionSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BotVersionSummary x -> BotVersionSummary
$cfrom :: forall x. BotVersionSummary -> Rep BotVersionSummary x
Prelude.Generic)

-- |
-- Create a value of 'BotVersionSummary' 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:
--
-- 'botName', 'botVersionSummary_botName' - The name of the bot associated with the version.
--
-- 'botStatus', 'botVersionSummary_botStatus' - The status of the bot. When the status is available, the version of the
-- bot is ready for use.
--
-- 'botVersion', 'botVersionSummary_botVersion' - The numeric version of the bot, or @DRAFT@ to indicate that this is the
-- version of the bot that can be updated..
--
-- 'creationDateTime', 'botVersionSummary_creationDateTime' - A timestamp of the date and time that the version was created.
--
-- 'description', 'botVersionSummary_description' - The description of the version.
newBotVersionSummary ::
  BotVersionSummary
newBotVersionSummary :: BotVersionSummary
newBotVersionSummary =
  BotVersionSummary'
    { $sel:botName:BotVersionSummary' :: Maybe Text
botName = forall a. Maybe a
Prelude.Nothing,
      $sel:botStatus:BotVersionSummary' :: Maybe BotStatus
botStatus = forall a. Maybe a
Prelude.Nothing,
      $sel:botVersion:BotVersionSummary' :: Maybe Text
botVersion = forall a. Maybe a
Prelude.Nothing,
      $sel:creationDateTime:BotVersionSummary' :: Maybe POSIX
creationDateTime = forall a. Maybe a
Prelude.Nothing,
      $sel:description:BotVersionSummary' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing
    }

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

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

-- | The numeric version of the bot, or @DRAFT@ to indicate that this is the
-- version of the bot that can be updated..
botVersionSummary_botVersion :: Lens.Lens' BotVersionSummary (Prelude.Maybe Prelude.Text)
botVersionSummary_botVersion :: Lens' BotVersionSummary (Maybe Text)
botVersionSummary_botVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BotVersionSummary' {Maybe Text
botVersion :: Maybe Text
$sel:botVersion:BotVersionSummary' :: BotVersionSummary -> Maybe Text
botVersion} -> Maybe Text
botVersion) (\s :: BotVersionSummary
s@BotVersionSummary' {} Maybe Text
a -> BotVersionSummary
s {$sel:botVersion:BotVersionSummary' :: Maybe Text
botVersion = Maybe Text
a} :: BotVersionSummary)

-- | A timestamp of the date and time that the version was created.
botVersionSummary_creationDateTime :: Lens.Lens' BotVersionSummary (Prelude.Maybe Prelude.UTCTime)
botVersionSummary_creationDateTime :: Lens' BotVersionSummary (Maybe UTCTime)
botVersionSummary_creationDateTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BotVersionSummary' {Maybe POSIX
creationDateTime :: Maybe POSIX
$sel:creationDateTime:BotVersionSummary' :: BotVersionSummary -> Maybe POSIX
creationDateTime} -> Maybe POSIX
creationDateTime) (\s :: BotVersionSummary
s@BotVersionSummary' {} Maybe POSIX
a -> BotVersionSummary
s {$sel:creationDateTime:BotVersionSummary' :: Maybe POSIX
creationDateTime = Maybe POSIX
a} :: BotVersionSummary) 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 description of the version.
botVersionSummary_description :: Lens.Lens' BotVersionSummary (Prelude.Maybe Prelude.Text)
botVersionSummary_description :: Lens' BotVersionSummary (Maybe Text)
botVersionSummary_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BotVersionSummary' {Maybe Text
description :: Maybe Text
$sel:description:BotVersionSummary' :: BotVersionSummary -> Maybe Text
description} -> Maybe Text
description) (\s :: BotVersionSummary
s@BotVersionSummary' {} Maybe Text
a -> BotVersionSummary
s {$sel:description:BotVersionSummary' :: Maybe Text
description = Maybe Text
a} :: BotVersionSummary)

instance Data.FromJSON BotVersionSummary where
  parseJSON :: Value -> Parser BotVersionSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"BotVersionSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe BotStatus
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> BotVersionSummary
BotVersionSummary'
            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
"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
"botVersion")
            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
"creationDateTime")
            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")
      )

instance Prelude.Hashable BotVersionSummary where
  hashWithSalt :: Int -> BotVersionSummary -> Int
hashWithSalt Int
_salt BotVersionSummary' {Maybe Text
Maybe POSIX
Maybe BotStatus
description :: Maybe Text
creationDateTime :: Maybe POSIX
botVersion :: Maybe Text
botStatus :: Maybe BotStatus
botName :: Maybe Text
$sel:description:BotVersionSummary' :: BotVersionSummary -> Maybe Text
$sel:creationDateTime:BotVersionSummary' :: BotVersionSummary -> Maybe POSIX
$sel:botVersion:BotVersionSummary' :: BotVersionSummary -> Maybe Text
$sel:botStatus:BotVersionSummary' :: BotVersionSummary -> Maybe BotStatus
$sel:botName:BotVersionSummary' :: BotVersionSummary -> Maybe Text
..} =
    Int
_salt
      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
botVersion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
creationDateTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description

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