{-# 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.ContentRedaction where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Transcribe.Types.RedactionOutput
import Amazonka.Transcribe.Types.RedactionType
data ContentRedaction = ContentRedaction'
{
ContentRedaction -> RedactionType
redactionType :: RedactionType,
ContentRedaction -> RedactionOutput
redactionOutput :: RedactionOutput
}
deriving (ContentRedaction -> ContentRedaction -> Bool
(ContentRedaction -> ContentRedaction -> Bool)
-> (ContentRedaction -> ContentRedaction -> Bool)
-> Eq ContentRedaction
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ContentRedaction -> ContentRedaction -> Bool
$c/= :: ContentRedaction -> ContentRedaction -> Bool
== :: ContentRedaction -> ContentRedaction -> Bool
$c== :: ContentRedaction -> ContentRedaction -> Bool
Prelude.Eq, ReadPrec [ContentRedaction]
ReadPrec ContentRedaction
Int -> ReadS ContentRedaction
ReadS [ContentRedaction]
(Int -> ReadS ContentRedaction)
-> ReadS [ContentRedaction]
-> ReadPrec ContentRedaction
-> ReadPrec [ContentRedaction]
-> Read ContentRedaction
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ContentRedaction]
$creadListPrec :: ReadPrec [ContentRedaction]
readPrec :: ReadPrec ContentRedaction
$creadPrec :: ReadPrec ContentRedaction
readList :: ReadS [ContentRedaction]
$creadList :: ReadS [ContentRedaction]
readsPrec :: Int -> ReadS ContentRedaction
$creadsPrec :: Int -> ReadS ContentRedaction
Prelude.Read, Int -> ContentRedaction -> ShowS
[ContentRedaction] -> ShowS
ContentRedaction -> String
(Int -> ContentRedaction -> ShowS)
-> (ContentRedaction -> String)
-> ([ContentRedaction] -> ShowS)
-> Show ContentRedaction
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ContentRedaction] -> ShowS
$cshowList :: [ContentRedaction] -> ShowS
show :: ContentRedaction -> String
$cshow :: ContentRedaction -> String
showsPrec :: Int -> ContentRedaction -> ShowS
$cshowsPrec :: Int -> ContentRedaction -> ShowS
Prelude.Show, (forall x. ContentRedaction -> Rep ContentRedaction x)
-> (forall x. Rep ContentRedaction x -> ContentRedaction)
-> Generic ContentRedaction
forall x. Rep ContentRedaction x -> ContentRedaction
forall x. ContentRedaction -> Rep ContentRedaction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ContentRedaction x -> ContentRedaction
$cfrom :: forall x. ContentRedaction -> Rep ContentRedaction x
Prelude.Generic)
newContentRedaction ::
RedactionType ->
RedactionOutput ->
ContentRedaction
newContentRedaction :: RedactionType -> RedactionOutput -> ContentRedaction
newContentRedaction RedactionType
pRedactionType_ RedactionOutput
pRedactionOutput_ =
ContentRedaction' :: RedactionType -> RedactionOutput -> ContentRedaction
ContentRedaction'
{ $sel:redactionType:ContentRedaction' :: RedactionType
redactionType = RedactionType
pRedactionType_,
$sel:redactionOutput:ContentRedaction' :: RedactionOutput
redactionOutput = RedactionOutput
pRedactionOutput_
}
contentRedaction_redactionType :: Lens.Lens' ContentRedaction RedactionType
contentRedaction_redactionType :: (RedactionType -> f RedactionType)
-> ContentRedaction -> f ContentRedaction
contentRedaction_redactionType = (ContentRedaction -> RedactionType)
-> (ContentRedaction -> RedactionType -> ContentRedaction)
-> Lens
ContentRedaction ContentRedaction RedactionType RedactionType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContentRedaction' {RedactionType
redactionType :: RedactionType
$sel:redactionType:ContentRedaction' :: ContentRedaction -> RedactionType
redactionType} -> RedactionType
redactionType) (\s :: ContentRedaction
s@ContentRedaction' {} RedactionType
a -> ContentRedaction
s {$sel:redactionType:ContentRedaction' :: RedactionType
redactionType = RedactionType
a} :: ContentRedaction)
contentRedaction_redactionOutput :: Lens.Lens' ContentRedaction RedactionOutput
contentRedaction_redactionOutput :: (RedactionOutput -> f RedactionOutput)
-> ContentRedaction -> f ContentRedaction
contentRedaction_redactionOutput = (ContentRedaction -> RedactionOutput)
-> (ContentRedaction -> RedactionOutput -> ContentRedaction)
-> Lens
ContentRedaction ContentRedaction RedactionOutput RedactionOutput
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContentRedaction' {RedactionOutput
redactionOutput :: RedactionOutput
$sel:redactionOutput:ContentRedaction' :: ContentRedaction -> RedactionOutput
redactionOutput} -> RedactionOutput
redactionOutput) (\s :: ContentRedaction
s@ContentRedaction' {} RedactionOutput
a -> ContentRedaction
s {$sel:redactionOutput:ContentRedaction' :: RedactionOutput
redactionOutput = RedactionOutput
a} :: ContentRedaction)
instance Core.FromJSON ContentRedaction where
parseJSON :: Value -> Parser ContentRedaction
parseJSON =
String
-> (Object -> Parser ContentRedaction)
-> Value
-> Parser ContentRedaction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ContentRedaction"
( \Object
x ->
RedactionType -> RedactionOutput -> ContentRedaction
ContentRedaction'
(RedactionType -> RedactionOutput -> ContentRedaction)
-> Parser RedactionType
-> Parser (RedactionOutput -> ContentRedaction)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser RedactionType
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"RedactionType")
Parser (RedactionOutput -> ContentRedaction)
-> Parser RedactionOutput -> Parser ContentRedaction
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser RedactionOutput
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"RedactionOutput")
)
instance Prelude.Hashable ContentRedaction
instance Prelude.NFData ContentRedaction
instance Core.ToJSON ContentRedaction where
toJSON :: ContentRedaction -> Value
toJSON ContentRedaction' {RedactionOutput
RedactionType
redactionOutput :: RedactionOutput
redactionType :: RedactionType
$sel:redactionOutput:ContentRedaction' :: ContentRedaction -> RedactionOutput
$sel:redactionType:ContentRedaction' :: ContentRedaction -> RedactionType
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"RedactionType" Text -> RedactionType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= RedactionType
redactionType),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"RedactionOutput" Text -> RedactionOutput -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= RedactionOutput
redactionOutput)
]
)