{-# 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.SnowflakeDestinationProperties 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 SnowflakeDestinationProperties = SnowflakeDestinationProperties'
{
SnowflakeDestinationProperties -> Maybe Text
bucketPrefix :: Prelude.Maybe Prelude.Text,
SnowflakeDestinationProperties -> Maybe ErrorHandlingConfig
errorHandlingConfig :: Prelude.Maybe ErrorHandlingConfig,
SnowflakeDestinationProperties -> Text
object' :: Prelude.Text,
SnowflakeDestinationProperties -> Text
intermediateBucketName :: Prelude.Text
}
deriving (SnowflakeDestinationProperties
-> SnowflakeDestinationProperties -> Bool
(SnowflakeDestinationProperties
-> SnowflakeDestinationProperties -> Bool)
-> (SnowflakeDestinationProperties
-> SnowflakeDestinationProperties -> Bool)
-> Eq SnowflakeDestinationProperties
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SnowflakeDestinationProperties
-> SnowflakeDestinationProperties -> Bool
$c/= :: SnowflakeDestinationProperties
-> SnowflakeDestinationProperties -> Bool
== :: SnowflakeDestinationProperties
-> SnowflakeDestinationProperties -> Bool
$c== :: SnowflakeDestinationProperties
-> SnowflakeDestinationProperties -> Bool
Prelude.Eq, ReadPrec [SnowflakeDestinationProperties]
ReadPrec SnowflakeDestinationProperties
Int -> ReadS SnowflakeDestinationProperties
ReadS [SnowflakeDestinationProperties]
(Int -> ReadS SnowflakeDestinationProperties)
-> ReadS [SnowflakeDestinationProperties]
-> ReadPrec SnowflakeDestinationProperties
-> ReadPrec [SnowflakeDestinationProperties]
-> Read SnowflakeDestinationProperties
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SnowflakeDestinationProperties]
$creadListPrec :: ReadPrec [SnowflakeDestinationProperties]
readPrec :: ReadPrec SnowflakeDestinationProperties
$creadPrec :: ReadPrec SnowflakeDestinationProperties
readList :: ReadS [SnowflakeDestinationProperties]
$creadList :: ReadS [SnowflakeDestinationProperties]
readsPrec :: Int -> ReadS SnowflakeDestinationProperties
$creadsPrec :: Int -> ReadS SnowflakeDestinationProperties
Prelude.Read, Int -> SnowflakeDestinationProperties -> ShowS
[SnowflakeDestinationProperties] -> ShowS
SnowflakeDestinationProperties -> String
(Int -> SnowflakeDestinationProperties -> ShowS)
-> (SnowflakeDestinationProperties -> String)
-> ([SnowflakeDestinationProperties] -> ShowS)
-> Show SnowflakeDestinationProperties
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SnowflakeDestinationProperties] -> ShowS
$cshowList :: [SnowflakeDestinationProperties] -> ShowS
show :: SnowflakeDestinationProperties -> String
$cshow :: SnowflakeDestinationProperties -> String
showsPrec :: Int -> SnowflakeDestinationProperties -> ShowS
$cshowsPrec :: Int -> SnowflakeDestinationProperties -> ShowS
Prelude.Show, (forall x.
SnowflakeDestinationProperties
-> Rep SnowflakeDestinationProperties x)
-> (forall x.
Rep SnowflakeDestinationProperties x
-> SnowflakeDestinationProperties)
-> Generic SnowflakeDestinationProperties
forall x.
Rep SnowflakeDestinationProperties x
-> SnowflakeDestinationProperties
forall x.
SnowflakeDestinationProperties
-> Rep SnowflakeDestinationProperties x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SnowflakeDestinationProperties x
-> SnowflakeDestinationProperties
$cfrom :: forall x.
SnowflakeDestinationProperties
-> Rep SnowflakeDestinationProperties x
Prelude.Generic)
newSnowflakeDestinationProperties ::
Prelude.Text ->
Prelude.Text ->
SnowflakeDestinationProperties
newSnowflakeDestinationProperties :: Text -> Text -> SnowflakeDestinationProperties
newSnowflakeDestinationProperties
Text
pObject_
Text
pIntermediateBucketName_ =
SnowflakeDestinationProperties' :: Maybe Text
-> Maybe ErrorHandlingConfig
-> Text
-> Text
-> SnowflakeDestinationProperties
SnowflakeDestinationProperties'
{ $sel:bucketPrefix:SnowflakeDestinationProperties' :: Maybe Text
bucketPrefix =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:errorHandlingConfig:SnowflakeDestinationProperties' :: Maybe ErrorHandlingConfig
errorHandlingConfig = Maybe ErrorHandlingConfig
forall a. Maybe a
Prelude.Nothing,
$sel:object':SnowflakeDestinationProperties' :: Text
object' = Text
pObject_,
$sel:intermediateBucketName:SnowflakeDestinationProperties' :: Text
intermediateBucketName =
Text
pIntermediateBucketName_
}
snowflakeDestinationProperties_bucketPrefix :: Lens.Lens' SnowflakeDestinationProperties (Prelude.Maybe Prelude.Text)
snowflakeDestinationProperties_bucketPrefix :: (Maybe Text -> f (Maybe Text))
-> SnowflakeDestinationProperties
-> f SnowflakeDestinationProperties
snowflakeDestinationProperties_bucketPrefix = (SnowflakeDestinationProperties -> Maybe Text)
-> (SnowflakeDestinationProperties
-> Maybe Text -> SnowflakeDestinationProperties)
-> Lens
SnowflakeDestinationProperties
SnowflakeDestinationProperties
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SnowflakeDestinationProperties' {Maybe Text
bucketPrefix :: Maybe Text
$sel:bucketPrefix:SnowflakeDestinationProperties' :: SnowflakeDestinationProperties -> Maybe Text
bucketPrefix} -> Maybe Text
bucketPrefix) (\s :: SnowflakeDestinationProperties
s@SnowflakeDestinationProperties' {} Maybe Text
a -> SnowflakeDestinationProperties
s {$sel:bucketPrefix:SnowflakeDestinationProperties' :: Maybe Text
bucketPrefix = Maybe Text
a} :: SnowflakeDestinationProperties)
snowflakeDestinationProperties_errorHandlingConfig :: Lens.Lens' SnowflakeDestinationProperties (Prelude.Maybe ErrorHandlingConfig)
snowflakeDestinationProperties_errorHandlingConfig :: (Maybe ErrorHandlingConfig -> f (Maybe ErrorHandlingConfig))
-> SnowflakeDestinationProperties
-> f SnowflakeDestinationProperties
snowflakeDestinationProperties_errorHandlingConfig = (SnowflakeDestinationProperties -> Maybe ErrorHandlingConfig)
-> (SnowflakeDestinationProperties
-> Maybe ErrorHandlingConfig -> SnowflakeDestinationProperties)
-> Lens
SnowflakeDestinationProperties
SnowflakeDestinationProperties
(Maybe ErrorHandlingConfig)
(Maybe ErrorHandlingConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SnowflakeDestinationProperties' {Maybe ErrorHandlingConfig
errorHandlingConfig :: Maybe ErrorHandlingConfig
$sel:errorHandlingConfig:SnowflakeDestinationProperties' :: SnowflakeDestinationProperties -> Maybe ErrorHandlingConfig
errorHandlingConfig} -> Maybe ErrorHandlingConfig
errorHandlingConfig) (\s :: SnowflakeDestinationProperties
s@SnowflakeDestinationProperties' {} Maybe ErrorHandlingConfig
a -> SnowflakeDestinationProperties
s {$sel:errorHandlingConfig:SnowflakeDestinationProperties' :: Maybe ErrorHandlingConfig
errorHandlingConfig = Maybe ErrorHandlingConfig
a} :: SnowflakeDestinationProperties)
snowflakeDestinationProperties_object :: Lens.Lens' SnowflakeDestinationProperties Prelude.Text
snowflakeDestinationProperties_object :: (Text -> f Text)
-> SnowflakeDestinationProperties
-> f SnowflakeDestinationProperties
snowflakeDestinationProperties_object = (SnowflakeDestinationProperties -> Text)
-> (SnowflakeDestinationProperties
-> Text -> SnowflakeDestinationProperties)
-> Lens
SnowflakeDestinationProperties
SnowflakeDestinationProperties
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SnowflakeDestinationProperties' {Text
object' :: Text
$sel:object':SnowflakeDestinationProperties' :: SnowflakeDestinationProperties -> Text
object'} -> Text
object') (\s :: SnowflakeDestinationProperties
s@SnowflakeDestinationProperties' {} Text
a -> SnowflakeDestinationProperties
s {$sel:object':SnowflakeDestinationProperties' :: Text
object' = Text
a} :: SnowflakeDestinationProperties)
snowflakeDestinationProperties_intermediateBucketName :: Lens.Lens' SnowflakeDestinationProperties Prelude.Text
snowflakeDestinationProperties_intermediateBucketName :: (Text -> f Text)
-> SnowflakeDestinationProperties
-> f SnowflakeDestinationProperties
snowflakeDestinationProperties_intermediateBucketName = (SnowflakeDestinationProperties -> Text)
-> (SnowflakeDestinationProperties
-> Text -> SnowflakeDestinationProperties)
-> Lens
SnowflakeDestinationProperties
SnowflakeDestinationProperties
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SnowflakeDestinationProperties' {Text
intermediateBucketName :: Text
$sel:intermediateBucketName:SnowflakeDestinationProperties' :: SnowflakeDestinationProperties -> Text
intermediateBucketName} -> Text
intermediateBucketName) (\s :: SnowflakeDestinationProperties
s@SnowflakeDestinationProperties' {} Text
a -> SnowflakeDestinationProperties
s {$sel:intermediateBucketName:SnowflakeDestinationProperties' :: Text
intermediateBucketName = Text
a} :: SnowflakeDestinationProperties)
instance Core.FromJSON SnowflakeDestinationProperties where
parseJSON :: Value -> Parser SnowflakeDestinationProperties
parseJSON =
String
-> (Object -> Parser SnowflakeDestinationProperties)
-> Value
-> Parser SnowflakeDestinationProperties
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SnowflakeDestinationProperties"
( \Object
x ->
Maybe Text
-> Maybe ErrorHandlingConfig
-> Text
-> Text
-> SnowflakeDestinationProperties
SnowflakeDestinationProperties'
(Maybe Text
-> Maybe ErrorHandlingConfig
-> Text
-> Text
-> SnowflakeDestinationProperties)
-> Parser (Maybe Text)
-> Parser
(Maybe ErrorHandlingConfig
-> Text -> Text -> SnowflakeDestinationProperties)
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 -> SnowflakeDestinationProperties)
-> Parser (Maybe ErrorHandlingConfig)
-> Parser (Text -> Text -> SnowflakeDestinationProperties)
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 -> SnowflakeDestinationProperties)
-> Parser Text -> Parser (Text -> SnowflakeDestinationProperties)
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 -> SnowflakeDestinationProperties)
-> Parser Text -> Parser SnowflakeDestinationProperties
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
SnowflakeDestinationProperties
instance
Prelude.NFData
SnowflakeDestinationProperties
instance Core.ToJSON SnowflakeDestinationProperties where
toJSON :: SnowflakeDestinationProperties -> Value
toJSON SnowflakeDestinationProperties' {Maybe Text
Maybe ErrorHandlingConfig
Text
intermediateBucketName :: Text
object' :: Text
errorHandlingConfig :: Maybe ErrorHandlingConfig
bucketPrefix :: Maybe Text
$sel:intermediateBucketName:SnowflakeDestinationProperties' :: SnowflakeDestinationProperties -> Text
$sel:object':SnowflakeDestinationProperties' :: SnowflakeDestinationProperties -> Text
$sel:errorHandlingConfig:SnowflakeDestinationProperties' :: SnowflakeDestinationProperties -> Maybe ErrorHandlingConfig
$sel:bucketPrefix:SnowflakeDestinationProperties' :: SnowflakeDestinationProperties -> 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
)
]
)