{-# 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.LexModels.GetBot
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns metadata information for a specific bot. You must provide the
-- bot name and the bot version or alias.
--
-- This operation requires permissions for the @lex:GetBot@ action.
module Amazonka.LexModels.GetBot
  ( -- * Creating a Request
    GetBot (..),
    newGetBot,

    -- * Request Lenses
    getBot_name,
    getBot_versionOrAlias,

    -- * Destructuring the Response
    GetBotResponse (..),
    newGetBotResponse,

    -- * Response Lenses
    getBotResponse_failureReason,
    getBotResponse_status,
    getBotResponse_abortStatement,
    getBotResponse_intents,
    getBotResponse_checksum,
    getBotResponse_enableModelImprovements,
    getBotResponse_nluIntentConfidenceThreshold,
    getBotResponse_detectSentiment,
    getBotResponse_locale,
    getBotResponse_createdDate,
    getBotResponse_name,
    getBotResponse_version,
    getBotResponse_idleSessionTTLInSeconds,
    getBotResponse_clarificationPrompt,
    getBotResponse_voiceId,
    getBotResponse_lastUpdatedDate,
    getBotResponse_childDirected,
    getBotResponse_description,
    getBotResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.LexModels.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newGetBot' smart constructor.
data GetBot = GetBot'
  { -- | The name of the bot. The name is case sensitive.
    GetBot -> Text
name :: Prelude.Text,
    -- | The version or alias of the bot.
    GetBot -> Text
versionOrAlias :: Prelude.Text
  }
  deriving (GetBot -> GetBot -> Bool
(GetBot -> GetBot -> Bool)
-> (GetBot -> GetBot -> Bool) -> Eq GetBot
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetBot -> GetBot -> Bool
$c/= :: GetBot -> GetBot -> Bool
== :: GetBot -> GetBot -> Bool
$c== :: GetBot -> GetBot -> Bool
Prelude.Eq, ReadPrec [GetBot]
ReadPrec GetBot
Int -> ReadS GetBot
ReadS [GetBot]
(Int -> ReadS GetBot)
-> ReadS [GetBot]
-> ReadPrec GetBot
-> ReadPrec [GetBot]
-> Read GetBot
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetBot]
$creadListPrec :: ReadPrec [GetBot]
readPrec :: ReadPrec GetBot
$creadPrec :: ReadPrec GetBot
readList :: ReadS [GetBot]
$creadList :: ReadS [GetBot]
readsPrec :: Int -> ReadS GetBot
$creadsPrec :: Int -> ReadS GetBot
Prelude.Read, Int -> GetBot -> ShowS
[GetBot] -> ShowS
GetBot -> String
(Int -> GetBot -> ShowS)
-> (GetBot -> String) -> ([GetBot] -> ShowS) -> Show GetBot
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetBot] -> ShowS
$cshowList :: [GetBot] -> ShowS
show :: GetBot -> String
$cshow :: GetBot -> String
showsPrec :: Int -> GetBot -> ShowS
$cshowsPrec :: Int -> GetBot -> ShowS
Prelude.Show, (forall x. GetBot -> Rep GetBot x)
-> (forall x. Rep GetBot x -> GetBot) -> Generic GetBot
forall x. Rep GetBot x -> GetBot
forall x. GetBot -> Rep GetBot x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetBot x -> GetBot
$cfrom :: forall x. GetBot -> Rep GetBot x
Prelude.Generic)

-- |
-- Create a value of 'GetBot' 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:
--
-- 'name', 'getBot_name' - The name of the bot. The name is case sensitive.
--
-- 'versionOrAlias', 'getBot_versionOrAlias' - The version or alias of the bot.
newGetBot ::
  -- | 'name'
  Prelude.Text ->
  -- | 'versionOrAlias'
  Prelude.Text ->
  GetBot
newGetBot :: Text -> Text -> GetBot
newGetBot Text
pName_ Text
pVersionOrAlias_ =
  GetBot' :: Text -> Text -> GetBot
GetBot'
    { $sel:name:GetBot' :: Text
name = Text
pName_,
      $sel:versionOrAlias:GetBot' :: Text
versionOrAlias = Text
pVersionOrAlias_
    }

-- | The name of the bot. The name is case sensitive.
getBot_name :: Lens.Lens' GetBot Prelude.Text
getBot_name :: (Text -> f Text) -> GetBot -> f GetBot
getBot_name = (GetBot -> Text)
-> (GetBot -> Text -> GetBot) -> Lens GetBot GetBot Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBot' {Text
name :: Text
$sel:name:GetBot' :: GetBot -> Text
name} -> Text
name) (\s :: GetBot
s@GetBot' {} Text
a -> GetBot
s {$sel:name:GetBot' :: Text
name = Text
a} :: GetBot)

-- | The version or alias of the bot.
getBot_versionOrAlias :: Lens.Lens' GetBot Prelude.Text
getBot_versionOrAlias :: (Text -> f Text) -> GetBot -> f GetBot
getBot_versionOrAlias = (GetBot -> Text)
-> (GetBot -> Text -> GetBot) -> Lens GetBot GetBot Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBot' {Text
versionOrAlias :: Text
$sel:versionOrAlias:GetBot' :: GetBot -> Text
versionOrAlias} -> Text
versionOrAlias) (\s :: GetBot
s@GetBot' {} Text
a -> GetBot
s {$sel:versionOrAlias:GetBot' :: Text
versionOrAlias = Text
a} :: GetBot)

instance Core.AWSRequest GetBot where
  type AWSResponse GetBot = GetBotResponse
  request :: GetBot -> Request GetBot
request = Service -> GetBot -> Request GetBot
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy GetBot
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetBot)))
response =
    (Int
 -> ResponseHeaders -> Object -> Either String (AWSResponse GetBot))
-> Logger
-> Service
-> Proxy GetBot
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetBot)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe LexStatus
-> Maybe Statement
-> Maybe [Intent]
-> Maybe Text
-> Maybe Bool
-> Maybe Double
-> Maybe Bool
-> Maybe Locale
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe Prompt
-> Maybe Text
-> Maybe POSIX
-> Maybe Bool
-> Maybe Text
-> Int
-> GetBotResponse
GetBotResponse'
            (Maybe Text
 -> Maybe LexStatus
 -> Maybe Statement
 -> Maybe [Intent]
 -> Maybe Text
 -> Maybe Bool
 -> Maybe Double
 -> Maybe Bool
 -> Maybe Locale
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe Natural
 -> Maybe Prompt
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Bool
 -> Maybe Text
 -> Int
 -> GetBotResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe LexStatus
      -> Maybe Statement
      -> Maybe [Intent]
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Double
      -> Maybe Bool
      -> Maybe Locale
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> Maybe Prompt
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Bool
      -> Maybe Text
      -> Int
      -> GetBotResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"failureReason")
            Either
  String
  (Maybe LexStatus
   -> Maybe Statement
   -> Maybe [Intent]
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Double
   -> Maybe Bool
   -> Maybe Locale
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> Maybe Prompt
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Bool
   -> Maybe Text
   -> Int
   -> GetBotResponse)
-> Either String (Maybe LexStatus)
-> Either
     String
     (Maybe Statement
      -> Maybe [Intent]
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Double
      -> Maybe Bool
      -> Maybe Locale
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> Maybe Prompt
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Bool
      -> Maybe Text
      -> Int
      -> GetBotResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe LexStatus)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"status")
            Either
  String
  (Maybe Statement
   -> Maybe [Intent]
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Double
   -> Maybe Bool
   -> Maybe Locale
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> Maybe Prompt
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Bool
   -> Maybe Text
   -> Int
   -> GetBotResponse)
-> Either String (Maybe Statement)
-> Either
     String
     (Maybe [Intent]
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Double
      -> Maybe Bool
      -> Maybe Locale
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> Maybe Prompt
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Bool
      -> Maybe Text
      -> Int
      -> GetBotResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Statement)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"abortStatement")
            Either
  String
  (Maybe [Intent]
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Double
   -> Maybe Bool
   -> Maybe Locale
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> Maybe Prompt
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Bool
   -> Maybe Text
   -> Int
   -> GetBotResponse)
-> Either String (Maybe [Intent])
-> Either
     String
     (Maybe Text
      -> Maybe Bool
      -> Maybe Double
      -> Maybe Bool
      -> Maybe Locale
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> Maybe Prompt
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Bool
      -> Maybe Text
      -> Int
      -> GetBotResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [Intent]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"intents" Either String (Maybe (Maybe [Intent]))
-> Maybe [Intent] -> Either String (Maybe [Intent])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Intent]
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (Maybe Text
   -> Maybe Bool
   -> Maybe Double
   -> Maybe Bool
   -> Maybe Locale
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> Maybe Prompt
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Bool
   -> Maybe Text
   -> Int
   -> GetBotResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Bool
      -> Maybe Double
      -> Maybe Bool
      -> Maybe Locale
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> Maybe Prompt
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Bool
      -> Maybe Text
      -> Int
      -> GetBotResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"checksum")
            Either
  String
  (Maybe Bool
   -> Maybe Double
   -> Maybe Bool
   -> Maybe Locale
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> Maybe Prompt
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Bool
   -> Maybe Text
   -> Int
   -> GetBotResponse)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe Double
      -> Maybe Bool
      -> Maybe Locale
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> Maybe Prompt
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Bool
      -> Maybe Text
      -> Int
      -> GetBotResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"enableModelImprovements")
            Either
  String
  (Maybe Double
   -> Maybe Bool
   -> Maybe Locale
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> Maybe Prompt
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Bool
   -> Maybe Text
   -> Int
   -> GetBotResponse)
-> Either String (Maybe Double)
-> Either
     String
     (Maybe Bool
      -> Maybe Locale
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> Maybe Prompt
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Bool
      -> Maybe Text
      -> Int
      -> GetBotResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Double)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"nluIntentConfidenceThreshold")
            Either
  String
  (Maybe Bool
   -> Maybe Locale
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> Maybe Prompt
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Bool
   -> Maybe Text
   -> Int
   -> GetBotResponse)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe Locale
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> Maybe Prompt
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Bool
      -> Maybe Text
      -> Int
      -> GetBotResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"detectSentiment")
            Either
  String
  (Maybe Locale
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> Maybe Prompt
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Bool
   -> Maybe Text
   -> Int
   -> GetBotResponse)
-> Either String (Maybe Locale)
-> Either
     String
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> Maybe Prompt
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Bool
      -> Maybe Text
      -> Int
      -> GetBotResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Locale)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"locale")
            Either
  String
  (Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> Maybe Prompt
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Bool
   -> Maybe Text
   -> Int
   -> GetBotResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> Maybe Prompt
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Bool
      -> Maybe Text
      -> Int
      -> GetBotResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"createdDate")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> Maybe Prompt
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Bool
   -> Maybe Text
   -> Int
   -> GetBotResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Natural
      -> Maybe Prompt
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Bool
      -> Maybe Text
      -> Int
      -> GetBotResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"name")
            Either
  String
  (Maybe Text
   -> Maybe Natural
   -> Maybe Prompt
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Bool
   -> Maybe Text
   -> Int
   -> GetBotResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Natural
      -> Maybe Prompt
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Bool
      -> Maybe Text
      -> Int
      -> GetBotResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"version")
            Either
  String
  (Maybe Natural
   -> Maybe Prompt
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Bool
   -> Maybe Text
   -> Int
   -> GetBotResponse)
-> Either String (Maybe Natural)
-> Either
     String
     (Maybe Prompt
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Bool
      -> Maybe Text
      -> Int
      -> GetBotResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"idleSessionTTLInSeconds")
            Either
  String
  (Maybe Prompt
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Bool
   -> Maybe Text
   -> Int
   -> GetBotResponse)
-> Either String (Maybe Prompt)
-> Either
     String
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Bool
      -> Maybe Text
      -> Int
      -> GetBotResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Prompt)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"clarificationPrompt")
            Either
  String
  (Maybe Text
   -> Maybe POSIX
   -> Maybe Bool
   -> Maybe Text
   -> Int
   -> GetBotResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe POSIX -> Maybe Bool -> Maybe Text -> Int -> GetBotResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"voiceId")
            Either
  String
  (Maybe POSIX -> Maybe Bool -> Maybe Text -> Int -> GetBotResponse)
-> Either String (Maybe POSIX)
-> Either
     String (Maybe Bool -> Maybe Text -> Int -> GetBotResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"lastUpdatedDate")
            Either String (Maybe Bool -> Maybe Text -> Int -> GetBotResponse)
-> Either String (Maybe Bool)
-> Either String (Maybe Text -> Int -> GetBotResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"childDirected")
            Either String (Maybe Text -> Int -> GetBotResponse)
-> Either String (Maybe Text)
-> Either String (Int -> GetBotResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"description")
            Either String (Int -> GetBotResponse)
-> Either String Int -> Either String GetBotResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable GetBot

instance Prelude.NFData GetBot

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

instance Core.ToPath GetBot where
  toPath :: GetBot -> ByteString
toPath GetBot' {Text
versionOrAlias :: Text
name :: Text
$sel:versionOrAlias:GetBot' :: GetBot -> Text
$sel:name:GetBot' :: GetBot -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/bots/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
name,
        ByteString
"/versions/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
versionOrAlias
      ]

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

-- | /See:/ 'newGetBotResponse' smart constructor.
data GetBotResponse = GetBotResponse'
  { -- | If @status@ is @FAILED@, Amazon Lex explains why it failed to build the
    -- bot.
    GetBotResponse -> Maybe Text
failureReason :: Prelude.Maybe Prelude.Text,
    -- | The status of the bot.
    --
    -- When the status is @BUILDING@ Amazon Lex is building the bot for testing
    -- and use.
    --
    -- If the status of the bot is @READY_BASIC_TESTING@, you can test the bot
    -- using the exact utterances specified in the bot\'s intents. When the bot
    -- is ready for full testing or to run, the status is @READY@.
    --
    -- If there was a problem with building the bot, the status is @FAILED@ and
    -- the @failureReason@ field explains why the bot did not build.
    --
    -- If the bot was saved but not built, the status is @NOT_BUILT@.
    GetBotResponse -> Maybe LexStatus
status :: Prelude.Maybe LexStatus,
    -- | The message that Amazon Lex returns when the user elects to end the
    -- conversation without completing it. For more information, see PutBot.
    GetBotResponse -> Maybe Statement
abortStatement :: Prelude.Maybe Statement,
    -- | An array of @intent@ objects. For more information, see PutBot.
    GetBotResponse -> Maybe [Intent]
intents :: Prelude.Maybe [Intent],
    -- | Checksum of the bot used to identify a specific revision of the bot\'s
    -- @$LATEST@ version.
    GetBotResponse -> Maybe Text
checksum :: Prelude.Maybe Prelude.Text,
    -- | Indicates whether the bot uses accuracy improvements. @true@ indicates
    -- that the bot is using the improvements, otherwise, @false@.
    GetBotResponse -> Maybe Bool
enableModelImprovements :: Prelude.Maybe Prelude.Bool,
    -- | The score that determines where Amazon Lex inserts the
    -- @AMAZON.FallbackIntent@, @AMAZON.KendraSearchIntent@, or both when
    -- returning alternative intents in a
    -- <https://docs.aws.amazon.com/lex/latest/dg/API_runtime_PostContent.html PostContent>
    -- or
    -- <https://docs.aws.amazon.com/lex/latest/dg/API_runtime_PostText.html PostText>
    -- response. @AMAZON.FallbackIntent@ is inserted if the confidence score
    -- for all intents is below this value. @AMAZON.KendraSearchIntent@ is only
    -- inserted if it is configured for the bot.
    GetBotResponse -> Maybe Double
nluIntentConfidenceThreshold :: Prelude.Maybe Prelude.Double,
    -- | Indicates whether user utterances should be sent to Amazon Comprehend
    -- for sentiment analysis.
    GetBotResponse -> Maybe Bool
detectSentiment :: Prelude.Maybe Prelude.Bool,
    -- | The target locale for the bot.
    GetBotResponse -> Maybe Locale
locale :: Prelude.Maybe Locale,
    -- | The date that the bot was created.
    GetBotResponse -> Maybe POSIX
createdDate :: Prelude.Maybe Core.POSIX,
    -- | The name of the bot.
    GetBotResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The version of the bot. For a new bot, the version is always @$LATEST@.
    GetBotResponse -> Maybe Text
version :: Prelude.Maybe Prelude.Text,
    -- | The maximum time in seconds that Amazon Lex retains the data gathered in
    -- a conversation. For more information, see PutBot.
    GetBotResponse -> Maybe Natural
idleSessionTTLInSeconds :: Prelude.Maybe Prelude.Natural,
    -- | The message Amazon Lex uses when it doesn\'t understand the user\'s
    -- request. For more information, see PutBot.
    GetBotResponse -> Maybe Prompt
clarificationPrompt :: Prelude.Maybe Prompt,
    -- | The Amazon Polly voice ID that Amazon Lex uses for voice interaction
    -- with the user. For more information, see PutBot.
    GetBotResponse -> Maybe Text
voiceId :: Prelude.Maybe Prelude.Text,
    -- | The date that the bot was updated. When you create a resource, the
    -- creation date and last updated date are the same.
    GetBotResponse -> Maybe POSIX
lastUpdatedDate :: Prelude.Maybe Core.POSIX,
    -- | For each Amazon Lex bot created with the Amazon Lex Model Building
    -- Service, you must specify whether your use of Amazon Lex is related to a
    -- website, program, or other application that is directed or targeted, in
    -- whole or in part, to children under age 13 and subject to the
    -- Children\'s Online Privacy Protection Act (COPPA) by specifying @true@
    -- or @false@ in the @childDirected@ field. By specifying @true@ in the
    -- @childDirected@ field, you confirm that your use of Amazon Lex __is__
    -- related to a website, program, or other application that is directed or
    -- targeted, in whole or in part, to children under age 13 and subject to
    -- COPPA. By specifying @false@ in the @childDirected@ field, you confirm
    -- that your use of Amazon Lex __is not__ related to a website, program, or
    -- other application that is directed or targeted, in whole or in part, to
    -- children under age 13 and subject to COPPA. You may not specify a
    -- default value for the @childDirected@ field that does not accurately
    -- reflect whether your use of Amazon Lex is related to a website, program,
    -- or other application that is directed or targeted, in whole or in part,
    -- to children under age 13 and subject to COPPA.
    --
    -- If your use of Amazon Lex relates to a website, program, or other
    -- application that is directed in whole or in part, to children under age
    -- 13, you must obtain any required verifiable parental consent under
    -- COPPA. For information regarding the use of Amazon Lex in connection
    -- with websites, programs, or other applications that are directed or
    -- targeted, in whole or in part, to children under age 13, see the
    -- <https://aws.amazon.com/lex/faqs#data-security Amazon Lex FAQ.>
    GetBotResponse -> Maybe Bool
childDirected :: Prelude.Maybe Prelude.Bool,
    -- | A description of the bot.
    GetBotResponse -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetBotResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetBotResponse -> GetBotResponse -> Bool
(GetBotResponse -> GetBotResponse -> Bool)
-> (GetBotResponse -> GetBotResponse -> Bool) -> Eq GetBotResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetBotResponse -> GetBotResponse -> Bool
$c/= :: GetBotResponse -> GetBotResponse -> Bool
== :: GetBotResponse -> GetBotResponse -> Bool
$c== :: GetBotResponse -> GetBotResponse -> Bool
Prelude.Eq, ReadPrec [GetBotResponse]
ReadPrec GetBotResponse
Int -> ReadS GetBotResponse
ReadS [GetBotResponse]
(Int -> ReadS GetBotResponse)
-> ReadS [GetBotResponse]
-> ReadPrec GetBotResponse
-> ReadPrec [GetBotResponse]
-> Read GetBotResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetBotResponse]
$creadListPrec :: ReadPrec [GetBotResponse]
readPrec :: ReadPrec GetBotResponse
$creadPrec :: ReadPrec GetBotResponse
readList :: ReadS [GetBotResponse]
$creadList :: ReadS [GetBotResponse]
readsPrec :: Int -> ReadS GetBotResponse
$creadsPrec :: Int -> ReadS GetBotResponse
Prelude.Read, Int -> GetBotResponse -> ShowS
[GetBotResponse] -> ShowS
GetBotResponse -> String
(Int -> GetBotResponse -> ShowS)
-> (GetBotResponse -> String)
-> ([GetBotResponse] -> ShowS)
-> Show GetBotResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetBotResponse] -> ShowS
$cshowList :: [GetBotResponse] -> ShowS
show :: GetBotResponse -> String
$cshow :: GetBotResponse -> String
showsPrec :: Int -> GetBotResponse -> ShowS
$cshowsPrec :: Int -> GetBotResponse -> ShowS
Prelude.Show, (forall x. GetBotResponse -> Rep GetBotResponse x)
-> (forall x. Rep GetBotResponse x -> GetBotResponse)
-> Generic GetBotResponse
forall x. Rep GetBotResponse x -> GetBotResponse
forall x. GetBotResponse -> Rep GetBotResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetBotResponse x -> GetBotResponse
$cfrom :: forall x. GetBotResponse -> Rep GetBotResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetBotResponse' 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:
--
-- 'failureReason', 'getBotResponse_failureReason' - If @status@ is @FAILED@, Amazon Lex explains why it failed to build the
-- bot.
--
-- 'status', 'getBotResponse_status' - The status of the bot.
--
-- When the status is @BUILDING@ Amazon Lex is building the bot for testing
-- and use.
--
-- If the status of the bot is @READY_BASIC_TESTING@, you can test the bot
-- using the exact utterances specified in the bot\'s intents. When the bot
-- is ready for full testing or to run, the status is @READY@.
--
-- If there was a problem with building the bot, the status is @FAILED@ and
-- the @failureReason@ field explains why the bot did not build.
--
-- If the bot was saved but not built, the status is @NOT_BUILT@.
--
-- 'abortStatement', 'getBotResponse_abortStatement' - The message that Amazon Lex returns when the user elects to end the
-- conversation without completing it. For more information, see PutBot.
--
-- 'intents', 'getBotResponse_intents' - An array of @intent@ objects. For more information, see PutBot.
--
-- 'checksum', 'getBotResponse_checksum' - Checksum of the bot used to identify a specific revision of the bot\'s
-- @$LATEST@ version.
--
-- 'enableModelImprovements', 'getBotResponse_enableModelImprovements' - Indicates whether the bot uses accuracy improvements. @true@ indicates
-- that the bot is using the improvements, otherwise, @false@.
--
-- 'nluIntentConfidenceThreshold', 'getBotResponse_nluIntentConfidenceThreshold' - The score that determines where Amazon Lex inserts the
-- @AMAZON.FallbackIntent@, @AMAZON.KendraSearchIntent@, or both when
-- returning alternative intents in a
-- <https://docs.aws.amazon.com/lex/latest/dg/API_runtime_PostContent.html PostContent>
-- or
-- <https://docs.aws.amazon.com/lex/latest/dg/API_runtime_PostText.html PostText>
-- response. @AMAZON.FallbackIntent@ is inserted if the confidence score
-- for all intents is below this value. @AMAZON.KendraSearchIntent@ is only
-- inserted if it is configured for the bot.
--
-- 'detectSentiment', 'getBotResponse_detectSentiment' - Indicates whether user utterances should be sent to Amazon Comprehend
-- for sentiment analysis.
--
-- 'locale', 'getBotResponse_locale' - The target locale for the bot.
--
-- 'createdDate', 'getBotResponse_createdDate' - The date that the bot was created.
--
-- 'name', 'getBotResponse_name' - The name of the bot.
--
-- 'version', 'getBotResponse_version' - The version of the bot. For a new bot, the version is always @$LATEST@.
--
-- 'idleSessionTTLInSeconds', 'getBotResponse_idleSessionTTLInSeconds' - The maximum time in seconds that Amazon Lex retains the data gathered in
-- a conversation. For more information, see PutBot.
--
-- 'clarificationPrompt', 'getBotResponse_clarificationPrompt' - The message Amazon Lex uses when it doesn\'t understand the user\'s
-- request. For more information, see PutBot.
--
-- 'voiceId', 'getBotResponse_voiceId' - The Amazon Polly voice ID that Amazon Lex uses for voice interaction
-- with the user. For more information, see PutBot.
--
-- 'lastUpdatedDate', 'getBotResponse_lastUpdatedDate' - The date that the bot was updated. When you create a resource, the
-- creation date and last updated date are the same.
--
-- 'childDirected', 'getBotResponse_childDirected' - For each Amazon Lex bot created with the Amazon Lex Model Building
-- Service, you must specify whether your use of Amazon Lex is related to a
-- website, program, or other application that is directed or targeted, in
-- whole or in part, to children under age 13 and subject to the
-- Children\'s Online Privacy Protection Act (COPPA) by specifying @true@
-- or @false@ in the @childDirected@ field. By specifying @true@ in the
-- @childDirected@ field, you confirm that your use of Amazon Lex __is__
-- related to a website, program, or other application that is directed or
-- targeted, in whole or in part, to children under age 13 and subject to
-- COPPA. By specifying @false@ in the @childDirected@ field, you confirm
-- that your use of Amazon Lex __is not__ related to a website, program, or
-- other application that is directed or targeted, in whole or in part, to
-- children under age 13 and subject to COPPA. You may not specify a
-- default value for the @childDirected@ field that does not accurately
-- reflect whether your use of Amazon Lex is related to a website, program,
-- or other application that is directed or targeted, in whole or in part,
-- to children under age 13 and subject to COPPA.
--
-- If your use of Amazon Lex relates to a website, program, or other
-- application that is directed in whole or in part, to children under age
-- 13, you must obtain any required verifiable parental consent under
-- COPPA. For information regarding the use of Amazon Lex in connection
-- with websites, programs, or other applications that are directed or
-- targeted, in whole or in part, to children under age 13, see the
-- <https://aws.amazon.com/lex/faqs#data-security Amazon Lex FAQ.>
--
-- 'description', 'getBotResponse_description' - A description of the bot.
--
-- 'httpStatus', 'getBotResponse_httpStatus' - The response's http status code.
newGetBotResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetBotResponse
newGetBotResponse :: Int -> GetBotResponse
newGetBotResponse Int
pHttpStatus_ =
  GetBotResponse' :: Maybe Text
-> Maybe LexStatus
-> Maybe Statement
-> Maybe [Intent]
-> Maybe Text
-> Maybe Bool
-> Maybe Double
-> Maybe Bool
-> Maybe Locale
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe Prompt
-> Maybe Text
-> Maybe POSIX
-> Maybe Bool
-> Maybe Text
-> Int
-> GetBotResponse
GetBotResponse'
    { $sel:failureReason:GetBotResponse' :: Maybe Text
failureReason = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:status:GetBotResponse' :: Maybe LexStatus
status = Maybe LexStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:abortStatement:GetBotResponse' :: Maybe Statement
abortStatement = Maybe Statement
forall a. Maybe a
Prelude.Nothing,
      $sel:intents:GetBotResponse' :: Maybe [Intent]
intents = Maybe [Intent]
forall a. Maybe a
Prelude.Nothing,
      $sel:checksum:GetBotResponse' :: Maybe Text
checksum = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:enableModelImprovements:GetBotResponse' :: Maybe Bool
enableModelImprovements = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:nluIntentConfidenceThreshold:GetBotResponse' :: Maybe Double
nluIntentConfidenceThreshold = Maybe Double
forall a. Maybe a
Prelude.Nothing,
      $sel:detectSentiment:GetBotResponse' :: Maybe Bool
detectSentiment = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:locale:GetBotResponse' :: Maybe Locale
locale = Maybe Locale
forall a. Maybe a
Prelude.Nothing,
      $sel:createdDate:GetBotResponse' :: Maybe POSIX
createdDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:name:GetBotResponse' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:version:GetBotResponse' :: Maybe Text
version = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:idleSessionTTLInSeconds:GetBotResponse' :: Maybe Natural
idleSessionTTLInSeconds = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:clarificationPrompt:GetBotResponse' :: Maybe Prompt
clarificationPrompt = Maybe Prompt
forall a. Maybe a
Prelude.Nothing,
      $sel:voiceId:GetBotResponse' :: Maybe Text
voiceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedDate:GetBotResponse' :: Maybe POSIX
lastUpdatedDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:childDirected:GetBotResponse' :: Maybe Bool
childDirected = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:description:GetBotResponse' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetBotResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | If @status@ is @FAILED@, Amazon Lex explains why it failed to build the
-- bot.
getBotResponse_failureReason :: Lens.Lens' GetBotResponse (Prelude.Maybe Prelude.Text)
getBotResponse_failureReason :: (Maybe Text -> f (Maybe Text))
-> GetBotResponse -> f GetBotResponse
getBotResponse_failureReason = (GetBotResponse -> Maybe Text)
-> (GetBotResponse -> Maybe Text -> GetBotResponse)
-> Lens GetBotResponse GetBotResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBotResponse' {Maybe Text
failureReason :: Maybe Text
$sel:failureReason:GetBotResponse' :: GetBotResponse -> Maybe Text
failureReason} -> Maybe Text
failureReason) (\s :: GetBotResponse
s@GetBotResponse' {} Maybe Text
a -> GetBotResponse
s {$sel:failureReason:GetBotResponse' :: Maybe Text
failureReason = Maybe Text
a} :: GetBotResponse)

-- | The status of the bot.
--
-- When the status is @BUILDING@ Amazon Lex is building the bot for testing
-- and use.
--
-- If the status of the bot is @READY_BASIC_TESTING@, you can test the bot
-- using the exact utterances specified in the bot\'s intents. When the bot
-- is ready for full testing or to run, the status is @READY@.
--
-- If there was a problem with building the bot, the status is @FAILED@ and
-- the @failureReason@ field explains why the bot did not build.
--
-- If the bot was saved but not built, the status is @NOT_BUILT@.
getBotResponse_status :: Lens.Lens' GetBotResponse (Prelude.Maybe LexStatus)
getBotResponse_status :: (Maybe LexStatus -> f (Maybe LexStatus))
-> GetBotResponse -> f GetBotResponse
getBotResponse_status = (GetBotResponse -> Maybe LexStatus)
-> (GetBotResponse -> Maybe LexStatus -> GetBotResponse)
-> Lens
     GetBotResponse GetBotResponse (Maybe LexStatus) (Maybe LexStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBotResponse' {Maybe LexStatus
status :: Maybe LexStatus
$sel:status:GetBotResponse' :: GetBotResponse -> Maybe LexStatus
status} -> Maybe LexStatus
status) (\s :: GetBotResponse
s@GetBotResponse' {} Maybe LexStatus
a -> GetBotResponse
s {$sel:status:GetBotResponse' :: Maybe LexStatus
status = Maybe LexStatus
a} :: GetBotResponse)

-- | The message that Amazon Lex returns when the user elects to end the
-- conversation without completing it. For more information, see PutBot.
getBotResponse_abortStatement :: Lens.Lens' GetBotResponse (Prelude.Maybe Statement)
getBotResponse_abortStatement :: (Maybe Statement -> f (Maybe Statement))
-> GetBotResponse -> f GetBotResponse
getBotResponse_abortStatement = (GetBotResponse -> Maybe Statement)
-> (GetBotResponse -> Maybe Statement -> GetBotResponse)
-> Lens
     GetBotResponse GetBotResponse (Maybe Statement) (Maybe Statement)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBotResponse' {Maybe Statement
abortStatement :: Maybe Statement
$sel:abortStatement:GetBotResponse' :: GetBotResponse -> Maybe Statement
abortStatement} -> Maybe Statement
abortStatement) (\s :: GetBotResponse
s@GetBotResponse' {} Maybe Statement
a -> GetBotResponse
s {$sel:abortStatement:GetBotResponse' :: Maybe Statement
abortStatement = Maybe Statement
a} :: GetBotResponse)

-- | An array of @intent@ objects. For more information, see PutBot.
getBotResponse_intents :: Lens.Lens' GetBotResponse (Prelude.Maybe [Intent])
getBotResponse_intents :: (Maybe [Intent] -> f (Maybe [Intent]))
-> GetBotResponse -> f GetBotResponse
getBotResponse_intents = (GetBotResponse -> Maybe [Intent])
-> (GetBotResponse -> Maybe [Intent] -> GetBotResponse)
-> Lens
     GetBotResponse GetBotResponse (Maybe [Intent]) (Maybe [Intent])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBotResponse' {Maybe [Intent]
intents :: Maybe [Intent]
$sel:intents:GetBotResponse' :: GetBotResponse -> Maybe [Intent]
intents} -> Maybe [Intent]
intents) (\s :: GetBotResponse
s@GetBotResponse' {} Maybe [Intent]
a -> GetBotResponse
s {$sel:intents:GetBotResponse' :: Maybe [Intent]
intents = Maybe [Intent]
a} :: GetBotResponse) ((Maybe [Intent] -> f (Maybe [Intent]))
 -> GetBotResponse -> f GetBotResponse)
-> ((Maybe [Intent] -> f (Maybe [Intent]))
    -> Maybe [Intent] -> f (Maybe [Intent]))
-> (Maybe [Intent] -> f (Maybe [Intent]))
-> GetBotResponse
-> f GetBotResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Intent] [Intent] [Intent] [Intent]
-> Iso
     (Maybe [Intent]) (Maybe [Intent]) (Maybe [Intent]) (Maybe [Intent])
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 AnIso [Intent] [Intent] [Intent] [Intent]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Checksum of the bot used to identify a specific revision of the bot\'s
-- @$LATEST@ version.
getBotResponse_checksum :: Lens.Lens' GetBotResponse (Prelude.Maybe Prelude.Text)
getBotResponse_checksum :: (Maybe Text -> f (Maybe Text))
-> GetBotResponse -> f GetBotResponse
getBotResponse_checksum = (GetBotResponse -> Maybe Text)
-> (GetBotResponse -> Maybe Text -> GetBotResponse)
-> Lens GetBotResponse GetBotResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBotResponse' {Maybe Text
checksum :: Maybe Text
$sel:checksum:GetBotResponse' :: GetBotResponse -> Maybe Text
checksum} -> Maybe Text
checksum) (\s :: GetBotResponse
s@GetBotResponse' {} Maybe Text
a -> GetBotResponse
s {$sel:checksum:GetBotResponse' :: Maybe Text
checksum = Maybe Text
a} :: GetBotResponse)

-- | Indicates whether the bot uses accuracy improvements. @true@ indicates
-- that the bot is using the improvements, otherwise, @false@.
getBotResponse_enableModelImprovements :: Lens.Lens' GetBotResponse (Prelude.Maybe Prelude.Bool)
getBotResponse_enableModelImprovements :: (Maybe Bool -> f (Maybe Bool))
-> GetBotResponse -> f GetBotResponse
getBotResponse_enableModelImprovements = (GetBotResponse -> Maybe Bool)
-> (GetBotResponse -> Maybe Bool -> GetBotResponse)
-> Lens GetBotResponse GetBotResponse (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBotResponse' {Maybe Bool
enableModelImprovements :: Maybe Bool
$sel:enableModelImprovements:GetBotResponse' :: GetBotResponse -> Maybe Bool
enableModelImprovements} -> Maybe Bool
enableModelImprovements) (\s :: GetBotResponse
s@GetBotResponse' {} Maybe Bool
a -> GetBotResponse
s {$sel:enableModelImprovements:GetBotResponse' :: Maybe Bool
enableModelImprovements = Maybe Bool
a} :: GetBotResponse)

-- | The score that determines where Amazon Lex inserts the
-- @AMAZON.FallbackIntent@, @AMAZON.KendraSearchIntent@, or both when
-- returning alternative intents in a
-- <https://docs.aws.amazon.com/lex/latest/dg/API_runtime_PostContent.html PostContent>
-- or
-- <https://docs.aws.amazon.com/lex/latest/dg/API_runtime_PostText.html PostText>
-- response. @AMAZON.FallbackIntent@ is inserted if the confidence score
-- for all intents is below this value. @AMAZON.KendraSearchIntent@ is only
-- inserted if it is configured for the bot.
getBotResponse_nluIntentConfidenceThreshold :: Lens.Lens' GetBotResponse (Prelude.Maybe Prelude.Double)
getBotResponse_nluIntentConfidenceThreshold :: (Maybe Double -> f (Maybe Double))
-> GetBotResponse -> f GetBotResponse
getBotResponse_nluIntentConfidenceThreshold = (GetBotResponse -> Maybe Double)
-> (GetBotResponse -> Maybe Double -> GetBotResponse)
-> Lens GetBotResponse GetBotResponse (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBotResponse' {Maybe Double
nluIntentConfidenceThreshold :: Maybe Double
$sel:nluIntentConfidenceThreshold:GetBotResponse' :: GetBotResponse -> Maybe Double
nluIntentConfidenceThreshold} -> Maybe Double
nluIntentConfidenceThreshold) (\s :: GetBotResponse
s@GetBotResponse' {} Maybe Double
a -> GetBotResponse
s {$sel:nluIntentConfidenceThreshold:GetBotResponse' :: Maybe Double
nluIntentConfidenceThreshold = Maybe Double
a} :: GetBotResponse)

-- | Indicates whether user utterances should be sent to Amazon Comprehend
-- for sentiment analysis.
getBotResponse_detectSentiment :: Lens.Lens' GetBotResponse (Prelude.Maybe Prelude.Bool)
getBotResponse_detectSentiment :: (Maybe Bool -> f (Maybe Bool))
-> GetBotResponse -> f GetBotResponse
getBotResponse_detectSentiment = (GetBotResponse -> Maybe Bool)
-> (GetBotResponse -> Maybe Bool -> GetBotResponse)
-> Lens GetBotResponse GetBotResponse (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBotResponse' {Maybe Bool
detectSentiment :: Maybe Bool
$sel:detectSentiment:GetBotResponse' :: GetBotResponse -> Maybe Bool
detectSentiment} -> Maybe Bool
detectSentiment) (\s :: GetBotResponse
s@GetBotResponse' {} Maybe Bool
a -> GetBotResponse
s {$sel:detectSentiment:GetBotResponse' :: Maybe Bool
detectSentiment = Maybe Bool
a} :: GetBotResponse)

-- | The target locale for the bot.
getBotResponse_locale :: Lens.Lens' GetBotResponse (Prelude.Maybe Locale)
getBotResponse_locale :: (Maybe Locale -> f (Maybe Locale))
-> GetBotResponse -> f GetBotResponse
getBotResponse_locale = (GetBotResponse -> Maybe Locale)
-> (GetBotResponse -> Maybe Locale -> GetBotResponse)
-> Lens GetBotResponse GetBotResponse (Maybe Locale) (Maybe Locale)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBotResponse' {Maybe Locale
locale :: Maybe Locale
$sel:locale:GetBotResponse' :: GetBotResponse -> Maybe Locale
locale} -> Maybe Locale
locale) (\s :: GetBotResponse
s@GetBotResponse' {} Maybe Locale
a -> GetBotResponse
s {$sel:locale:GetBotResponse' :: Maybe Locale
locale = Maybe Locale
a} :: GetBotResponse)

-- | The date that the bot was created.
getBotResponse_createdDate :: Lens.Lens' GetBotResponse (Prelude.Maybe Prelude.UTCTime)
getBotResponse_createdDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> GetBotResponse -> f GetBotResponse
getBotResponse_createdDate = (GetBotResponse -> Maybe POSIX)
-> (GetBotResponse -> Maybe POSIX -> GetBotResponse)
-> Lens GetBotResponse GetBotResponse (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBotResponse' {Maybe POSIX
createdDate :: Maybe POSIX
$sel:createdDate:GetBotResponse' :: GetBotResponse -> Maybe POSIX
createdDate} -> Maybe POSIX
createdDate) (\s :: GetBotResponse
s@GetBotResponse' {} Maybe POSIX
a -> GetBotResponse
s {$sel:createdDate:GetBotResponse' :: Maybe POSIX
createdDate = Maybe POSIX
a} :: GetBotResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> GetBotResponse -> f GetBotResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GetBotResponse
-> f GetBotResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

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

-- | The version of the bot. For a new bot, the version is always @$LATEST@.
getBotResponse_version :: Lens.Lens' GetBotResponse (Prelude.Maybe Prelude.Text)
getBotResponse_version :: (Maybe Text -> f (Maybe Text))
-> GetBotResponse -> f GetBotResponse
getBotResponse_version = (GetBotResponse -> Maybe Text)
-> (GetBotResponse -> Maybe Text -> GetBotResponse)
-> Lens GetBotResponse GetBotResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBotResponse' {Maybe Text
version :: Maybe Text
$sel:version:GetBotResponse' :: GetBotResponse -> Maybe Text
version} -> Maybe Text
version) (\s :: GetBotResponse
s@GetBotResponse' {} Maybe Text
a -> GetBotResponse
s {$sel:version:GetBotResponse' :: Maybe Text
version = Maybe Text
a} :: GetBotResponse)

-- | The maximum time in seconds that Amazon Lex retains the data gathered in
-- a conversation. For more information, see PutBot.
getBotResponse_idleSessionTTLInSeconds :: Lens.Lens' GetBotResponse (Prelude.Maybe Prelude.Natural)
getBotResponse_idleSessionTTLInSeconds :: (Maybe Natural -> f (Maybe Natural))
-> GetBotResponse -> f GetBotResponse
getBotResponse_idleSessionTTLInSeconds = (GetBotResponse -> Maybe Natural)
-> (GetBotResponse -> Maybe Natural -> GetBotResponse)
-> Lens
     GetBotResponse GetBotResponse (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBotResponse' {Maybe Natural
idleSessionTTLInSeconds :: Maybe Natural
$sel:idleSessionTTLInSeconds:GetBotResponse' :: GetBotResponse -> Maybe Natural
idleSessionTTLInSeconds} -> Maybe Natural
idleSessionTTLInSeconds) (\s :: GetBotResponse
s@GetBotResponse' {} Maybe Natural
a -> GetBotResponse
s {$sel:idleSessionTTLInSeconds:GetBotResponse' :: Maybe Natural
idleSessionTTLInSeconds = Maybe Natural
a} :: GetBotResponse)

-- | The message Amazon Lex uses when it doesn\'t understand the user\'s
-- request. For more information, see PutBot.
getBotResponse_clarificationPrompt :: Lens.Lens' GetBotResponse (Prelude.Maybe Prompt)
getBotResponse_clarificationPrompt :: (Maybe Prompt -> f (Maybe Prompt))
-> GetBotResponse -> f GetBotResponse
getBotResponse_clarificationPrompt = (GetBotResponse -> Maybe Prompt)
-> (GetBotResponse -> Maybe Prompt -> GetBotResponse)
-> Lens GetBotResponse GetBotResponse (Maybe Prompt) (Maybe Prompt)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBotResponse' {Maybe Prompt
clarificationPrompt :: Maybe Prompt
$sel:clarificationPrompt:GetBotResponse' :: GetBotResponse -> Maybe Prompt
clarificationPrompt} -> Maybe Prompt
clarificationPrompt) (\s :: GetBotResponse
s@GetBotResponse' {} Maybe Prompt
a -> GetBotResponse
s {$sel:clarificationPrompt:GetBotResponse' :: Maybe Prompt
clarificationPrompt = Maybe Prompt
a} :: GetBotResponse)

-- | The Amazon Polly voice ID that Amazon Lex uses for voice interaction
-- with the user. For more information, see PutBot.
getBotResponse_voiceId :: Lens.Lens' GetBotResponse (Prelude.Maybe Prelude.Text)
getBotResponse_voiceId :: (Maybe Text -> f (Maybe Text))
-> GetBotResponse -> f GetBotResponse
getBotResponse_voiceId = (GetBotResponse -> Maybe Text)
-> (GetBotResponse -> Maybe Text -> GetBotResponse)
-> Lens GetBotResponse GetBotResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBotResponse' {Maybe Text
voiceId :: Maybe Text
$sel:voiceId:GetBotResponse' :: GetBotResponse -> Maybe Text
voiceId} -> Maybe Text
voiceId) (\s :: GetBotResponse
s@GetBotResponse' {} Maybe Text
a -> GetBotResponse
s {$sel:voiceId:GetBotResponse' :: Maybe Text
voiceId = Maybe Text
a} :: GetBotResponse)

-- | The date that the bot was updated. When you create a resource, the
-- creation date and last updated date are the same.
getBotResponse_lastUpdatedDate :: Lens.Lens' GetBotResponse (Prelude.Maybe Prelude.UTCTime)
getBotResponse_lastUpdatedDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> GetBotResponse -> f GetBotResponse
getBotResponse_lastUpdatedDate = (GetBotResponse -> Maybe POSIX)
-> (GetBotResponse -> Maybe POSIX -> GetBotResponse)
-> Lens GetBotResponse GetBotResponse (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBotResponse' {Maybe POSIX
lastUpdatedDate :: Maybe POSIX
$sel:lastUpdatedDate:GetBotResponse' :: GetBotResponse -> Maybe POSIX
lastUpdatedDate} -> Maybe POSIX
lastUpdatedDate) (\s :: GetBotResponse
s@GetBotResponse' {} Maybe POSIX
a -> GetBotResponse
s {$sel:lastUpdatedDate:GetBotResponse' :: Maybe POSIX
lastUpdatedDate = Maybe POSIX
a} :: GetBotResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> GetBotResponse -> f GetBotResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GetBotResponse
-> f GetBotResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | For each Amazon Lex bot created with the Amazon Lex Model Building
-- Service, you must specify whether your use of Amazon Lex is related to a
-- website, program, or other application that is directed or targeted, in
-- whole or in part, to children under age 13 and subject to the
-- Children\'s Online Privacy Protection Act (COPPA) by specifying @true@
-- or @false@ in the @childDirected@ field. By specifying @true@ in the
-- @childDirected@ field, you confirm that your use of Amazon Lex __is__
-- related to a website, program, or other application that is directed or
-- targeted, in whole or in part, to children under age 13 and subject to
-- COPPA. By specifying @false@ in the @childDirected@ field, you confirm
-- that your use of Amazon Lex __is not__ related to a website, program, or
-- other application that is directed or targeted, in whole or in part, to
-- children under age 13 and subject to COPPA. You may not specify a
-- default value for the @childDirected@ field that does not accurately
-- reflect whether your use of Amazon Lex is related to a website, program,
-- or other application that is directed or targeted, in whole or in part,
-- to children under age 13 and subject to COPPA.
--
-- If your use of Amazon Lex relates to a website, program, or other
-- application that is directed in whole or in part, to children under age
-- 13, you must obtain any required verifiable parental consent under
-- COPPA. For information regarding the use of Amazon Lex in connection
-- with websites, programs, or other applications that are directed or
-- targeted, in whole or in part, to children under age 13, see the
-- <https://aws.amazon.com/lex/faqs#data-security Amazon Lex FAQ.>
getBotResponse_childDirected :: Lens.Lens' GetBotResponse (Prelude.Maybe Prelude.Bool)
getBotResponse_childDirected :: (Maybe Bool -> f (Maybe Bool))
-> GetBotResponse -> f GetBotResponse
getBotResponse_childDirected = (GetBotResponse -> Maybe Bool)
-> (GetBotResponse -> Maybe Bool -> GetBotResponse)
-> Lens GetBotResponse GetBotResponse (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBotResponse' {Maybe Bool
childDirected :: Maybe Bool
$sel:childDirected:GetBotResponse' :: GetBotResponse -> Maybe Bool
childDirected} -> Maybe Bool
childDirected) (\s :: GetBotResponse
s@GetBotResponse' {} Maybe Bool
a -> GetBotResponse
s {$sel:childDirected:GetBotResponse' :: Maybe Bool
childDirected = Maybe Bool
a} :: GetBotResponse)

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

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

instance Prelude.NFData GetBotResponse