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