{-# 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.SuccessResponseHandlingConfig where
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 SuccessResponseHandlingConfig = SuccessResponseHandlingConfig'
{
SuccessResponseHandlingConfig -> Maybe Text
bucketName :: Prelude.Maybe Prelude.Text,
SuccessResponseHandlingConfig -> Maybe Text
bucketPrefix :: Prelude.Maybe Prelude.Text
}
deriving (SuccessResponseHandlingConfig
-> SuccessResponseHandlingConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SuccessResponseHandlingConfig
-> SuccessResponseHandlingConfig -> Bool
$c/= :: SuccessResponseHandlingConfig
-> SuccessResponseHandlingConfig -> Bool
== :: SuccessResponseHandlingConfig
-> SuccessResponseHandlingConfig -> Bool
$c== :: SuccessResponseHandlingConfig
-> SuccessResponseHandlingConfig -> Bool
Prelude.Eq, ReadPrec [SuccessResponseHandlingConfig]
ReadPrec SuccessResponseHandlingConfig
Int -> ReadS SuccessResponseHandlingConfig
ReadS [SuccessResponseHandlingConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SuccessResponseHandlingConfig]
$creadListPrec :: ReadPrec [SuccessResponseHandlingConfig]
readPrec :: ReadPrec SuccessResponseHandlingConfig
$creadPrec :: ReadPrec SuccessResponseHandlingConfig
readList :: ReadS [SuccessResponseHandlingConfig]
$creadList :: ReadS [SuccessResponseHandlingConfig]
readsPrec :: Int -> ReadS SuccessResponseHandlingConfig
$creadsPrec :: Int -> ReadS SuccessResponseHandlingConfig
Prelude.Read, Int -> SuccessResponseHandlingConfig -> ShowS
[SuccessResponseHandlingConfig] -> ShowS
SuccessResponseHandlingConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SuccessResponseHandlingConfig] -> ShowS
$cshowList :: [SuccessResponseHandlingConfig] -> ShowS
show :: SuccessResponseHandlingConfig -> String
$cshow :: SuccessResponseHandlingConfig -> String
showsPrec :: Int -> SuccessResponseHandlingConfig -> ShowS
$cshowsPrec :: Int -> SuccessResponseHandlingConfig -> ShowS
Prelude.Show, forall x.
Rep SuccessResponseHandlingConfig x
-> SuccessResponseHandlingConfig
forall x.
SuccessResponseHandlingConfig
-> Rep SuccessResponseHandlingConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SuccessResponseHandlingConfig x
-> SuccessResponseHandlingConfig
$cfrom :: forall x.
SuccessResponseHandlingConfig
-> Rep SuccessResponseHandlingConfig x
Prelude.Generic)
newSuccessResponseHandlingConfig ::
SuccessResponseHandlingConfig
newSuccessResponseHandlingConfig :: SuccessResponseHandlingConfig
newSuccessResponseHandlingConfig =
SuccessResponseHandlingConfig'
{ $sel:bucketName:SuccessResponseHandlingConfig' :: Maybe Text
bucketName =
forall a. Maybe a
Prelude.Nothing,
$sel:bucketPrefix:SuccessResponseHandlingConfig' :: Maybe Text
bucketPrefix = forall a. Maybe a
Prelude.Nothing
}
successResponseHandlingConfig_bucketName :: Lens.Lens' SuccessResponseHandlingConfig (Prelude.Maybe Prelude.Text)
successResponseHandlingConfig_bucketName :: Lens' SuccessResponseHandlingConfig (Maybe Text)
successResponseHandlingConfig_bucketName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SuccessResponseHandlingConfig' {Maybe Text
bucketName :: Maybe Text
$sel:bucketName:SuccessResponseHandlingConfig' :: SuccessResponseHandlingConfig -> Maybe Text
bucketName} -> Maybe Text
bucketName) (\s :: SuccessResponseHandlingConfig
s@SuccessResponseHandlingConfig' {} Maybe Text
a -> SuccessResponseHandlingConfig
s {$sel:bucketName:SuccessResponseHandlingConfig' :: Maybe Text
bucketName = Maybe Text
a} :: SuccessResponseHandlingConfig)
successResponseHandlingConfig_bucketPrefix :: Lens.Lens' SuccessResponseHandlingConfig (Prelude.Maybe Prelude.Text)
successResponseHandlingConfig_bucketPrefix :: Lens' SuccessResponseHandlingConfig (Maybe Text)
successResponseHandlingConfig_bucketPrefix = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SuccessResponseHandlingConfig' {Maybe Text
bucketPrefix :: Maybe Text
$sel:bucketPrefix:SuccessResponseHandlingConfig' :: SuccessResponseHandlingConfig -> Maybe Text
bucketPrefix} -> Maybe Text
bucketPrefix) (\s :: SuccessResponseHandlingConfig
s@SuccessResponseHandlingConfig' {} Maybe Text
a -> SuccessResponseHandlingConfig
s {$sel:bucketPrefix:SuccessResponseHandlingConfig' :: Maybe Text
bucketPrefix = Maybe Text
a} :: SuccessResponseHandlingConfig)
instance Data.FromJSON SuccessResponseHandlingConfig where
parseJSON :: Value -> Parser SuccessResponseHandlingConfig
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"SuccessResponseHandlingConfig"
( \Object
x ->
Maybe Text -> Maybe Text -> SuccessResponseHandlingConfig
SuccessResponseHandlingConfig'
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
"bucketName")
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
"bucketPrefix")
)
instance
Prelude.Hashable
SuccessResponseHandlingConfig
where
hashWithSalt :: Int -> SuccessResponseHandlingConfig -> Int
hashWithSalt Int
_salt SuccessResponseHandlingConfig' {Maybe Text
bucketPrefix :: Maybe Text
bucketName :: Maybe Text
$sel:bucketPrefix:SuccessResponseHandlingConfig' :: SuccessResponseHandlingConfig -> Maybe Text
$sel:bucketName:SuccessResponseHandlingConfig' :: SuccessResponseHandlingConfig -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
bucketName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
bucketPrefix
instance Prelude.NFData SuccessResponseHandlingConfig where
rnf :: SuccessResponseHandlingConfig -> ()
rnf SuccessResponseHandlingConfig' {Maybe Text
bucketPrefix :: Maybe Text
bucketName :: Maybe Text
$sel:bucketPrefix:SuccessResponseHandlingConfig' :: SuccessResponseHandlingConfig -> Maybe Text
$sel:bucketName:SuccessResponseHandlingConfig' :: SuccessResponseHandlingConfig -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
bucketName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
bucketPrefix
instance Data.ToJSON SuccessResponseHandlingConfig where
toJSON :: SuccessResponseHandlingConfig -> Value
toJSON SuccessResponseHandlingConfig' {Maybe Text
bucketPrefix :: Maybe Text
bucketName :: Maybe Text
$sel:bucketPrefix:SuccessResponseHandlingConfig' :: SuccessResponseHandlingConfig -> Maybe Text
$sel:bucketName:SuccessResponseHandlingConfig' :: SuccessResponseHandlingConfig -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"bucketName" 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
bucketName,
(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
]
)