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

    -- * Request Lenses
    listRealtimeContactAnalysisSegments_maxResults,
    listRealtimeContactAnalysisSegments_nextToken,
    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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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 maximimum number of results to return per page.
    ListRealtimeContactAnalysisSegments -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | 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 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
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]
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
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.
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:
--
-- 'maxResults', 'listRealtimeContactAnalysisSegments_maxResults' - The maximimum number of results to return per page.
--
-- '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.
--
-- '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'
      { $sel:maxResults:ListRealtimeContactAnalysisSegments' :: Maybe Natural
maxResults =
          forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:ListRealtimeContactAnalysisSegments' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
        $sel:instanceId:ListRealtimeContactAnalysisSegments' :: Text
instanceId = Text
pInstanceId_,
        $sel:contactId:ListRealtimeContactAnalysisSegments' :: Text
contactId = Text
pContactId_
      }

-- | The maximimum number of results to return per page.
listRealtimeContactAnalysisSegments_maxResults :: Lens.Lens' ListRealtimeContactAnalysisSegments (Prelude.Maybe Prelude.Natural)
listRealtimeContactAnalysisSegments_maxResults :: Lens' ListRealtimeContactAnalysisSegments (Maybe Natural)
listRealtimeContactAnalysisSegments_maxResults = 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 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 :: Lens' ListRealtimeContactAnalysisSegments (Maybe Text)
listRealtimeContactAnalysisSegments_nextToken = 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 identifier of the Amazon Connect instance.
listRealtimeContactAnalysisSegments_instanceId :: Lens.Lens' ListRealtimeContactAnalysisSegments Prelude.Text
listRealtimeContactAnalysisSegments_instanceId :: Lens' ListRealtimeContactAnalysisSegments Text
listRealtimeContactAnalysisSegments_instanceId = 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 :: Lens' ListRealtimeContactAnalysisSegments Text
listRealtimeContactAnalysisSegments_contactId = 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 :: (Service -> Service)
-> ListRealtimeContactAnalysisSegments
-> Request ListRealtimeContactAnalysisSegments
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 ListRealtimeContactAnalysisSegments
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse ListRealtimeContactAnalysisSegments)))
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 Text
-> Int
-> [RealtimeContactAnalysisSegment]
-> ListRealtimeContactAnalysisSegmentsResponse
ListRealtimeContactAnalysisSegmentsResponse'
            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
"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))
            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
"Segments" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
      )

instance
  Prelude.Hashable
    ListRealtimeContactAnalysisSegments
  where
  hashWithSalt :: Int -> ListRealtimeContactAnalysisSegments -> Int
hashWithSalt
    Int
_salt
    ListRealtimeContactAnalysisSegments' {Maybe Natural
Maybe Text
Text
contactId :: Text
instanceId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:contactId:ListRealtimeContactAnalysisSegments' :: ListRealtimeContactAnalysisSegments -> Text
$sel:instanceId:ListRealtimeContactAnalysisSegments' :: ListRealtimeContactAnalysisSegments -> Text
$sel:nextToken:ListRealtimeContactAnalysisSegments' :: ListRealtimeContactAnalysisSegments -> Maybe Text
$sel:maxResults:ListRealtimeContactAnalysisSegments' :: ListRealtimeContactAnalysisSegments -> Maybe Natural
..} =
      Int
_salt
        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` Text
instanceId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
contactId

instance
  Prelude.NFData
    ListRealtimeContactAnalysisSegments
  where
  rnf :: ListRealtimeContactAnalysisSegments -> ()
rnf ListRealtimeContactAnalysisSegments' {Maybe Natural
Maybe Text
Text
contactId :: Text
instanceId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:contactId:ListRealtimeContactAnalysisSegments' :: ListRealtimeContactAnalysisSegments -> Text
$sel:instanceId:ListRealtimeContactAnalysisSegments' :: ListRealtimeContactAnalysisSegments -> Text
$sel:nextToken:ListRealtimeContactAnalysisSegments' :: ListRealtimeContactAnalysisSegments -> Maybe Text
$sel:maxResults:ListRealtimeContactAnalysisSegments' :: ListRealtimeContactAnalysisSegments -> Maybe Natural
..} =
    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 Text
instanceId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
contactId

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

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

instance
  Data.ToQuery
    ListRealtimeContactAnalysisSegments
  where
  toQuery :: ListRealtimeContactAnalysisSegments -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const 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
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]
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
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.
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'
      { $sel:nextToken:ListRealtimeContactAnalysisSegmentsResponse' :: Maybe Text
nextToken =
          forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:ListRealtimeContactAnalysisSegmentsResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:segments:ListRealtimeContactAnalysisSegmentsResponse' :: [RealtimeContactAnalysisSegment]
segments = 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 :: Lens' ListRealtimeContactAnalysisSegmentsResponse (Maybe Text)
listRealtimeContactAnalysisSegmentsResponse_nextToken = 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 :: Lens' ListRealtimeContactAnalysisSegmentsResponse Int
listRealtimeContactAnalysisSegmentsResponse_httpStatus = 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 :: Lens'
  ListRealtimeContactAnalysisSegmentsResponse
  [RealtimeContactAnalysisSegment]
listRealtimeContactAnalysisSegmentsResponse_segments = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Prelude.NFData
    ListRealtimeContactAnalysisSegmentsResponse
  where
  rnf :: ListRealtimeContactAnalysisSegmentsResponse -> ()
rnf ListRealtimeContactAnalysisSegmentsResponse' {Int
[RealtimeContactAnalysisSegment]
Maybe Text
segments :: [RealtimeContactAnalysisSegment]
httpStatus :: Int
nextToken :: Maybe Text
$sel:segments:ListRealtimeContactAnalysisSegmentsResponse' :: ListRealtimeContactAnalysisSegmentsResponse
-> [RealtimeContactAnalysisSegment]
$sel:httpStatus:ListRealtimeContactAnalysisSegmentsResponse' :: ListRealtimeContactAnalysisSegmentsResponse -> Int
$sel:nextToken:ListRealtimeContactAnalysisSegmentsResponse' :: ListRealtimeContactAnalysisSegmentsResponse -> Maybe Text
..} =
    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
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [RealtimeContactAnalysisSegment]
segments