{-# 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.AppMesh.Types.MatchRange 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 MatchRange = MatchRange'
{
MatchRange -> Integer
end :: Prelude.Integer,
MatchRange -> Integer
start :: Prelude.Integer
}
deriving (MatchRange -> MatchRange -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MatchRange -> MatchRange -> Bool
$c/= :: MatchRange -> MatchRange -> Bool
== :: MatchRange -> MatchRange -> Bool
$c== :: MatchRange -> MatchRange -> Bool
Prelude.Eq, ReadPrec [MatchRange]
ReadPrec MatchRange
Int -> ReadS MatchRange
ReadS [MatchRange]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MatchRange]
$creadListPrec :: ReadPrec [MatchRange]
readPrec :: ReadPrec MatchRange
$creadPrec :: ReadPrec MatchRange
readList :: ReadS [MatchRange]
$creadList :: ReadS [MatchRange]
readsPrec :: Int -> ReadS MatchRange
$creadsPrec :: Int -> ReadS MatchRange
Prelude.Read, Int -> MatchRange -> ShowS
[MatchRange] -> ShowS
MatchRange -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MatchRange] -> ShowS
$cshowList :: [MatchRange] -> ShowS
show :: MatchRange -> String
$cshow :: MatchRange -> String
showsPrec :: Int -> MatchRange -> ShowS
$cshowsPrec :: Int -> MatchRange -> ShowS
Prelude.Show, forall x. Rep MatchRange x -> MatchRange
forall x. MatchRange -> Rep MatchRange x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MatchRange x -> MatchRange
$cfrom :: forall x. MatchRange -> Rep MatchRange x
Prelude.Generic)
newMatchRange ::
Prelude.Integer ->
Prelude.Integer ->
MatchRange
newMatchRange :: Integer -> Integer -> MatchRange
newMatchRange Integer
pEnd_ Integer
pStart_ =
MatchRange' {$sel:end:MatchRange' :: Integer
end = Integer
pEnd_, $sel:start:MatchRange' :: Integer
start = Integer
pStart_}
matchRange_end :: Lens.Lens' MatchRange Prelude.Integer
matchRange_end :: Lens' MatchRange Integer
matchRange_end = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MatchRange' {Integer
end :: Integer
$sel:end:MatchRange' :: MatchRange -> Integer
end} -> Integer
end) (\s :: MatchRange
s@MatchRange' {} Integer
a -> MatchRange
s {$sel:end:MatchRange' :: Integer
end = Integer
a} :: MatchRange)
matchRange_start :: Lens.Lens' MatchRange Prelude.Integer
matchRange_start :: Lens' MatchRange Integer
matchRange_start = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MatchRange' {Integer
start :: Integer
$sel:start:MatchRange' :: MatchRange -> Integer
start} -> Integer
start) (\s :: MatchRange
s@MatchRange' {} Integer
a -> MatchRange
s {$sel:start:MatchRange' :: Integer
start = Integer
a} :: MatchRange)
instance Data.FromJSON MatchRange where
parseJSON :: Value -> Parser MatchRange
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"MatchRange"
( \Object
x ->
Integer -> Integer -> MatchRange
MatchRange'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"end")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"start")
)
instance Prelude.Hashable MatchRange where
hashWithSalt :: Int -> MatchRange -> Int
hashWithSalt Int
_salt MatchRange' {Integer
start :: Integer
end :: Integer
$sel:start:MatchRange' :: MatchRange -> Integer
$sel:end:MatchRange' :: MatchRange -> Integer
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Integer
end
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Integer
start
instance Prelude.NFData MatchRange where
rnf :: MatchRange -> ()
rnf MatchRange' {Integer
start :: Integer
end :: Integer
$sel:start:MatchRange' :: MatchRange -> Integer
$sel:end:MatchRange' :: MatchRange -> Integer
..} =
forall a. NFData a => a -> ()
Prelude.rnf Integer
end seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Integer
start
instance Data.ToJSON MatchRange where
toJSON :: MatchRange -> Value
toJSON MatchRange' {Integer
start :: Integer
end :: Integer
$sel:start:MatchRange' :: MatchRange -> Integer
$sel:end:MatchRange' :: MatchRange -> Integer
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"end" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Integer
end),
forall a. a -> Maybe a
Prelude.Just (Key
"start" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Integer
start)
]
)