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