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