{-# 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.Transcribe.Types.TranscriptFilter where
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 Amazonka.Transcribe.Types.AbsoluteTimeRange
import Amazonka.Transcribe.Types.ParticipantRole
import Amazonka.Transcribe.Types.RelativeTimeRange
import Amazonka.Transcribe.Types.TranscriptFilterType
data TranscriptFilter = TranscriptFilter'
{
TranscriptFilter -> Maybe AbsoluteTimeRange
absoluteTimeRange :: Prelude.Maybe AbsoluteTimeRange,
TranscriptFilter -> Maybe Bool
negate :: Prelude.Maybe Prelude.Bool,
TranscriptFilter -> Maybe ParticipantRole
participantRole :: Prelude.Maybe ParticipantRole,
TranscriptFilter -> Maybe RelativeTimeRange
relativeTimeRange :: Prelude.Maybe RelativeTimeRange,
TranscriptFilter -> TranscriptFilterType
transcriptFilterType :: TranscriptFilterType,
TranscriptFilter -> NonEmpty Text
targets :: Prelude.NonEmpty Prelude.Text
}
deriving (TranscriptFilter -> TranscriptFilter -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TranscriptFilter -> TranscriptFilter -> Bool
$c/= :: TranscriptFilter -> TranscriptFilter -> Bool
== :: TranscriptFilter -> TranscriptFilter -> Bool
$c== :: TranscriptFilter -> TranscriptFilter -> Bool
Prelude.Eq, ReadPrec [TranscriptFilter]
ReadPrec TranscriptFilter
Int -> ReadS TranscriptFilter
ReadS [TranscriptFilter]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TranscriptFilter]
$creadListPrec :: ReadPrec [TranscriptFilter]
readPrec :: ReadPrec TranscriptFilter
$creadPrec :: ReadPrec TranscriptFilter
readList :: ReadS [TranscriptFilter]
$creadList :: ReadS [TranscriptFilter]
readsPrec :: Int -> ReadS TranscriptFilter
$creadsPrec :: Int -> ReadS TranscriptFilter
Prelude.Read, Int -> TranscriptFilter -> ShowS
[TranscriptFilter] -> ShowS
TranscriptFilter -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TranscriptFilter] -> ShowS
$cshowList :: [TranscriptFilter] -> ShowS
show :: TranscriptFilter -> String
$cshow :: TranscriptFilter -> String
showsPrec :: Int -> TranscriptFilter -> ShowS
$cshowsPrec :: Int -> TranscriptFilter -> ShowS
Prelude.Show, forall x. Rep TranscriptFilter x -> TranscriptFilter
forall x. TranscriptFilter -> Rep TranscriptFilter x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TranscriptFilter x -> TranscriptFilter
$cfrom :: forall x. TranscriptFilter -> Rep TranscriptFilter x
Prelude.Generic)
newTranscriptFilter ::
TranscriptFilterType ->
Prelude.NonEmpty Prelude.Text ->
TranscriptFilter
newTranscriptFilter :: TranscriptFilterType -> NonEmpty Text -> TranscriptFilter
newTranscriptFilter TranscriptFilterType
pTranscriptFilterType_ NonEmpty Text
pTargets_ =
TranscriptFilter'
{ $sel:absoluteTimeRange:TranscriptFilter' :: Maybe AbsoluteTimeRange
absoluteTimeRange =
forall a. Maybe a
Prelude.Nothing,
$sel:negate:TranscriptFilter' :: Maybe Bool
negate = forall a. Maybe a
Prelude.Nothing,
$sel:participantRole:TranscriptFilter' :: Maybe ParticipantRole
participantRole = forall a. Maybe a
Prelude.Nothing,
$sel:relativeTimeRange:TranscriptFilter' :: Maybe RelativeTimeRange
relativeTimeRange = forall a. Maybe a
Prelude.Nothing,
$sel:transcriptFilterType:TranscriptFilter' :: TranscriptFilterType
transcriptFilterType = TranscriptFilterType
pTranscriptFilterType_,
$sel:targets:TranscriptFilter' :: NonEmpty Text
targets = forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced forall t b. AReview t b -> b -> t
Lens.# NonEmpty Text
pTargets_
}
transcriptFilter_absoluteTimeRange :: Lens.Lens' TranscriptFilter (Prelude.Maybe AbsoluteTimeRange)
transcriptFilter_absoluteTimeRange :: Lens' TranscriptFilter (Maybe AbsoluteTimeRange)
transcriptFilter_absoluteTimeRange = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TranscriptFilter' {Maybe AbsoluteTimeRange
absoluteTimeRange :: Maybe AbsoluteTimeRange
$sel:absoluteTimeRange:TranscriptFilter' :: TranscriptFilter -> Maybe AbsoluteTimeRange
absoluteTimeRange} -> Maybe AbsoluteTimeRange
absoluteTimeRange) (\s :: TranscriptFilter
s@TranscriptFilter' {} Maybe AbsoluteTimeRange
a -> TranscriptFilter
s {$sel:absoluteTimeRange:TranscriptFilter' :: Maybe AbsoluteTimeRange
absoluteTimeRange = Maybe AbsoluteTimeRange
a} :: TranscriptFilter)
transcriptFilter_negate :: Lens.Lens' TranscriptFilter (Prelude.Maybe Prelude.Bool)
transcriptFilter_negate :: Lens' TranscriptFilter (Maybe Bool)
transcriptFilter_negate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TranscriptFilter' {Maybe Bool
negate :: Maybe Bool
$sel:negate:TranscriptFilter' :: TranscriptFilter -> Maybe Bool
negate} -> Maybe Bool
negate) (\s :: TranscriptFilter
s@TranscriptFilter' {} Maybe Bool
a -> TranscriptFilter
s {$sel:negate:TranscriptFilter' :: Maybe Bool
negate = Maybe Bool
a} :: TranscriptFilter)
transcriptFilter_participantRole :: Lens.Lens' TranscriptFilter (Prelude.Maybe ParticipantRole)
transcriptFilter_participantRole :: Lens' TranscriptFilter (Maybe ParticipantRole)
transcriptFilter_participantRole = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TranscriptFilter' {Maybe ParticipantRole
participantRole :: Maybe ParticipantRole
$sel:participantRole:TranscriptFilter' :: TranscriptFilter -> Maybe ParticipantRole
participantRole} -> Maybe ParticipantRole
participantRole) (\s :: TranscriptFilter
s@TranscriptFilter' {} Maybe ParticipantRole
a -> TranscriptFilter
s {$sel:participantRole:TranscriptFilter' :: Maybe ParticipantRole
participantRole = Maybe ParticipantRole
a} :: TranscriptFilter)
transcriptFilter_relativeTimeRange :: Lens.Lens' TranscriptFilter (Prelude.Maybe RelativeTimeRange)
transcriptFilter_relativeTimeRange :: Lens' TranscriptFilter (Maybe RelativeTimeRange)
transcriptFilter_relativeTimeRange = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TranscriptFilter' {Maybe RelativeTimeRange
relativeTimeRange :: Maybe RelativeTimeRange
$sel:relativeTimeRange:TranscriptFilter' :: TranscriptFilter -> Maybe RelativeTimeRange
relativeTimeRange} -> Maybe RelativeTimeRange
relativeTimeRange) (\s :: TranscriptFilter
s@TranscriptFilter' {} Maybe RelativeTimeRange
a -> TranscriptFilter
s {$sel:relativeTimeRange:TranscriptFilter' :: Maybe RelativeTimeRange
relativeTimeRange = Maybe RelativeTimeRange
a} :: TranscriptFilter)
transcriptFilter_transcriptFilterType :: Lens.Lens' TranscriptFilter TranscriptFilterType
transcriptFilter_transcriptFilterType :: Lens' TranscriptFilter TranscriptFilterType
transcriptFilter_transcriptFilterType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TranscriptFilter' {TranscriptFilterType
transcriptFilterType :: TranscriptFilterType
$sel:transcriptFilterType:TranscriptFilter' :: TranscriptFilter -> TranscriptFilterType
transcriptFilterType} -> TranscriptFilterType
transcriptFilterType) (\s :: TranscriptFilter
s@TranscriptFilter' {} TranscriptFilterType
a -> TranscriptFilter
s {$sel:transcriptFilterType:TranscriptFilter' :: TranscriptFilterType
transcriptFilterType = TranscriptFilterType
a} :: TranscriptFilter)
transcriptFilter_targets :: Lens.Lens' TranscriptFilter (Prelude.NonEmpty Prelude.Text)
transcriptFilter_targets :: Lens' TranscriptFilter (NonEmpty Text)
transcriptFilter_targets = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TranscriptFilter' {NonEmpty Text
targets :: NonEmpty Text
$sel:targets:TranscriptFilter' :: TranscriptFilter -> NonEmpty Text
targets} -> NonEmpty Text
targets) (\s :: TranscriptFilter
s@TranscriptFilter' {} NonEmpty Text
a -> TranscriptFilter
s {$sel:targets:TranscriptFilter' :: NonEmpty Text
targets = NonEmpty Text
a} :: TranscriptFilter) 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 Data.FromJSON TranscriptFilter where
parseJSON :: Value -> Parser TranscriptFilter
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"TranscriptFilter"
( \Object
x ->
Maybe AbsoluteTimeRange
-> Maybe Bool
-> Maybe ParticipantRole
-> Maybe RelativeTimeRange
-> TranscriptFilterType
-> NonEmpty Text
-> TranscriptFilter
TranscriptFilter'
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
"AbsoluteTimeRange")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Negate")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe 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 (Maybe a)
Data..:? Key
"RelativeTimeRange")
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
"TranscriptFilterType")
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
"Targets")
)
instance Prelude.Hashable TranscriptFilter where
hashWithSalt :: Int -> TranscriptFilter -> Int
hashWithSalt Int
_salt TranscriptFilter' {Maybe Bool
Maybe AbsoluteTimeRange
Maybe ParticipantRole
Maybe RelativeTimeRange
NonEmpty Text
TranscriptFilterType
targets :: NonEmpty Text
transcriptFilterType :: TranscriptFilterType
relativeTimeRange :: Maybe RelativeTimeRange
participantRole :: Maybe ParticipantRole
negate :: Maybe Bool
absoluteTimeRange :: Maybe AbsoluteTimeRange
$sel:targets:TranscriptFilter' :: TranscriptFilter -> NonEmpty Text
$sel:transcriptFilterType:TranscriptFilter' :: TranscriptFilter -> TranscriptFilterType
$sel:relativeTimeRange:TranscriptFilter' :: TranscriptFilter -> Maybe RelativeTimeRange
$sel:participantRole:TranscriptFilter' :: TranscriptFilter -> Maybe ParticipantRole
$sel:negate:TranscriptFilter' :: TranscriptFilter -> Maybe Bool
$sel:absoluteTimeRange:TranscriptFilter' :: TranscriptFilter -> Maybe AbsoluteTimeRange
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AbsoluteTimeRange
absoluteTimeRange
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
negate
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ParticipantRole
participantRole
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe RelativeTimeRange
relativeTimeRange
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` TranscriptFilterType
transcriptFilterType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NonEmpty Text
targets
instance Prelude.NFData TranscriptFilter where
rnf :: TranscriptFilter -> ()
rnf TranscriptFilter' {Maybe Bool
Maybe AbsoluteTimeRange
Maybe ParticipantRole
Maybe RelativeTimeRange
NonEmpty Text
TranscriptFilterType
targets :: NonEmpty Text
transcriptFilterType :: TranscriptFilterType
relativeTimeRange :: Maybe RelativeTimeRange
participantRole :: Maybe ParticipantRole
negate :: Maybe Bool
absoluteTimeRange :: Maybe AbsoluteTimeRange
$sel:targets:TranscriptFilter' :: TranscriptFilter -> NonEmpty Text
$sel:transcriptFilterType:TranscriptFilter' :: TranscriptFilter -> TranscriptFilterType
$sel:relativeTimeRange:TranscriptFilter' :: TranscriptFilter -> Maybe RelativeTimeRange
$sel:participantRole:TranscriptFilter' :: TranscriptFilter -> Maybe ParticipantRole
$sel:negate:TranscriptFilter' :: TranscriptFilter -> Maybe Bool
$sel:absoluteTimeRange:TranscriptFilter' :: TranscriptFilter -> Maybe AbsoluteTimeRange
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe AbsoluteTimeRange
absoluteTimeRange
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
negate
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ParticipantRole
participantRole
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RelativeTimeRange
relativeTimeRange
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf TranscriptFilterType
transcriptFilterType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf NonEmpty Text
targets
instance Data.ToJSON TranscriptFilter where
toJSON :: TranscriptFilter -> Value
toJSON TranscriptFilter' {Maybe Bool
Maybe AbsoluteTimeRange
Maybe ParticipantRole
Maybe RelativeTimeRange
NonEmpty Text
TranscriptFilterType
targets :: NonEmpty Text
transcriptFilterType :: TranscriptFilterType
relativeTimeRange :: Maybe RelativeTimeRange
participantRole :: Maybe ParticipantRole
negate :: Maybe Bool
absoluteTimeRange :: Maybe AbsoluteTimeRange
$sel:targets:TranscriptFilter' :: TranscriptFilter -> NonEmpty Text
$sel:transcriptFilterType:TranscriptFilter' :: TranscriptFilter -> TranscriptFilterType
$sel:relativeTimeRange:TranscriptFilter' :: TranscriptFilter -> Maybe RelativeTimeRange
$sel:participantRole:TranscriptFilter' :: TranscriptFilter -> Maybe ParticipantRole
$sel:negate:TranscriptFilter' :: TranscriptFilter -> Maybe Bool
$sel:absoluteTimeRange:TranscriptFilter' :: TranscriptFilter -> Maybe AbsoluteTimeRange
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"AbsoluteTimeRange" 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 AbsoluteTimeRange
absoluteTimeRange,
(Key
"Negate" 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 Bool
negate,
(Key
"ParticipantRole" 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 ParticipantRole
participantRole,
(Key
"RelativeTimeRange" 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 RelativeTimeRange
relativeTimeRange,
forall a. a -> Maybe a
Prelude.Just
( Key
"TranscriptFilterType"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= TranscriptFilterType
transcriptFilterType
),
forall a. a -> Maybe a
Prelude.Just (Key
"Targets" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= NonEmpty Text
targets)
]
)