{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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.
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'
{ $sel:bucketPrefix:SnowflakeDestinationProperties' :: Maybe Text
bucketPrefix =
forall a. Maybe a
Prelude.Nothing,
$sel:errorHandlingConfig:SnowflakeDestinationProperties' :: Maybe ErrorHandlingConfig
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 :: Lens' SnowflakeDestinationProperties (Maybe Text)
snowflakeDestinationProperties_bucketPrefix = 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 :: Lens' SnowflakeDestinationProperties (Maybe ErrorHandlingConfig)
snowflakeDestinationProperties_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 :: Lens' SnowflakeDestinationProperties Text
snowflakeDestinationProperties_object = 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 :: Lens' SnowflakeDestinationProperties Text
snowflakeDestinationProperties_intermediateBucketName = 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 Data.FromJSON SnowflakeDestinationProperties where
parseJSON :: Value -> Parser SnowflakeDestinationProperties
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"SnowflakeDestinationProperties"
( \Object
x ->
Maybe Text
-> Maybe ErrorHandlingConfig
-> Text
-> Text
-> SnowflakeDestinationProperties
SnowflakeDestinationProperties'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"bucketPrefix")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"errorHandlingConfig")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"object")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"intermediateBucketName")
)
instance
Prelude.Hashable
SnowflakeDestinationProperties
where
hashWithSalt :: Int -> SnowflakeDestinationProperties -> Int
hashWithSalt
Int
_salt
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
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
bucketPrefix
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ErrorHandlingConfig
errorHandlingConfig
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
object'
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
intermediateBucketName
instance
Prelude.NFData
SnowflakeDestinationProperties
where
rnf :: SnowflakeDestinationProperties -> ()
rnf 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
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
bucketPrefix
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ErrorHandlingConfig
errorHandlingConfig
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
object'
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
intermediateBucketName
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"bucketPrefix" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
bucketPrefix,
(Key
"errorHandlingConfig" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ErrorHandlingConfig
errorHandlingConfig,
forall a. a -> Maybe a
Prelude.Just (Key
"object" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
object'),
forall a. a -> Maybe a
Prelude.Just
( Key
"intermediateBucketName"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
intermediateBucketName
)
]
)