{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data DurationRange = DurationRange'
{
DurationRange -> Maybe Natural
maxSeconds :: Prelude.Maybe Prelude.Natural,
DurationRange -> Maybe Natural
minSeconds :: Prelude.Maybe Prelude.Natural
}
deriving (DurationRange -> DurationRange -> Bool
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]
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
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. 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'
{ $sel:maxSeconds:DurationRange' :: Maybe Natural
maxSeconds = forall a. Maybe a
Prelude.Nothing,
$sel:minSeconds:DurationRange' :: Maybe Natural
minSeconds = forall a. Maybe a
Prelude.Nothing
}
durationRange_maxSeconds :: Lens.Lens' DurationRange (Prelude.Maybe Prelude.Natural)
durationRange_maxSeconds :: Lens' DurationRange (Maybe Natural)
durationRange_maxSeconds = 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)
durationRange_minSeconds :: Lens.Lens' DurationRange (Prelude.Maybe Prelude.Natural)
durationRange_minSeconds :: Lens' DurationRange (Maybe Natural)
durationRange_minSeconds = 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)
instance Prelude.Hashable DurationRange where
hashWithSalt :: Int -> DurationRange -> Int
hashWithSalt Int
_salt DurationRange' {Maybe Natural
minSeconds :: Maybe Natural
maxSeconds :: Maybe Natural
$sel:minSeconds:DurationRange' :: DurationRange -> Maybe Natural
$sel:maxSeconds:DurationRange' :: DurationRange -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxSeconds
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
minSeconds
instance Prelude.NFData DurationRange where
rnf :: DurationRange -> ()
rnf DurationRange' {Maybe Natural
minSeconds :: Maybe Natural
maxSeconds :: Maybe Natural
$sel:minSeconds:DurationRange' :: DurationRange -> Maybe Natural
$sel:maxSeconds:DurationRange' :: DurationRange -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxSeconds
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
minSeconds
instance Data.ToJSON DurationRange where
toJSON :: DurationRange -> Value
toJSON DurationRange' {Maybe Natural
minSeconds :: Maybe Natural
maxSeconds :: Maybe Natural
$sel:minSeconds:DurationRange' :: DurationRange -> Maybe Natural
$sel:maxSeconds:DurationRange' :: DurationRange -> Maybe Natural
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"maxSeconds" 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
maxSeconds,
(Key
"minSeconds" 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
minSeconds
]
)