{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Transcribe.Types.TranscriptFilter
-- 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)
module Amazonka.Transcribe.Types.TranscriptFilter where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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

-- | Matches the output of the transcription to either the specific phrases
-- that you specify, or the intent of the phrases that you specify.
--
-- /See:/ 'newTranscriptFilter' smart constructor.
data TranscriptFilter = TranscriptFilter'
  { -- | Determines whether the customer or the agent is speaking the phrases
    -- that you\'ve specified.
    TranscriptFilter -> Maybe ParticipantRole
participantRole :: Prelude.Maybe ParticipantRole,
    -- | An object that allows percentages to specify the proportion of the call
    -- where you would like to apply a filter. For example, you can specify the
    -- first half of the call. You can also specify the period of time between
    -- halfway through to three-quarters of the way through the call. Because
    -- the length of conversation can vary between calls, you can apply
    -- relative time ranges across all calls.
    TranscriptFilter -> Maybe RelativeTimeRange
relativeTimeRange :: Prelude.Maybe RelativeTimeRange,
    -- | If @TRUE@, the rule that you specify is applied to everything except for
    -- the phrases that you specify.
    TranscriptFilter -> Maybe Bool
negate :: Prelude.Maybe Prelude.Bool,
    -- | A time range, set in seconds, between two points in the call.
    TranscriptFilter -> Maybe AbsoluteTimeRange
absoluteTimeRange :: Prelude.Maybe AbsoluteTimeRange,
    -- | Matches the phrase to the transcription output in a word for word
    -- fashion. For example, if you specify the phrase \"I want to speak to the
    -- manager.\" Amazon Transcribe attempts to match that specific phrase to
    -- the transcription.
    TranscriptFilter -> TranscriptFilterType
transcriptFilterType :: TranscriptFilterType,
    -- | The phrases that you\'re specifying for the transcript filter to match.
    TranscriptFilter -> NonEmpty Text
targets :: Prelude.NonEmpty Prelude.Text
  }
  deriving (TranscriptFilter -> TranscriptFilter -> Bool
(TranscriptFilter -> TranscriptFilter -> Bool)
-> (TranscriptFilter -> TranscriptFilter -> Bool)
-> Eq TranscriptFilter
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]
(Int -> ReadS TranscriptFilter)
-> ReadS [TranscriptFilter]
-> ReadPrec TranscriptFilter
-> ReadPrec [TranscriptFilter]
-> Read 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
(Int -> TranscriptFilter -> ShowS)
-> (TranscriptFilter -> String)
-> ([TranscriptFilter] -> ShowS)
-> Show TranscriptFilter
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. TranscriptFilter -> Rep TranscriptFilter x)
-> (forall x. Rep TranscriptFilter x -> TranscriptFilter)
-> Generic TranscriptFilter
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)

-- |
-- Create a value of 'TranscriptFilter' 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:
--
-- 'participantRole', 'transcriptFilter_participantRole' - Determines whether the customer or the agent is speaking the phrases
-- that you\'ve specified.
--
-- 'relativeTimeRange', 'transcriptFilter_relativeTimeRange' - An object that allows percentages to specify the proportion of the call
-- where you would like to apply a filter. For example, you can specify the
-- first half of the call. You can also specify the period of time between
-- halfway through to three-quarters of the way through the call. Because
-- the length of conversation can vary between calls, you can apply
-- relative time ranges across all calls.
--
-- 'negate', 'transcriptFilter_negate' - If @TRUE@, the rule that you specify is applied to everything except for
-- the phrases that you specify.
--
-- 'absoluteTimeRange', 'transcriptFilter_absoluteTimeRange' - A time range, set in seconds, between two points in the call.
--
-- 'transcriptFilterType', 'transcriptFilter_transcriptFilterType' - Matches the phrase to the transcription output in a word for word
-- fashion. For example, if you specify the phrase \"I want to speak to the
-- manager.\" Amazon Transcribe attempts to match that specific phrase to
-- the transcription.
--
-- 'targets', 'transcriptFilter_targets' - The phrases that you\'re specifying for the transcript filter to match.
newTranscriptFilter ::
  -- | 'transcriptFilterType'
  TranscriptFilterType ->
  -- | 'targets'
  Prelude.NonEmpty Prelude.Text ->
  TranscriptFilter
newTranscriptFilter :: TranscriptFilterType -> NonEmpty Text -> TranscriptFilter
newTranscriptFilter TranscriptFilterType
pTranscriptFilterType_ NonEmpty Text
pTargets_ =
  TranscriptFilter' :: Maybe ParticipantRole
-> Maybe RelativeTimeRange
-> Maybe Bool
-> Maybe AbsoluteTimeRange
-> TranscriptFilterType
-> NonEmpty Text
-> TranscriptFilter
TranscriptFilter'
    { $sel:participantRole:TranscriptFilter' :: Maybe ParticipantRole
participantRole =
        Maybe ParticipantRole
forall a. Maybe a
Prelude.Nothing,
      $sel:relativeTimeRange:TranscriptFilter' :: Maybe RelativeTimeRange
relativeTimeRange = Maybe RelativeTimeRange
forall a. Maybe a
Prelude.Nothing,
      $sel:negate:TranscriptFilter' :: Maybe Bool
negate = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:absoluteTimeRange:TranscriptFilter' :: Maybe AbsoluteTimeRange
absoluteTimeRange = Maybe AbsoluteTimeRange
forall a. Maybe a
Prelude.Nothing,
      $sel:transcriptFilterType:TranscriptFilter' :: TranscriptFilterType
transcriptFilterType = TranscriptFilterType
pTranscriptFilterType_,
      $sel:targets:TranscriptFilter' :: NonEmpty Text
targets = Tagged (NonEmpty Text) (Identity (NonEmpty Text))
-> Tagged (NonEmpty Text) (Identity (NonEmpty Text))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged (NonEmpty Text) (Identity (NonEmpty Text))
 -> Tagged (NonEmpty Text) (Identity (NonEmpty Text)))
-> NonEmpty Text -> NonEmpty Text
forall t b. AReview t b -> b -> t
Lens.# NonEmpty Text
pTargets_
    }

-- | Determines whether the customer or the agent is speaking the phrases
-- that you\'ve specified.
transcriptFilter_participantRole :: Lens.Lens' TranscriptFilter (Prelude.Maybe ParticipantRole)
transcriptFilter_participantRole :: (Maybe ParticipantRole -> f (Maybe ParticipantRole))
-> TranscriptFilter -> f TranscriptFilter
transcriptFilter_participantRole = (TranscriptFilter -> Maybe ParticipantRole)
-> (TranscriptFilter -> Maybe ParticipantRole -> TranscriptFilter)
-> Lens
     TranscriptFilter
     TranscriptFilter
     (Maybe ParticipantRole)
     (Maybe 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)

-- | An object that allows percentages to specify the proportion of the call
-- where you would like to apply a filter. For example, you can specify the
-- first half of the call. You can also specify the period of time between
-- halfway through to three-quarters of the way through the call. Because
-- the length of conversation can vary between calls, you can apply
-- relative time ranges across all calls.
transcriptFilter_relativeTimeRange :: Lens.Lens' TranscriptFilter (Prelude.Maybe RelativeTimeRange)
transcriptFilter_relativeTimeRange :: (Maybe RelativeTimeRange -> f (Maybe RelativeTimeRange))
-> TranscriptFilter -> f TranscriptFilter
transcriptFilter_relativeTimeRange = (TranscriptFilter -> Maybe RelativeTimeRange)
-> (TranscriptFilter
    -> Maybe RelativeTimeRange -> TranscriptFilter)
-> Lens
     TranscriptFilter
     TranscriptFilter
     (Maybe RelativeTimeRange)
     (Maybe 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)

-- | If @TRUE@, the rule that you specify is applied to everything except for
-- the phrases that you specify.
transcriptFilter_negate :: Lens.Lens' TranscriptFilter (Prelude.Maybe Prelude.Bool)
transcriptFilter_negate :: (Maybe Bool -> f (Maybe Bool))
-> TranscriptFilter -> f TranscriptFilter
transcriptFilter_negate = (TranscriptFilter -> Maybe Bool)
-> (TranscriptFilter -> Maybe Bool -> TranscriptFilter)
-> Lens TranscriptFilter TranscriptFilter (Maybe Bool) (Maybe Bool)
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)

-- | A time range, set in seconds, between two points in the call.
transcriptFilter_absoluteTimeRange :: Lens.Lens' TranscriptFilter (Prelude.Maybe AbsoluteTimeRange)
transcriptFilter_absoluteTimeRange :: (Maybe AbsoluteTimeRange -> f (Maybe AbsoluteTimeRange))
-> TranscriptFilter -> f TranscriptFilter
transcriptFilter_absoluteTimeRange = (TranscriptFilter -> Maybe AbsoluteTimeRange)
-> (TranscriptFilter
    -> Maybe AbsoluteTimeRange -> TranscriptFilter)
-> Lens
     TranscriptFilter
     TranscriptFilter
     (Maybe AbsoluteTimeRange)
     (Maybe 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)

-- | Matches the phrase to the transcription output in a word for word
-- fashion. For example, if you specify the phrase \"I want to speak to the
-- manager.\" Amazon Transcribe attempts to match that specific phrase to
-- the transcription.
transcriptFilter_transcriptFilterType :: Lens.Lens' TranscriptFilter TranscriptFilterType
transcriptFilter_transcriptFilterType :: (TranscriptFilterType -> f TranscriptFilterType)
-> TranscriptFilter -> f TranscriptFilter
transcriptFilter_transcriptFilterType = (TranscriptFilter -> TranscriptFilterType)
-> (TranscriptFilter -> TranscriptFilterType -> TranscriptFilter)
-> Lens
     TranscriptFilter
     TranscriptFilter
     TranscriptFilterType
     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)

-- | The phrases that you\'re specifying for the transcript filter to match.
transcriptFilter_targets :: Lens.Lens' TranscriptFilter (Prelude.NonEmpty Prelude.Text)
transcriptFilter_targets :: (NonEmpty Text -> f (NonEmpty Text))
-> TranscriptFilter -> f TranscriptFilter
transcriptFilter_targets = (TranscriptFilter -> NonEmpty Text)
-> (TranscriptFilter -> NonEmpty Text -> TranscriptFilter)
-> Lens
     TranscriptFilter TranscriptFilter (NonEmpty Text) (NonEmpty Text)
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) ((NonEmpty Text -> f (NonEmpty Text))
 -> TranscriptFilter -> f TranscriptFilter)
-> ((NonEmpty Text -> f (NonEmpty Text))
    -> NonEmpty Text -> f (NonEmpty Text))
-> (NonEmpty Text -> f (NonEmpty Text))
-> TranscriptFilter
-> f TranscriptFilter
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty Text -> f (NonEmpty Text))
-> NonEmpty Text -> f (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON TranscriptFilter where
  parseJSON :: Value -> Parser TranscriptFilter
parseJSON =
    String
-> (Object -> Parser TranscriptFilter)
-> Value
-> Parser TranscriptFilter
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"TranscriptFilter"
      ( \Object
x ->
          Maybe ParticipantRole
-> Maybe RelativeTimeRange
-> Maybe Bool
-> Maybe AbsoluteTimeRange
-> TranscriptFilterType
-> NonEmpty Text
-> TranscriptFilter
TranscriptFilter'
            (Maybe ParticipantRole
 -> Maybe RelativeTimeRange
 -> Maybe Bool
 -> Maybe AbsoluteTimeRange
 -> TranscriptFilterType
 -> NonEmpty Text
 -> TranscriptFilter)
-> Parser (Maybe ParticipantRole)
-> Parser
     (Maybe RelativeTimeRange
      -> Maybe Bool
      -> Maybe AbsoluteTimeRange
      -> TranscriptFilterType
      -> NonEmpty Text
      -> TranscriptFilter)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ParticipantRole)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ParticipantRole")
            Parser
  (Maybe RelativeTimeRange
   -> Maybe Bool
   -> Maybe AbsoluteTimeRange
   -> TranscriptFilterType
   -> NonEmpty Text
   -> TranscriptFilter)
-> Parser (Maybe RelativeTimeRange)
-> Parser
     (Maybe Bool
      -> Maybe AbsoluteTimeRange
      -> TranscriptFilterType
      -> NonEmpty Text
      -> TranscriptFilter)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe RelativeTimeRange)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RelativeTimeRange")
            Parser
  (Maybe Bool
   -> Maybe AbsoluteTimeRange
   -> TranscriptFilterType
   -> NonEmpty Text
   -> TranscriptFilter)
-> Parser (Maybe Bool)
-> Parser
     (Maybe AbsoluteTimeRange
      -> TranscriptFilterType -> NonEmpty Text -> TranscriptFilter)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Negate")
            Parser
  (Maybe AbsoluteTimeRange
   -> TranscriptFilterType -> NonEmpty Text -> TranscriptFilter)
-> Parser (Maybe AbsoluteTimeRange)
-> Parser
     (TranscriptFilterType -> NonEmpty Text -> TranscriptFilter)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AbsoluteTimeRange)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AbsoluteTimeRange")
            Parser (TranscriptFilterType -> NonEmpty Text -> TranscriptFilter)
-> Parser TranscriptFilterType
-> Parser (NonEmpty Text -> TranscriptFilter)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser TranscriptFilterType
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"TranscriptFilterType")
            Parser (NonEmpty Text -> TranscriptFilter)
-> Parser (NonEmpty Text) -> Parser TranscriptFilter
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (NonEmpty Text)
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Targets")
      )

instance Prelude.Hashable TranscriptFilter

instance Prelude.NFData TranscriptFilter

instance Core.ToJSON TranscriptFilter where
  toJSON :: TranscriptFilter -> Value
toJSON TranscriptFilter' {Maybe Bool
Maybe AbsoluteTimeRange
Maybe ParticipantRole
Maybe RelativeTimeRange
NonEmpty Text
TranscriptFilterType
targets :: NonEmpty Text
transcriptFilterType :: TranscriptFilterType
absoluteTimeRange :: Maybe AbsoluteTimeRange
negate :: Maybe Bool
relativeTimeRange :: Maybe RelativeTimeRange
participantRole :: Maybe ParticipantRole
$sel:targets:TranscriptFilter' :: TranscriptFilter -> NonEmpty Text
$sel:transcriptFilterType:TranscriptFilter' :: TranscriptFilter -> TranscriptFilterType
$sel:absoluteTimeRange:TranscriptFilter' :: TranscriptFilter -> Maybe AbsoluteTimeRange
$sel:negate:TranscriptFilter' :: TranscriptFilter -> Maybe Bool
$sel:relativeTimeRange:TranscriptFilter' :: TranscriptFilter -> Maybe RelativeTimeRange
$sel:participantRole:TranscriptFilter' :: TranscriptFilter -> Maybe ParticipantRole
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"ParticipantRole" Text -> ParticipantRole -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ParticipantRole -> Pair) -> Maybe ParticipantRole -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ParticipantRole
participantRole,
            (Text
"RelativeTimeRange" Text -> RelativeTimeRange -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (RelativeTimeRange -> Pair)
-> Maybe RelativeTimeRange -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RelativeTimeRange
relativeTimeRange,
            (Text
"Negate" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
negate,
            (Text
"AbsoluteTimeRange" Text -> AbsoluteTimeRange -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (AbsoluteTimeRange -> Pair)
-> Maybe AbsoluteTimeRange -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AbsoluteTimeRange
absoluteTimeRange,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"TranscriptFilterType"
                  Text -> TranscriptFilterType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= TranscriptFilterType
transcriptFilterType
              ),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Targets" Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty Text
targets)
          ]
      )