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