{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.LexV2Models.ListAggregatedUtterances
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Provides a list of utterances that users have sent to the bot.
--
-- Utterances are aggregated by the text of the utterance. For example, all
-- instances where customers used the phrase \"I want to order pizza\" are
-- aggregated into the same line in the response.
--
-- You can see both detected utterances and missed utterances. A detected
-- utterance is where the bot properly recognized the utterance and
-- activated the associated intent. A missed utterance was not recognized
-- by the bot and didn\'t activate an intent.
--
-- Utterances can be aggregated for a bot alias or for a bot version, but
-- not both at the same time.
--
-- Utterances statistics are not generated under the following conditions:
--
-- -   The @childDirected@ field was set to true when the bot was created.
--
-- -   You are using slot obfuscation with one or more slots.
--
-- -   You opted out of participating in improving Amazon Lex.
module Amazonka.LexV2Models.ListAggregatedUtterances
  ( -- * Creating a Request
    ListAggregatedUtterances (..),
    newListAggregatedUtterances,

    -- * Request Lenses
    listAggregatedUtterances_botAliasId,
    listAggregatedUtterances_botVersion,
    listAggregatedUtterances_filters,
    listAggregatedUtterances_maxResults,
    listAggregatedUtterances_nextToken,
    listAggregatedUtterances_sortBy,
    listAggregatedUtterances_botId,
    listAggregatedUtterances_localeId,
    listAggregatedUtterances_aggregationDuration,

    -- * Destructuring the Response
    ListAggregatedUtterancesResponse (..),
    newListAggregatedUtterancesResponse,

    -- * Response Lenses
    listAggregatedUtterancesResponse_aggregatedUtterancesSummaries,
    listAggregatedUtterancesResponse_aggregationDuration,
    listAggregatedUtterancesResponse_aggregationLastRefreshedDateTime,
    listAggregatedUtterancesResponse_aggregationWindowEndTime,
    listAggregatedUtterancesResponse_aggregationWindowStartTime,
    listAggregatedUtterancesResponse_botAliasId,
    listAggregatedUtterancesResponse_botId,
    listAggregatedUtterancesResponse_botVersion,
    listAggregatedUtterancesResponse_localeId,
    listAggregatedUtterancesResponse_nextToken,
    listAggregatedUtterancesResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.LexV2Models.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newListAggregatedUtterances' smart constructor.
data ListAggregatedUtterances = ListAggregatedUtterances'
  { -- | The identifier of the bot alias associated with this request. If you
    -- specify the bot alias, you can\'t specify the bot version.
    ListAggregatedUtterances -> Maybe Text
botAliasId :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the bot version associated with this request. If you
    -- specify the bot version, you can\'t specify the bot alias.
    ListAggregatedUtterances -> Maybe Text
botVersion :: Prelude.Maybe Prelude.Text,
    -- | Provides the specification of a filter used to limit the utterances in
    -- the response to only those that match the filter specification. You can
    -- only specify one filter and one string to filter on.
    ListAggregatedUtterances
-> Maybe (NonEmpty AggregatedUtterancesFilter)
filters :: Prelude.Maybe (Prelude.NonEmpty AggregatedUtterancesFilter),
    -- | The maximum number of utterances to return in each page of results. If
    -- there are fewer results than the maximum page size, only the actual
    -- number of results are returned. If you don\'t specify the @maxResults@
    -- parameter, 1,000 results are returned.
    ListAggregatedUtterances -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | If the response from the @ListAggregatedUtterances@ operation contains
    -- more results that specified in the @maxResults@ parameter, a token is
    -- returned in the response. Use that token in the @nextToken@ parameter to
    -- return the next page of results.
    ListAggregatedUtterances -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Specifies sorting parameters for the list of utterances. You can sort by
    -- the hit count, the missed count, or the number of distinct sessions the
    -- utterance appeared in.
    ListAggregatedUtterances -> Maybe AggregatedUtterancesSortBy
sortBy :: Prelude.Maybe AggregatedUtterancesSortBy,
    -- | The unique identifier of the bot associated with this request.
    ListAggregatedUtterances -> Text
botId :: Prelude.Text,
    -- | The identifier of the language and locale where the utterances were
    -- collected. For more information, see
    -- <https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html Supported languages>.
    ListAggregatedUtterances -> Text
localeId :: Prelude.Text,
    -- | The time window for aggregating the utterance information. You can
    -- specify a time between one hour and two weeks.
    ListAggregatedUtterances -> UtteranceAggregationDuration
aggregationDuration :: UtteranceAggregationDuration
  }
  deriving (ListAggregatedUtterances -> ListAggregatedUtterances -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAggregatedUtterances -> ListAggregatedUtterances -> Bool
$c/= :: ListAggregatedUtterances -> ListAggregatedUtterances -> Bool
== :: ListAggregatedUtterances -> ListAggregatedUtterances -> Bool
$c== :: ListAggregatedUtterances -> ListAggregatedUtterances -> Bool
Prelude.Eq, ReadPrec [ListAggregatedUtterances]
ReadPrec ListAggregatedUtterances
Int -> ReadS ListAggregatedUtterances
ReadS [ListAggregatedUtterances]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAggregatedUtterances]
$creadListPrec :: ReadPrec [ListAggregatedUtterances]
readPrec :: ReadPrec ListAggregatedUtterances
$creadPrec :: ReadPrec ListAggregatedUtterances
readList :: ReadS [ListAggregatedUtterances]
$creadList :: ReadS [ListAggregatedUtterances]
readsPrec :: Int -> ReadS ListAggregatedUtterances
$creadsPrec :: Int -> ReadS ListAggregatedUtterances
Prelude.Read, Int -> ListAggregatedUtterances -> ShowS
[ListAggregatedUtterances] -> ShowS
ListAggregatedUtterances -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAggregatedUtterances] -> ShowS
$cshowList :: [ListAggregatedUtterances] -> ShowS
show :: ListAggregatedUtterances -> String
$cshow :: ListAggregatedUtterances -> String
showsPrec :: Int -> ListAggregatedUtterances -> ShowS
$cshowsPrec :: Int -> ListAggregatedUtterances -> ShowS
Prelude.Show, forall x.
Rep ListAggregatedUtterances x -> ListAggregatedUtterances
forall x.
ListAggregatedUtterances -> Rep ListAggregatedUtterances x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListAggregatedUtterances x -> ListAggregatedUtterances
$cfrom :: forall x.
ListAggregatedUtterances -> Rep ListAggregatedUtterances x
Prelude.Generic)

-- |
-- Create a value of 'ListAggregatedUtterances' 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:
--
-- 'botAliasId', 'listAggregatedUtterances_botAliasId' - The identifier of the bot alias associated with this request. If you
-- specify the bot alias, you can\'t specify the bot version.
--
-- 'botVersion', 'listAggregatedUtterances_botVersion' - The identifier of the bot version associated with this request. If you
-- specify the bot version, you can\'t specify the bot alias.
--
-- 'filters', 'listAggregatedUtterances_filters' - Provides the specification of a filter used to limit the utterances in
-- the response to only those that match the filter specification. You can
-- only specify one filter and one string to filter on.
--
-- 'maxResults', 'listAggregatedUtterances_maxResults' - The maximum number of utterances to return in each page of results. If
-- there are fewer results than the maximum page size, only the actual
-- number of results are returned. If you don\'t specify the @maxResults@
-- parameter, 1,000 results are returned.
--
-- 'nextToken', 'listAggregatedUtterances_nextToken' - If the response from the @ListAggregatedUtterances@ operation contains
-- more results that specified in the @maxResults@ parameter, a token is
-- returned in the response. Use that token in the @nextToken@ parameter to
-- return the next page of results.
--
-- 'sortBy', 'listAggregatedUtterances_sortBy' - Specifies sorting parameters for the list of utterances. You can sort by
-- the hit count, the missed count, or the number of distinct sessions the
-- utterance appeared in.
--
-- 'botId', 'listAggregatedUtterances_botId' - The unique identifier of the bot associated with this request.
--
-- 'localeId', 'listAggregatedUtterances_localeId' - The identifier of the language and locale where the utterances were
-- collected. For more information, see
-- <https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html Supported languages>.
--
-- 'aggregationDuration', 'listAggregatedUtterances_aggregationDuration' - The time window for aggregating the utterance information. You can
-- specify a time between one hour and two weeks.
newListAggregatedUtterances ::
  -- | 'botId'
  Prelude.Text ->
  -- | 'localeId'
  Prelude.Text ->
  -- | 'aggregationDuration'
  UtteranceAggregationDuration ->
  ListAggregatedUtterances
newListAggregatedUtterances :: Text
-> Text -> UtteranceAggregationDuration -> ListAggregatedUtterances
newListAggregatedUtterances
  Text
pBotId_
  Text
pLocaleId_
  UtteranceAggregationDuration
pAggregationDuration_ =
    ListAggregatedUtterances'
      { $sel:botAliasId:ListAggregatedUtterances' :: Maybe Text
botAliasId =
          forall a. Maybe a
Prelude.Nothing,
        $sel:botVersion:ListAggregatedUtterances' :: Maybe Text
botVersion = forall a. Maybe a
Prelude.Nothing,
        $sel:filters:ListAggregatedUtterances' :: Maybe (NonEmpty AggregatedUtterancesFilter)
filters = forall a. Maybe a
Prelude.Nothing,
        $sel:maxResults:ListAggregatedUtterances' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:ListAggregatedUtterances' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
        $sel:sortBy:ListAggregatedUtterances' :: Maybe AggregatedUtterancesSortBy
sortBy = forall a. Maybe a
Prelude.Nothing,
        $sel:botId:ListAggregatedUtterances' :: Text
botId = Text
pBotId_,
        $sel:localeId:ListAggregatedUtterances' :: Text
localeId = Text
pLocaleId_,
        $sel:aggregationDuration:ListAggregatedUtterances' :: UtteranceAggregationDuration
aggregationDuration = UtteranceAggregationDuration
pAggregationDuration_
      }

-- | The identifier of the bot alias associated with this request. If you
-- specify the bot alias, you can\'t specify the bot version.
listAggregatedUtterances_botAliasId :: Lens.Lens' ListAggregatedUtterances (Prelude.Maybe Prelude.Text)
listAggregatedUtterances_botAliasId :: Lens' ListAggregatedUtterances (Maybe Text)
listAggregatedUtterances_botAliasId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAggregatedUtterances' {Maybe Text
botAliasId :: Maybe Text
$sel:botAliasId:ListAggregatedUtterances' :: ListAggregatedUtterances -> Maybe Text
botAliasId} -> Maybe Text
botAliasId) (\s :: ListAggregatedUtterances
s@ListAggregatedUtterances' {} Maybe Text
a -> ListAggregatedUtterances
s {$sel:botAliasId:ListAggregatedUtterances' :: Maybe Text
botAliasId = Maybe Text
a} :: ListAggregatedUtterances)

-- | The identifier of the bot version associated with this request. If you
-- specify the bot version, you can\'t specify the bot alias.
listAggregatedUtterances_botVersion :: Lens.Lens' ListAggregatedUtterances (Prelude.Maybe Prelude.Text)
listAggregatedUtterances_botVersion :: Lens' ListAggregatedUtterances (Maybe Text)
listAggregatedUtterances_botVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAggregatedUtterances' {Maybe Text
botVersion :: Maybe Text
$sel:botVersion:ListAggregatedUtterances' :: ListAggregatedUtterances -> Maybe Text
botVersion} -> Maybe Text
botVersion) (\s :: ListAggregatedUtterances
s@ListAggregatedUtterances' {} Maybe Text
a -> ListAggregatedUtterances
s {$sel:botVersion:ListAggregatedUtterances' :: Maybe Text
botVersion = Maybe Text
a} :: ListAggregatedUtterances)

-- | Provides the specification of a filter used to limit the utterances in
-- the response to only those that match the filter specification. You can
-- only specify one filter and one string to filter on.
listAggregatedUtterances_filters :: Lens.Lens' ListAggregatedUtterances (Prelude.Maybe (Prelude.NonEmpty AggregatedUtterancesFilter))
listAggregatedUtterances_filters :: Lens'
  ListAggregatedUtterances
  (Maybe (NonEmpty AggregatedUtterancesFilter))
listAggregatedUtterances_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAggregatedUtterances' {Maybe (NonEmpty AggregatedUtterancesFilter)
filters :: Maybe (NonEmpty AggregatedUtterancesFilter)
$sel:filters:ListAggregatedUtterances' :: ListAggregatedUtterances
-> Maybe (NonEmpty AggregatedUtterancesFilter)
filters} -> Maybe (NonEmpty AggregatedUtterancesFilter)
filters) (\s :: ListAggregatedUtterances
s@ListAggregatedUtterances' {} Maybe (NonEmpty AggregatedUtterancesFilter)
a -> ListAggregatedUtterances
s {$sel:filters:ListAggregatedUtterances' :: Maybe (NonEmpty AggregatedUtterancesFilter)
filters = Maybe (NonEmpty AggregatedUtterancesFilter)
a} :: ListAggregatedUtterances) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The maximum number of utterances to return in each page of results. If
-- there are fewer results than the maximum page size, only the actual
-- number of results are returned. If you don\'t specify the @maxResults@
-- parameter, 1,000 results are returned.
listAggregatedUtterances_maxResults :: Lens.Lens' ListAggregatedUtterances (Prelude.Maybe Prelude.Natural)
listAggregatedUtterances_maxResults :: Lens' ListAggregatedUtterances (Maybe Natural)
listAggregatedUtterances_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAggregatedUtterances' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListAggregatedUtterances' :: ListAggregatedUtterances -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListAggregatedUtterances
s@ListAggregatedUtterances' {} Maybe Natural
a -> ListAggregatedUtterances
s {$sel:maxResults:ListAggregatedUtterances' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListAggregatedUtterances)

-- | If the response from the @ListAggregatedUtterances@ operation contains
-- more results that specified in the @maxResults@ parameter, a token is
-- returned in the response. Use that token in the @nextToken@ parameter to
-- return the next page of results.
listAggregatedUtterances_nextToken :: Lens.Lens' ListAggregatedUtterances (Prelude.Maybe Prelude.Text)
listAggregatedUtterances_nextToken :: Lens' ListAggregatedUtterances (Maybe Text)
listAggregatedUtterances_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAggregatedUtterances' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAggregatedUtterances' :: ListAggregatedUtterances -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAggregatedUtterances
s@ListAggregatedUtterances' {} Maybe Text
a -> ListAggregatedUtterances
s {$sel:nextToken:ListAggregatedUtterances' :: Maybe Text
nextToken = Maybe Text
a} :: ListAggregatedUtterances)

-- | Specifies sorting parameters for the list of utterances. You can sort by
-- the hit count, the missed count, or the number of distinct sessions the
-- utterance appeared in.
listAggregatedUtterances_sortBy :: Lens.Lens' ListAggregatedUtterances (Prelude.Maybe AggregatedUtterancesSortBy)
listAggregatedUtterances_sortBy :: Lens' ListAggregatedUtterances (Maybe AggregatedUtterancesSortBy)
listAggregatedUtterances_sortBy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAggregatedUtterances' {Maybe AggregatedUtterancesSortBy
sortBy :: Maybe AggregatedUtterancesSortBy
$sel:sortBy:ListAggregatedUtterances' :: ListAggregatedUtterances -> Maybe AggregatedUtterancesSortBy
sortBy} -> Maybe AggregatedUtterancesSortBy
sortBy) (\s :: ListAggregatedUtterances
s@ListAggregatedUtterances' {} Maybe AggregatedUtterancesSortBy
a -> ListAggregatedUtterances
s {$sel:sortBy:ListAggregatedUtterances' :: Maybe AggregatedUtterancesSortBy
sortBy = Maybe AggregatedUtterancesSortBy
a} :: ListAggregatedUtterances)

-- | The unique identifier of the bot associated with this request.
listAggregatedUtterances_botId :: Lens.Lens' ListAggregatedUtterances Prelude.Text
listAggregatedUtterances_botId :: Lens' ListAggregatedUtterances Text
listAggregatedUtterances_botId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAggregatedUtterances' {Text
botId :: Text
$sel:botId:ListAggregatedUtterances' :: ListAggregatedUtterances -> Text
botId} -> Text
botId) (\s :: ListAggregatedUtterances
s@ListAggregatedUtterances' {} Text
a -> ListAggregatedUtterances
s {$sel:botId:ListAggregatedUtterances' :: Text
botId = Text
a} :: ListAggregatedUtterances)

-- | The identifier of the language and locale where the utterances were
-- collected. For more information, see
-- <https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html Supported languages>.
listAggregatedUtterances_localeId :: Lens.Lens' ListAggregatedUtterances Prelude.Text
listAggregatedUtterances_localeId :: Lens' ListAggregatedUtterances Text
listAggregatedUtterances_localeId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAggregatedUtterances' {Text
localeId :: Text
$sel:localeId:ListAggregatedUtterances' :: ListAggregatedUtterances -> Text
localeId} -> Text
localeId) (\s :: ListAggregatedUtterances
s@ListAggregatedUtterances' {} Text
a -> ListAggregatedUtterances
s {$sel:localeId:ListAggregatedUtterances' :: Text
localeId = Text
a} :: ListAggregatedUtterances)

-- | The time window for aggregating the utterance information. You can
-- specify a time between one hour and two weeks.
listAggregatedUtterances_aggregationDuration :: Lens.Lens' ListAggregatedUtterances UtteranceAggregationDuration
listAggregatedUtterances_aggregationDuration :: Lens' ListAggregatedUtterances UtteranceAggregationDuration
listAggregatedUtterances_aggregationDuration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAggregatedUtterances' {UtteranceAggregationDuration
aggregationDuration :: UtteranceAggregationDuration
$sel:aggregationDuration:ListAggregatedUtterances' :: ListAggregatedUtterances -> UtteranceAggregationDuration
aggregationDuration} -> UtteranceAggregationDuration
aggregationDuration) (\s :: ListAggregatedUtterances
s@ListAggregatedUtterances' {} UtteranceAggregationDuration
a -> ListAggregatedUtterances
s {$sel:aggregationDuration:ListAggregatedUtterances' :: UtteranceAggregationDuration
aggregationDuration = UtteranceAggregationDuration
a} :: ListAggregatedUtterances)

instance Core.AWSRequest ListAggregatedUtterances where
  type
    AWSResponse ListAggregatedUtterances =
      ListAggregatedUtterancesResponse
  request :: (Service -> Service)
-> ListAggregatedUtterances -> Request ListAggregatedUtterances
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListAggregatedUtterances
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListAggregatedUtterances)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe [AggregatedUtterancesSummary]
-> Maybe UtteranceAggregationDuration
-> Maybe POSIX
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> ListAggregatedUtterancesResponse
ListAggregatedUtterancesResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"aggregatedUtterancesSummaries"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"aggregationDuration")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"aggregationLastRefreshedDateTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"aggregationWindowEndTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"aggregationWindowStartTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"botAliasId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"botId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"botVersion")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"localeId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"nextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable ListAggregatedUtterances where
  hashWithSalt :: Int -> ListAggregatedUtterances -> Int
hashWithSalt Int
_salt ListAggregatedUtterances' {Maybe Natural
Maybe (NonEmpty AggregatedUtterancesFilter)
Maybe Text
Maybe AggregatedUtterancesSortBy
Text
UtteranceAggregationDuration
aggregationDuration :: UtteranceAggregationDuration
localeId :: Text
botId :: Text
sortBy :: Maybe AggregatedUtterancesSortBy
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe (NonEmpty AggregatedUtterancesFilter)
botVersion :: Maybe Text
botAliasId :: Maybe Text
$sel:aggregationDuration:ListAggregatedUtterances' :: ListAggregatedUtterances -> UtteranceAggregationDuration
$sel:localeId:ListAggregatedUtterances' :: ListAggregatedUtterances -> Text
$sel:botId:ListAggregatedUtterances' :: ListAggregatedUtterances -> Text
$sel:sortBy:ListAggregatedUtterances' :: ListAggregatedUtterances -> Maybe AggregatedUtterancesSortBy
$sel:nextToken:ListAggregatedUtterances' :: ListAggregatedUtterances -> Maybe Text
$sel:maxResults:ListAggregatedUtterances' :: ListAggregatedUtterances -> Maybe Natural
$sel:filters:ListAggregatedUtterances' :: ListAggregatedUtterances
-> Maybe (NonEmpty AggregatedUtterancesFilter)
$sel:botVersion:ListAggregatedUtterances' :: ListAggregatedUtterances -> Maybe Text
$sel:botAliasId:ListAggregatedUtterances' :: ListAggregatedUtterances -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
botAliasId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
botVersion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty AggregatedUtterancesFilter)
filters
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AggregatedUtterancesSortBy
sortBy
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
botId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
localeId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` UtteranceAggregationDuration
aggregationDuration

instance Prelude.NFData ListAggregatedUtterances where
  rnf :: ListAggregatedUtterances -> ()
rnf ListAggregatedUtterances' {Maybe Natural
Maybe (NonEmpty AggregatedUtterancesFilter)
Maybe Text
Maybe AggregatedUtterancesSortBy
Text
UtteranceAggregationDuration
aggregationDuration :: UtteranceAggregationDuration
localeId :: Text
botId :: Text
sortBy :: Maybe AggregatedUtterancesSortBy
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe (NonEmpty AggregatedUtterancesFilter)
botVersion :: Maybe Text
botAliasId :: Maybe Text
$sel:aggregationDuration:ListAggregatedUtterances' :: ListAggregatedUtterances -> UtteranceAggregationDuration
$sel:localeId:ListAggregatedUtterances' :: ListAggregatedUtterances -> Text
$sel:botId:ListAggregatedUtterances' :: ListAggregatedUtterances -> Text
$sel:sortBy:ListAggregatedUtterances' :: ListAggregatedUtterances -> Maybe AggregatedUtterancesSortBy
$sel:nextToken:ListAggregatedUtterances' :: ListAggregatedUtterances -> Maybe Text
$sel:maxResults:ListAggregatedUtterances' :: ListAggregatedUtterances -> Maybe Natural
$sel:filters:ListAggregatedUtterances' :: ListAggregatedUtterances
-> Maybe (NonEmpty AggregatedUtterancesFilter)
$sel:botVersion:ListAggregatedUtterances' :: ListAggregatedUtterances -> Maybe Text
$sel:botAliasId:ListAggregatedUtterances' :: ListAggregatedUtterances -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
botAliasId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
botVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty AggregatedUtterancesFilter)
filters
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AggregatedUtterancesSortBy
sortBy
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
botId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
localeId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf UtteranceAggregationDuration
aggregationDuration

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

instance Data.ToJSON ListAggregatedUtterances where
  toJSON :: ListAggregatedUtterances -> Value
toJSON ListAggregatedUtterances' {Maybe Natural
Maybe (NonEmpty AggregatedUtterancesFilter)
Maybe Text
Maybe AggregatedUtterancesSortBy
Text
UtteranceAggregationDuration
aggregationDuration :: UtteranceAggregationDuration
localeId :: Text
botId :: Text
sortBy :: Maybe AggregatedUtterancesSortBy
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe (NonEmpty AggregatedUtterancesFilter)
botVersion :: Maybe Text
botAliasId :: Maybe Text
$sel:aggregationDuration:ListAggregatedUtterances' :: ListAggregatedUtterances -> UtteranceAggregationDuration
$sel:localeId:ListAggregatedUtterances' :: ListAggregatedUtterances -> Text
$sel:botId:ListAggregatedUtterances' :: ListAggregatedUtterances -> Text
$sel:sortBy:ListAggregatedUtterances' :: ListAggregatedUtterances -> Maybe AggregatedUtterancesSortBy
$sel:nextToken:ListAggregatedUtterances' :: ListAggregatedUtterances -> Maybe Text
$sel:maxResults:ListAggregatedUtterances' :: ListAggregatedUtterances -> Maybe Natural
$sel:filters:ListAggregatedUtterances' :: ListAggregatedUtterances
-> Maybe (NonEmpty AggregatedUtterancesFilter)
$sel:botVersion:ListAggregatedUtterances' :: ListAggregatedUtterances -> Maybe Text
$sel:botAliasId:ListAggregatedUtterances' :: ListAggregatedUtterances -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"botAliasId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
botAliasId,
            (Key
"botVersion" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
botVersion,
            (Key
"filters" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty AggregatedUtterancesFilter)
filters,
            (Key
"maxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            (Key
"nextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Key
"sortBy" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AggregatedUtterancesSortBy
sortBy,
            forall a. a -> Maybe a
Prelude.Just (Key
"localeId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
localeId),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"aggregationDuration" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= UtteranceAggregationDuration
aggregationDuration)
          ]
      )

instance Data.ToPath ListAggregatedUtterances where
  toPath :: ListAggregatedUtterances -> ByteString
toPath ListAggregatedUtterances' {Maybe Natural
Maybe (NonEmpty AggregatedUtterancesFilter)
Maybe Text
Maybe AggregatedUtterancesSortBy
Text
UtteranceAggregationDuration
aggregationDuration :: UtteranceAggregationDuration
localeId :: Text
botId :: Text
sortBy :: Maybe AggregatedUtterancesSortBy
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe (NonEmpty AggregatedUtterancesFilter)
botVersion :: Maybe Text
botAliasId :: Maybe Text
$sel:aggregationDuration:ListAggregatedUtterances' :: ListAggregatedUtterances -> UtteranceAggregationDuration
$sel:localeId:ListAggregatedUtterances' :: ListAggregatedUtterances -> Text
$sel:botId:ListAggregatedUtterances' :: ListAggregatedUtterances -> Text
$sel:sortBy:ListAggregatedUtterances' :: ListAggregatedUtterances -> Maybe AggregatedUtterancesSortBy
$sel:nextToken:ListAggregatedUtterances' :: ListAggregatedUtterances -> Maybe Text
$sel:maxResults:ListAggregatedUtterances' :: ListAggregatedUtterances -> Maybe Natural
$sel:filters:ListAggregatedUtterances' :: ListAggregatedUtterances
-> Maybe (NonEmpty AggregatedUtterancesFilter)
$sel:botVersion:ListAggregatedUtterances' :: ListAggregatedUtterances -> Maybe Text
$sel:botAliasId:ListAggregatedUtterances' :: ListAggregatedUtterances -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/bots/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
botId, ByteString
"/aggregatedutterances/"]

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

-- | /See:/ 'newListAggregatedUtterancesResponse' smart constructor.
data ListAggregatedUtterancesResponse = ListAggregatedUtterancesResponse'
  { -- | Summaries of the aggregated utterance data. Each response contains
    -- information about the number of times that the utterance was seen during
    -- the time period, whether it was detected or missed, and when it was seen
    -- during the time period.
    ListAggregatedUtterancesResponse
-> Maybe [AggregatedUtterancesSummary]
aggregatedUtterancesSummaries :: Prelude.Maybe [AggregatedUtterancesSummary],
    -- | The time period used to aggregate the utterance data.
    ListAggregatedUtterancesResponse
-> Maybe UtteranceAggregationDuration
aggregationDuration :: Prelude.Maybe UtteranceAggregationDuration,
    -- | The last date and time that the aggregated data was collected. The time
    -- period depends on the length of the aggregation window.
    --
    -- -   __Hours__ - for 1 hour time window, every half hour; otherwise every
    --     hour.
    --
    -- -   __Days__ - every 6 hours
    --
    -- -   __Weeks__ - for a one week time window, every 12 hours; otherwise,
    --     every day
    ListAggregatedUtterancesResponse -> Maybe POSIX
aggregationLastRefreshedDateTime :: Prelude.Maybe Data.POSIX,
    -- | The date and time that the aggregation window ends. Only data collected
    -- between the start time and the end time are returned in the results.
    ListAggregatedUtterancesResponse -> Maybe POSIX
aggregationWindowEndTime :: Prelude.Maybe Data.POSIX,
    -- | The date and time that the aggregation window begins. Only data
    -- collected after this time is returned in the results.
    ListAggregatedUtterancesResponse -> Maybe POSIX
aggregationWindowStartTime :: Prelude.Maybe Data.POSIX,
    -- | The identifier of the bot alias that contains the utterances. If you
    -- specified the bot version, the bot alias ID isn\'t returned.
    ListAggregatedUtterancesResponse -> Maybe Text
botAliasId :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the bot that contains the utterances.
    ListAggregatedUtterancesResponse -> Maybe Text
botId :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the bot version that contains the utterances. If you
    -- specified the bot alias, the bot version isn\'t returned.
    ListAggregatedUtterancesResponse -> Maybe Text
botVersion :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the language and locale that the utterances are in.
    ListAggregatedUtterancesResponse -> Maybe Text
localeId :: Prelude.Maybe Prelude.Text,
    -- | A token that indicates whether there are more results to return in a
    -- response to the @ListAggregatedUtterances@ operation. If the @nextToken@
    -- field is present, you send the contents as the @nextToken@ parameter of
    -- a @ListAggregatedUtterances@ operation request to get the next page of
    -- results.
    ListAggregatedUtterancesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListAggregatedUtterancesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListAggregatedUtterancesResponse
-> ListAggregatedUtterancesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAggregatedUtterancesResponse
-> ListAggregatedUtterancesResponse -> Bool
$c/= :: ListAggregatedUtterancesResponse
-> ListAggregatedUtterancesResponse -> Bool
== :: ListAggregatedUtterancesResponse
-> ListAggregatedUtterancesResponse -> Bool
$c== :: ListAggregatedUtterancesResponse
-> ListAggregatedUtterancesResponse -> Bool
Prelude.Eq, ReadPrec [ListAggregatedUtterancesResponse]
ReadPrec ListAggregatedUtterancesResponse
Int -> ReadS ListAggregatedUtterancesResponse
ReadS [ListAggregatedUtterancesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAggregatedUtterancesResponse]
$creadListPrec :: ReadPrec [ListAggregatedUtterancesResponse]
readPrec :: ReadPrec ListAggregatedUtterancesResponse
$creadPrec :: ReadPrec ListAggregatedUtterancesResponse
readList :: ReadS [ListAggregatedUtterancesResponse]
$creadList :: ReadS [ListAggregatedUtterancesResponse]
readsPrec :: Int -> ReadS ListAggregatedUtterancesResponse
$creadsPrec :: Int -> ReadS ListAggregatedUtterancesResponse
Prelude.Read, Int -> ListAggregatedUtterancesResponse -> ShowS
[ListAggregatedUtterancesResponse] -> ShowS
ListAggregatedUtterancesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAggregatedUtterancesResponse] -> ShowS
$cshowList :: [ListAggregatedUtterancesResponse] -> ShowS
show :: ListAggregatedUtterancesResponse -> String
$cshow :: ListAggregatedUtterancesResponse -> String
showsPrec :: Int -> ListAggregatedUtterancesResponse -> ShowS
$cshowsPrec :: Int -> ListAggregatedUtterancesResponse -> ShowS
Prelude.Show, forall x.
Rep ListAggregatedUtterancesResponse x
-> ListAggregatedUtterancesResponse
forall x.
ListAggregatedUtterancesResponse
-> Rep ListAggregatedUtterancesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListAggregatedUtterancesResponse x
-> ListAggregatedUtterancesResponse
$cfrom :: forall x.
ListAggregatedUtterancesResponse
-> Rep ListAggregatedUtterancesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListAggregatedUtterancesResponse' 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:
--
-- 'aggregatedUtterancesSummaries', 'listAggregatedUtterancesResponse_aggregatedUtterancesSummaries' - Summaries of the aggregated utterance data. Each response contains
-- information about the number of times that the utterance was seen during
-- the time period, whether it was detected or missed, and when it was seen
-- during the time period.
--
-- 'aggregationDuration', 'listAggregatedUtterancesResponse_aggregationDuration' - The time period used to aggregate the utterance data.
--
-- 'aggregationLastRefreshedDateTime', 'listAggregatedUtterancesResponse_aggregationLastRefreshedDateTime' - The last date and time that the aggregated data was collected. The time
-- period depends on the length of the aggregation window.
--
-- -   __Hours__ - for 1 hour time window, every half hour; otherwise every
--     hour.
--
-- -   __Days__ - every 6 hours
--
-- -   __Weeks__ - for a one week time window, every 12 hours; otherwise,
--     every day
--
-- 'aggregationWindowEndTime', 'listAggregatedUtterancesResponse_aggregationWindowEndTime' - The date and time that the aggregation window ends. Only data collected
-- between the start time and the end time are returned in the results.
--
-- 'aggregationWindowStartTime', 'listAggregatedUtterancesResponse_aggregationWindowStartTime' - The date and time that the aggregation window begins. Only data
-- collected after this time is returned in the results.
--
-- 'botAliasId', 'listAggregatedUtterancesResponse_botAliasId' - The identifier of the bot alias that contains the utterances. If you
-- specified the bot version, the bot alias ID isn\'t returned.
--
-- 'botId', 'listAggregatedUtterancesResponse_botId' - The identifier of the bot that contains the utterances.
--
-- 'botVersion', 'listAggregatedUtterancesResponse_botVersion' - The identifier of the bot version that contains the utterances. If you
-- specified the bot alias, the bot version isn\'t returned.
--
-- 'localeId', 'listAggregatedUtterancesResponse_localeId' - The identifier of the language and locale that the utterances are in.
--
-- 'nextToken', 'listAggregatedUtterancesResponse_nextToken' - A token that indicates whether there are more results to return in a
-- response to the @ListAggregatedUtterances@ operation. If the @nextToken@
-- field is present, you send the contents as the @nextToken@ parameter of
-- a @ListAggregatedUtterances@ operation request to get the next page of
-- results.
--
-- 'httpStatus', 'listAggregatedUtterancesResponse_httpStatus' - The response's http status code.
newListAggregatedUtterancesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListAggregatedUtterancesResponse
newListAggregatedUtterancesResponse :: Int -> ListAggregatedUtterancesResponse
newListAggregatedUtterancesResponse Int
pHttpStatus_ =
  ListAggregatedUtterancesResponse'
    { $sel:aggregatedUtterancesSummaries:ListAggregatedUtterancesResponse' :: Maybe [AggregatedUtterancesSummary]
aggregatedUtterancesSummaries =
        forall a. Maybe a
Prelude.Nothing,
      $sel:aggregationDuration:ListAggregatedUtterancesResponse' :: Maybe UtteranceAggregationDuration
aggregationDuration = forall a. Maybe a
Prelude.Nothing,
      $sel:aggregationLastRefreshedDateTime:ListAggregatedUtterancesResponse' :: Maybe POSIX
aggregationLastRefreshedDateTime =
        forall a. Maybe a
Prelude.Nothing,
      $sel:aggregationWindowEndTime:ListAggregatedUtterancesResponse' :: Maybe POSIX
aggregationWindowEndTime =
        forall a. Maybe a
Prelude.Nothing,
      $sel:aggregationWindowStartTime:ListAggregatedUtterancesResponse' :: Maybe POSIX
aggregationWindowStartTime =
        forall a. Maybe a
Prelude.Nothing,
      $sel:botAliasId:ListAggregatedUtterancesResponse' :: Maybe Text
botAliasId = forall a. Maybe a
Prelude.Nothing,
      $sel:botId:ListAggregatedUtterancesResponse' :: Maybe Text
botId = forall a. Maybe a
Prelude.Nothing,
      $sel:botVersion:ListAggregatedUtterancesResponse' :: Maybe Text
botVersion = forall a. Maybe a
Prelude.Nothing,
      $sel:localeId:ListAggregatedUtterancesResponse' :: Maybe Text
localeId = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListAggregatedUtterancesResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListAggregatedUtterancesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Summaries of the aggregated utterance data. Each response contains
-- information about the number of times that the utterance was seen during
-- the time period, whether it was detected or missed, and when it was seen
-- during the time period.
listAggregatedUtterancesResponse_aggregatedUtterancesSummaries :: Lens.Lens' ListAggregatedUtterancesResponse (Prelude.Maybe [AggregatedUtterancesSummary])
listAggregatedUtterancesResponse_aggregatedUtterancesSummaries :: Lens'
  ListAggregatedUtterancesResponse
  (Maybe [AggregatedUtterancesSummary])
listAggregatedUtterancesResponse_aggregatedUtterancesSummaries = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAggregatedUtterancesResponse' {Maybe [AggregatedUtterancesSummary]
aggregatedUtterancesSummaries :: Maybe [AggregatedUtterancesSummary]
$sel:aggregatedUtterancesSummaries:ListAggregatedUtterancesResponse' :: ListAggregatedUtterancesResponse
-> Maybe [AggregatedUtterancesSummary]
aggregatedUtterancesSummaries} -> Maybe [AggregatedUtterancesSummary]
aggregatedUtterancesSummaries) (\s :: ListAggregatedUtterancesResponse
s@ListAggregatedUtterancesResponse' {} Maybe [AggregatedUtterancesSummary]
a -> ListAggregatedUtterancesResponse
s {$sel:aggregatedUtterancesSummaries:ListAggregatedUtterancesResponse' :: Maybe [AggregatedUtterancesSummary]
aggregatedUtterancesSummaries = Maybe [AggregatedUtterancesSummary]
a} :: ListAggregatedUtterancesResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The time period used to aggregate the utterance data.
listAggregatedUtterancesResponse_aggregationDuration :: Lens.Lens' ListAggregatedUtterancesResponse (Prelude.Maybe UtteranceAggregationDuration)
listAggregatedUtterancesResponse_aggregationDuration :: Lens'
  ListAggregatedUtterancesResponse
  (Maybe UtteranceAggregationDuration)
listAggregatedUtterancesResponse_aggregationDuration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAggregatedUtterancesResponse' {Maybe UtteranceAggregationDuration
aggregationDuration :: Maybe UtteranceAggregationDuration
$sel:aggregationDuration:ListAggregatedUtterancesResponse' :: ListAggregatedUtterancesResponse
-> Maybe UtteranceAggregationDuration
aggregationDuration} -> Maybe UtteranceAggregationDuration
aggregationDuration) (\s :: ListAggregatedUtterancesResponse
s@ListAggregatedUtterancesResponse' {} Maybe UtteranceAggregationDuration
a -> ListAggregatedUtterancesResponse
s {$sel:aggregationDuration:ListAggregatedUtterancesResponse' :: Maybe UtteranceAggregationDuration
aggregationDuration = Maybe UtteranceAggregationDuration
a} :: ListAggregatedUtterancesResponse)

-- | The last date and time that the aggregated data was collected. The time
-- period depends on the length of the aggregation window.
--
-- -   __Hours__ - for 1 hour time window, every half hour; otherwise every
--     hour.
--
-- -   __Days__ - every 6 hours
--
-- -   __Weeks__ - for a one week time window, every 12 hours; otherwise,
--     every day
listAggregatedUtterancesResponse_aggregationLastRefreshedDateTime :: Lens.Lens' ListAggregatedUtterancesResponse (Prelude.Maybe Prelude.UTCTime)
listAggregatedUtterancesResponse_aggregationLastRefreshedDateTime :: Lens' ListAggregatedUtterancesResponse (Maybe UTCTime)
listAggregatedUtterancesResponse_aggregationLastRefreshedDateTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAggregatedUtterancesResponse' {Maybe POSIX
aggregationLastRefreshedDateTime :: Maybe POSIX
$sel:aggregationLastRefreshedDateTime:ListAggregatedUtterancesResponse' :: ListAggregatedUtterancesResponse -> Maybe POSIX
aggregationLastRefreshedDateTime} -> Maybe POSIX
aggregationLastRefreshedDateTime) (\s :: ListAggregatedUtterancesResponse
s@ListAggregatedUtterancesResponse' {} Maybe POSIX
a -> ListAggregatedUtterancesResponse
s {$sel:aggregationLastRefreshedDateTime:ListAggregatedUtterancesResponse' :: Maybe POSIX
aggregationLastRefreshedDateTime = Maybe POSIX
a} :: ListAggregatedUtterancesResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The date and time that the aggregation window ends. Only data collected
-- between the start time and the end time are returned in the results.
listAggregatedUtterancesResponse_aggregationWindowEndTime :: Lens.Lens' ListAggregatedUtterancesResponse (Prelude.Maybe Prelude.UTCTime)
listAggregatedUtterancesResponse_aggregationWindowEndTime :: Lens' ListAggregatedUtterancesResponse (Maybe UTCTime)
listAggregatedUtterancesResponse_aggregationWindowEndTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAggregatedUtterancesResponse' {Maybe POSIX
aggregationWindowEndTime :: Maybe POSIX
$sel:aggregationWindowEndTime:ListAggregatedUtterancesResponse' :: ListAggregatedUtterancesResponse -> Maybe POSIX
aggregationWindowEndTime} -> Maybe POSIX
aggregationWindowEndTime) (\s :: ListAggregatedUtterancesResponse
s@ListAggregatedUtterancesResponse' {} Maybe POSIX
a -> ListAggregatedUtterancesResponse
s {$sel:aggregationWindowEndTime:ListAggregatedUtterancesResponse' :: Maybe POSIX
aggregationWindowEndTime = Maybe POSIX
a} :: ListAggregatedUtterancesResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The date and time that the aggregation window begins. Only data
-- collected after this time is returned in the results.
listAggregatedUtterancesResponse_aggregationWindowStartTime :: Lens.Lens' ListAggregatedUtterancesResponse (Prelude.Maybe Prelude.UTCTime)
listAggregatedUtterancesResponse_aggregationWindowStartTime :: Lens' ListAggregatedUtterancesResponse (Maybe UTCTime)
listAggregatedUtterancesResponse_aggregationWindowStartTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAggregatedUtterancesResponse' {Maybe POSIX
aggregationWindowStartTime :: Maybe POSIX
$sel:aggregationWindowStartTime:ListAggregatedUtterancesResponse' :: ListAggregatedUtterancesResponse -> Maybe POSIX
aggregationWindowStartTime} -> Maybe POSIX
aggregationWindowStartTime) (\s :: ListAggregatedUtterancesResponse
s@ListAggregatedUtterancesResponse' {} Maybe POSIX
a -> ListAggregatedUtterancesResponse
s {$sel:aggregationWindowStartTime:ListAggregatedUtterancesResponse' :: Maybe POSIX
aggregationWindowStartTime = Maybe POSIX
a} :: ListAggregatedUtterancesResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The identifier of the bot alias that contains the utterances. If you
-- specified the bot version, the bot alias ID isn\'t returned.
listAggregatedUtterancesResponse_botAliasId :: Lens.Lens' ListAggregatedUtterancesResponse (Prelude.Maybe Prelude.Text)
listAggregatedUtterancesResponse_botAliasId :: Lens' ListAggregatedUtterancesResponse (Maybe Text)
listAggregatedUtterancesResponse_botAliasId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAggregatedUtterancesResponse' {Maybe Text
botAliasId :: Maybe Text
$sel:botAliasId:ListAggregatedUtterancesResponse' :: ListAggregatedUtterancesResponse -> Maybe Text
botAliasId} -> Maybe Text
botAliasId) (\s :: ListAggregatedUtterancesResponse
s@ListAggregatedUtterancesResponse' {} Maybe Text
a -> ListAggregatedUtterancesResponse
s {$sel:botAliasId:ListAggregatedUtterancesResponse' :: Maybe Text
botAliasId = Maybe Text
a} :: ListAggregatedUtterancesResponse)

-- | The identifier of the bot that contains the utterances.
listAggregatedUtterancesResponse_botId :: Lens.Lens' ListAggregatedUtterancesResponse (Prelude.Maybe Prelude.Text)
listAggregatedUtterancesResponse_botId :: Lens' ListAggregatedUtterancesResponse (Maybe Text)
listAggregatedUtterancesResponse_botId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAggregatedUtterancesResponse' {Maybe Text
botId :: Maybe Text
$sel:botId:ListAggregatedUtterancesResponse' :: ListAggregatedUtterancesResponse -> Maybe Text
botId} -> Maybe Text
botId) (\s :: ListAggregatedUtterancesResponse
s@ListAggregatedUtterancesResponse' {} Maybe Text
a -> ListAggregatedUtterancesResponse
s {$sel:botId:ListAggregatedUtterancesResponse' :: Maybe Text
botId = Maybe Text
a} :: ListAggregatedUtterancesResponse)

-- | The identifier of the bot version that contains the utterances. If you
-- specified the bot alias, the bot version isn\'t returned.
listAggregatedUtterancesResponse_botVersion :: Lens.Lens' ListAggregatedUtterancesResponse (Prelude.Maybe Prelude.Text)
listAggregatedUtterancesResponse_botVersion :: Lens' ListAggregatedUtterancesResponse (Maybe Text)
listAggregatedUtterancesResponse_botVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAggregatedUtterancesResponse' {Maybe Text
botVersion :: Maybe Text
$sel:botVersion:ListAggregatedUtterancesResponse' :: ListAggregatedUtterancesResponse -> Maybe Text
botVersion} -> Maybe Text
botVersion) (\s :: ListAggregatedUtterancesResponse
s@ListAggregatedUtterancesResponse' {} Maybe Text
a -> ListAggregatedUtterancesResponse
s {$sel:botVersion:ListAggregatedUtterancesResponse' :: Maybe Text
botVersion = Maybe Text
a} :: ListAggregatedUtterancesResponse)

-- | The identifier of the language and locale that the utterances are in.
listAggregatedUtterancesResponse_localeId :: Lens.Lens' ListAggregatedUtterancesResponse (Prelude.Maybe Prelude.Text)
listAggregatedUtterancesResponse_localeId :: Lens' ListAggregatedUtterancesResponse (Maybe Text)
listAggregatedUtterancesResponse_localeId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAggregatedUtterancesResponse' {Maybe Text
localeId :: Maybe Text
$sel:localeId:ListAggregatedUtterancesResponse' :: ListAggregatedUtterancesResponse -> Maybe Text
localeId} -> Maybe Text
localeId) (\s :: ListAggregatedUtterancesResponse
s@ListAggregatedUtterancesResponse' {} Maybe Text
a -> ListAggregatedUtterancesResponse
s {$sel:localeId:ListAggregatedUtterancesResponse' :: Maybe Text
localeId = Maybe Text
a} :: ListAggregatedUtterancesResponse)

-- | A token that indicates whether there are more results to return in a
-- response to the @ListAggregatedUtterances@ operation. If the @nextToken@
-- field is present, you send the contents as the @nextToken@ parameter of
-- a @ListAggregatedUtterances@ operation request to get the next page of
-- results.
listAggregatedUtterancesResponse_nextToken :: Lens.Lens' ListAggregatedUtterancesResponse (Prelude.Maybe Prelude.Text)
listAggregatedUtterancesResponse_nextToken :: Lens' ListAggregatedUtterancesResponse (Maybe Text)
listAggregatedUtterancesResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAggregatedUtterancesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAggregatedUtterancesResponse' :: ListAggregatedUtterancesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAggregatedUtterancesResponse
s@ListAggregatedUtterancesResponse' {} Maybe Text
a -> ListAggregatedUtterancesResponse
s {$sel:nextToken:ListAggregatedUtterancesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListAggregatedUtterancesResponse)

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

instance
  Prelude.NFData
    ListAggregatedUtterancesResponse
  where
  rnf :: ListAggregatedUtterancesResponse -> ()
rnf ListAggregatedUtterancesResponse' {Int
Maybe [AggregatedUtterancesSummary]
Maybe Text
Maybe POSIX
Maybe UtteranceAggregationDuration
httpStatus :: Int
nextToken :: Maybe Text
localeId :: Maybe Text
botVersion :: Maybe Text
botId :: Maybe Text
botAliasId :: Maybe Text
aggregationWindowStartTime :: Maybe POSIX
aggregationWindowEndTime :: Maybe POSIX
aggregationLastRefreshedDateTime :: Maybe POSIX
aggregationDuration :: Maybe UtteranceAggregationDuration
aggregatedUtterancesSummaries :: Maybe [AggregatedUtterancesSummary]
$sel:httpStatus:ListAggregatedUtterancesResponse' :: ListAggregatedUtterancesResponse -> Int
$sel:nextToken:ListAggregatedUtterancesResponse' :: ListAggregatedUtterancesResponse -> Maybe Text
$sel:localeId:ListAggregatedUtterancesResponse' :: ListAggregatedUtterancesResponse -> Maybe Text
$sel:botVersion:ListAggregatedUtterancesResponse' :: ListAggregatedUtterancesResponse -> Maybe Text
$sel:botId:ListAggregatedUtterancesResponse' :: ListAggregatedUtterancesResponse -> Maybe Text
$sel:botAliasId:ListAggregatedUtterancesResponse' :: ListAggregatedUtterancesResponse -> Maybe Text
$sel:aggregationWindowStartTime:ListAggregatedUtterancesResponse' :: ListAggregatedUtterancesResponse -> Maybe POSIX
$sel:aggregationWindowEndTime:ListAggregatedUtterancesResponse' :: ListAggregatedUtterancesResponse -> Maybe POSIX
$sel:aggregationLastRefreshedDateTime:ListAggregatedUtterancesResponse' :: ListAggregatedUtterancesResponse -> Maybe POSIX
$sel:aggregationDuration:ListAggregatedUtterancesResponse' :: ListAggregatedUtterancesResponse
-> Maybe UtteranceAggregationDuration
$sel:aggregatedUtterancesSummaries:ListAggregatedUtterancesResponse' :: ListAggregatedUtterancesResponse
-> Maybe [AggregatedUtterancesSummary]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [AggregatedUtterancesSummary]
aggregatedUtterancesSummaries
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe UtteranceAggregationDuration
aggregationDuration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
aggregationLastRefreshedDateTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
aggregationWindowEndTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
aggregationWindowStartTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
botAliasId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
botId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
botVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
localeId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus