{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.ConnectContactLens.Types.Transcript where
import Amazonka.ConnectContactLens.Types.IssueDetected
import Amazonka.ConnectContactLens.Types.SentimentValue
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Transcript = Transcript'
{
Transcript -> Maybe [IssueDetected]
issuesDetected :: Prelude.Maybe [IssueDetected],
Transcript -> Text
id :: Prelude.Text,
Transcript -> Text
participantId :: Prelude.Text,
Transcript -> Text
participantRole :: Prelude.Text,
Transcript -> Text
content :: Prelude.Text,
Transcript -> Natural
beginOffsetMillis :: Prelude.Natural,
Transcript -> Natural
endOffsetMillis :: Prelude.Natural,
Transcript -> SentimentValue
sentiment :: SentimentValue
}
deriving (Transcript -> Transcript -> Bool
(Transcript -> Transcript -> Bool)
-> (Transcript -> Transcript -> Bool) -> Eq Transcript
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Transcript -> Transcript -> Bool
$c/= :: Transcript -> Transcript -> Bool
== :: Transcript -> Transcript -> Bool
$c== :: Transcript -> Transcript -> Bool
Prelude.Eq, ReadPrec [Transcript]
ReadPrec Transcript
Int -> ReadS Transcript
ReadS [Transcript]
(Int -> ReadS Transcript)
-> ReadS [Transcript]
-> ReadPrec Transcript
-> ReadPrec [Transcript]
-> Read Transcript
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Transcript]
$creadListPrec :: ReadPrec [Transcript]
readPrec :: ReadPrec Transcript
$creadPrec :: ReadPrec Transcript
readList :: ReadS [Transcript]
$creadList :: ReadS [Transcript]
readsPrec :: Int -> ReadS Transcript
$creadsPrec :: Int -> ReadS Transcript
Prelude.Read, Int -> Transcript -> ShowS
[Transcript] -> ShowS
Transcript -> String
(Int -> Transcript -> ShowS)
-> (Transcript -> String)
-> ([Transcript] -> ShowS)
-> Show Transcript
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Transcript] -> ShowS
$cshowList :: [Transcript] -> ShowS
show :: Transcript -> String
$cshow :: Transcript -> String
showsPrec :: Int -> Transcript -> ShowS
$cshowsPrec :: Int -> Transcript -> ShowS
Prelude.Show, (forall x. Transcript -> Rep Transcript x)
-> (forall x. Rep Transcript x -> Transcript) -> Generic Transcript
forall x. Rep Transcript x -> Transcript
forall x. Transcript -> Rep Transcript x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Transcript x -> Transcript
$cfrom :: forall x. Transcript -> Rep Transcript x
Prelude.Generic)
newTranscript ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Natural ->
Prelude.Natural ->
SentimentValue ->
Transcript
newTranscript :: Text
-> Text
-> Text
-> Text
-> Natural
-> Natural
-> SentimentValue
-> Transcript
newTranscript
Text
pId_
Text
pParticipantId_
Text
pParticipantRole_
Text
pContent_
Natural
pBeginOffsetMillis_
Natural
pEndOffsetMillis_
SentimentValue
pSentiment_ =
Transcript' :: Maybe [IssueDetected]
-> Text
-> Text
-> Text
-> Text
-> Natural
-> Natural
-> SentimentValue
-> Transcript
Transcript'
{ $sel:issuesDetected:Transcript' :: Maybe [IssueDetected]
issuesDetected = Maybe [IssueDetected]
forall a. Maybe a
Prelude.Nothing,
$sel:id:Transcript' :: Text
id = Text
pId_,
$sel:participantId:Transcript' :: Text
participantId = Text
pParticipantId_,
$sel:participantRole:Transcript' :: Text
participantRole = Text
pParticipantRole_,
$sel:content:Transcript' :: Text
content = Text
pContent_,
$sel:beginOffsetMillis:Transcript' :: Natural
beginOffsetMillis = Natural
pBeginOffsetMillis_,
$sel:endOffsetMillis:Transcript' :: Natural
endOffsetMillis = Natural
pEndOffsetMillis_,
$sel:sentiment:Transcript' :: SentimentValue
sentiment = SentimentValue
pSentiment_
}
transcript_issuesDetected :: Lens.Lens' Transcript (Prelude.Maybe [IssueDetected])
transcript_issuesDetected :: (Maybe [IssueDetected] -> f (Maybe [IssueDetected]))
-> Transcript -> f Transcript
transcript_issuesDetected = (Transcript -> Maybe [IssueDetected])
-> (Transcript -> Maybe [IssueDetected] -> Transcript)
-> Lens
Transcript
Transcript
(Maybe [IssueDetected])
(Maybe [IssueDetected])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Transcript' {Maybe [IssueDetected]
issuesDetected :: Maybe [IssueDetected]
$sel:issuesDetected:Transcript' :: Transcript -> Maybe [IssueDetected]
issuesDetected} -> Maybe [IssueDetected]
issuesDetected) (\s :: Transcript
s@Transcript' {} Maybe [IssueDetected]
a -> Transcript
s {$sel:issuesDetected:Transcript' :: Maybe [IssueDetected]
issuesDetected = Maybe [IssueDetected]
a} :: Transcript) ((Maybe [IssueDetected] -> f (Maybe [IssueDetected]))
-> Transcript -> f Transcript)
-> ((Maybe [IssueDetected] -> f (Maybe [IssueDetected]))
-> Maybe [IssueDetected] -> f (Maybe [IssueDetected]))
-> (Maybe [IssueDetected] -> f (Maybe [IssueDetected]))
-> Transcript
-> f Transcript
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[IssueDetected] [IssueDetected] [IssueDetected] [IssueDetected]
-> Iso
(Maybe [IssueDetected])
(Maybe [IssueDetected])
(Maybe [IssueDetected])
(Maybe [IssueDetected])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
[IssueDetected] [IssueDetected] [IssueDetected] [IssueDetected]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
transcript_id :: Lens.Lens' Transcript Prelude.Text
transcript_id :: (Text -> f Text) -> Transcript -> f Transcript
transcript_id = (Transcript -> Text)
-> (Transcript -> Text -> Transcript)
-> Lens Transcript Transcript Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Transcript' {Text
id :: Text
$sel:id:Transcript' :: Transcript -> Text
id} -> Text
id) (\s :: Transcript
s@Transcript' {} Text
a -> Transcript
s {$sel:id:Transcript' :: Text
id = Text
a} :: Transcript)
transcript_participantId :: Lens.Lens' Transcript Prelude.Text
transcript_participantId :: (Text -> f Text) -> Transcript -> f Transcript
transcript_participantId = (Transcript -> Text)
-> (Transcript -> Text -> Transcript)
-> Lens Transcript Transcript Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Transcript' {Text
participantId :: Text
$sel:participantId:Transcript' :: Transcript -> Text
participantId} -> Text
participantId) (\s :: Transcript
s@Transcript' {} Text
a -> Transcript
s {$sel:participantId:Transcript' :: Text
participantId = Text
a} :: Transcript)
transcript_participantRole :: Lens.Lens' Transcript Prelude.Text
transcript_participantRole :: (Text -> f Text) -> Transcript -> f Transcript
transcript_participantRole = (Transcript -> Text)
-> (Transcript -> Text -> Transcript)
-> Lens Transcript Transcript Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Transcript' {Text
participantRole :: Text
$sel:participantRole:Transcript' :: Transcript -> Text
participantRole} -> Text
participantRole) (\s :: Transcript
s@Transcript' {} Text
a -> Transcript
s {$sel:participantRole:Transcript' :: Text
participantRole = Text
a} :: Transcript)
transcript_content :: Lens.Lens' Transcript Prelude.Text
transcript_content :: (Text -> f Text) -> Transcript -> f Transcript
transcript_content = (Transcript -> Text)
-> (Transcript -> Text -> Transcript)
-> Lens Transcript Transcript Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Transcript' {Text
content :: Text
$sel:content:Transcript' :: Transcript -> Text
content} -> Text
content) (\s :: Transcript
s@Transcript' {} Text
a -> Transcript
s {$sel:content:Transcript' :: Text
content = Text
a} :: Transcript)
transcript_beginOffsetMillis :: Lens.Lens' Transcript Prelude.Natural
transcript_beginOffsetMillis :: (Natural -> f Natural) -> Transcript -> f Transcript
transcript_beginOffsetMillis = (Transcript -> Natural)
-> (Transcript -> Natural -> Transcript)
-> Lens Transcript Transcript Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Transcript' {Natural
beginOffsetMillis :: Natural
$sel:beginOffsetMillis:Transcript' :: Transcript -> Natural
beginOffsetMillis} -> Natural
beginOffsetMillis) (\s :: Transcript
s@Transcript' {} Natural
a -> Transcript
s {$sel:beginOffsetMillis:Transcript' :: Natural
beginOffsetMillis = Natural
a} :: Transcript)
transcript_endOffsetMillis :: Lens.Lens' Transcript Prelude.Natural
transcript_endOffsetMillis :: (Natural -> f Natural) -> Transcript -> f Transcript
transcript_endOffsetMillis = (Transcript -> Natural)
-> (Transcript -> Natural -> Transcript)
-> Lens Transcript Transcript Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Transcript' {Natural
endOffsetMillis :: Natural
$sel:endOffsetMillis:Transcript' :: Transcript -> Natural
endOffsetMillis} -> Natural
endOffsetMillis) (\s :: Transcript
s@Transcript' {} Natural
a -> Transcript
s {$sel:endOffsetMillis:Transcript' :: Natural
endOffsetMillis = Natural
a} :: Transcript)
transcript_sentiment :: Lens.Lens' Transcript SentimentValue
transcript_sentiment :: (SentimentValue -> f SentimentValue) -> Transcript -> f Transcript
transcript_sentiment = (Transcript -> SentimentValue)
-> (Transcript -> SentimentValue -> Transcript)
-> Lens Transcript Transcript SentimentValue SentimentValue
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Transcript' {SentimentValue
sentiment :: SentimentValue
$sel:sentiment:Transcript' :: Transcript -> SentimentValue
sentiment} -> SentimentValue
sentiment) (\s :: Transcript
s@Transcript' {} SentimentValue
a -> Transcript
s {$sel:sentiment:Transcript' :: SentimentValue
sentiment = SentimentValue
a} :: Transcript)
instance Core.FromJSON Transcript where
parseJSON :: Value -> Parser Transcript
parseJSON =
String
-> (Object -> Parser Transcript) -> Value -> Parser Transcript
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Transcript"
( \Object
x ->
Maybe [IssueDetected]
-> Text
-> Text
-> Text
-> Text
-> Natural
-> Natural
-> SentimentValue
-> Transcript
Transcript'
(Maybe [IssueDetected]
-> Text
-> Text
-> Text
-> Text
-> Natural
-> Natural
-> SentimentValue
-> Transcript)
-> Parser (Maybe [IssueDetected])
-> Parser
(Text
-> Text
-> Text
-> Text
-> Natural
-> Natural
-> SentimentValue
-> Transcript)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [IssueDetected]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"IssuesDetected" Parser (Maybe (Maybe [IssueDetected]))
-> Maybe [IssueDetected] -> Parser (Maybe [IssueDetected])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [IssueDetected]
forall a. Monoid a => a
Prelude.mempty)
Parser
(Text
-> Text
-> Text
-> Text
-> Natural
-> Natural
-> SentimentValue
-> Transcript)
-> Parser Text
-> Parser
(Text
-> Text
-> Text
-> Natural
-> Natural
-> SentimentValue
-> Transcript)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Id")
Parser
(Text
-> Text
-> Text
-> Natural
-> Natural
-> SentimentValue
-> Transcript)
-> Parser Text
-> Parser
(Text
-> Text -> Natural -> Natural -> SentimentValue -> Transcript)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ParticipantId")
Parser
(Text
-> Text -> Natural -> Natural -> SentimentValue -> Transcript)
-> Parser Text
-> Parser
(Text -> Natural -> Natural -> SentimentValue -> Transcript)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ParticipantRole")
Parser (Text -> Natural -> Natural -> SentimentValue -> Transcript)
-> Parser Text
-> Parser (Natural -> Natural -> SentimentValue -> Transcript)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Content")
Parser (Natural -> Natural -> SentimentValue -> Transcript)
-> Parser Natural
-> Parser (Natural -> SentimentValue -> Transcript)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Natural
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"BeginOffsetMillis")
Parser (Natural -> SentimentValue -> Transcript)
-> Parser Natural -> Parser (SentimentValue -> Transcript)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Natural
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"EndOffsetMillis")
Parser (SentimentValue -> Transcript)
-> Parser SentimentValue -> Parser Transcript
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser SentimentValue
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Sentiment")
)
instance Prelude.Hashable Transcript
instance Prelude.NFData Transcript