{-# 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.GetUtterancesView
-- 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)
--
-- Use the @GetUtterancesView@ operation to get information about the
-- utterances that your users have made to your bot. You can use this list
-- to tune the utterances that your bot responds to.
--
-- For example, say that you have created a bot to order flowers. After
-- your users have used your bot for a while, use the @GetUtterancesView@
-- operation to see the requests that they have made and whether they have
-- been successful. You might find that the utterance \"I want flowers\" is
-- not being recognized. You could add this utterance to the @OrderFlowers@
-- intent so that your bot recognizes that utterance.
--
-- After you publish a new version of a bot, you can get information about
-- the old version and the new so that you can compare the performance
-- across the two versions.
--
-- Utterance statistics are generated once a day. Data is available for the
-- last 15 days. You can request information for up to 5 versions of your
-- bot in each request. Amazon Lex returns the most frequent utterances
-- received by the bot in the last 15 days. The response contains
-- information about a maximum of 100 utterances for each version.
--
-- If you set @childDirected@ field to true when you created your bot, if
-- you are using slot obfuscation with one or more slots, or if you opted
-- out of participating in improving Amazon Lex, utterances are not
-- available.
--
-- This operation requires permissions for the @lex:GetUtterancesView@
-- action.
module Amazonka.LexModels.GetUtterancesView
  ( -- * Creating a Request
    GetUtterancesView (..),
    newGetUtterancesView,

    -- * Request Lenses
    getUtterancesView_botName,
    getUtterancesView_botVersions,
    getUtterancesView_statusType,

    -- * Destructuring the Response
    GetUtterancesViewResponse (..),
    newGetUtterancesViewResponse,

    -- * Response Lenses
    getUtterancesViewResponse_botName,
    getUtterancesViewResponse_utterances,
    getUtterancesViewResponse_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:/ 'newGetUtterancesView' smart constructor.
data GetUtterancesView = GetUtterancesView'
  { -- | The name of the bot for which utterance information should be returned.
    GetUtterancesView -> Text
botName :: Prelude.Text,
    -- | An array of bot versions for which utterance information should be
    -- returned. The limit is 5 versions per request.
    GetUtterancesView -> NonEmpty Text
botVersions :: Prelude.NonEmpty Prelude.Text,
    -- | To return utterances that were recognized and handled, use @Detected@.
    -- To return utterances that were not recognized, use @Missed@.
    GetUtterancesView -> StatusType
statusType :: StatusType
  }
  deriving (GetUtterancesView -> GetUtterancesView -> Bool
(GetUtterancesView -> GetUtterancesView -> Bool)
-> (GetUtterancesView -> GetUtterancesView -> Bool)
-> Eq GetUtterancesView
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetUtterancesView -> GetUtterancesView -> Bool
$c/= :: GetUtterancesView -> GetUtterancesView -> Bool
== :: GetUtterancesView -> GetUtterancesView -> Bool
$c== :: GetUtterancesView -> GetUtterancesView -> Bool
Prelude.Eq, ReadPrec [GetUtterancesView]
ReadPrec GetUtterancesView
Int -> ReadS GetUtterancesView
ReadS [GetUtterancesView]
(Int -> ReadS GetUtterancesView)
-> ReadS [GetUtterancesView]
-> ReadPrec GetUtterancesView
-> ReadPrec [GetUtterancesView]
-> Read GetUtterancesView
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetUtterancesView]
$creadListPrec :: ReadPrec [GetUtterancesView]
readPrec :: ReadPrec GetUtterancesView
$creadPrec :: ReadPrec GetUtterancesView
readList :: ReadS [GetUtterancesView]
$creadList :: ReadS [GetUtterancesView]
readsPrec :: Int -> ReadS GetUtterancesView
$creadsPrec :: Int -> ReadS GetUtterancesView
Prelude.Read, Int -> GetUtterancesView -> ShowS
[GetUtterancesView] -> ShowS
GetUtterancesView -> String
(Int -> GetUtterancesView -> ShowS)
-> (GetUtterancesView -> String)
-> ([GetUtterancesView] -> ShowS)
-> Show GetUtterancesView
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetUtterancesView] -> ShowS
$cshowList :: [GetUtterancesView] -> ShowS
show :: GetUtterancesView -> String
$cshow :: GetUtterancesView -> String
showsPrec :: Int -> GetUtterancesView -> ShowS
$cshowsPrec :: Int -> GetUtterancesView -> ShowS
Prelude.Show, (forall x. GetUtterancesView -> Rep GetUtterancesView x)
-> (forall x. Rep GetUtterancesView x -> GetUtterancesView)
-> Generic GetUtterancesView
forall x. Rep GetUtterancesView x -> GetUtterancesView
forall x. GetUtterancesView -> Rep GetUtterancesView x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetUtterancesView x -> GetUtterancesView
$cfrom :: forall x. GetUtterancesView -> Rep GetUtterancesView x
Prelude.Generic)

-- |
-- Create a value of 'GetUtterancesView' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'botName', 'getUtterancesView_botName' - The name of the bot for which utterance information should be returned.
--
-- 'botVersions', 'getUtterancesView_botVersions' - An array of bot versions for which utterance information should be
-- returned. The limit is 5 versions per request.
--
-- 'statusType', 'getUtterancesView_statusType' - To return utterances that were recognized and handled, use @Detected@.
-- To return utterances that were not recognized, use @Missed@.
newGetUtterancesView ::
  -- | 'botName'
  Prelude.Text ->
  -- | 'botVersions'
  Prelude.NonEmpty Prelude.Text ->
  -- | 'statusType'
  StatusType ->
  GetUtterancesView
newGetUtterancesView :: Text -> NonEmpty Text -> StatusType -> GetUtterancesView
newGetUtterancesView
  Text
pBotName_
  NonEmpty Text
pBotVersions_
  StatusType
pStatusType_ =
    GetUtterancesView' :: Text -> NonEmpty Text -> StatusType -> GetUtterancesView
GetUtterancesView'
      { $sel:botName:GetUtterancesView' :: Text
botName = Text
pBotName_,
        $sel:botVersions:GetUtterancesView' :: NonEmpty Text
botVersions = Tagged (NonEmpty Text) (Identity (NonEmpty Text))
-> Tagged (NonEmpty Text) (Identity (NonEmpty Text))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged (NonEmpty Text) (Identity (NonEmpty Text))
 -> Tagged (NonEmpty Text) (Identity (NonEmpty Text)))
-> NonEmpty Text -> NonEmpty Text
forall t b. AReview t b -> b -> t
Lens.# NonEmpty Text
pBotVersions_,
        $sel:statusType:GetUtterancesView' :: StatusType
statusType = StatusType
pStatusType_
      }

-- | The name of the bot for which utterance information should be returned.
getUtterancesView_botName :: Lens.Lens' GetUtterancesView Prelude.Text
getUtterancesView_botName :: (Text -> f Text) -> GetUtterancesView -> f GetUtterancesView
getUtterancesView_botName = (GetUtterancesView -> Text)
-> (GetUtterancesView -> Text -> GetUtterancesView)
-> Lens GetUtterancesView GetUtterancesView Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetUtterancesView' {Text
botName :: Text
$sel:botName:GetUtterancesView' :: GetUtterancesView -> Text
botName} -> Text
botName) (\s :: GetUtterancesView
s@GetUtterancesView' {} Text
a -> GetUtterancesView
s {$sel:botName:GetUtterancesView' :: Text
botName = Text
a} :: GetUtterancesView)

-- | An array of bot versions for which utterance information should be
-- returned. The limit is 5 versions per request.
getUtterancesView_botVersions :: Lens.Lens' GetUtterancesView (Prelude.NonEmpty Prelude.Text)
getUtterancesView_botVersions :: (NonEmpty Text -> f (NonEmpty Text))
-> GetUtterancesView -> f GetUtterancesView
getUtterancesView_botVersions = (GetUtterancesView -> NonEmpty Text)
-> (GetUtterancesView -> NonEmpty Text -> GetUtterancesView)
-> Lens
     GetUtterancesView GetUtterancesView (NonEmpty Text) (NonEmpty Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetUtterancesView' {NonEmpty Text
botVersions :: NonEmpty Text
$sel:botVersions:GetUtterancesView' :: GetUtterancesView -> NonEmpty Text
botVersions} -> NonEmpty Text
botVersions) (\s :: GetUtterancesView
s@GetUtterancesView' {} NonEmpty Text
a -> GetUtterancesView
s {$sel:botVersions:GetUtterancesView' :: NonEmpty Text
botVersions = NonEmpty Text
a} :: GetUtterancesView) ((NonEmpty Text -> f (NonEmpty Text))
 -> GetUtterancesView -> f GetUtterancesView)
-> ((NonEmpty Text -> f (NonEmpty Text))
    -> NonEmpty Text -> f (NonEmpty Text))
-> (NonEmpty Text -> f (NonEmpty Text))
-> GetUtterancesView
-> f GetUtterancesView
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty Text -> f (NonEmpty Text))
-> NonEmpty Text -> f (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | To return utterances that were recognized and handled, use @Detected@.
-- To return utterances that were not recognized, use @Missed@.
getUtterancesView_statusType :: Lens.Lens' GetUtterancesView StatusType
getUtterancesView_statusType :: (StatusType -> f StatusType)
-> GetUtterancesView -> f GetUtterancesView
getUtterancesView_statusType = (GetUtterancesView -> StatusType)
-> (GetUtterancesView -> StatusType -> GetUtterancesView)
-> Lens GetUtterancesView GetUtterancesView StatusType StatusType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetUtterancesView' {StatusType
statusType :: StatusType
$sel:statusType:GetUtterancesView' :: GetUtterancesView -> StatusType
statusType} -> StatusType
statusType) (\s :: GetUtterancesView
s@GetUtterancesView' {} StatusType
a -> GetUtterancesView
s {$sel:statusType:GetUtterancesView' :: StatusType
statusType = StatusType
a} :: GetUtterancesView)

instance Core.AWSRequest GetUtterancesView where
  type
    AWSResponse GetUtterancesView =
      GetUtterancesViewResponse
  request :: GetUtterancesView -> Request GetUtterancesView
request = Service -> GetUtterancesView -> Request GetUtterancesView
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy GetUtterancesView
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetUtterancesView)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetUtterancesView))
-> Logger
-> Service
-> Proxy GetUtterancesView
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetUtterancesView)))
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 [UtteranceList] -> Int -> GetUtterancesViewResponse
GetUtterancesViewResponse'
            (Maybe Text
 -> Maybe [UtteranceList] -> Int -> GetUtterancesViewResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe [UtteranceList] -> Int -> GetUtterancesViewResponse)
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
"botName")
            Either
  String (Maybe [UtteranceList] -> Int -> GetUtterancesViewResponse)
-> Either String (Maybe [UtteranceList])
-> Either String (Int -> GetUtterancesViewResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [UtteranceList]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"utterances" Either String (Maybe (Maybe [UtteranceList]))
-> Maybe [UtteranceList] -> Either String (Maybe [UtteranceList])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [UtteranceList]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> GetUtterancesViewResponse)
-> Either String Int -> Either String GetUtterancesViewResponse
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 GetUtterancesView

instance Prelude.NFData GetUtterancesView

instance Core.ToHeaders GetUtterancesView where
  toHeaders :: GetUtterancesView -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetUtterancesView -> 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 GetUtterancesView where
  toPath :: GetUtterancesView -> ByteString
toPath GetUtterancesView' {NonEmpty Text
Text
StatusType
statusType :: StatusType
botVersions :: NonEmpty Text
botName :: Text
$sel:statusType:GetUtterancesView' :: GetUtterancesView -> StatusType
$sel:botVersions:GetUtterancesView' :: GetUtterancesView -> NonEmpty Text
$sel:botName:GetUtterancesView' :: GetUtterancesView -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/bots/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
botName, ByteString
"/utterances"]

instance Core.ToQuery GetUtterancesView where
  toQuery :: GetUtterancesView -> QueryString
toQuery GetUtterancesView' {NonEmpty Text
Text
StatusType
statusType :: StatusType
botVersions :: NonEmpty Text
botName :: Text
$sel:statusType:GetUtterancesView' :: GetUtterancesView -> StatusType
$sel:botVersions:GetUtterancesView' :: GetUtterancesView -> NonEmpty Text
$sel:botName:GetUtterancesView' :: GetUtterancesView -> Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"bot_versions"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ByteString -> NonEmpty Text -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" NonEmpty Text
botVersions,
        ByteString
"status_type" ByteString -> StatusType -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: StatusType
statusType,
        QueryString
"view=aggregation"
      ]

-- | /See:/ 'newGetUtterancesViewResponse' smart constructor.
data GetUtterancesViewResponse = GetUtterancesViewResponse'
  { -- | The name of the bot for which utterance information was returned.
    GetUtterancesViewResponse -> Maybe Text
botName :: Prelude.Maybe Prelude.Text,
    -- | An array of UtteranceList objects, each containing a list of
    -- UtteranceData objects describing the utterances that were processed by
    -- your bot. The response contains a maximum of 100 @UtteranceData@ objects
    -- for each version. Amazon Lex returns the most frequent utterances
    -- received by the bot in the last 15 days.
    GetUtterancesViewResponse -> Maybe [UtteranceList]
utterances :: Prelude.Maybe [UtteranceList],
    -- | The response's http status code.
    GetUtterancesViewResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetUtterancesViewResponse -> GetUtterancesViewResponse -> Bool
(GetUtterancesViewResponse -> GetUtterancesViewResponse -> Bool)
-> (GetUtterancesViewResponse -> GetUtterancesViewResponse -> Bool)
-> Eq GetUtterancesViewResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetUtterancesViewResponse -> GetUtterancesViewResponse -> Bool
$c/= :: GetUtterancesViewResponse -> GetUtterancesViewResponse -> Bool
== :: GetUtterancesViewResponse -> GetUtterancesViewResponse -> Bool
$c== :: GetUtterancesViewResponse -> GetUtterancesViewResponse -> Bool
Prelude.Eq, ReadPrec [GetUtterancesViewResponse]
ReadPrec GetUtterancesViewResponse
Int -> ReadS GetUtterancesViewResponse
ReadS [GetUtterancesViewResponse]
(Int -> ReadS GetUtterancesViewResponse)
-> ReadS [GetUtterancesViewResponse]
-> ReadPrec GetUtterancesViewResponse
-> ReadPrec [GetUtterancesViewResponse]
-> Read GetUtterancesViewResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetUtterancesViewResponse]
$creadListPrec :: ReadPrec [GetUtterancesViewResponse]
readPrec :: ReadPrec GetUtterancesViewResponse
$creadPrec :: ReadPrec GetUtterancesViewResponse
readList :: ReadS [GetUtterancesViewResponse]
$creadList :: ReadS [GetUtterancesViewResponse]
readsPrec :: Int -> ReadS GetUtterancesViewResponse
$creadsPrec :: Int -> ReadS GetUtterancesViewResponse
Prelude.Read, Int -> GetUtterancesViewResponse -> ShowS
[GetUtterancesViewResponse] -> ShowS
GetUtterancesViewResponse -> String
(Int -> GetUtterancesViewResponse -> ShowS)
-> (GetUtterancesViewResponse -> String)
-> ([GetUtterancesViewResponse] -> ShowS)
-> Show GetUtterancesViewResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetUtterancesViewResponse] -> ShowS
$cshowList :: [GetUtterancesViewResponse] -> ShowS
show :: GetUtterancesViewResponse -> String
$cshow :: GetUtterancesViewResponse -> String
showsPrec :: Int -> GetUtterancesViewResponse -> ShowS
$cshowsPrec :: Int -> GetUtterancesViewResponse -> ShowS
Prelude.Show, (forall x.
 GetUtterancesViewResponse -> Rep GetUtterancesViewResponse x)
-> (forall x.
    Rep GetUtterancesViewResponse x -> GetUtterancesViewResponse)
-> Generic GetUtterancesViewResponse
forall x.
Rep GetUtterancesViewResponse x -> GetUtterancesViewResponse
forall x.
GetUtterancesViewResponse -> Rep GetUtterancesViewResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetUtterancesViewResponse x -> GetUtterancesViewResponse
$cfrom :: forall x.
GetUtterancesViewResponse -> Rep GetUtterancesViewResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetUtterancesViewResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'botName', 'getUtterancesViewResponse_botName' - The name of the bot for which utterance information was returned.
--
-- 'utterances', 'getUtterancesViewResponse_utterances' - An array of UtteranceList objects, each containing a list of
-- UtteranceData objects describing the utterances that were processed by
-- your bot. The response contains a maximum of 100 @UtteranceData@ objects
-- for each version. Amazon Lex returns the most frequent utterances
-- received by the bot in the last 15 days.
--
-- 'httpStatus', 'getUtterancesViewResponse_httpStatus' - The response's http status code.
newGetUtterancesViewResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetUtterancesViewResponse
newGetUtterancesViewResponse :: Int -> GetUtterancesViewResponse
newGetUtterancesViewResponse Int
pHttpStatus_ =
  GetUtterancesViewResponse' :: Maybe Text
-> Maybe [UtteranceList] -> Int -> GetUtterancesViewResponse
GetUtterancesViewResponse'
    { $sel:botName:GetUtterancesViewResponse' :: Maybe Text
botName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:utterances:GetUtterancesViewResponse' :: Maybe [UtteranceList]
utterances = Maybe [UtteranceList]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetUtterancesViewResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The name of the bot for which utterance information was returned.
getUtterancesViewResponse_botName :: Lens.Lens' GetUtterancesViewResponse (Prelude.Maybe Prelude.Text)
getUtterancesViewResponse_botName :: (Maybe Text -> f (Maybe Text))
-> GetUtterancesViewResponse -> f GetUtterancesViewResponse
getUtterancesViewResponse_botName = (GetUtterancesViewResponse -> Maybe Text)
-> (GetUtterancesViewResponse
    -> Maybe Text -> GetUtterancesViewResponse)
-> Lens
     GetUtterancesViewResponse
     GetUtterancesViewResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetUtterancesViewResponse' {Maybe Text
botName :: Maybe Text
$sel:botName:GetUtterancesViewResponse' :: GetUtterancesViewResponse -> Maybe Text
botName} -> Maybe Text
botName) (\s :: GetUtterancesViewResponse
s@GetUtterancesViewResponse' {} Maybe Text
a -> GetUtterancesViewResponse
s {$sel:botName:GetUtterancesViewResponse' :: Maybe Text
botName = Maybe Text
a} :: GetUtterancesViewResponse)

-- | An array of UtteranceList objects, each containing a list of
-- UtteranceData objects describing the utterances that were processed by
-- your bot. The response contains a maximum of 100 @UtteranceData@ objects
-- for each version. Amazon Lex returns the most frequent utterances
-- received by the bot in the last 15 days.
getUtterancesViewResponse_utterances :: Lens.Lens' GetUtterancesViewResponse (Prelude.Maybe [UtteranceList])
getUtterancesViewResponse_utterances :: (Maybe [UtteranceList] -> f (Maybe [UtteranceList]))
-> GetUtterancesViewResponse -> f GetUtterancesViewResponse
getUtterancesViewResponse_utterances = (GetUtterancesViewResponse -> Maybe [UtteranceList])
-> (GetUtterancesViewResponse
    -> Maybe [UtteranceList] -> GetUtterancesViewResponse)
-> Lens
     GetUtterancesViewResponse
     GetUtterancesViewResponse
     (Maybe [UtteranceList])
     (Maybe [UtteranceList])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetUtterancesViewResponse' {Maybe [UtteranceList]
utterances :: Maybe [UtteranceList]
$sel:utterances:GetUtterancesViewResponse' :: GetUtterancesViewResponse -> Maybe [UtteranceList]
utterances} -> Maybe [UtteranceList]
utterances) (\s :: GetUtterancesViewResponse
s@GetUtterancesViewResponse' {} Maybe [UtteranceList]
a -> GetUtterancesViewResponse
s {$sel:utterances:GetUtterancesViewResponse' :: Maybe [UtteranceList]
utterances = Maybe [UtteranceList]
a} :: GetUtterancesViewResponse) ((Maybe [UtteranceList] -> f (Maybe [UtteranceList]))
 -> GetUtterancesViewResponse -> f GetUtterancesViewResponse)
-> ((Maybe [UtteranceList] -> f (Maybe [UtteranceList]))
    -> Maybe [UtteranceList] -> f (Maybe [UtteranceList]))
-> (Maybe [UtteranceList] -> f (Maybe [UtteranceList]))
-> GetUtterancesViewResponse
-> f GetUtterancesViewResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [UtteranceList] [UtteranceList] [UtteranceList] [UtteranceList]
-> Iso
     (Maybe [UtteranceList])
     (Maybe [UtteranceList])
     (Maybe [UtteranceList])
     (Maybe [UtteranceList])
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
  [UtteranceList] [UtteranceList] [UtteranceList] [UtteranceList]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData GetUtterancesViewResponse