{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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'
{ $sel:issuesDetected:Transcript' :: Maybe [IssueDetected]
issuesDetected = 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 :: Lens' Transcript (Maybe [IssueDetected])
transcript_issuesDetected = 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) 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
transcript_id :: Lens.Lens' Transcript Prelude.Text
transcript_id :: Lens' Transcript Text
transcript_id = 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 :: Lens' Transcript Text
transcript_participantId = 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 :: Lens' Transcript Text
transcript_participantRole = 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 :: Lens' Transcript Text
transcript_content = 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 :: Lens' Transcript Natural
transcript_beginOffsetMillis = 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 :: Lens' Transcript Natural
transcript_endOffsetMillis = 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 :: Lens' Transcript SentimentValue
transcript_sentiment = 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 Data.FromJSON Transcript where
parseJSON :: Value -> Parser Transcript
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Transcript"
( \Object
x ->
Maybe [IssueDetected]
-> Text
-> Text
-> Text
-> Text
-> Natural
-> Natural
-> SentimentValue
-> Transcript
Transcript'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"IssuesDetected" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= 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 -> Parser a
Data..: Key
"Id")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ParticipantId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ParticipantRole")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Content")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"BeginOffsetMillis")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"EndOffsetMillis")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Sentiment")
)
instance Prelude.Hashable Transcript where
hashWithSalt :: Int -> Transcript -> Int
hashWithSalt Int
_salt Transcript' {Natural
Maybe [IssueDetected]
Text
SentimentValue
sentiment :: SentimentValue
endOffsetMillis :: Natural
beginOffsetMillis :: Natural
content :: Text
participantRole :: Text
participantId :: Text
id :: Text
issuesDetected :: Maybe [IssueDetected]
$sel:sentiment:Transcript' :: Transcript -> SentimentValue
$sel:endOffsetMillis:Transcript' :: Transcript -> Natural
$sel:beginOffsetMillis:Transcript' :: Transcript -> Natural
$sel:content:Transcript' :: Transcript -> Text
$sel:participantRole:Transcript' :: Transcript -> Text
$sel:participantId:Transcript' :: Transcript -> Text
$sel:id:Transcript' :: Transcript -> Text
$sel:issuesDetected:Transcript' :: Transcript -> Maybe [IssueDetected]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [IssueDetected]
issuesDetected
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
id
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
participantId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
participantRole
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
content
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
beginOffsetMillis
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
endOffsetMillis
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` SentimentValue
sentiment
instance Prelude.NFData Transcript where
rnf :: Transcript -> ()
rnf Transcript' {Natural
Maybe [IssueDetected]
Text
SentimentValue
sentiment :: SentimentValue
endOffsetMillis :: Natural
beginOffsetMillis :: Natural
content :: Text
participantRole :: Text
participantId :: Text
id :: Text
issuesDetected :: Maybe [IssueDetected]
$sel:sentiment:Transcript' :: Transcript -> SentimentValue
$sel:endOffsetMillis:Transcript' :: Transcript -> Natural
$sel:beginOffsetMillis:Transcript' :: Transcript -> Natural
$sel:content:Transcript' :: Transcript -> Text
$sel:participantRole:Transcript' :: Transcript -> Text
$sel:participantId:Transcript' :: Transcript -> Text
$sel:id:Transcript' :: Transcript -> Text
$sel:issuesDetected:Transcript' :: Transcript -> Maybe [IssueDetected]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [IssueDetected]
issuesDetected
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
id
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
participantId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
participantRole
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
content
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
beginOffsetMillis
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
endOffsetMillis
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf SentimentValue
sentiment