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