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