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

-- | Provides information about a bot alias.
--
-- /See:/ 'newBotAliasMetadata' smart constructor.
data BotAliasMetadata = BotAliasMetadata'
  { -- | The name of the bot to which the alias points.
    BotAliasMetadata -> Maybe Text
botName :: Prelude.Maybe Prelude.Text,
    -- | The version of the Amazon Lex bot to which the alias points.
    BotAliasMetadata -> Maybe Text
botVersion :: Prelude.Maybe Prelude.Text,
    -- | Checksum of the bot alias.
    BotAliasMetadata -> Maybe Text
checksum :: Prelude.Maybe Prelude.Text,
    -- | Settings that determine how Amazon Lex uses conversation logs for the
    -- alias.
    BotAliasMetadata -> Maybe ConversationLogsResponse
conversationLogs :: Prelude.Maybe ConversationLogsResponse,
    -- | The date that the bot alias was created.
    BotAliasMetadata -> Maybe POSIX
createdDate :: Prelude.Maybe Data.POSIX,
    -- | A description of the bot alias.
    BotAliasMetadata -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The date that the bot alias was updated. When you create a resource, the
    -- creation date and last updated date are the same.
    BotAliasMetadata -> Maybe POSIX
lastUpdatedDate :: Prelude.Maybe Data.POSIX,
    -- | The name of the bot alias.
    BotAliasMetadata -> Maybe Text
name :: Prelude.Maybe Prelude.Text
  }
  deriving (BotAliasMetadata -> BotAliasMetadata -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BotAliasMetadata -> BotAliasMetadata -> Bool
$c/= :: BotAliasMetadata -> BotAliasMetadata -> Bool
== :: BotAliasMetadata -> BotAliasMetadata -> Bool
$c== :: BotAliasMetadata -> BotAliasMetadata -> Bool
Prelude.Eq, ReadPrec [BotAliasMetadata]
ReadPrec BotAliasMetadata
Int -> ReadS BotAliasMetadata
ReadS [BotAliasMetadata]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BotAliasMetadata]
$creadListPrec :: ReadPrec [BotAliasMetadata]
readPrec :: ReadPrec BotAliasMetadata
$creadPrec :: ReadPrec BotAliasMetadata
readList :: ReadS [BotAliasMetadata]
$creadList :: ReadS [BotAliasMetadata]
readsPrec :: Int -> ReadS BotAliasMetadata
$creadsPrec :: Int -> ReadS BotAliasMetadata
Prelude.Read, Int -> BotAliasMetadata -> ShowS
[BotAliasMetadata] -> ShowS
BotAliasMetadata -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BotAliasMetadata] -> ShowS
$cshowList :: [BotAliasMetadata] -> ShowS
show :: BotAliasMetadata -> String
$cshow :: BotAliasMetadata -> String
showsPrec :: Int -> BotAliasMetadata -> ShowS
$cshowsPrec :: Int -> BotAliasMetadata -> ShowS
Prelude.Show, forall x. Rep BotAliasMetadata x -> BotAliasMetadata
forall x. BotAliasMetadata -> Rep BotAliasMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BotAliasMetadata x -> BotAliasMetadata
$cfrom :: forall x. BotAliasMetadata -> Rep BotAliasMetadata x
Prelude.Generic)

-- |
-- Create a value of 'BotAliasMetadata' 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', 'botAliasMetadata_botName' - The name of the bot to which the alias points.
--
-- 'botVersion', 'botAliasMetadata_botVersion' - The version of the Amazon Lex bot to which the alias points.
--
-- 'checksum', 'botAliasMetadata_checksum' - Checksum of the bot alias.
--
-- 'conversationLogs', 'botAliasMetadata_conversationLogs' - Settings that determine how Amazon Lex uses conversation logs for the
-- alias.
--
-- 'createdDate', 'botAliasMetadata_createdDate' - The date that the bot alias was created.
--
-- 'description', 'botAliasMetadata_description' - A description of the bot alias.
--
-- 'lastUpdatedDate', 'botAliasMetadata_lastUpdatedDate' - The date that the bot alias was updated. When you create a resource, the
-- creation date and last updated date are the same.
--
-- 'name', 'botAliasMetadata_name' - The name of the bot alias.
newBotAliasMetadata ::
  BotAliasMetadata
newBotAliasMetadata :: BotAliasMetadata
newBotAliasMetadata =
  BotAliasMetadata'
    { $sel:botName:BotAliasMetadata' :: Maybe Text
botName = forall a. Maybe a
Prelude.Nothing,
      $sel:botVersion:BotAliasMetadata' :: Maybe Text
botVersion = forall a. Maybe a
Prelude.Nothing,
      $sel:checksum:BotAliasMetadata' :: Maybe Text
checksum = forall a. Maybe a
Prelude.Nothing,
      $sel:conversationLogs:BotAliasMetadata' :: Maybe ConversationLogsResponse
conversationLogs = forall a. Maybe a
Prelude.Nothing,
      $sel:createdDate:BotAliasMetadata' :: Maybe POSIX
createdDate = forall a. Maybe a
Prelude.Nothing,
      $sel:description:BotAliasMetadata' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedDate:BotAliasMetadata' :: Maybe POSIX
lastUpdatedDate = forall a. Maybe a
Prelude.Nothing,
      $sel:name:BotAliasMetadata' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the bot to which the alias points.
botAliasMetadata_botName :: Lens.Lens' BotAliasMetadata (Prelude.Maybe Prelude.Text)
botAliasMetadata_botName :: Lens' BotAliasMetadata (Maybe Text)
botAliasMetadata_botName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BotAliasMetadata' {Maybe Text
botName :: Maybe Text
$sel:botName:BotAliasMetadata' :: BotAliasMetadata -> Maybe Text
botName} -> Maybe Text
botName) (\s :: BotAliasMetadata
s@BotAliasMetadata' {} Maybe Text
a -> BotAliasMetadata
s {$sel:botName:BotAliasMetadata' :: Maybe Text
botName = Maybe Text
a} :: BotAliasMetadata)

-- | The version of the Amazon Lex bot to which the alias points.
botAliasMetadata_botVersion :: Lens.Lens' BotAliasMetadata (Prelude.Maybe Prelude.Text)
botAliasMetadata_botVersion :: Lens' BotAliasMetadata (Maybe Text)
botAliasMetadata_botVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BotAliasMetadata' {Maybe Text
botVersion :: Maybe Text
$sel:botVersion:BotAliasMetadata' :: BotAliasMetadata -> Maybe Text
botVersion} -> Maybe Text
botVersion) (\s :: BotAliasMetadata
s@BotAliasMetadata' {} Maybe Text
a -> BotAliasMetadata
s {$sel:botVersion:BotAliasMetadata' :: Maybe Text
botVersion = Maybe Text
a} :: BotAliasMetadata)

-- | Checksum of the bot alias.
botAliasMetadata_checksum :: Lens.Lens' BotAliasMetadata (Prelude.Maybe Prelude.Text)
botAliasMetadata_checksum :: Lens' BotAliasMetadata (Maybe Text)
botAliasMetadata_checksum = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BotAliasMetadata' {Maybe Text
checksum :: Maybe Text
$sel:checksum:BotAliasMetadata' :: BotAliasMetadata -> Maybe Text
checksum} -> Maybe Text
checksum) (\s :: BotAliasMetadata
s@BotAliasMetadata' {} Maybe Text
a -> BotAliasMetadata
s {$sel:checksum:BotAliasMetadata' :: Maybe Text
checksum = Maybe Text
a} :: BotAliasMetadata)

-- | Settings that determine how Amazon Lex uses conversation logs for the
-- alias.
botAliasMetadata_conversationLogs :: Lens.Lens' BotAliasMetadata (Prelude.Maybe ConversationLogsResponse)
botAliasMetadata_conversationLogs :: Lens' BotAliasMetadata (Maybe ConversationLogsResponse)
botAliasMetadata_conversationLogs = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BotAliasMetadata' {Maybe ConversationLogsResponse
conversationLogs :: Maybe ConversationLogsResponse
$sel:conversationLogs:BotAliasMetadata' :: BotAliasMetadata -> Maybe ConversationLogsResponse
conversationLogs} -> Maybe ConversationLogsResponse
conversationLogs) (\s :: BotAliasMetadata
s@BotAliasMetadata' {} Maybe ConversationLogsResponse
a -> BotAliasMetadata
s {$sel:conversationLogs:BotAliasMetadata' :: Maybe ConversationLogsResponse
conversationLogs = Maybe ConversationLogsResponse
a} :: BotAliasMetadata)

-- | The date that the bot alias was created.
botAliasMetadata_createdDate :: Lens.Lens' BotAliasMetadata (Prelude.Maybe Prelude.UTCTime)
botAliasMetadata_createdDate :: Lens' BotAliasMetadata (Maybe UTCTime)
botAliasMetadata_createdDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BotAliasMetadata' {Maybe POSIX
createdDate :: Maybe POSIX
$sel:createdDate:BotAliasMetadata' :: BotAliasMetadata -> Maybe POSIX
createdDate} -> Maybe POSIX
createdDate) (\s :: BotAliasMetadata
s@BotAliasMetadata' {} Maybe POSIX
a -> BotAliasMetadata
s {$sel:createdDate:BotAliasMetadata' :: Maybe POSIX
createdDate = Maybe POSIX
a} :: BotAliasMetadata) 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 alias.
botAliasMetadata_description :: Lens.Lens' BotAliasMetadata (Prelude.Maybe Prelude.Text)
botAliasMetadata_description :: Lens' BotAliasMetadata (Maybe Text)
botAliasMetadata_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BotAliasMetadata' {Maybe Text
description :: Maybe Text
$sel:description:BotAliasMetadata' :: BotAliasMetadata -> Maybe Text
description} -> Maybe Text
description) (\s :: BotAliasMetadata
s@BotAliasMetadata' {} Maybe Text
a -> BotAliasMetadata
s {$sel:description:BotAliasMetadata' :: Maybe Text
description = Maybe Text
a} :: BotAliasMetadata)

-- | The date that the bot alias was updated. When you create a resource, the
-- creation date and last updated date are the same.
botAliasMetadata_lastUpdatedDate :: Lens.Lens' BotAliasMetadata (Prelude.Maybe Prelude.UTCTime)
botAliasMetadata_lastUpdatedDate :: Lens' BotAliasMetadata (Maybe UTCTime)
botAliasMetadata_lastUpdatedDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BotAliasMetadata' {Maybe POSIX
lastUpdatedDate :: Maybe POSIX
$sel:lastUpdatedDate:BotAliasMetadata' :: BotAliasMetadata -> Maybe POSIX
lastUpdatedDate} -> Maybe POSIX
lastUpdatedDate) (\s :: BotAliasMetadata
s@BotAliasMetadata' {} Maybe POSIX
a -> BotAliasMetadata
s {$sel:lastUpdatedDate:BotAliasMetadata' :: Maybe POSIX
lastUpdatedDate = Maybe POSIX
a} :: BotAliasMetadata) 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 alias.
botAliasMetadata_name :: Lens.Lens' BotAliasMetadata (Prelude.Maybe Prelude.Text)
botAliasMetadata_name :: Lens' BotAliasMetadata (Maybe Text)
botAliasMetadata_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BotAliasMetadata' {Maybe Text
name :: Maybe Text
$sel:name:BotAliasMetadata' :: BotAliasMetadata -> Maybe Text
name} -> Maybe Text
name) (\s :: BotAliasMetadata
s@BotAliasMetadata' {} Maybe Text
a -> BotAliasMetadata
s {$sel:name:BotAliasMetadata' :: Maybe Text
name = Maybe Text
a} :: BotAliasMetadata)

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

instance Prelude.Hashable BotAliasMetadata where
  hashWithSalt :: Int -> BotAliasMetadata -> Int
hashWithSalt Int
_salt BotAliasMetadata' {Maybe Text
Maybe POSIX
Maybe ConversationLogsResponse
name :: Maybe Text
lastUpdatedDate :: Maybe POSIX
description :: Maybe Text
createdDate :: Maybe POSIX
conversationLogs :: Maybe ConversationLogsResponse
checksum :: Maybe Text
botVersion :: Maybe Text
botName :: Maybe Text
$sel:name:BotAliasMetadata' :: BotAliasMetadata -> Maybe Text
$sel:lastUpdatedDate:BotAliasMetadata' :: BotAliasMetadata -> Maybe POSIX
$sel:description:BotAliasMetadata' :: BotAliasMetadata -> Maybe Text
$sel:createdDate:BotAliasMetadata' :: BotAliasMetadata -> Maybe POSIX
$sel:conversationLogs:BotAliasMetadata' :: BotAliasMetadata -> Maybe ConversationLogsResponse
$sel:checksum:BotAliasMetadata' :: BotAliasMetadata -> Maybe Text
$sel:botVersion:BotAliasMetadata' :: BotAliasMetadata -> Maybe Text
$sel:botName:BotAliasMetadata' :: BotAliasMetadata -> 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 Text
botVersion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
checksum
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ConversationLogsResponse
conversationLogs
      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

instance Prelude.NFData BotAliasMetadata where
  rnf :: BotAliasMetadata -> ()
rnf BotAliasMetadata' {Maybe Text
Maybe POSIX
Maybe ConversationLogsResponse
name :: Maybe Text
lastUpdatedDate :: Maybe POSIX
description :: Maybe Text
createdDate :: Maybe POSIX
conversationLogs :: Maybe ConversationLogsResponse
checksum :: Maybe Text
botVersion :: Maybe Text
botName :: Maybe Text
$sel:name:BotAliasMetadata' :: BotAliasMetadata -> Maybe Text
$sel:lastUpdatedDate:BotAliasMetadata' :: BotAliasMetadata -> Maybe POSIX
$sel:description:BotAliasMetadata' :: BotAliasMetadata -> Maybe Text
$sel:createdDate:BotAliasMetadata' :: BotAliasMetadata -> Maybe POSIX
$sel:conversationLogs:BotAliasMetadata' :: BotAliasMetadata -> Maybe ConversationLogsResponse
$sel:checksum:BotAliasMetadata' :: BotAliasMetadata -> Maybe Text
$sel:botVersion:BotAliasMetadata' :: BotAliasMetadata -> Maybe Text
$sel:botName:BotAliasMetadata' :: BotAliasMetadata -> 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 Text
botVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
checksum
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ConversationLogsResponse
conversationLogs
      seq :: forall a b. a -> b -> b
`Prelude.seq` 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