{-# 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.BotAliasSummary
-- 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.BotAliasSummary 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.BotAliasStatus
import qualified Amazonka.Prelude as Prelude

-- | Summary information about bot aliases returned from the
-- <https://docs.aws.amazon.com/lexv2/latest/dg/API_ListBotAliases.html ListBotAliases>
-- operation.
--
-- /See:/ 'newBotAliasSummary' smart constructor.
data BotAliasSummary = BotAliasSummary'
  { -- | The unique identifier assigned to the bot alias. You can use this ID to
    -- get detailed information about the alias using the
    -- <https://docs.aws.amazon.com/lexv2/latest/dg/API_DescribeBotAlias.html DescribeBotAlias>
    -- operation.
    BotAliasSummary -> Maybe Text
botAliasId :: Prelude.Maybe Prelude.Text,
    -- | The name of the bot alias.
    BotAliasSummary -> Maybe Text
botAliasName :: Prelude.Maybe Prelude.Text,
    -- | The current state of the bot alias. If the status is @Available@, the
    -- alias is ready for use.
    BotAliasSummary -> Maybe BotAliasStatus
botAliasStatus :: Prelude.Maybe BotAliasStatus,
    -- | The version of the bot that the bot alias references.
    BotAliasSummary -> Maybe Text
botVersion :: Prelude.Maybe Prelude.Text,
    -- | A timestamp of the date and time that the bot alias was created.
    BotAliasSummary -> Maybe POSIX
creationDateTime :: Prelude.Maybe Data.POSIX,
    -- | The description of the bot alias.
    BotAliasSummary -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | A timestamp of the date and time that the bot alias was last updated.
    BotAliasSummary -> Maybe POSIX
lastUpdatedDateTime :: Prelude.Maybe Data.POSIX
  }
  deriving (BotAliasSummary -> BotAliasSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BotAliasSummary -> BotAliasSummary -> Bool
$c/= :: BotAliasSummary -> BotAliasSummary -> Bool
== :: BotAliasSummary -> BotAliasSummary -> Bool
$c== :: BotAliasSummary -> BotAliasSummary -> Bool
Prelude.Eq, ReadPrec [BotAliasSummary]
ReadPrec BotAliasSummary
Int -> ReadS BotAliasSummary
ReadS [BotAliasSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BotAliasSummary]
$creadListPrec :: ReadPrec [BotAliasSummary]
readPrec :: ReadPrec BotAliasSummary
$creadPrec :: ReadPrec BotAliasSummary
readList :: ReadS [BotAliasSummary]
$creadList :: ReadS [BotAliasSummary]
readsPrec :: Int -> ReadS BotAliasSummary
$creadsPrec :: Int -> ReadS BotAliasSummary
Prelude.Read, Int -> BotAliasSummary -> ShowS
[BotAliasSummary] -> ShowS
BotAliasSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BotAliasSummary] -> ShowS
$cshowList :: [BotAliasSummary] -> ShowS
show :: BotAliasSummary -> String
$cshow :: BotAliasSummary -> String
showsPrec :: Int -> BotAliasSummary -> ShowS
$cshowsPrec :: Int -> BotAliasSummary -> ShowS
Prelude.Show, forall x. Rep BotAliasSummary x -> BotAliasSummary
forall x. BotAliasSummary -> Rep BotAliasSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BotAliasSummary x -> BotAliasSummary
$cfrom :: forall x. BotAliasSummary -> Rep BotAliasSummary x
Prelude.Generic)

-- |
-- Create a value of 'BotAliasSummary' 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:
--
-- 'botAliasId', 'botAliasSummary_botAliasId' - The unique identifier assigned to the bot alias. You can use this ID to
-- get detailed information about the alias using the
-- <https://docs.aws.amazon.com/lexv2/latest/dg/API_DescribeBotAlias.html DescribeBotAlias>
-- operation.
--
-- 'botAliasName', 'botAliasSummary_botAliasName' - The name of the bot alias.
--
-- 'botAliasStatus', 'botAliasSummary_botAliasStatus' - The current state of the bot alias. If the status is @Available@, the
-- alias is ready for use.
--
-- 'botVersion', 'botAliasSummary_botVersion' - The version of the bot that the bot alias references.
--
-- 'creationDateTime', 'botAliasSummary_creationDateTime' - A timestamp of the date and time that the bot alias was created.
--
-- 'description', 'botAliasSummary_description' - The description of the bot alias.
--
-- 'lastUpdatedDateTime', 'botAliasSummary_lastUpdatedDateTime' - A timestamp of the date and time that the bot alias was last updated.
newBotAliasSummary ::
  BotAliasSummary
newBotAliasSummary :: BotAliasSummary
newBotAliasSummary =
  BotAliasSummary'
    { $sel:botAliasId:BotAliasSummary' :: Maybe Text
botAliasId = forall a. Maybe a
Prelude.Nothing,
      $sel:botAliasName:BotAliasSummary' :: Maybe Text
botAliasName = forall a. Maybe a
Prelude.Nothing,
      $sel:botAliasStatus:BotAliasSummary' :: Maybe BotAliasStatus
botAliasStatus = forall a. Maybe a
Prelude.Nothing,
      $sel:botVersion:BotAliasSummary' :: Maybe Text
botVersion = forall a. Maybe a
Prelude.Nothing,
      $sel:creationDateTime:BotAliasSummary' :: Maybe POSIX
creationDateTime = forall a. Maybe a
Prelude.Nothing,
      $sel:description:BotAliasSummary' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedDateTime:BotAliasSummary' :: Maybe POSIX
lastUpdatedDateTime = forall a. Maybe a
Prelude.Nothing
    }

-- | The unique identifier assigned to the bot alias. You can use this ID to
-- get detailed information about the alias using the
-- <https://docs.aws.amazon.com/lexv2/latest/dg/API_DescribeBotAlias.html DescribeBotAlias>
-- operation.
botAliasSummary_botAliasId :: Lens.Lens' BotAliasSummary (Prelude.Maybe Prelude.Text)
botAliasSummary_botAliasId :: Lens' BotAliasSummary (Maybe Text)
botAliasSummary_botAliasId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BotAliasSummary' {Maybe Text
botAliasId :: Maybe Text
$sel:botAliasId:BotAliasSummary' :: BotAliasSummary -> Maybe Text
botAliasId} -> Maybe Text
botAliasId) (\s :: BotAliasSummary
s@BotAliasSummary' {} Maybe Text
a -> BotAliasSummary
s {$sel:botAliasId:BotAliasSummary' :: Maybe Text
botAliasId = Maybe Text
a} :: BotAliasSummary)

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

-- | The current state of the bot alias. If the status is @Available@, the
-- alias is ready for use.
botAliasSummary_botAliasStatus :: Lens.Lens' BotAliasSummary (Prelude.Maybe BotAliasStatus)
botAliasSummary_botAliasStatus :: Lens' BotAliasSummary (Maybe BotAliasStatus)
botAliasSummary_botAliasStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BotAliasSummary' {Maybe BotAliasStatus
botAliasStatus :: Maybe BotAliasStatus
$sel:botAliasStatus:BotAliasSummary' :: BotAliasSummary -> Maybe BotAliasStatus
botAliasStatus} -> Maybe BotAliasStatus
botAliasStatus) (\s :: BotAliasSummary
s@BotAliasSummary' {} Maybe BotAliasStatus
a -> BotAliasSummary
s {$sel:botAliasStatus:BotAliasSummary' :: Maybe BotAliasStatus
botAliasStatus = Maybe BotAliasStatus
a} :: BotAliasSummary)

-- | The version of the bot that the bot alias references.
botAliasSummary_botVersion :: Lens.Lens' BotAliasSummary (Prelude.Maybe Prelude.Text)
botAliasSummary_botVersion :: Lens' BotAliasSummary (Maybe Text)
botAliasSummary_botVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BotAliasSummary' {Maybe Text
botVersion :: Maybe Text
$sel:botVersion:BotAliasSummary' :: BotAliasSummary -> Maybe Text
botVersion} -> Maybe Text
botVersion) (\s :: BotAliasSummary
s@BotAliasSummary' {} Maybe Text
a -> BotAliasSummary
s {$sel:botVersion:BotAliasSummary' :: Maybe Text
botVersion = Maybe Text
a} :: BotAliasSummary)

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

-- | A timestamp of the date and time that the bot alias was last updated.
botAliasSummary_lastUpdatedDateTime :: Lens.Lens' BotAliasSummary (Prelude.Maybe Prelude.UTCTime)
botAliasSummary_lastUpdatedDateTime :: Lens' BotAliasSummary (Maybe UTCTime)
botAliasSummary_lastUpdatedDateTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BotAliasSummary' {Maybe POSIX
lastUpdatedDateTime :: Maybe POSIX
$sel:lastUpdatedDateTime:BotAliasSummary' :: BotAliasSummary -> Maybe POSIX
lastUpdatedDateTime} -> Maybe POSIX
lastUpdatedDateTime) (\s :: BotAliasSummary
s@BotAliasSummary' {} Maybe POSIX
a -> BotAliasSummary
s {$sel:lastUpdatedDateTime:BotAliasSummary' :: Maybe POSIX
lastUpdatedDateTime = Maybe POSIX
a} :: BotAliasSummary) 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

instance Data.FromJSON BotAliasSummary where
  parseJSON :: Value -> Parser BotAliasSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"BotAliasSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe BotAliasStatus
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> BotAliasSummary
BotAliasSummary'
            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
"botAliasId")
            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
"botAliasName")
            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
"botAliasStatus")
            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")
            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")
      )

instance Prelude.Hashable BotAliasSummary where
  hashWithSalt :: Int -> BotAliasSummary -> Int
hashWithSalt Int
_salt BotAliasSummary' {Maybe Text
Maybe POSIX
Maybe BotAliasStatus
lastUpdatedDateTime :: Maybe POSIX
description :: Maybe Text
creationDateTime :: Maybe POSIX
botVersion :: Maybe Text
botAliasStatus :: Maybe BotAliasStatus
botAliasName :: Maybe Text
botAliasId :: Maybe Text
$sel:lastUpdatedDateTime:BotAliasSummary' :: BotAliasSummary -> Maybe POSIX
$sel:description:BotAliasSummary' :: BotAliasSummary -> Maybe Text
$sel:creationDateTime:BotAliasSummary' :: BotAliasSummary -> Maybe POSIX
$sel:botVersion:BotAliasSummary' :: BotAliasSummary -> Maybe Text
$sel:botAliasStatus:BotAliasSummary' :: BotAliasSummary -> Maybe BotAliasStatus
$sel:botAliasName:BotAliasSummary' :: BotAliasSummary -> Maybe Text
$sel:botAliasId:BotAliasSummary' :: BotAliasSummary -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
botAliasId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
botAliasName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe BotAliasStatus
botAliasStatus
      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
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastUpdatedDateTime

instance Prelude.NFData BotAliasSummary where
  rnf :: BotAliasSummary -> ()
rnf BotAliasSummary' {Maybe Text
Maybe POSIX
Maybe BotAliasStatus
lastUpdatedDateTime :: Maybe POSIX
description :: Maybe Text
creationDateTime :: Maybe POSIX
botVersion :: Maybe Text
botAliasStatus :: Maybe BotAliasStatus
botAliasName :: Maybe Text
botAliasId :: Maybe Text
$sel:lastUpdatedDateTime:BotAliasSummary' :: BotAliasSummary -> Maybe POSIX
$sel:description:BotAliasSummary' :: BotAliasSummary -> Maybe Text
$sel:creationDateTime:BotAliasSummary' :: BotAliasSummary -> Maybe POSIX
$sel:botVersion:BotAliasSummary' :: BotAliasSummary -> Maybe Text
$sel:botAliasStatus:BotAliasSummary' :: BotAliasSummary -> Maybe BotAliasStatus
$sel:botAliasName:BotAliasSummary' :: BotAliasSummary -> Maybe Text
$sel:botAliasId:BotAliasSummary' :: BotAliasSummary -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
botAliasId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
botAliasName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe BotAliasStatus
botAliasStatus
      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
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastUpdatedDateTime