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