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