{-# 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.Inspector.Types.DurationRange where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data DurationRange = DurationRange'
{
DurationRange -> Maybe Natural
minSeconds :: Prelude.Maybe Prelude.Natural,
DurationRange -> Maybe Natural
maxSeconds :: Prelude.Maybe Prelude.Natural
}
deriving (DurationRange -> DurationRange -> Bool
(DurationRange -> DurationRange -> Bool)
-> (DurationRange -> DurationRange -> Bool) -> Eq DurationRange
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DurationRange -> DurationRange -> Bool
$c/= :: DurationRange -> DurationRange -> Bool
== :: DurationRange -> DurationRange -> Bool
$c== :: DurationRange -> DurationRange -> Bool
Prelude.Eq, ReadPrec [DurationRange]
ReadPrec DurationRange
Int -> ReadS DurationRange
ReadS [DurationRange]
(Int -> ReadS DurationRange)
-> ReadS [DurationRange]
-> ReadPrec DurationRange
-> ReadPrec [DurationRange]
-> Read DurationRange
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DurationRange]
$creadListPrec :: ReadPrec [DurationRange]
readPrec :: ReadPrec DurationRange
$creadPrec :: ReadPrec DurationRange
readList :: ReadS [DurationRange]
$creadList :: ReadS [DurationRange]
readsPrec :: Int -> ReadS DurationRange
$creadsPrec :: Int -> ReadS DurationRange
Prelude.Read, Int -> DurationRange -> ShowS
[DurationRange] -> ShowS
DurationRange -> String
(Int -> DurationRange -> ShowS)
-> (DurationRange -> String)
-> ([DurationRange] -> ShowS)
-> Show DurationRange
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DurationRange] -> ShowS
$cshowList :: [DurationRange] -> ShowS
show :: DurationRange -> String
$cshow :: DurationRange -> String
showsPrec :: Int -> DurationRange -> ShowS
$cshowsPrec :: Int -> DurationRange -> ShowS
Prelude.Show, (forall x. DurationRange -> Rep DurationRange x)
-> (forall x. Rep DurationRange x -> DurationRange)
-> Generic DurationRange
forall x. Rep DurationRange x -> DurationRange
forall x. DurationRange -> Rep DurationRange x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DurationRange x -> DurationRange
$cfrom :: forall x. DurationRange -> Rep DurationRange x
Prelude.Generic)
newDurationRange ::
DurationRange
newDurationRange :: DurationRange
newDurationRange =
DurationRange' :: Maybe Natural -> Maybe Natural -> DurationRange
DurationRange'
{ $sel:minSeconds:DurationRange' :: Maybe Natural
minSeconds = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:maxSeconds:DurationRange' :: Maybe Natural
maxSeconds = Maybe Natural
forall a. Maybe a
Prelude.Nothing
}
durationRange_minSeconds :: Lens.Lens' DurationRange (Prelude.Maybe Prelude.Natural)
durationRange_minSeconds :: (Maybe Natural -> f (Maybe Natural))
-> DurationRange -> f DurationRange
durationRange_minSeconds = (DurationRange -> Maybe Natural)
-> (DurationRange -> Maybe Natural -> DurationRange)
-> Lens DurationRange DurationRange (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DurationRange' {Maybe Natural
minSeconds :: Maybe Natural
$sel:minSeconds:DurationRange' :: DurationRange -> Maybe Natural
minSeconds} -> Maybe Natural
minSeconds) (\s :: DurationRange
s@DurationRange' {} Maybe Natural
a -> DurationRange
s {$sel:minSeconds:DurationRange' :: Maybe Natural
minSeconds = Maybe Natural
a} :: DurationRange)
durationRange_maxSeconds :: Lens.Lens' DurationRange (Prelude.Maybe Prelude.Natural)
durationRange_maxSeconds :: (Maybe Natural -> f (Maybe Natural))
-> DurationRange -> f DurationRange
durationRange_maxSeconds = (DurationRange -> Maybe Natural)
-> (DurationRange -> Maybe Natural -> DurationRange)
-> Lens DurationRange DurationRange (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DurationRange' {Maybe Natural
maxSeconds :: Maybe Natural
$sel:maxSeconds:DurationRange' :: DurationRange -> Maybe Natural
maxSeconds} -> Maybe Natural
maxSeconds) (\s :: DurationRange
s@DurationRange' {} Maybe Natural
a -> DurationRange
s {$sel:maxSeconds:DurationRange' :: Maybe Natural
maxSeconds = Maybe Natural
a} :: DurationRange)
instance Prelude.Hashable DurationRange
instance Prelude.NFData DurationRange
instance Core.ToJSON DurationRange where
toJSON :: DurationRange -> Value
toJSON DurationRange' {Maybe Natural
maxSeconds :: Maybe Natural
minSeconds :: Maybe Natural
$sel:maxSeconds:DurationRange' :: DurationRange -> Maybe Natural
$sel:minSeconds:DurationRange' :: DurationRange -> Maybe Natural
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"minSeconds" 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
minSeconds,
(Text
"maxSeconds" 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
maxSeconds
]
)