{-# 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.ConnectContactLens.ListRealtimeContactAnalysisSegments
-- 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)
--
-- Provides a list of analysis segments for a real-time analysis session.
module Amazonka.ConnectContactLens.ListRealtimeContactAnalysisSegments
  ( -- * Creating a Request
    ListRealtimeContactAnalysisSegments (..),
    newListRealtimeContactAnalysisSegments,

    -- * Request Lenses
    listRealtimeContactAnalysisSegments_nextToken,
    listRealtimeContactAnalysisSegments_maxResults,
    listRealtimeContactAnalysisSegments_instanceId,
    listRealtimeContactAnalysisSegments_contactId,

    -- * Destructuring the Response
    ListRealtimeContactAnalysisSegmentsResponse (..),
    newListRealtimeContactAnalysisSegmentsResponse,

    -- * Response Lenses
    listRealtimeContactAnalysisSegmentsResponse_nextToken,
    listRealtimeContactAnalysisSegmentsResponse_httpStatus,
    listRealtimeContactAnalysisSegmentsResponse_segments,
  )
where

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

-- | /See:/ 'newListRealtimeContactAnalysisSegments' smart constructor.
data ListRealtimeContactAnalysisSegments = ListRealtimeContactAnalysisSegments'
  { -- | The token for the next set of results. Use the value returned in the
    -- previous response in the next request to retrieve the next set of
    -- results.
    ListRealtimeContactAnalysisSegments -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximimum number of results to return per page.
    ListRealtimeContactAnalysisSegments -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The identifier of the Amazon Connect instance.
    ListRealtimeContactAnalysisSegments -> Text
instanceId :: Prelude.Text,
    -- | The identifier of the contact.
    ListRealtimeContactAnalysisSegments -> Text
contactId :: Prelude.Text
  }
  deriving (ListRealtimeContactAnalysisSegments
-> ListRealtimeContactAnalysisSegments -> Bool
(ListRealtimeContactAnalysisSegments
 -> ListRealtimeContactAnalysisSegments -> Bool)
-> (ListRealtimeContactAnalysisSegments
    -> ListRealtimeContactAnalysisSegments -> Bool)
-> Eq ListRealtimeContactAnalysisSegments
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListRealtimeContactAnalysisSegments
-> ListRealtimeContactAnalysisSegments -> Bool
$c/= :: ListRealtimeContactAnalysisSegments
-> ListRealtimeContactAnalysisSegments -> Bool
== :: ListRealtimeContactAnalysisSegments
-> ListRealtimeContactAnalysisSegments -> Bool
$c== :: ListRealtimeContactAnalysisSegments
-> ListRealtimeContactAnalysisSegments -> Bool
Prelude.Eq, ReadPrec [ListRealtimeContactAnalysisSegments]
ReadPrec ListRealtimeContactAnalysisSegments
Int -> ReadS ListRealtimeContactAnalysisSegments
ReadS [ListRealtimeContactAnalysisSegments]
(Int -> ReadS ListRealtimeContactAnalysisSegments)
-> ReadS [ListRealtimeContactAnalysisSegments]
-> ReadPrec ListRealtimeContactAnalysisSegments
-> ReadPrec [ListRealtimeContactAnalysisSegments]
-> Read ListRealtimeContactAnalysisSegments
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListRealtimeContactAnalysisSegments]
$creadListPrec :: ReadPrec [ListRealtimeContactAnalysisSegments]
readPrec :: ReadPrec ListRealtimeContactAnalysisSegments
$creadPrec :: ReadPrec ListRealtimeContactAnalysisSegments
readList :: ReadS [ListRealtimeContactAnalysisSegments]
$creadList :: ReadS [ListRealtimeContactAnalysisSegments]
readsPrec :: Int -> ReadS ListRealtimeContactAnalysisSegments
$creadsPrec :: Int -> ReadS ListRealtimeContactAnalysisSegments
Prelude.Read, Int -> ListRealtimeContactAnalysisSegments -> ShowS
[ListRealtimeContactAnalysisSegments] -> ShowS
ListRealtimeContactAnalysisSegments -> String
(Int -> ListRealtimeContactAnalysisSegments -> ShowS)
-> (ListRealtimeContactAnalysisSegments -> String)
-> ([ListRealtimeContactAnalysisSegments] -> ShowS)
-> Show ListRealtimeContactAnalysisSegments
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListRealtimeContactAnalysisSegments] -> ShowS
$cshowList :: [ListRealtimeContactAnalysisSegments] -> ShowS
show :: ListRealtimeContactAnalysisSegments -> String
$cshow :: ListRealtimeContactAnalysisSegments -> String
showsPrec :: Int -> ListRealtimeContactAnalysisSegments -> ShowS
$cshowsPrec :: Int -> ListRealtimeContactAnalysisSegments -> ShowS
Prelude.Show, (forall x.
 ListRealtimeContactAnalysisSegments
 -> Rep ListRealtimeContactAnalysisSegments x)
-> (forall x.
    Rep ListRealtimeContactAnalysisSegments x
    -> ListRealtimeContactAnalysisSegments)
-> Generic ListRealtimeContactAnalysisSegments
forall x.
Rep ListRealtimeContactAnalysisSegments x
-> ListRealtimeContactAnalysisSegments
forall x.
ListRealtimeContactAnalysisSegments
-> Rep ListRealtimeContactAnalysisSegments x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListRealtimeContactAnalysisSegments x
-> ListRealtimeContactAnalysisSegments
$cfrom :: forall x.
ListRealtimeContactAnalysisSegments
-> Rep ListRealtimeContactAnalysisSegments x
Prelude.Generic)

-- |
-- Create a value of 'ListRealtimeContactAnalysisSegments' 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:
--
-- 'nextToken', 'listRealtimeContactAnalysisSegments_nextToken' - The token for the next set of results. Use the value returned in the
-- previous response in the next request to retrieve the next set of
-- results.
--
-- 'maxResults', 'listRealtimeContactAnalysisSegments_maxResults' - The maximimum number of results to return per page.
--
-- 'instanceId', 'listRealtimeContactAnalysisSegments_instanceId' - The identifier of the Amazon Connect instance.
--
-- 'contactId', 'listRealtimeContactAnalysisSegments_contactId' - The identifier of the contact.
newListRealtimeContactAnalysisSegments ::
  -- | 'instanceId'
  Prelude.Text ->
  -- | 'contactId'
  Prelude.Text ->
  ListRealtimeContactAnalysisSegments
newListRealtimeContactAnalysisSegments :: Text -> Text -> ListRealtimeContactAnalysisSegments
newListRealtimeContactAnalysisSegments
  Text
pInstanceId_
  Text
pContactId_ =
    ListRealtimeContactAnalysisSegments' :: Maybe Text
-> Maybe Natural
-> Text
-> Text
-> ListRealtimeContactAnalysisSegments
ListRealtimeContactAnalysisSegments'
      { $sel:nextToken:ListRealtimeContactAnalysisSegments' :: Maybe Text
nextToken =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:maxResults:ListRealtimeContactAnalysisSegments' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
        $sel:instanceId:ListRealtimeContactAnalysisSegments' :: Text
instanceId = Text
pInstanceId_,
        $sel:contactId:ListRealtimeContactAnalysisSegments' :: Text
contactId = Text
pContactId_
      }

-- | The token for the next set of results. Use the value returned in the
-- previous response in the next request to retrieve the next set of
-- results.
listRealtimeContactAnalysisSegments_nextToken :: Lens.Lens' ListRealtimeContactAnalysisSegments (Prelude.Maybe Prelude.Text)
listRealtimeContactAnalysisSegments_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListRealtimeContactAnalysisSegments
-> f ListRealtimeContactAnalysisSegments
listRealtimeContactAnalysisSegments_nextToken = (ListRealtimeContactAnalysisSegments -> Maybe Text)
-> (ListRealtimeContactAnalysisSegments
    -> Maybe Text -> ListRealtimeContactAnalysisSegments)
-> Lens
     ListRealtimeContactAnalysisSegments
     ListRealtimeContactAnalysisSegments
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRealtimeContactAnalysisSegments' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListRealtimeContactAnalysisSegments' :: ListRealtimeContactAnalysisSegments -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListRealtimeContactAnalysisSegments
s@ListRealtimeContactAnalysisSegments' {} Maybe Text
a -> ListRealtimeContactAnalysisSegments
s {$sel:nextToken:ListRealtimeContactAnalysisSegments' :: Maybe Text
nextToken = Maybe Text
a} :: ListRealtimeContactAnalysisSegments)

-- | The maximimum number of results to return per page.
listRealtimeContactAnalysisSegments_maxResults :: Lens.Lens' ListRealtimeContactAnalysisSegments (Prelude.Maybe Prelude.Natural)
listRealtimeContactAnalysisSegments_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListRealtimeContactAnalysisSegments
-> f ListRealtimeContactAnalysisSegments
listRealtimeContactAnalysisSegments_maxResults = (ListRealtimeContactAnalysisSegments -> Maybe Natural)
-> (ListRealtimeContactAnalysisSegments
    -> Maybe Natural -> ListRealtimeContactAnalysisSegments)
-> Lens
     ListRealtimeContactAnalysisSegments
     ListRealtimeContactAnalysisSegments
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRealtimeContactAnalysisSegments' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListRealtimeContactAnalysisSegments' :: ListRealtimeContactAnalysisSegments -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListRealtimeContactAnalysisSegments
s@ListRealtimeContactAnalysisSegments' {} Maybe Natural
a -> ListRealtimeContactAnalysisSegments
s {$sel:maxResults:ListRealtimeContactAnalysisSegments' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListRealtimeContactAnalysisSegments)

-- | The identifier of the Amazon Connect instance.
listRealtimeContactAnalysisSegments_instanceId :: Lens.Lens' ListRealtimeContactAnalysisSegments Prelude.Text
listRealtimeContactAnalysisSegments_instanceId :: (Text -> f Text)
-> ListRealtimeContactAnalysisSegments
-> f ListRealtimeContactAnalysisSegments
listRealtimeContactAnalysisSegments_instanceId = (ListRealtimeContactAnalysisSegments -> Text)
-> (ListRealtimeContactAnalysisSegments
    -> Text -> ListRealtimeContactAnalysisSegments)
-> Lens
     ListRealtimeContactAnalysisSegments
     ListRealtimeContactAnalysisSegments
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRealtimeContactAnalysisSegments' {Text
instanceId :: Text
$sel:instanceId:ListRealtimeContactAnalysisSegments' :: ListRealtimeContactAnalysisSegments -> Text
instanceId} -> Text
instanceId) (\s :: ListRealtimeContactAnalysisSegments
s@ListRealtimeContactAnalysisSegments' {} Text
a -> ListRealtimeContactAnalysisSegments
s {$sel:instanceId:ListRealtimeContactAnalysisSegments' :: Text
instanceId = Text
a} :: ListRealtimeContactAnalysisSegments)

-- | The identifier of the contact.
listRealtimeContactAnalysisSegments_contactId :: Lens.Lens' ListRealtimeContactAnalysisSegments Prelude.Text
listRealtimeContactAnalysisSegments_contactId :: (Text -> f Text)
-> ListRealtimeContactAnalysisSegments
-> f ListRealtimeContactAnalysisSegments
listRealtimeContactAnalysisSegments_contactId = (ListRealtimeContactAnalysisSegments -> Text)
-> (ListRealtimeContactAnalysisSegments
    -> Text -> ListRealtimeContactAnalysisSegments)
-> Lens
     ListRealtimeContactAnalysisSegments
     ListRealtimeContactAnalysisSegments
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRealtimeContactAnalysisSegments' {Text
contactId :: Text
$sel:contactId:ListRealtimeContactAnalysisSegments' :: ListRealtimeContactAnalysisSegments -> Text
contactId} -> Text
contactId) (\s :: ListRealtimeContactAnalysisSegments
s@ListRealtimeContactAnalysisSegments' {} Text
a -> ListRealtimeContactAnalysisSegments
s {$sel:contactId:ListRealtimeContactAnalysisSegments' :: Text
contactId = Text
a} :: ListRealtimeContactAnalysisSegments)

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

instance
  Prelude.Hashable
    ListRealtimeContactAnalysisSegments

instance
  Prelude.NFData
    ListRealtimeContactAnalysisSegments

instance
  Core.ToHeaders
    ListRealtimeContactAnalysisSegments
  where
  toHeaders :: ListRealtimeContactAnalysisSegments -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> ListRealtimeContactAnalysisSegments -> 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.ToJSON
    ListRealtimeContactAnalysisSegments
  where
  toJSON :: ListRealtimeContactAnalysisSegments -> Value
toJSON ListRealtimeContactAnalysisSegments' {Maybe Natural
Maybe Text
Text
contactId :: Text
instanceId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:contactId:ListRealtimeContactAnalysisSegments' :: ListRealtimeContactAnalysisSegments -> Text
$sel:instanceId:ListRealtimeContactAnalysisSegments' :: ListRealtimeContactAnalysisSegments -> Text
$sel:maxResults:ListRealtimeContactAnalysisSegments' :: ListRealtimeContactAnalysisSegments -> Maybe Natural
$sel:nextToken:ListRealtimeContactAnalysisSegments' :: ListRealtimeContactAnalysisSegments -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"NextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Text
"MaxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"InstanceId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
instanceId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ContactId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
contactId)
          ]
      )

instance
  Core.ToPath
    ListRealtimeContactAnalysisSegments
  where
  toPath :: ListRealtimeContactAnalysisSegments -> ByteString
toPath =
    ByteString -> ListRealtimeContactAnalysisSegments -> ByteString
forall a b. a -> b -> a
Prelude.const
      ByteString
"/realtime-contact-analysis/analysis-segments"

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

-- | /See:/ 'newListRealtimeContactAnalysisSegmentsResponse' smart constructor.
data ListRealtimeContactAnalysisSegmentsResponse = ListRealtimeContactAnalysisSegmentsResponse'
  { -- | If there are additional results, this is the token for the next set of
    -- results. If response includes @nextToken@ there are two possible
    -- scenarios:
    --
    -- -   There are more segments so another call is required to get them.
    --
    -- -   There are no more segments at this time, but more may be available
    --     later (real-time analysis is in progress) so the client should call
    --     the operation again to get new segments.
    --
    -- If response does not include @nextToken@, the analysis is completed
    -- (successfully or failed) and there are no more segments to retrieve.
    ListRealtimeContactAnalysisSegmentsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListRealtimeContactAnalysisSegmentsResponse -> Int
httpStatus :: Prelude.Int,
    -- | An analyzed transcript or category.
    ListRealtimeContactAnalysisSegmentsResponse
-> [RealtimeContactAnalysisSegment]
segments :: [RealtimeContactAnalysisSegment]
  }
  deriving (ListRealtimeContactAnalysisSegmentsResponse
-> ListRealtimeContactAnalysisSegmentsResponse -> Bool
(ListRealtimeContactAnalysisSegmentsResponse
 -> ListRealtimeContactAnalysisSegmentsResponse -> Bool)
-> (ListRealtimeContactAnalysisSegmentsResponse
    -> ListRealtimeContactAnalysisSegmentsResponse -> Bool)
-> Eq ListRealtimeContactAnalysisSegmentsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListRealtimeContactAnalysisSegmentsResponse
-> ListRealtimeContactAnalysisSegmentsResponse -> Bool
$c/= :: ListRealtimeContactAnalysisSegmentsResponse
-> ListRealtimeContactAnalysisSegmentsResponse -> Bool
== :: ListRealtimeContactAnalysisSegmentsResponse
-> ListRealtimeContactAnalysisSegmentsResponse -> Bool
$c== :: ListRealtimeContactAnalysisSegmentsResponse
-> ListRealtimeContactAnalysisSegmentsResponse -> Bool
Prelude.Eq, ReadPrec [ListRealtimeContactAnalysisSegmentsResponse]
ReadPrec ListRealtimeContactAnalysisSegmentsResponse
Int -> ReadS ListRealtimeContactAnalysisSegmentsResponse
ReadS [ListRealtimeContactAnalysisSegmentsResponse]
(Int -> ReadS ListRealtimeContactAnalysisSegmentsResponse)
-> ReadS [ListRealtimeContactAnalysisSegmentsResponse]
-> ReadPrec ListRealtimeContactAnalysisSegmentsResponse
-> ReadPrec [ListRealtimeContactAnalysisSegmentsResponse]
-> Read ListRealtimeContactAnalysisSegmentsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListRealtimeContactAnalysisSegmentsResponse]
$creadListPrec :: ReadPrec [ListRealtimeContactAnalysisSegmentsResponse]
readPrec :: ReadPrec ListRealtimeContactAnalysisSegmentsResponse
$creadPrec :: ReadPrec ListRealtimeContactAnalysisSegmentsResponse
readList :: ReadS [ListRealtimeContactAnalysisSegmentsResponse]
$creadList :: ReadS [ListRealtimeContactAnalysisSegmentsResponse]
readsPrec :: Int -> ReadS ListRealtimeContactAnalysisSegmentsResponse
$creadsPrec :: Int -> ReadS ListRealtimeContactAnalysisSegmentsResponse
Prelude.Read, Int -> ListRealtimeContactAnalysisSegmentsResponse -> ShowS
[ListRealtimeContactAnalysisSegmentsResponse] -> ShowS
ListRealtimeContactAnalysisSegmentsResponse -> String
(Int -> ListRealtimeContactAnalysisSegmentsResponse -> ShowS)
-> (ListRealtimeContactAnalysisSegmentsResponse -> String)
-> ([ListRealtimeContactAnalysisSegmentsResponse] -> ShowS)
-> Show ListRealtimeContactAnalysisSegmentsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListRealtimeContactAnalysisSegmentsResponse] -> ShowS
$cshowList :: [ListRealtimeContactAnalysisSegmentsResponse] -> ShowS
show :: ListRealtimeContactAnalysisSegmentsResponse -> String
$cshow :: ListRealtimeContactAnalysisSegmentsResponse -> String
showsPrec :: Int -> ListRealtimeContactAnalysisSegmentsResponse -> ShowS
$cshowsPrec :: Int -> ListRealtimeContactAnalysisSegmentsResponse -> ShowS
Prelude.Show, (forall x.
 ListRealtimeContactAnalysisSegmentsResponse
 -> Rep ListRealtimeContactAnalysisSegmentsResponse x)
-> (forall x.
    Rep ListRealtimeContactAnalysisSegmentsResponse x
    -> ListRealtimeContactAnalysisSegmentsResponse)
-> Generic ListRealtimeContactAnalysisSegmentsResponse
forall x.
Rep ListRealtimeContactAnalysisSegmentsResponse x
-> ListRealtimeContactAnalysisSegmentsResponse
forall x.
ListRealtimeContactAnalysisSegmentsResponse
-> Rep ListRealtimeContactAnalysisSegmentsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListRealtimeContactAnalysisSegmentsResponse x
-> ListRealtimeContactAnalysisSegmentsResponse
$cfrom :: forall x.
ListRealtimeContactAnalysisSegmentsResponse
-> Rep ListRealtimeContactAnalysisSegmentsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListRealtimeContactAnalysisSegmentsResponse' 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:
--
-- 'nextToken', 'listRealtimeContactAnalysisSegmentsResponse_nextToken' - If there are additional results, this is the token for the next set of
-- results. If response includes @nextToken@ there are two possible
-- scenarios:
--
-- -   There are more segments so another call is required to get them.
--
-- -   There are no more segments at this time, but more may be available
--     later (real-time analysis is in progress) so the client should call
--     the operation again to get new segments.
--
-- If response does not include @nextToken@, the analysis is completed
-- (successfully or failed) and there are no more segments to retrieve.
--
-- 'httpStatus', 'listRealtimeContactAnalysisSegmentsResponse_httpStatus' - The response's http status code.
--
-- 'segments', 'listRealtimeContactAnalysisSegmentsResponse_segments' - An analyzed transcript or category.
newListRealtimeContactAnalysisSegmentsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListRealtimeContactAnalysisSegmentsResponse
newListRealtimeContactAnalysisSegmentsResponse :: Int -> ListRealtimeContactAnalysisSegmentsResponse
newListRealtimeContactAnalysisSegmentsResponse
  Int
pHttpStatus_ =
    ListRealtimeContactAnalysisSegmentsResponse' :: Maybe Text
-> Int
-> [RealtimeContactAnalysisSegment]
-> ListRealtimeContactAnalysisSegmentsResponse
ListRealtimeContactAnalysisSegmentsResponse'
      { $sel:nextToken:ListRealtimeContactAnalysisSegmentsResponse' :: Maybe Text
nextToken =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:ListRealtimeContactAnalysisSegmentsResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:segments:ListRealtimeContactAnalysisSegmentsResponse' :: [RealtimeContactAnalysisSegment]
segments = [RealtimeContactAnalysisSegment]
forall a. Monoid a => a
Prelude.mempty
      }

-- | If there are additional results, this is the token for the next set of
-- results. If response includes @nextToken@ there are two possible
-- scenarios:
--
-- -   There are more segments so another call is required to get them.
--
-- -   There are no more segments at this time, but more may be available
--     later (real-time analysis is in progress) so the client should call
--     the operation again to get new segments.
--
-- If response does not include @nextToken@, the analysis is completed
-- (successfully or failed) and there are no more segments to retrieve.
listRealtimeContactAnalysisSegmentsResponse_nextToken :: Lens.Lens' ListRealtimeContactAnalysisSegmentsResponse (Prelude.Maybe Prelude.Text)
listRealtimeContactAnalysisSegmentsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListRealtimeContactAnalysisSegmentsResponse
-> f ListRealtimeContactAnalysisSegmentsResponse
listRealtimeContactAnalysisSegmentsResponse_nextToken = (ListRealtimeContactAnalysisSegmentsResponse -> Maybe Text)
-> (ListRealtimeContactAnalysisSegmentsResponse
    -> Maybe Text -> ListRealtimeContactAnalysisSegmentsResponse)
-> Lens
     ListRealtimeContactAnalysisSegmentsResponse
     ListRealtimeContactAnalysisSegmentsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRealtimeContactAnalysisSegmentsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListRealtimeContactAnalysisSegmentsResponse' :: ListRealtimeContactAnalysisSegmentsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListRealtimeContactAnalysisSegmentsResponse
s@ListRealtimeContactAnalysisSegmentsResponse' {} Maybe Text
a -> ListRealtimeContactAnalysisSegmentsResponse
s {$sel:nextToken:ListRealtimeContactAnalysisSegmentsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListRealtimeContactAnalysisSegmentsResponse)

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

-- | An analyzed transcript or category.
listRealtimeContactAnalysisSegmentsResponse_segments :: Lens.Lens' ListRealtimeContactAnalysisSegmentsResponse [RealtimeContactAnalysisSegment]
listRealtimeContactAnalysisSegmentsResponse_segments :: ([RealtimeContactAnalysisSegment]
 -> f [RealtimeContactAnalysisSegment])
-> ListRealtimeContactAnalysisSegmentsResponse
-> f ListRealtimeContactAnalysisSegmentsResponse
listRealtimeContactAnalysisSegmentsResponse_segments = (ListRealtimeContactAnalysisSegmentsResponse
 -> [RealtimeContactAnalysisSegment])
-> (ListRealtimeContactAnalysisSegmentsResponse
    -> [RealtimeContactAnalysisSegment]
    -> ListRealtimeContactAnalysisSegmentsResponse)
-> Lens
     ListRealtimeContactAnalysisSegmentsResponse
     ListRealtimeContactAnalysisSegmentsResponse
     [RealtimeContactAnalysisSegment]
     [RealtimeContactAnalysisSegment]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRealtimeContactAnalysisSegmentsResponse' {[RealtimeContactAnalysisSegment]
segments :: [RealtimeContactAnalysisSegment]
$sel:segments:ListRealtimeContactAnalysisSegmentsResponse' :: ListRealtimeContactAnalysisSegmentsResponse
-> [RealtimeContactAnalysisSegment]
segments} -> [RealtimeContactAnalysisSegment]
segments) (\s :: ListRealtimeContactAnalysisSegmentsResponse
s@ListRealtimeContactAnalysisSegmentsResponse' {} [RealtimeContactAnalysisSegment]
a -> ListRealtimeContactAnalysisSegmentsResponse
s {$sel:segments:ListRealtimeContactAnalysisSegmentsResponse' :: [RealtimeContactAnalysisSegment]
segments = [RealtimeContactAnalysisSegment]
a} :: ListRealtimeContactAnalysisSegmentsResponse) (([RealtimeContactAnalysisSegment]
  -> f [RealtimeContactAnalysisSegment])
 -> ListRealtimeContactAnalysisSegmentsResponse
 -> f ListRealtimeContactAnalysisSegmentsResponse)
-> (([RealtimeContactAnalysisSegment]
     -> f [RealtimeContactAnalysisSegment])
    -> [RealtimeContactAnalysisSegment]
    -> f [RealtimeContactAnalysisSegment])
-> ([RealtimeContactAnalysisSegment]
    -> f [RealtimeContactAnalysisSegment])
-> ListRealtimeContactAnalysisSegmentsResponse
-> f ListRealtimeContactAnalysisSegmentsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([RealtimeContactAnalysisSegment]
 -> f [RealtimeContactAnalysisSegment])
-> [RealtimeContactAnalysisSegment]
-> f [RealtimeContactAnalysisSegment]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Prelude.NFData
    ListRealtimeContactAnalysisSegmentsResponse