{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.UpdateBot
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Updates the configuration of an existing bot.
module Amazonka.LexV2Models.UpdateBot
  ( -- * Creating a Request
    UpdateBot (..),
    newUpdateBot,

    -- * Request Lenses
    updateBot_description,
    updateBot_botId,
    updateBot_botName,
    updateBot_roleArn,
    updateBot_dataPrivacy,
    updateBot_idleSessionTTLInSeconds,

    -- * Destructuring the Response
    UpdateBotResponse (..),
    newUpdateBotResponse,

    -- * Response Lenses
    updateBotResponse_botId,
    updateBotResponse_botName,
    updateBotResponse_botStatus,
    updateBotResponse_creationDateTime,
    updateBotResponse_dataPrivacy,
    updateBotResponse_description,
    updateBotResponse_idleSessionTTLInSeconds,
    updateBotResponse_lastUpdatedDateTime,
    updateBotResponse_roleArn,
    updateBotResponse_httpStatus,
  )
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
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newUpdateBot' smart constructor.
data UpdateBot = UpdateBot'
  { -- | A description of the bot.
    UpdateBot -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier of the bot to update. This identifier is returned
    -- by the
    -- <https://docs.aws.amazon.com/lexv2/latest/dg/API_CreateBot.html CreateBot>
    -- operation.
    UpdateBot -> Text
botId :: Prelude.Text,
    -- | The new name of the bot. The name must be unique in the account that
    -- creates the bot.
    UpdateBot -> Text
botName :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of an IAM role that has permissions to
    -- access the bot.
    UpdateBot -> Text
roleArn :: Prelude.Text,
    -- | Provides information on additional privacy protections Amazon Lex should
    -- use with the bot\'s data.
    UpdateBot -> DataPrivacy
dataPrivacy :: DataPrivacy,
    -- | The time, in seconds, that Amazon Lex should keep information about a
    -- user\'s conversation with the bot.
    --
    -- A user interaction remains active for the amount of time specified. If
    -- no conversation occurs during this time, the session expires and Amazon
    -- Lex deletes any data provided before the timeout.
    --
    -- You can specify between 60 (1 minute) and 86,400 (24 hours) seconds.
    UpdateBot -> Natural
idleSessionTTLInSeconds :: Prelude.Natural
  }
  deriving (UpdateBot -> UpdateBot -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateBot -> UpdateBot -> Bool
$c/= :: UpdateBot -> UpdateBot -> Bool
== :: UpdateBot -> UpdateBot -> Bool
$c== :: UpdateBot -> UpdateBot -> Bool
Prelude.Eq, ReadPrec [UpdateBot]
ReadPrec UpdateBot
Int -> ReadS UpdateBot
ReadS [UpdateBot]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateBot]
$creadListPrec :: ReadPrec [UpdateBot]
readPrec :: ReadPrec UpdateBot
$creadPrec :: ReadPrec UpdateBot
readList :: ReadS [UpdateBot]
$creadList :: ReadS [UpdateBot]
readsPrec :: Int -> ReadS UpdateBot
$creadsPrec :: Int -> ReadS UpdateBot
Prelude.Read, Int -> UpdateBot -> ShowS
[UpdateBot] -> ShowS
UpdateBot -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateBot] -> ShowS
$cshowList :: [UpdateBot] -> ShowS
show :: UpdateBot -> String
$cshow :: UpdateBot -> String
showsPrec :: Int -> UpdateBot -> ShowS
$cshowsPrec :: Int -> UpdateBot -> ShowS
Prelude.Show, forall x. Rep UpdateBot x -> UpdateBot
forall x. UpdateBot -> Rep UpdateBot x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateBot x -> UpdateBot
$cfrom :: forall x. UpdateBot -> Rep UpdateBot x
Prelude.Generic)

-- |
-- Create a value of 'UpdateBot' 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:
--
-- 'description', 'updateBot_description' - A description of the bot.
--
-- 'botId', 'updateBot_botId' - The unique identifier of the bot to update. This identifier is returned
-- by the
-- <https://docs.aws.amazon.com/lexv2/latest/dg/API_CreateBot.html CreateBot>
-- operation.
--
-- 'botName', 'updateBot_botName' - The new name of the bot. The name must be unique in the account that
-- creates the bot.
--
-- 'roleArn', 'updateBot_roleArn' - The Amazon Resource Name (ARN) of an IAM role that has permissions to
-- access the bot.
--
-- 'dataPrivacy', 'updateBot_dataPrivacy' - Provides information on additional privacy protections Amazon Lex should
-- use with the bot\'s data.
--
-- 'idleSessionTTLInSeconds', 'updateBot_idleSessionTTLInSeconds' - The time, in seconds, that Amazon Lex should keep information about a
-- user\'s conversation with the bot.
--
-- A user interaction remains active for the amount of time specified. If
-- no conversation occurs during this time, the session expires and Amazon
-- Lex deletes any data provided before the timeout.
--
-- You can specify between 60 (1 minute) and 86,400 (24 hours) seconds.
newUpdateBot ::
  -- | 'botId'
  Prelude.Text ->
  -- | 'botName'
  Prelude.Text ->
  -- | 'roleArn'
  Prelude.Text ->
  -- | 'dataPrivacy'
  DataPrivacy ->
  -- | 'idleSessionTTLInSeconds'
  Prelude.Natural ->
  UpdateBot
newUpdateBot :: Text -> Text -> Text -> DataPrivacy -> Natural -> UpdateBot
newUpdateBot
  Text
pBotId_
  Text
pBotName_
  Text
pRoleArn_
  DataPrivacy
pDataPrivacy_
  Natural
pIdleSessionTTLInSeconds_ =
    UpdateBot'
      { $sel:description:UpdateBot' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
        $sel:botId:UpdateBot' :: Text
botId = Text
pBotId_,
        $sel:botName:UpdateBot' :: Text
botName = Text
pBotName_,
        $sel:roleArn:UpdateBot' :: Text
roleArn = Text
pRoleArn_,
        $sel:dataPrivacy:UpdateBot' :: DataPrivacy
dataPrivacy = DataPrivacy
pDataPrivacy_,
        $sel:idleSessionTTLInSeconds:UpdateBot' :: Natural
idleSessionTTLInSeconds = Natural
pIdleSessionTTLInSeconds_
      }

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

-- | The unique identifier of the bot to update. This identifier is returned
-- by the
-- <https://docs.aws.amazon.com/lexv2/latest/dg/API_CreateBot.html CreateBot>
-- operation.
updateBot_botId :: Lens.Lens' UpdateBot Prelude.Text
updateBot_botId :: Lens' UpdateBot Text
updateBot_botId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBot' {Text
botId :: Text
$sel:botId:UpdateBot' :: UpdateBot -> Text
botId} -> Text
botId) (\s :: UpdateBot
s@UpdateBot' {} Text
a -> UpdateBot
s {$sel:botId:UpdateBot' :: Text
botId = Text
a} :: UpdateBot)

-- | The new name of the bot. The name must be unique in the account that
-- creates the bot.
updateBot_botName :: Lens.Lens' UpdateBot Prelude.Text
updateBot_botName :: Lens' UpdateBot Text
updateBot_botName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBot' {Text
botName :: Text
$sel:botName:UpdateBot' :: UpdateBot -> Text
botName} -> Text
botName) (\s :: UpdateBot
s@UpdateBot' {} Text
a -> UpdateBot
s {$sel:botName:UpdateBot' :: Text
botName = Text
a} :: UpdateBot)

-- | The Amazon Resource Name (ARN) of an IAM role that has permissions to
-- access the bot.
updateBot_roleArn :: Lens.Lens' UpdateBot Prelude.Text
updateBot_roleArn :: Lens' UpdateBot Text
updateBot_roleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBot' {Text
roleArn :: Text
$sel:roleArn:UpdateBot' :: UpdateBot -> Text
roleArn} -> Text
roleArn) (\s :: UpdateBot
s@UpdateBot' {} Text
a -> UpdateBot
s {$sel:roleArn:UpdateBot' :: Text
roleArn = Text
a} :: UpdateBot)

-- | Provides information on additional privacy protections Amazon Lex should
-- use with the bot\'s data.
updateBot_dataPrivacy :: Lens.Lens' UpdateBot DataPrivacy
updateBot_dataPrivacy :: Lens' UpdateBot DataPrivacy
updateBot_dataPrivacy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBot' {DataPrivacy
dataPrivacy :: DataPrivacy
$sel:dataPrivacy:UpdateBot' :: UpdateBot -> DataPrivacy
dataPrivacy} -> DataPrivacy
dataPrivacy) (\s :: UpdateBot
s@UpdateBot' {} DataPrivacy
a -> UpdateBot
s {$sel:dataPrivacy:UpdateBot' :: DataPrivacy
dataPrivacy = DataPrivacy
a} :: UpdateBot)

-- | The time, in seconds, that Amazon Lex should keep information about a
-- user\'s conversation with the bot.
--
-- A user interaction remains active for the amount of time specified. If
-- no conversation occurs during this time, the session expires and Amazon
-- Lex deletes any data provided before the timeout.
--
-- You can specify between 60 (1 minute) and 86,400 (24 hours) seconds.
updateBot_idleSessionTTLInSeconds :: Lens.Lens' UpdateBot Prelude.Natural
updateBot_idleSessionTTLInSeconds :: Lens' UpdateBot Natural
updateBot_idleSessionTTLInSeconds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBot' {Natural
idleSessionTTLInSeconds :: Natural
$sel:idleSessionTTLInSeconds:UpdateBot' :: UpdateBot -> Natural
idleSessionTTLInSeconds} -> Natural
idleSessionTTLInSeconds) (\s :: UpdateBot
s@UpdateBot' {} Natural
a -> UpdateBot
s {$sel:idleSessionTTLInSeconds:UpdateBot' :: Natural
idleSessionTTLInSeconds = Natural
a} :: UpdateBot)

instance Core.AWSRequest UpdateBot where
  type AWSResponse UpdateBot = UpdateBotResponse
  request :: (Service -> Service) -> UpdateBot -> Request UpdateBot
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateBot
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateBot)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe BotStatus
-> Maybe POSIX
-> Maybe DataPrivacy
-> Maybe Text
-> Maybe Natural
-> Maybe POSIX
-> Maybe Text
-> Int
-> UpdateBotResponse
UpdateBotResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (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 -> Either String (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 -> Either String (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 -> Either String (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 -> Either String (Maybe a)
Data..?> Key
"dataPrivacy")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (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 -> Either String (Maybe a)
Data..?> Key
"idleSessionTTLInSeconds")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (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 -> Either String (Maybe a)
Data..?> Key
"roleArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable UpdateBot where
  hashWithSalt :: Int -> UpdateBot -> Int
hashWithSalt Int
_salt UpdateBot' {Natural
Maybe Text
Text
DataPrivacy
idleSessionTTLInSeconds :: Natural
dataPrivacy :: DataPrivacy
roleArn :: Text
botName :: Text
botId :: Text
description :: Maybe Text
$sel:idleSessionTTLInSeconds:UpdateBot' :: UpdateBot -> Natural
$sel:dataPrivacy:UpdateBot' :: UpdateBot -> DataPrivacy
$sel:roleArn:UpdateBot' :: UpdateBot -> Text
$sel:botName:UpdateBot' :: UpdateBot -> Text
$sel:botId:UpdateBot' :: UpdateBot -> Text
$sel:description:UpdateBot' :: UpdateBot -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
botId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
botName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
roleArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` DataPrivacy
dataPrivacy
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
idleSessionTTLInSeconds

instance Prelude.NFData UpdateBot where
  rnf :: UpdateBot -> ()
rnf UpdateBot' {Natural
Maybe Text
Text
DataPrivacy
idleSessionTTLInSeconds :: Natural
dataPrivacy :: DataPrivacy
roleArn :: Text
botName :: Text
botId :: Text
description :: Maybe Text
$sel:idleSessionTTLInSeconds:UpdateBot' :: UpdateBot -> Natural
$sel:dataPrivacy:UpdateBot' :: UpdateBot -> DataPrivacy
$sel:roleArn:UpdateBot' :: UpdateBot -> Text
$sel:botName:UpdateBot' :: UpdateBot -> Text
$sel:botId:UpdateBot' :: UpdateBot -> Text
$sel:description:UpdateBot' :: UpdateBot -> Maybe Text
..} =
    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 Text
botId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
botName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
roleArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf DataPrivacy
dataPrivacy
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
idleSessionTTLInSeconds

instance Data.ToHeaders UpdateBot where
  toHeaders :: UpdateBot -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON UpdateBot where
  toJSON :: UpdateBot -> Value
toJSON UpdateBot' {Natural
Maybe Text
Text
DataPrivacy
idleSessionTTLInSeconds :: Natural
dataPrivacy :: DataPrivacy
roleArn :: Text
botName :: Text
botId :: Text
description :: Maybe Text
$sel:idleSessionTTLInSeconds:UpdateBot' :: UpdateBot -> Natural
$sel:dataPrivacy:UpdateBot' :: UpdateBot -> DataPrivacy
$sel:roleArn:UpdateBot' :: UpdateBot -> Text
$sel:botName:UpdateBot' :: UpdateBot -> Text
$sel:botId:UpdateBot' :: UpdateBot -> Text
$sel:description:UpdateBot' :: UpdateBot -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"description" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description,
            forall a. a -> Maybe a
Prelude.Just (Key
"botName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
botName),
            forall a. a -> Maybe a
Prelude.Just (Key
"roleArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
roleArn),
            forall a. a -> Maybe a
Prelude.Just (Key
"dataPrivacy" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= DataPrivacy
dataPrivacy),
            forall a. a -> Maybe a
Prelude.Just
              ( Key
"idleSessionTTLInSeconds"
                  forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
idleSessionTTLInSeconds
              )
          ]
      )

instance Data.ToPath UpdateBot where
  toPath :: UpdateBot -> ByteString
toPath UpdateBot' {Natural
Maybe Text
Text
DataPrivacy
idleSessionTTLInSeconds :: Natural
dataPrivacy :: DataPrivacy
roleArn :: Text
botName :: Text
botId :: Text
description :: Maybe Text
$sel:idleSessionTTLInSeconds:UpdateBot' :: UpdateBot -> Natural
$sel:dataPrivacy:UpdateBot' :: UpdateBot -> DataPrivacy
$sel:roleArn:UpdateBot' :: UpdateBot -> Text
$sel:botName:UpdateBot' :: UpdateBot -> Text
$sel:botId:UpdateBot' :: UpdateBot -> Text
$sel:description:UpdateBot' :: UpdateBot -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/bots/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
botId, ByteString
"/"]

instance Data.ToQuery UpdateBot where
  toQuery :: UpdateBot -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newUpdateBotResponse' smart constructor.
data UpdateBotResponse = UpdateBotResponse'
  { -- | The unique identifier of the bot that was updated.
    UpdateBotResponse -> Maybe Text
botId :: Prelude.Maybe Prelude.Text,
    -- | The name of the bot after the update.
    UpdateBotResponse -> Maybe Text
botName :: Prelude.Maybe Prelude.Text,
    -- | Shows the current status of the bot. The bot is first in the @Creating@
    -- status. Once the bot is read for use, it changes to the @Available@
    -- status. After the bot is created, you can use the @DRAFT@ version of the
    -- bot.
    UpdateBotResponse -> Maybe BotStatus
botStatus :: Prelude.Maybe BotStatus,
    -- | A timestamp of the date and time that the bot was created.
    UpdateBotResponse -> Maybe POSIX
creationDateTime :: Prelude.Maybe Data.POSIX,
    -- | The data privacy settings for the bot after the update.
    UpdateBotResponse -> Maybe DataPrivacy
dataPrivacy :: Prelude.Maybe DataPrivacy,
    -- | The description of the bot after the update.
    UpdateBotResponse -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The session timeout, in seconds, for the bot after the update.
    UpdateBotResponse -> Maybe Natural
idleSessionTTLInSeconds :: Prelude.Maybe Prelude.Natural,
    -- | A timestamp of the date and time that the bot was last updated.
    UpdateBotResponse -> Maybe POSIX
lastUpdatedDateTime :: Prelude.Maybe Data.POSIX,
    -- | The Amazon Resource Name (ARN) of the IAM role used by the bot after the
    -- update.
    UpdateBotResponse -> Maybe Text
roleArn :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    UpdateBotResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateBotResponse -> UpdateBotResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateBotResponse -> UpdateBotResponse -> Bool
$c/= :: UpdateBotResponse -> UpdateBotResponse -> Bool
== :: UpdateBotResponse -> UpdateBotResponse -> Bool
$c== :: UpdateBotResponse -> UpdateBotResponse -> Bool
Prelude.Eq, ReadPrec [UpdateBotResponse]
ReadPrec UpdateBotResponse
Int -> ReadS UpdateBotResponse
ReadS [UpdateBotResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateBotResponse]
$creadListPrec :: ReadPrec [UpdateBotResponse]
readPrec :: ReadPrec UpdateBotResponse
$creadPrec :: ReadPrec UpdateBotResponse
readList :: ReadS [UpdateBotResponse]
$creadList :: ReadS [UpdateBotResponse]
readsPrec :: Int -> ReadS UpdateBotResponse
$creadsPrec :: Int -> ReadS UpdateBotResponse
Prelude.Read, Int -> UpdateBotResponse -> ShowS
[UpdateBotResponse] -> ShowS
UpdateBotResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateBotResponse] -> ShowS
$cshowList :: [UpdateBotResponse] -> ShowS
show :: UpdateBotResponse -> String
$cshow :: UpdateBotResponse -> String
showsPrec :: Int -> UpdateBotResponse -> ShowS
$cshowsPrec :: Int -> UpdateBotResponse -> ShowS
Prelude.Show, forall x. Rep UpdateBotResponse x -> UpdateBotResponse
forall x. UpdateBotResponse -> Rep UpdateBotResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateBotResponse x -> UpdateBotResponse
$cfrom :: forall x. UpdateBotResponse -> Rep UpdateBotResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateBotResponse' 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', 'updateBotResponse_botId' - The unique identifier of the bot that was updated.
--
-- 'botName', 'updateBotResponse_botName' - The name of the bot after the update.
--
-- 'botStatus', 'updateBotResponse_botStatus' - Shows the current status of the bot. The bot is first in the @Creating@
-- status. Once the bot is read for use, it changes to the @Available@
-- status. After the bot is created, you can use the @DRAFT@ version of the
-- bot.
--
-- 'creationDateTime', 'updateBotResponse_creationDateTime' - A timestamp of the date and time that the bot was created.
--
-- 'dataPrivacy', 'updateBotResponse_dataPrivacy' - The data privacy settings for the bot after the update.
--
-- 'description', 'updateBotResponse_description' - The description of the bot after the update.
--
-- 'idleSessionTTLInSeconds', 'updateBotResponse_idleSessionTTLInSeconds' - The session timeout, in seconds, for the bot after the update.
--
-- 'lastUpdatedDateTime', 'updateBotResponse_lastUpdatedDateTime' - A timestamp of the date and time that the bot was last updated.
--
-- 'roleArn', 'updateBotResponse_roleArn' - The Amazon Resource Name (ARN) of the IAM role used by the bot after the
-- update.
--
-- 'httpStatus', 'updateBotResponse_httpStatus' - The response's http status code.
newUpdateBotResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateBotResponse
newUpdateBotResponse :: Int -> UpdateBotResponse
newUpdateBotResponse Int
pHttpStatus_ =
  UpdateBotResponse'
    { $sel:botId:UpdateBotResponse' :: Maybe Text
botId = forall a. Maybe a
Prelude.Nothing,
      $sel:botName:UpdateBotResponse' :: Maybe Text
botName = forall a. Maybe a
Prelude.Nothing,
      $sel:botStatus:UpdateBotResponse' :: Maybe BotStatus
botStatus = forall a. Maybe a
Prelude.Nothing,
      $sel:creationDateTime:UpdateBotResponse' :: Maybe POSIX
creationDateTime = forall a. Maybe a
Prelude.Nothing,
      $sel:dataPrivacy:UpdateBotResponse' :: Maybe DataPrivacy
dataPrivacy = forall a. Maybe a
Prelude.Nothing,
      $sel:description:UpdateBotResponse' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:idleSessionTTLInSeconds:UpdateBotResponse' :: Maybe Natural
idleSessionTTLInSeconds = forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedDateTime:UpdateBotResponse' :: Maybe POSIX
lastUpdatedDateTime = forall a. Maybe a
Prelude.Nothing,
      $sel:roleArn:UpdateBotResponse' :: Maybe Text
roleArn = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateBotResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The unique identifier of the bot that was updated.
updateBotResponse_botId :: Lens.Lens' UpdateBotResponse (Prelude.Maybe Prelude.Text)
updateBotResponse_botId :: Lens' UpdateBotResponse (Maybe Text)
updateBotResponse_botId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBotResponse' {Maybe Text
botId :: Maybe Text
$sel:botId:UpdateBotResponse' :: UpdateBotResponse -> Maybe Text
botId} -> Maybe Text
botId) (\s :: UpdateBotResponse
s@UpdateBotResponse' {} Maybe Text
a -> UpdateBotResponse
s {$sel:botId:UpdateBotResponse' :: Maybe Text
botId = Maybe Text
a} :: UpdateBotResponse)

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

-- | Shows the current status of the bot. The bot is first in the @Creating@
-- status. Once the bot is read for use, it changes to the @Available@
-- status. After the bot is created, you can use the @DRAFT@ version of the
-- bot.
updateBotResponse_botStatus :: Lens.Lens' UpdateBotResponse (Prelude.Maybe BotStatus)
updateBotResponse_botStatus :: Lens' UpdateBotResponse (Maybe BotStatus)
updateBotResponse_botStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBotResponse' {Maybe BotStatus
botStatus :: Maybe BotStatus
$sel:botStatus:UpdateBotResponse' :: UpdateBotResponse -> Maybe BotStatus
botStatus} -> Maybe BotStatus
botStatus) (\s :: UpdateBotResponse
s@UpdateBotResponse' {} Maybe BotStatus
a -> UpdateBotResponse
s {$sel:botStatus:UpdateBotResponse' :: Maybe BotStatus
botStatus = Maybe BotStatus
a} :: UpdateBotResponse)

-- | A timestamp of the date and time that the bot was created.
updateBotResponse_creationDateTime :: Lens.Lens' UpdateBotResponse (Prelude.Maybe Prelude.UTCTime)
updateBotResponse_creationDateTime :: Lens' UpdateBotResponse (Maybe UTCTime)
updateBotResponse_creationDateTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBotResponse' {Maybe POSIX
creationDateTime :: Maybe POSIX
$sel:creationDateTime:UpdateBotResponse' :: UpdateBotResponse -> Maybe POSIX
creationDateTime} -> Maybe POSIX
creationDateTime) (\s :: UpdateBotResponse
s@UpdateBotResponse' {} Maybe POSIX
a -> UpdateBotResponse
s {$sel:creationDateTime:UpdateBotResponse' :: Maybe POSIX
creationDateTime = Maybe POSIX
a} :: UpdateBotResponse) 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 data privacy settings for the bot after the update.
updateBotResponse_dataPrivacy :: Lens.Lens' UpdateBotResponse (Prelude.Maybe DataPrivacy)
updateBotResponse_dataPrivacy :: Lens' UpdateBotResponse (Maybe DataPrivacy)
updateBotResponse_dataPrivacy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBotResponse' {Maybe DataPrivacy
dataPrivacy :: Maybe DataPrivacy
$sel:dataPrivacy:UpdateBotResponse' :: UpdateBotResponse -> Maybe DataPrivacy
dataPrivacy} -> Maybe DataPrivacy
dataPrivacy) (\s :: UpdateBotResponse
s@UpdateBotResponse' {} Maybe DataPrivacy
a -> UpdateBotResponse
s {$sel:dataPrivacy:UpdateBotResponse' :: Maybe DataPrivacy
dataPrivacy = Maybe DataPrivacy
a} :: UpdateBotResponse)

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

-- | The session timeout, in seconds, for the bot after the update.
updateBotResponse_idleSessionTTLInSeconds :: Lens.Lens' UpdateBotResponse (Prelude.Maybe Prelude.Natural)
updateBotResponse_idleSessionTTLInSeconds :: Lens' UpdateBotResponse (Maybe Natural)
updateBotResponse_idleSessionTTLInSeconds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBotResponse' {Maybe Natural
idleSessionTTLInSeconds :: Maybe Natural
$sel:idleSessionTTLInSeconds:UpdateBotResponse' :: UpdateBotResponse -> Maybe Natural
idleSessionTTLInSeconds} -> Maybe Natural
idleSessionTTLInSeconds) (\s :: UpdateBotResponse
s@UpdateBotResponse' {} Maybe Natural
a -> UpdateBotResponse
s {$sel:idleSessionTTLInSeconds:UpdateBotResponse' :: Maybe Natural
idleSessionTTLInSeconds = Maybe Natural
a} :: UpdateBotResponse)

-- | A timestamp of the date and time that the bot was last updated.
updateBotResponse_lastUpdatedDateTime :: Lens.Lens' UpdateBotResponse (Prelude.Maybe Prelude.UTCTime)
updateBotResponse_lastUpdatedDateTime :: Lens' UpdateBotResponse (Maybe UTCTime)
updateBotResponse_lastUpdatedDateTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBotResponse' {Maybe POSIX
lastUpdatedDateTime :: Maybe POSIX
$sel:lastUpdatedDateTime:UpdateBotResponse' :: UpdateBotResponse -> Maybe POSIX
lastUpdatedDateTime} -> Maybe POSIX
lastUpdatedDateTime) (\s :: UpdateBotResponse
s@UpdateBotResponse' {} Maybe POSIX
a -> UpdateBotResponse
s {$sel:lastUpdatedDateTime:UpdateBotResponse' :: Maybe POSIX
lastUpdatedDateTime = Maybe POSIX
a} :: UpdateBotResponse) 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 Amazon Resource Name (ARN) of the IAM role used by the bot after the
-- update.
updateBotResponse_roleArn :: Lens.Lens' UpdateBotResponse (Prelude.Maybe Prelude.Text)
updateBotResponse_roleArn :: Lens' UpdateBotResponse (Maybe Text)
updateBotResponse_roleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBotResponse' {Maybe Text
roleArn :: Maybe Text
$sel:roleArn:UpdateBotResponse' :: UpdateBotResponse -> Maybe Text
roleArn} -> Maybe Text
roleArn) (\s :: UpdateBotResponse
s@UpdateBotResponse' {} Maybe Text
a -> UpdateBotResponse
s {$sel:roleArn:UpdateBotResponse' :: Maybe Text
roleArn = Maybe Text
a} :: UpdateBotResponse)

-- | The response's http status code.
updateBotResponse_httpStatus :: Lens.Lens' UpdateBotResponse Prelude.Int
updateBotResponse_httpStatus :: Lens' UpdateBotResponse Int
updateBotResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBotResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateBotResponse' :: UpdateBotResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateBotResponse
s@UpdateBotResponse' {} Int
a -> UpdateBotResponse
s {$sel:httpStatus:UpdateBotResponse' :: Int
httpStatus = Int
a} :: UpdateBotResponse)

instance Prelude.NFData UpdateBotResponse where
  rnf :: UpdateBotResponse -> ()
rnf UpdateBotResponse' {Int
Maybe Natural
Maybe Text
Maybe POSIX
Maybe BotStatus
Maybe DataPrivacy
httpStatus :: Int
roleArn :: Maybe Text
lastUpdatedDateTime :: Maybe POSIX
idleSessionTTLInSeconds :: Maybe Natural
description :: Maybe Text
dataPrivacy :: Maybe DataPrivacy
creationDateTime :: Maybe POSIX
botStatus :: Maybe BotStatus
botName :: Maybe Text
botId :: Maybe Text
$sel:httpStatus:UpdateBotResponse' :: UpdateBotResponse -> Int
$sel:roleArn:UpdateBotResponse' :: UpdateBotResponse -> Maybe Text
$sel:lastUpdatedDateTime:UpdateBotResponse' :: UpdateBotResponse -> Maybe POSIX
$sel:idleSessionTTLInSeconds:UpdateBotResponse' :: UpdateBotResponse -> Maybe Natural
$sel:description:UpdateBotResponse' :: UpdateBotResponse -> Maybe Text
$sel:dataPrivacy:UpdateBotResponse' :: UpdateBotResponse -> Maybe DataPrivacy
$sel:creationDateTime:UpdateBotResponse' :: UpdateBotResponse -> Maybe POSIX
$sel:botStatus:UpdateBotResponse' :: UpdateBotResponse -> Maybe BotStatus
$sel:botName:UpdateBotResponse' :: UpdateBotResponse -> Maybe Text
$sel:botId:UpdateBotResponse' :: UpdateBotResponse -> 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 POSIX
creationDateTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DataPrivacy
dataPrivacy
      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 Natural
idleSessionTTLInSeconds
      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
roleArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus