{-# 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.GetIntent
-- 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 information about an intent. In addition to the intent name, you
-- must specify the intent version.
--
-- This operation requires permissions to perform the @lex:GetIntent@
-- action.
module Amazonka.LexModels.GetIntent
  ( -- * Creating a Request
    GetIntent (..),
    newGetIntent,

    -- * Request Lenses
    getIntent_name,
    getIntent_version,

    -- * Destructuring the Response
    GetIntentResponse (..),
    newGetIntentResponse,

    -- * Response Lenses
    getIntentResponse_fulfillmentActivity,
    getIntentResponse_slots,
    getIntentResponse_rejectionStatement,
    getIntentResponse_checksum,
    getIntentResponse_conclusionStatement,
    getIntentResponse_sampleUtterances,
    getIntentResponse_parentIntentSignature,
    getIntentResponse_createdDate,
    getIntentResponse_kendraConfiguration,
    getIntentResponse_name,
    getIntentResponse_version,
    getIntentResponse_inputContexts,
    getIntentResponse_followUpPrompt,
    getIntentResponse_lastUpdatedDate,
    getIntentResponse_outputContexts,
    getIntentResponse_confirmationPrompt,
    getIntentResponse_dialogCodeHook,
    getIntentResponse_description,
    getIntentResponse_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:/ 'newGetIntent' smart constructor.
data GetIntent = GetIntent'
  { -- | The name of the intent. The name is case sensitive.
    GetIntent -> Text
name :: Prelude.Text,
    -- | The version of the intent.
    GetIntent -> Text
version :: Prelude.Text
  }
  deriving (GetIntent -> GetIntent -> Bool
(GetIntent -> GetIntent -> Bool)
-> (GetIntent -> GetIntent -> Bool) -> Eq GetIntent
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetIntent -> GetIntent -> Bool
$c/= :: GetIntent -> GetIntent -> Bool
== :: GetIntent -> GetIntent -> Bool
$c== :: GetIntent -> GetIntent -> Bool
Prelude.Eq, ReadPrec [GetIntent]
ReadPrec GetIntent
Int -> ReadS GetIntent
ReadS [GetIntent]
(Int -> ReadS GetIntent)
-> ReadS [GetIntent]
-> ReadPrec GetIntent
-> ReadPrec [GetIntent]
-> Read GetIntent
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetIntent]
$creadListPrec :: ReadPrec [GetIntent]
readPrec :: ReadPrec GetIntent
$creadPrec :: ReadPrec GetIntent
readList :: ReadS [GetIntent]
$creadList :: ReadS [GetIntent]
readsPrec :: Int -> ReadS GetIntent
$creadsPrec :: Int -> ReadS GetIntent
Prelude.Read, Int -> GetIntent -> ShowS
[GetIntent] -> ShowS
GetIntent -> String
(Int -> GetIntent -> ShowS)
-> (GetIntent -> String)
-> ([GetIntent] -> ShowS)
-> Show GetIntent
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetIntent] -> ShowS
$cshowList :: [GetIntent] -> ShowS
show :: GetIntent -> String
$cshow :: GetIntent -> String
showsPrec :: Int -> GetIntent -> ShowS
$cshowsPrec :: Int -> GetIntent -> ShowS
Prelude.Show, (forall x. GetIntent -> Rep GetIntent x)
-> (forall x. Rep GetIntent x -> GetIntent) -> Generic GetIntent
forall x. Rep GetIntent x -> GetIntent
forall x. GetIntent -> Rep GetIntent x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetIntent x -> GetIntent
$cfrom :: forall x. GetIntent -> Rep GetIntent x
Prelude.Generic)

-- |
-- Create a value of 'GetIntent' 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', 'getIntent_name' - The name of the intent. The name is case sensitive.
--
-- 'version', 'getIntent_version' - The version of the intent.
newGetIntent ::
  -- | 'name'
  Prelude.Text ->
  -- | 'version'
  Prelude.Text ->
  GetIntent
newGetIntent :: Text -> Text -> GetIntent
newGetIntent Text
pName_ Text
pVersion_ =
  GetIntent' :: Text -> Text -> GetIntent
GetIntent' {$sel:name:GetIntent' :: Text
name = Text
pName_, $sel:version:GetIntent' :: Text
version = Text
pVersion_}

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

-- | The version of the intent.
getIntent_version :: Lens.Lens' GetIntent Prelude.Text
getIntent_version :: (Text -> f Text) -> GetIntent -> f GetIntent
getIntent_version = (GetIntent -> Text)
-> (GetIntent -> Text -> GetIntent)
-> Lens GetIntent GetIntent Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetIntent' {Text
version :: Text
$sel:version:GetIntent' :: GetIntent -> Text
version} -> Text
version) (\s :: GetIntent
s@GetIntent' {} Text
a -> GetIntent
s {$sel:version:GetIntent' :: Text
version = Text
a} :: GetIntent)

instance Core.AWSRequest GetIntent where
  type AWSResponse GetIntent = GetIntentResponse
  request :: GetIntent -> Request GetIntent
request = Service -> GetIntent -> Request GetIntent
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy GetIntent
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetIntent)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetIntent))
-> Logger
-> Service
-> Proxy GetIntent
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetIntent)))
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 FulfillmentActivity
-> Maybe [Slot]
-> Maybe Statement
-> Maybe Text
-> Maybe Statement
-> Maybe [Text]
-> Maybe Text
-> Maybe POSIX
-> Maybe KendraConfiguration
-> Maybe Text
-> Maybe Text
-> Maybe [InputContext]
-> Maybe FollowUpPrompt
-> Maybe POSIX
-> Maybe [OutputContext]
-> Maybe Prompt
-> Maybe CodeHook
-> Maybe Text
-> Int
-> GetIntentResponse
GetIntentResponse'
            (Maybe FulfillmentActivity
 -> Maybe [Slot]
 -> Maybe Statement
 -> Maybe Text
 -> Maybe Statement
 -> Maybe [Text]
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe KendraConfiguration
 -> Maybe Text
 -> Maybe Text
 -> Maybe [InputContext]
 -> Maybe FollowUpPrompt
 -> Maybe POSIX
 -> Maybe [OutputContext]
 -> Maybe Prompt
 -> Maybe CodeHook
 -> Maybe Text
 -> Int
 -> GetIntentResponse)
-> Either String (Maybe FulfillmentActivity)
-> Either
     String
     (Maybe [Slot]
      -> Maybe Statement
      -> Maybe Text
      -> Maybe Statement
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe KendraConfiguration
      -> Maybe Text
      -> Maybe Text
      -> Maybe [InputContext]
      -> Maybe FollowUpPrompt
      -> Maybe POSIX
      -> Maybe [OutputContext]
      -> Maybe Prompt
      -> Maybe CodeHook
      -> Maybe Text
      -> Int
      -> GetIntentResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe FulfillmentActivity)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"fulfillmentActivity")
            Either
  String
  (Maybe [Slot]
   -> Maybe Statement
   -> Maybe Text
   -> Maybe Statement
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe KendraConfiguration
   -> Maybe Text
   -> Maybe Text
   -> Maybe [InputContext]
   -> Maybe FollowUpPrompt
   -> Maybe POSIX
   -> Maybe [OutputContext]
   -> Maybe Prompt
   -> Maybe CodeHook
   -> Maybe Text
   -> Int
   -> GetIntentResponse)
-> Either String (Maybe [Slot])
-> Either
     String
     (Maybe Statement
      -> Maybe Text
      -> Maybe Statement
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe KendraConfiguration
      -> Maybe Text
      -> Maybe Text
      -> Maybe [InputContext]
      -> Maybe FollowUpPrompt
      -> Maybe POSIX
      -> Maybe [OutputContext]
      -> Maybe Prompt
      -> Maybe CodeHook
      -> Maybe Text
      -> Int
      -> GetIntentResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [Slot]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"slots" Either String (Maybe (Maybe [Slot]))
-> Maybe [Slot] -> Either String (Maybe [Slot])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Slot]
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (Maybe Statement
   -> Maybe Text
   -> Maybe Statement
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe KendraConfiguration
   -> Maybe Text
   -> Maybe Text
   -> Maybe [InputContext]
   -> Maybe FollowUpPrompt
   -> Maybe POSIX
   -> Maybe [OutputContext]
   -> Maybe Prompt
   -> Maybe CodeHook
   -> Maybe Text
   -> Int
   -> GetIntentResponse)
-> Either String (Maybe Statement)
-> Either
     String
     (Maybe Text
      -> Maybe Statement
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe KendraConfiguration
      -> Maybe Text
      -> Maybe Text
      -> Maybe [InputContext]
      -> Maybe FollowUpPrompt
      -> Maybe POSIX
      -> Maybe [OutputContext]
      -> Maybe Prompt
      -> Maybe CodeHook
      -> Maybe Text
      -> Int
      -> GetIntentResponse)
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
"rejectionStatement")
            Either
  String
  (Maybe Text
   -> Maybe Statement
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe KendraConfiguration
   -> Maybe Text
   -> Maybe Text
   -> Maybe [InputContext]
   -> Maybe FollowUpPrompt
   -> Maybe POSIX
   -> Maybe [OutputContext]
   -> Maybe Prompt
   -> Maybe CodeHook
   -> Maybe Text
   -> Int
   -> GetIntentResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Statement
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe KendraConfiguration
      -> Maybe Text
      -> Maybe Text
      -> Maybe [InputContext]
      -> Maybe FollowUpPrompt
      -> Maybe POSIX
      -> Maybe [OutputContext]
      -> Maybe Prompt
      -> Maybe CodeHook
      -> Maybe Text
      -> Int
      -> GetIntentResponse)
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 Statement
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe KendraConfiguration
   -> Maybe Text
   -> Maybe Text
   -> Maybe [InputContext]
   -> Maybe FollowUpPrompt
   -> Maybe POSIX
   -> Maybe [OutputContext]
   -> Maybe Prompt
   -> Maybe CodeHook
   -> Maybe Text
   -> Int
   -> GetIntentResponse)
-> Either String (Maybe Statement)
-> Either
     String
     (Maybe [Text]
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe KendraConfiguration
      -> Maybe Text
      -> Maybe Text
      -> Maybe [InputContext]
      -> Maybe FollowUpPrompt
      -> Maybe POSIX
      -> Maybe [OutputContext]
      -> Maybe Prompt
      -> Maybe CodeHook
      -> Maybe Text
      -> Int
      -> GetIntentResponse)
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
"conclusionStatement")
            Either
  String
  (Maybe [Text]
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe KendraConfiguration
   -> Maybe Text
   -> Maybe Text
   -> Maybe [InputContext]
   -> Maybe FollowUpPrompt
   -> Maybe POSIX
   -> Maybe [OutputContext]
   -> Maybe Prompt
   -> Maybe CodeHook
   -> Maybe Text
   -> Int
   -> GetIntentResponse)
-> Either String (Maybe [Text])
-> Either
     String
     (Maybe Text
      -> Maybe POSIX
      -> Maybe KendraConfiguration
      -> Maybe Text
      -> Maybe Text
      -> Maybe [InputContext]
      -> Maybe FollowUpPrompt
      -> Maybe POSIX
      -> Maybe [OutputContext]
      -> Maybe Prompt
      -> Maybe CodeHook
      -> Maybe Text
      -> Int
      -> GetIntentResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"sampleUtterances"
                            Either String (Maybe (Maybe [Text]))
-> Maybe [Text] -> Either String (Maybe [Text])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either
  String
  (Maybe Text
   -> Maybe POSIX
   -> Maybe KendraConfiguration
   -> Maybe Text
   -> Maybe Text
   -> Maybe [InputContext]
   -> Maybe FollowUpPrompt
   -> Maybe POSIX
   -> Maybe [OutputContext]
   -> Maybe Prompt
   -> Maybe CodeHook
   -> Maybe Text
   -> Int
   -> GetIntentResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe POSIX
      -> Maybe KendraConfiguration
      -> Maybe Text
      -> Maybe Text
      -> Maybe [InputContext]
      -> Maybe FollowUpPrompt
      -> Maybe POSIX
      -> Maybe [OutputContext]
      -> Maybe Prompt
      -> Maybe CodeHook
      -> Maybe Text
      -> Int
      -> GetIntentResponse)
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
"parentIntentSignature")
            Either
  String
  (Maybe POSIX
   -> Maybe KendraConfiguration
   -> Maybe Text
   -> Maybe Text
   -> Maybe [InputContext]
   -> Maybe FollowUpPrompt
   -> Maybe POSIX
   -> Maybe [OutputContext]
   -> Maybe Prompt
   -> Maybe CodeHook
   -> Maybe Text
   -> Int
   -> GetIntentResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe KendraConfiguration
      -> Maybe Text
      -> Maybe Text
      -> Maybe [InputContext]
      -> Maybe FollowUpPrompt
      -> Maybe POSIX
      -> Maybe [OutputContext]
      -> Maybe Prompt
      -> Maybe CodeHook
      -> Maybe Text
      -> Int
      -> GetIntentResponse)
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 KendraConfiguration
   -> Maybe Text
   -> Maybe Text
   -> Maybe [InputContext]
   -> Maybe FollowUpPrompt
   -> Maybe POSIX
   -> Maybe [OutputContext]
   -> Maybe Prompt
   -> Maybe CodeHook
   -> Maybe Text
   -> Int
   -> GetIntentResponse)
-> Either String (Maybe KendraConfiguration)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe [InputContext]
      -> Maybe FollowUpPrompt
      -> Maybe POSIX
      -> Maybe [OutputContext]
      -> Maybe Prompt
      -> Maybe CodeHook
      -> Maybe Text
      -> Int
      -> GetIntentResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe KendraConfiguration)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"kendraConfiguration")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe [InputContext]
   -> Maybe FollowUpPrompt
   -> Maybe POSIX
   -> Maybe [OutputContext]
   -> Maybe Prompt
   -> Maybe CodeHook
   -> Maybe Text
   -> Int
   -> GetIntentResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe [InputContext]
      -> Maybe FollowUpPrompt
      -> Maybe POSIX
      -> Maybe [OutputContext]
      -> Maybe Prompt
      -> Maybe CodeHook
      -> Maybe Text
      -> Int
      -> GetIntentResponse)
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 [InputContext]
   -> Maybe FollowUpPrompt
   -> Maybe POSIX
   -> Maybe [OutputContext]
   -> Maybe Prompt
   -> Maybe CodeHook
   -> Maybe Text
   -> Int
   -> GetIntentResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [InputContext]
      -> Maybe FollowUpPrompt
      -> Maybe POSIX
      -> Maybe [OutputContext]
      -> Maybe Prompt
      -> Maybe CodeHook
      -> Maybe Text
      -> Int
      -> GetIntentResponse)
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 [InputContext]
   -> Maybe FollowUpPrompt
   -> Maybe POSIX
   -> Maybe [OutputContext]
   -> Maybe Prompt
   -> Maybe CodeHook
   -> Maybe Text
   -> Int
   -> GetIntentResponse)
-> Either String (Maybe [InputContext])
-> Either
     String
     (Maybe FollowUpPrompt
      -> Maybe POSIX
      -> Maybe [OutputContext]
      -> Maybe Prompt
      -> Maybe CodeHook
      -> Maybe Text
      -> Int
      -> GetIntentResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [InputContext]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"inputContexts" Either String (Maybe (Maybe [InputContext]))
-> Maybe [InputContext] -> Either String (Maybe [InputContext])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [InputContext]
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (Maybe FollowUpPrompt
   -> Maybe POSIX
   -> Maybe [OutputContext]
   -> Maybe Prompt
   -> Maybe CodeHook
   -> Maybe Text
   -> Int
   -> GetIntentResponse)
-> Either String (Maybe FollowUpPrompt)
-> Either
     String
     (Maybe POSIX
      -> Maybe [OutputContext]
      -> Maybe Prompt
      -> Maybe CodeHook
      -> Maybe Text
      -> Int
      -> GetIntentResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe FollowUpPrompt)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"followUpPrompt")
            Either
  String
  (Maybe POSIX
   -> Maybe [OutputContext]
   -> Maybe Prompt
   -> Maybe CodeHook
   -> Maybe Text
   -> Int
   -> GetIntentResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe [OutputContext]
      -> Maybe Prompt
      -> Maybe CodeHook
      -> Maybe Text
      -> Int
      -> GetIntentResponse)
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 [OutputContext]
   -> Maybe Prompt
   -> Maybe CodeHook
   -> Maybe Text
   -> Int
   -> GetIntentResponse)
-> Either String (Maybe [OutputContext])
-> Either
     String
     (Maybe Prompt
      -> Maybe CodeHook -> Maybe Text -> Int -> GetIntentResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [OutputContext]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"outputContexts" Either String (Maybe (Maybe [OutputContext]))
-> Maybe [OutputContext] -> Either String (Maybe [OutputContext])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [OutputContext]
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (Maybe Prompt
   -> Maybe CodeHook -> Maybe Text -> Int -> GetIntentResponse)
-> Either String (Maybe Prompt)
-> Either
     String (Maybe CodeHook -> Maybe Text -> Int -> GetIntentResponse)
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
"confirmationPrompt")
            Either
  String (Maybe CodeHook -> Maybe Text -> Int -> GetIntentResponse)
-> Either String (Maybe CodeHook)
-> Either String (Maybe Text -> Int -> GetIntentResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe CodeHook)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"dialogCodeHook")
            Either String (Maybe Text -> Int -> GetIntentResponse)
-> Either String (Maybe Text)
-> Either String (Int -> GetIntentResponse)
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 -> GetIntentResponse)
-> Either String Int -> Either String GetIntentResponse
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 GetIntent

instance Prelude.NFData GetIntent

instance Core.ToHeaders GetIntent where
  toHeaders :: GetIntent -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetIntent -> 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 GetIntent where
  toPath :: GetIntent -> ByteString
toPath GetIntent' {Text
version :: Text
name :: Text
$sel:version:GetIntent' :: GetIntent -> Text
$sel:name:GetIntent' :: GetIntent -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/intents/",
        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
version
      ]

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

-- | /See:/ 'newGetIntentResponse' smart constructor.
data GetIntentResponse = GetIntentResponse'
  { -- | Describes how the intent is fulfilled. For more information, see
    -- PutIntent.
    GetIntentResponse -> Maybe FulfillmentActivity
fulfillmentActivity :: Prelude.Maybe FulfillmentActivity,
    -- | An array of intent slots configured for the intent.
    GetIntentResponse -> Maybe [Slot]
slots :: Prelude.Maybe [Slot],
    -- | If the user answers \"no\" to the question defined in
    -- @confirmationPrompt@, Amazon Lex responds with this statement to
    -- acknowledge that the intent was canceled.
    GetIntentResponse -> Maybe Statement
rejectionStatement :: Prelude.Maybe Statement,
    -- | Checksum of the intent.
    GetIntentResponse -> Maybe Text
checksum :: Prelude.Maybe Prelude.Text,
    -- | After the Lambda function specified in the @fulfillmentActivity@ element
    -- fulfills the intent, Amazon Lex conveys this statement to the user.
    GetIntentResponse -> Maybe Statement
conclusionStatement :: Prelude.Maybe Statement,
    -- | An array of sample utterances configured for the intent.
    GetIntentResponse -> Maybe [Text]
sampleUtterances :: Prelude.Maybe [Prelude.Text],
    -- | A unique identifier for a built-in intent.
    GetIntentResponse -> Maybe Text
parentIntentSignature :: Prelude.Maybe Prelude.Text,
    -- | The date that the intent was created.
    GetIntentResponse -> Maybe POSIX
createdDate :: Prelude.Maybe Core.POSIX,
    -- | Configuration information, if any, to connect to an Amazon Kendra index
    -- with the @AMAZON.KendraSearchIntent@ intent.
    GetIntentResponse -> Maybe KendraConfiguration
kendraConfiguration :: Prelude.Maybe KendraConfiguration,
    -- | The name of the intent.
    GetIntentResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The version of the intent.
    GetIntentResponse -> Maybe Text
version :: Prelude.Maybe Prelude.Text,
    -- | An array of @InputContext@ objects that lists the contexts that must be
    -- active for Amazon Lex to choose the intent in a conversation with the
    -- user.
    GetIntentResponse -> Maybe [InputContext]
inputContexts :: Prelude.Maybe [InputContext],
    -- | If defined in the bot, Amazon Lex uses this prompt to solicit additional
    -- user activity after the intent is fulfilled. For more information, see
    -- PutIntent.
    GetIntentResponse -> Maybe FollowUpPrompt
followUpPrompt :: Prelude.Maybe FollowUpPrompt,
    -- | The date that the intent was updated. When you create a resource, the
    -- creation date and the last updated date are the same.
    GetIntentResponse -> Maybe POSIX
lastUpdatedDate :: Prelude.Maybe Core.POSIX,
    -- | An array of @OutputContext@ objects that lists the contexts that the
    -- intent activates when the intent is fulfilled.
    GetIntentResponse -> Maybe [OutputContext]
outputContexts :: Prelude.Maybe [OutputContext],
    -- | If defined in the bot, Amazon Lex uses prompt to confirm the intent
    -- before fulfilling the user\'s request. For more information, see
    -- PutIntent.
    GetIntentResponse -> Maybe Prompt
confirmationPrompt :: Prelude.Maybe Prompt,
    -- | If defined in the bot, Amazon Amazon Lex invokes this Lambda function
    -- for each user input. For more information, see PutIntent.
    GetIntentResponse -> Maybe CodeHook
dialogCodeHook :: Prelude.Maybe CodeHook,
    -- | A description of the intent.
    GetIntentResponse -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetIntentResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetIntentResponse -> GetIntentResponse -> Bool
(GetIntentResponse -> GetIntentResponse -> Bool)
-> (GetIntentResponse -> GetIntentResponse -> Bool)
-> Eq GetIntentResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetIntentResponse -> GetIntentResponse -> Bool
$c/= :: GetIntentResponse -> GetIntentResponse -> Bool
== :: GetIntentResponse -> GetIntentResponse -> Bool
$c== :: GetIntentResponse -> GetIntentResponse -> Bool
Prelude.Eq, ReadPrec [GetIntentResponse]
ReadPrec GetIntentResponse
Int -> ReadS GetIntentResponse
ReadS [GetIntentResponse]
(Int -> ReadS GetIntentResponse)
-> ReadS [GetIntentResponse]
-> ReadPrec GetIntentResponse
-> ReadPrec [GetIntentResponse]
-> Read GetIntentResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetIntentResponse]
$creadListPrec :: ReadPrec [GetIntentResponse]
readPrec :: ReadPrec GetIntentResponse
$creadPrec :: ReadPrec GetIntentResponse
readList :: ReadS [GetIntentResponse]
$creadList :: ReadS [GetIntentResponse]
readsPrec :: Int -> ReadS GetIntentResponse
$creadsPrec :: Int -> ReadS GetIntentResponse
Prelude.Read, Int -> GetIntentResponse -> ShowS
[GetIntentResponse] -> ShowS
GetIntentResponse -> String
(Int -> GetIntentResponse -> ShowS)
-> (GetIntentResponse -> String)
-> ([GetIntentResponse] -> ShowS)
-> Show GetIntentResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetIntentResponse] -> ShowS
$cshowList :: [GetIntentResponse] -> ShowS
show :: GetIntentResponse -> String
$cshow :: GetIntentResponse -> String
showsPrec :: Int -> GetIntentResponse -> ShowS
$cshowsPrec :: Int -> GetIntentResponse -> ShowS
Prelude.Show, (forall x. GetIntentResponse -> Rep GetIntentResponse x)
-> (forall x. Rep GetIntentResponse x -> GetIntentResponse)
-> Generic GetIntentResponse
forall x. Rep GetIntentResponse x -> GetIntentResponse
forall x. GetIntentResponse -> Rep GetIntentResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetIntentResponse x -> GetIntentResponse
$cfrom :: forall x. GetIntentResponse -> Rep GetIntentResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetIntentResponse' 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:
--
-- 'fulfillmentActivity', 'getIntentResponse_fulfillmentActivity' - Describes how the intent is fulfilled. For more information, see
-- PutIntent.
--
-- 'slots', 'getIntentResponse_slots' - An array of intent slots configured for the intent.
--
-- 'rejectionStatement', 'getIntentResponse_rejectionStatement' - If the user answers \"no\" to the question defined in
-- @confirmationPrompt@, Amazon Lex responds with this statement to
-- acknowledge that the intent was canceled.
--
-- 'checksum', 'getIntentResponse_checksum' - Checksum of the intent.
--
-- 'conclusionStatement', 'getIntentResponse_conclusionStatement' - After the Lambda function specified in the @fulfillmentActivity@ element
-- fulfills the intent, Amazon Lex conveys this statement to the user.
--
-- 'sampleUtterances', 'getIntentResponse_sampleUtterances' - An array of sample utterances configured for the intent.
--
-- 'parentIntentSignature', 'getIntentResponse_parentIntentSignature' - A unique identifier for a built-in intent.
--
-- 'createdDate', 'getIntentResponse_createdDate' - The date that the intent was created.
--
-- 'kendraConfiguration', 'getIntentResponse_kendraConfiguration' - Configuration information, if any, to connect to an Amazon Kendra index
-- with the @AMAZON.KendraSearchIntent@ intent.
--
-- 'name', 'getIntentResponse_name' - The name of the intent.
--
-- 'version', 'getIntentResponse_version' - The version of the intent.
--
-- 'inputContexts', 'getIntentResponse_inputContexts' - An array of @InputContext@ objects that lists the contexts that must be
-- active for Amazon Lex to choose the intent in a conversation with the
-- user.
--
-- 'followUpPrompt', 'getIntentResponse_followUpPrompt' - If defined in the bot, Amazon Lex uses this prompt to solicit additional
-- user activity after the intent is fulfilled. For more information, see
-- PutIntent.
--
-- 'lastUpdatedDate', 'getIntentResponse_lastUpdatedDate' - The date that the intent was updated. When you create a resource, the
-- creation date and the last updated date are the same.
--
-- 'outputContexts', 'getIntentResponse_outputContexts' - An array of @OutputContext@ objects that lists the contexts that the
-- intent activates when the intent is fulfilled.
--
-- 'confirmationPrompt', 'getIntentResponse_confirmationPrompt' - If defined in the bot, Amazon Lex uses prompt to confirm the intent
-- before fulfilling the user\'s request. For more information, see
-- PutIntent.
--
-- 'dialogCodeHook', 'getIntentResponse_dialogCodeHook' - If defined in the bot, Amazon Amazon Lex invokes this Lambda function
-- for each user input. For more information, see PutIntent.
--
-- 'description', 'getIntentResponse_description' - A description of the intent.
--
-- 'httpStatus', 'getIntentResponse_httpStatus' - The response's http status code.
newGetIntentResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetIntentResponse
newGetIntentResponse :: Int -> GetIntentResponse
newGetIntentResponse Int
pHttpStatus_ =
  GetIntentResponse' :: Maybe FulfillmentActivity
-> Maybe [Slot]
-> Maybe Statement
-> Maybe Text
-> Maybe Statement
-> Maybe [Text]
-> Maybe Text
-> Maybe POSIX
-> Maybe KendraConfiguration
-> Maybe Text
-> Maybe Text
-> Maybe [InputContext]
-> Maybe FollowUpPrompt
-> Maybe POSIX
-> Maybe [OutputContext]
-> Maybe Prompt
-> Maybe CodeHook
-> Maybe Text
-> Int
-> GetIntentResponse
GetIntentResponse'
    { $sel:fulfillmentActivity:GetIntentResponse' :: Maybe FulfillmentActivity
fulfillmentActivity =
        Maybe FulfillmentActivity
forall a. Maybe a
Prelude.Nothing,
      $sel:slots:GetIntentResponse' :: Maybe [Slot]
slots = Maybe [Slot]
forall a. Maybe a
Prelude.Nothing,
      $sel:rejectionStatement:GetIntentResponse' :: Maybe Statement
rejectionStatement = Maybe Statement
forall a. Maybe a
Prelude.Nothing,
      $sel:checksum:GetIntentResponse' :: Maybe Text
checksum = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:conclusionStatement:GetIntentResponse' :: Maybe Statement
conclusionStatement = Maybe Statement
forall a. Maybe a
Prelude.Nothing,
      $sel:sampleUtterances:GetIntentResponse' :: Maybe [Text]
sampleUtterances = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:parentIntentSignature:GetIntentResponse' :: Maybe Text
parentIntentSignature = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdDate:GetIntentResponse' :: Maybe POSIX
createdDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:kendraConfiguration:GetIntentResponse' :: Maybe KendraConfiguration
kendraConfiguration = Maybe KendraConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:name:GetIntentResponse' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:version:GetIntentResponse' :: Maybe Text
version = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:inputContexts:GetIntentResponse' :: Maybe [InputContext]
inputContexts = Maybe [InputContext]
forall a. Maybe a
Prelude.Nothing,
      $sel:followUpPrompt:GetIntentResponse' :: Maybe FollowUpPrompt
followUpPrompt = Maybe FollowUpPrompt
forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedDate:GetIntentResponse' :: Maybe POSIX
lastUpdatedDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:outputContexts:GetIntentResponse' :: Maybe [OutputContext]
outputContexts = Maybe [OutputContext]
forall a. Maybe a
Prelude.Nothing,
      $sel:confirmationPrompt:GetIntentResponse' :: Maybe Prompt
confirmationPrompt = Maybe Prompt
forall a. Maybe a
Prelude.Nothing,
      $sel:dialogCodeHook:GetIntentResponse' :: Maybe CodeHook
dialogCodeHook = Maybe CodeHook
forall a. Maybe a
Prelude.Nothing,
      $sel:description:GetIntentResponse' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetIntentResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Describes how the intent is fulfilled. For more information, see
-- PutIntent.
getIntentResponse_fulfillmentActivity :: Lens.Lens' GetIntentResponse (Prelude.Maybe FulfillmentActivity)
getIntentResponse_fulfillmentActivity :: (Maybe FulfillmentActivity -> f (Maybe FulfillmentActivity))
-> GetIntentResponse -> f GetIntentResponse
getIntentResponse_fulfillmentActivity = (GetIntentResponse -> Maybe FulfillmentActivity)
-> (GetIntentResponse
    -> Maybe FulfillmentActivity -> GetIntentResponse)
-> Lens
     GetIntentResponse
     GetIntentResponse
     (Maybe FulfillmentActivity)
     (Maybe FulfillmentActivity)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetIntentResponse' {Maybe FulfillmentActivity
fulfillmentActivity :: Maybe FulfillmentActivity
$sel:fulfillmentActivity:GetIntentResponse' :: GetIntentResponse -> Maybe FulfillmentActivity
fulfillmentActivity} -> Maybe FulfillmentActivity
fulfillmentActivity) (\s :: GetIntentResponse
s@GetIntentResponse' {} Maybe FulfillmentActivity
a -> GetIntentResponse
s {$sel:fulfillmentActivity:GetIntentResponse' :: Maybe FulfillmentActivity
fulfillmentActivity = Maybe FulfillmentActivity
a} :: GetIntentResponse)

-- | An array of intent slots configured for the intent.
getIntentResponse_slots :: Lens.Lens' GetIntentResponse (Prelude.Maybe [Slot])
getIntentResponse_slots :: (Maybe [Slot] -> f (Maybe [Slot]))
-> GetIntentResponse -> f GetIntentResponse
getIntentResponse_slots = (GetIntentResponse -> Maybe [Slot])
-> (GetIntentResponse -> Maybe [Slot] -> GetIntentResponse)
-> Lens
     GetIntentResponse GetIntentResponse (Maybe [Slot]) (Maybe [Slot])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetIntentResponse' {Maybe [Slot]
slots :: Maybe [Slot]
$sel:slots:GetIntentResponse' :: GetIntentResponse -> Maybe [Slot]
slots} -> Maybe [Slot]
slots) (\s :: GetIntentResponse
s@GetIntentResponse' {} Maybe [Slot]
a -> GetIntentResponse
s {$sel:slots:GetIntentResponse' :: Maybe [Slot]
slots = Maybe [Slot]
a} :: GetIntentResponse) ((Maybe [Slot] -> f (Maybe [Slot]))
 -> GetIntentResponse -> f GetIntentResponse)
-> ((Maybe [Slot] -> f (Maybe [Slot]))
    -> Maybe [Slot] -> f (Maybe [Slot]))
-> (Maybe [Slot] -> f (Maybe [Slot]))
-> GetIntentResponse
-> f GetIntentResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Slot] [Slot] [Slot] [Slot]
-> Iso (Maybe [Slot]) (Maybe [Slot]) (Maybe [Slot]) (Maybe [Slot])
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 [Slot] [Slot] [Slot] [Slot]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | If the user answers \"no\" to the question defined in
-- @confirmationPrompt@, Amazon Lex responds with this statement to
-- acknowledge that the intent was canceled.
getIntentResponse_rejectionStatement :: Lens.Lens' GetIntentResponse (Prelude.Maybe Statement)
getIntentResponse_rejectionStatement :: (Maybe Statement -> f (Maybe Statement))
-> GetIntentResponse -> f GetIntentResponse
getIntentResponse_rejectionStatement = (GetIntentResponse -> Maybe Statement)
-> (GetIntentResponse -> Maybe Statement -> GetIntentResponse)
-> Lens
     GetIntentResponse
     GetIntentResponse
     (Maybe Statement)
     (Maybe Statement)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetIntentResponse' {Maybe Statement
rejectionStatement :: Maybe Statement
$sel:rejectionStatement:GetIntentResponse' :: GetIntentResponse -> Maybe Statement
rejectionStatement} -> Maybe Statement
rejectionStatement) (\s :: GetIntentResponse
s@GetIntentResponse' {} Maybe Statement
a -> GetIntentResponse
s {$sel:rejectionStatement:GetIntentResponse' :: Maybe Statement
rejectionStatement = Maybe Statement
a} :: GetIntentResponse)

-- | Checksum of the intent.
getIntentResponse_checksum :: Lens.Lens' GetIntentResponse (Prelude.Maybe Prelude.Text)
getIntentResponse_checksum :: (Maybe Text -> f (Maybe Text))
-> GetIntentResponse -> f GetIntentResponse
getIntentResponse_checksum = (GetIntentResponse -> Maybe Text)
-> (GetIntentResponse -> Maybe Text -> GetIntentResponse)
-> Lens
     GetIntentResponse GetIntentResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetIntentResponse' {Maybe Text
checksum :: Maybe Text
$sel:checksum:GetIntentResponse' :: GetIntentResponse -> Maybe Text
checksum} -> Maybe Text
checksum) (\s :: GetIntentResponse
s@GetIntentResponse' {} Maybe Text
a -> GetIntentResponse
s {$sel:checksum:GetIntentResponse' :: Maybe Text
checksum = Maybe Text
a} :: GetIntentResponse)

-- | After the Lambda function specified in the @fulfillmentActivity@ element
-- fulfills the intent, Amazon Lex conveys this statement to the user.
getIntentResponse_conclusionStatement :: Lens.Lens' GetIntentResponse (Prelude.Maybe Statement)
getIntentResponse_conclusionStatement :: (Maybe Statement -> f (Maybe Statement))
-> GetIntentResponse -> f GetIntentResponse
getIntentResponse_conclusionStatement = (GetIntentResponse -> Maybe Statement)
-> (GetIntentResponse -> Maybe Statement -> GetIntentResponse)
-> Lens
     GetIntentResponse
     GetIntentResponse
     (Maybe Statement)
     (Maybe Statement)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetIntentResponse' {Maybe Statement
conclusionStatement :: Maybe Statement
$sel:conclusionStatement:GetIntentResponse' :: GetIntentResponse -> Maybe Statement
conclusionStatement} -> Maybe Statement
conclusionStatement) (\s :: GetIntentResponse
s@GetIntentResponse' {} Maybe Statement
a -> GetIntentResponse
s {$sel:conclusionStatement:GetIntentResponse' :: Maybe Statement
conclusionStatement = Maybe Statement
a} :: GetIntentResponse)

-- | An array of sample utterances configured for the intent.
getIntentResponse_sampleUtterances :: Lens.Lens' GetIntentResponse (Prelude.Maybe [Prelude.Text])
getIntentResponse_sampleUtterances :: (Maybe [Text] -> f (Maybe [Text]))
-> GetIntentResponse -> f GetIntentResponse
getIntentResponse_sampleUtterances = (GetIntentResponse -> Maybe [Text])
-> (GetIntentResponse -> Maybe [Text] -> GetIntentResponse)
-> Lens
     GetIntentResponse GetIntentResponse (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetIntentResponse' {Maybe [Text]
sampleUtterances :: Maybe [Text]
$sel:sampleUtterances:GetIntentResponse' :: GetIntentResponse -> Maybe [Text]
sampleUtterances} -> Maybe [Text]
sampleUtterances) (\s :: GetIntentResponse
s@GetIntentResponse' {} Maybe [Text]
a -> GetIntentResponse
s {$sel:sampleUtterances:GetIntentResponse' :: Maybe [Text]
sampleUtterances = Maybe [Text]
a} :: GetIntentResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> GetIntentResponse -> f GetIntentResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> GetIntentResponse
-> f GetIntentResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A unique identifier for a built-in intent.
getIntentResponse_parentIntentSignature :: Lens.Lens' GetIntentResponse (Prelude.Maybe Prelude.Text)
getIntentResponse_parentIntentSignature :: (Maybe Text -> f (Maybe Text))
-> GetIntentResponse -> f GetIntentResponse
getIntentResponse_parentIntentSignature = (GetIntentResponse -> Maybe Text)
-> (GetIntentResponse -> Maybe Text -> GetIntentResponse)
-> Lens
     GetIntentResponse GetIntentResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetIntentResponse' {Maybe Text
parentIntentSignature :: Maybe Text
$sel:parentIntentSignature:GetIntentResponse' :: GetIntentResponse -> Maybe Text
parentIntentSignature} -> Maybe Text
parentIntentSignature) (\s :: GetIntentResponse
s@GetIntentResponse' {} Maybe Text
a -> GetIntentResponse
s {$sel:parentIntentSignature:GetIntentResponse' :: Maybe Text
parentIntentSignature = Maybe Text
a} :: GetIntentResponse)

-- | The date that the intent was created.
getIntentResponse_createdDate :: Lens.Lens' GetIntentResponse (Prelude.Maybe Prelude.UTCTime)
getIntentResponse_createdDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> GetIntentResponse -> f GetIntentResponse
getIntentResponse_createdDate = (GetIntentResponse -> Maybe POSIX)
-> (GetIntentResponse -> Maybe POSIX -> GetIntentResponse)
-> Lens
     GetIntentResponse GetIntentResponse (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetIntentResponse' {Maybe POSIX
createdDate :: Maybe POSIX
$sel:createdDate:GetIntentResponse' :: GetIntentResponse -> Maybe POSIX
createdDate} -> Maybe POSIX
createdDate) (\s :: GetIntentResponse
s@GetIntentResponse' {} Maybe POSIX
a -> GetIntentResponse
s {$sel:createdDate:GetIntentResponse' :: Maybe POSIX
createdDate = Maybe POSIX
a} :: GetIntentResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> GetIntentResponse -> f GetIntentResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GetIntentResponse
-> f GetIntentResponse
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

-- | Configuration information, if any, to connect to an Amazon Kendra index
-- with the @AMAZON.KendraSearchIntent@ intent.
getIntentResponse_kendraConfiguration :: Lens.Lens' GetIntentResponse (Prelude.Maybe KendraConfiguration)
getIntentResponse_kendraConfiguration :: (Maybe KendraConfiguration -> f (Maybe KendraConfiguration))
-> GetIntentResponse -> f GetIntentResponse
getIntentResponse_kendraConfiguration = (GetIntentResponse -> Maybe KendraConfiguration)
-> (GetIntentResponse
    -> Maybe KendraConfiguration -> GetIntentResponse)
-> Lens
     GetIntentResponse
     GetIntentResponse
     (Maybe KendraConfiguration)
     (Maybe KendraConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetIntentResponse' {Maybe KendraConfiguration
kendraConfiguration :: Maybe KendraConfiguration
$sel:kendraConfiguration:GetIntentResponse' :: GetIntentResponse -> Maybe KendraConfiguration
kendraConfiguration} -> Maybe KendraConfiguration
kendraConfiguration) (\s :: GetIntentResponse
s@GetIntentResponse' {} Maybe KendraConfiguration
a -> GetIntentResponse
s {$sel:kendraConfiguration:GetIntentResponse' :: Maybe KendraConfiguration
kendraConfiguration = Maybe KendraConfiguration
a} :: GetIntentResponse)

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

-- | The version of the intent.
getIntentResponse_version :: Lens.Lens' GetIntentResponse (Prelude.Maybe Prelude.Text)
getIntentResponse_version :: (Maybe Text -> f (Maybe Text))
-> GetIntentResponse -> f GetIntentResponse
getIntentResponse_version = (GetIntentResponse -> Maybe Text)
-> (GetIntentResponse -> Maybe Text -> GetIntentResponse)
-> Lens
     GetIntentResponse GetIntentResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetIntentResponse' {Maybe Text
version :: Maybe Text
$sel:version:GetIntentResponse' :: GetIntentResponse -> Maybe Text
version} -> Maybe Text
version) (\s :: GetIntentResponse
s@GetIntentResponse' {} Maybe Text
a -> GetIntentResponse
s {$sel:version:GetIntentResponse' :: Maybe Text
version = Maybe Text
a} :: GetIntentResponse)

-- | An array of @InputContext@ objects that lists the contexts that must be
-- active for Amazon Lex to choose the intent in a conversation with the
-- user.
getIntentResponse_inputContexts :: Lens.Lens' GetIntentResponse (Prelude.Maybe [InputContext])
getIntentResponse_inputContexts :: (Maybe [InputContext] -> f (Maybe [InputContext]))
-> GetIntentResponse -> f GetIntentResponse
getIntentResponse_inputContexts = (GetIntentResponse -> Maybe [InputContext])
-> (GetIntentResponse -> Maybe [InputContext] -> GetIntentResponse)
-> Lens
     GetIntentResponse
     GetIntentResponse
     (Maybe [InputContext])
     (Maybe [InputContext])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetIntentResponse' {Maybe [InputContext]
inputContexts :: Maybe [InputContext]
$sel:inputContexts:GetIntentResponse' :: GetIntentResponse -> Maybe [InputContext]
inputContexts} -> Maybe [InputContext]
inputContexts) (\s :: GetIntentResponse
s@GetIntentResponse' {} Maybe [InputContext]
a -> GetIntentResponse
s {$sel:inputContexts:GetIntentResponse' :: Maybe [InputContext]
inputContexts = Maybe [InputContext]
a} :: GetIntentResponse) ((Maybe [InputContext] -> f (Maybe [InputContext]))
 -> GetIntentResponse -> f GetIntentResponse)
-> ((Maybe [InputContext] -> f (Maybe [InputContext]))
    -> Maybe [InputContext] -> f (Maybe [InputContext]))
-> (Maybe [InputContext] -> f (Maybe [InputContext]))
-> GetIntentResponse
-> f GetIntentResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [InputContext] [InputContext] [InputContext] [InputContext]
-> Iso
     (Maybe [InputContext])
     (Maybe [InputContext])
     (Maybe [InputContext])
     (Maybe [InputContext])
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 [InputContext] [InputContext] [InputContext] [InputContext]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | If defined in the bot, Amazon Lex uses this prompt to solicit additional
-- user activity after the intent is fulfilled. For more information, see
-- PutIntent.
getIntentResponse_followUpPrompt :: Lens.Lens' GetIntentResponse (Prelude.Maybe FollowUpPrompt)
getIntentResponse_followUpPrompt :: (Maybe FollowUpPrompt -> f (Maybe FollowUpPrompt))
-> GetIntentResponse -> f GetIntentResponse
getIntentResponse_followUpPrompt = (GetIntentResponse -> Maybe FollowUpPrompt)
-> (GetIntentResponse -> Maybe FollowUpPrompt -> GetIntentResponse)
-> Lens
     GetIntentResponse
     GetIntentResponse
     (Maybe FollowUpPrompt)
     (Maybe FollowUpPrompt)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetIntentResponse' {Maybe FollowUpPrompt
followUpPrompt :: Maybe FollowUpPrompt
$sel:followUpPrompt:GetIntentResponse' :: GetIntentResponse -> Maybe FollowUpPrompt
followUpPrompt} -> Maybe FollowUpPrompt
followUpPrompt) (\s :: GetIntentResponse
s@GetIntentResponse' {} Maybe FollowUpPrompt
a -> GetIntentResponse
s {$sel:followUpPrompt:GetIntentResponse' :: Maybe FollowUpPrompt
followUpPrompt = Maybe FollowUpPrompt
a} :: GetIntentResponse)

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

-- | An array of @OutputContext@ objects that lists the contexts that the
-- intent activates when the intent is fulfilled.
getIntentResponse_outputContexts :: Lens.Lens' GetIntentResponse (Prelude.Maybe [OutputContext])
getIntentResponse_outputContexts :: (Maybe [OutputContext] -> f (Maybe [OutputContext]))
-> GetIntentResponse -> f GetIntentResponse
getIntentResponse_outputContexts = (GetIntentResponse -> Maybe [OutputContext])
-> (GetIntentResponse
    -> Maybe [OutputContext] -> GetIntentResponse)
-> Lens
     GetIntentResponse
     GetIntentResponse
     (Maybe [OutputContext])
     (Maybe [OutputContext])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetIntentResponse' {Maybe [OutputContext]
outputContexts :: Maybe [OutputContext]
$sel:outputContexts:GetIntentResponse' :: GetIntentResponse -> Maybe [OutputContext]
outputContexts} -> Maybe [OutputContext]
outputContexts) (\s :: GetIntentResponse
s@GetIntentResponse' {} Maybe [OutputContext]
a -> GetIntentResponse
s {$sel:outputContexts:GetIntentResponse' :: Maybe [OutputContext]
outputContexts = Maybe [OutputContext]
a} :: GetIntentResponse) ((Maybe [OutputContext] -> f (Maybe [OutputContext]))
 -> GetIntentResponse -> f GetIntentResponse)
-> ((Maybe [OutputContext] -> f (Maybe [OutputContext]))
    -> Maybe [OutputContext] -> f (Maybe [OutputContext]))
-> (Maybe [OutputContext] -> f (Maybe [OutputContext]))
-> GetIntentResponse
-> f GetIntentResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [OutputContext] [OutputContext] [OutputContext] [OutputContext]
-> Iso
     (Maybe [OutputContext])
     (Maybe [OutputContext])
     (Maybe [OutputContext])
     (Maybe [OutputContext])
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
  [OutputContext] [OutputContext] [OutputContext] [OutputContext]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | If defined in the bot, Amazon Lex uses prompt to confirm the intent
-- before fulfilling the user\'s request. For more information, see
-- PutIntent.
getIntentResponse_confirmationPrompt :: Lens.Lens' GetIntentResponse (Prelude.Maybe Prompt)
getIntentResponse_confirmationPrompt :: (Maybe Prompt -> f (Maybe Prompt))
-> GetIntentResponse -> f GetIntentResponse
getIntentResponse_confirmationPrompt = (GetIntentResponse -> Maybe Prompt)
-> (GetIntentResponse -> Maybe Prompt -> GetIntentResponse)
-> Lens
     GetIntentResponse GetIntentResponse (Maybe Prompt) (Maybe Prompt)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetIntentResponse' {Maybe Prompt
confirmationPrompt :: Maybe Prompt
$sel:confirmationPrompt:GetIntentResponse' :: GetIntentResponse -> Maybe Prompt
confirmationPrompt} -> Maybe Prompt
confirmationPrompt) (\s :: GetIntentResponse
s@GetIntentResponse' {} Maybe Prompt
a -> GetIntentResponse
s {$sel:confirmationPrompt:GetIntentResponse' :: Maybe Prompt
confirmationPrompt = Maybe Prompt
a} :: GetIntentResponse)

-- | If defined in the bot, Amazon Amazon Lex invokes this Lambda function
-- for each user input. For more information, see PutIntent.
getIntentResponse_dialogCodeHook :: Lens.Lens' GetIntentResponse (Prelude.Maybe CodeHook)
getIntentResponse_dialogCodeHook :: (Maybe CodeHook -> f (Maybe CodeHook))
-> GetIntentResponse -> f GetIntentResponse
getIntentResponse_dialogCodeHook = (GetIntentResponse -> Maybe CodeHook)
-> (GetIntentResponse -> Maybe CodeHook -> GetIntentResponse)
-> Lens
     GetIntentResponse
     GetIntentResponse
     (Maybe CodeHook)
     (Maybe CodeHook)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetIntentResponse' {Maybe CodeHook
dialogCodeHook :: Maybe CodeHook
$sel:dialogCodeHook:GetIntentResponse' :: GetIntentResponse -> Maybe CodeHook
dialogCodeHook} -> Maybe CodeHook
dialogCodeHook) (\s :: GetIntentResponse
s@GetIntentResponse' {} Maybe CodeHook
a -> GetIntentResponse
s {$sel:dialogCodeHook:GetIntentResponse' :: Maybe CodeHook
dialogCodeHook = Maybe CodeHook
a} :: GetIntentResponse)

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

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

instance Prelude.NFData GetIntentResponse