{-# 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.Textract.Types.OutputConfig where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data OutputConfig = OutputConfig'
{
OutputConfig -> Maybe Text
s3Prefix :: Prelude.Maybe Prelude.Text,
OutputConfig -> Text
s3Bucket :: Prelude.Text
}
deriving (OutputConfig -> OutputConfig -> Bool
(OutputConfig -> OutputConfig -> Bool)
-> (OutputConfig -> OutputConfig -> Bool) -> Eq OutputConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OutputConfig -> OutputConfig -> Bool
$c/= :: OutputConfig -> OutputConfig -> Bool
== :: OutputConfig -> OutputConfig -> Bool
$c== :: OutputConfig -> OutputConfig -> Bool
Prelude.Eq, ReadPrec [OutputConfig]
ReadPrec OutputConfig
Int -> ReadS OutputConfig
ReadS [OutputConfig]
(Int -> ReadS OutputConfig)
-> ReadS [OutputConfig]
-> ReadPrec OutputConfig
-> ReadPrec [OutputConfig]
-> Read OutputConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OutputConfig]
$creadListPrec :: ReadPrec [OutputConfig]
readPrec :: ReadPrec OutputConfig
$creadPrec :: ReadPrec OutputConfig
readList :: ReadS [OutputConfig]
$creadList :: ReadS [OutputConfig]
readsPrec :: Int -> ReadS OutputConfig
$creadsPrec :: Int -> ReadS OutputConfig
Prelude.Read, Int -> OutputConfig -> ShowS
[OutputConfig] -> ShowS
OutputConfig -> String
(Int -> OutputConfig -> ShowS)
-> (OutputConfig -> String)
-> ([OutputConfig] -> ShowS)
-> Show OutputConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OutputConfig] -> ShowS
$cshowList :: [OutputConfig] -> ShowS
show :: OutputConfig -> String
$cshow :: OutputConfig -> String
showsPrec :: Int -> OutputConfig -> ShowS
$cshowsPrec :: Int -> OutputConfig -> ShowS
Prelude.Show, (forall x. OutputConfig -> Rep OutputConfig x)
-> (forall x. Rep OutputConfig x -> OutputConfig)
-> Generic OutputConfig
forall x. Rep OutputConfig x -> OutputConfig
forall x. OutputConfig -> Rep OutputConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep OutputConfig x -> OutputConfig
$cfrom :: forall x. OutputConfig -> Rep OutputConfig x
Prelude.Generic)
newOutputConfig ::
Prelude.Text ->
OutputConfig
newOutputConfig :: Text -> OutputConfig
newOutputConfig Text
pS3Bucket_ =
OutputConfig' :: Maybe Text -> Text -> OutputConfig
OutputConfig'
{ $sel:s3Prefix:OutputConfig' :: Maybe Text
s3Prefix = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:s3Bucket:OutputConfig' :: Text
s3Bucket = Text
pS3Bucket_
}
outputConfig_s3Prefix :: Lens.Lens' OutputConfig (Prelude.Maybe Prelude.Text)
outputConfig_s3Prefix :: (Maybe Text -> f (Maybe Text)) -> OutputConfig -> f OutputConfig
outputConfig_s3Prefix = (OutputConfig -> Maybe Text)
-> (OutputConfig -> Maybe Text -> OutputConfig)
-> Lens OutputConfig OutputConfig (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OutputConfig' {Maybe Text
s3Prefix :: Maybe Text
$sel:s3Prefix:OutputConfig' :: OutputConfig -> Maybe Text
s3Prefix} -> Maybe Text
s3Prefix) (\s :: OutputConfig
s@OutputConfig' {} Maybe Text
a -> OutputConfig
s {$sel:s3Prefix:OutputConfig' :: Maybe Text
s3Prefix = Maybe Text
a} :: OutputConfig)
outputConfig_s3Bucket :: Lens.Lens' OutputConfig Prelude.Text
outputConfig_s3Bucket :: (Text -> f Text) -> OutputConfig -> f OutputConfig
outputConfig_s3Bucket = (OutputConfig -> Text)
-> (OutputConfig -> Text -> OutputConfig)
-> Lens OutputConfig OutputConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OutputConfig' {Text
s3Bucket :: Text
$sel:s3Bucket:OutputConfig' :: OutputConfig -> Text
s3Bucket} -> Text
s3Bucket) (\s :: OutputConfig
s@OutputConfig' {} Text
a -> OutputConfig
s {$sel:s3Bucket:OutputConfig' :: Text
s3Bucket = Text
a} :: OutputConfig)
instance Prelude.Hashable OutputConfig
instance Prelude.NFData OutputConfig
instance Core.ToJSON OutputConfig where
toJSON :: OutputConfig -> Value
toJSON OutputConfig' {Maybe Text
Text
s3Bucket :: Text
s3Prefix :: Maybe Text
$sel:s3Bucket:OutputConfig' :: OutputConfig -> Text
$sel:s3Prefix:OutputConfig' :: OutputConfig -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"S3Prefix" 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
s3Prefix,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"S3Bucket" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
s3Bucket)
]
)