{-# 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.CloudDirectory.Types.TypedAttributeValueRange where
import Amazonka.CloudDirectory.Types.RangeMode
import Amazonka.CloudDirectory.Types.TypedAttributeValue
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 TypedAttributeValueRange = TypedAttributeValueRange'
{
TypedAttributeValueRange -> Maybe TypedAttributeValue
endValue :: Prelude.Maybe TypedAttributeValue,
TypedAttributeValueRange -> Maybe TypedAttributeValue
startValue :: Prelude.Maybe TypedAttributeValue,
TypedAttributeValueRange -> RangeMode
startMode :: RangeMode,
TypedAttributeValueRange -> RangeMode
endMode :: RangeMode
}
deriving (TypedAttributeValueRange -> TypedAttributeValueRange -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TypedAttributeValueRange -> TypedAttributeValueRange -> Bool
$c/= :: TypedAttributeValueRange -> TypedAttributeValueRange -> Bool
== :: TypedAttributeValueRange -> TypedAttributeValueRange -> Bool
$c== :: TypedAttributeValueRange -> TypedAttributeValueRange -> Bool
Prelude.Eq, ReadPrec [TypedAttributeValueRange]
ReadPrec TypedAttributeValueRange
Int -> ReadS TypedAttributeValueRange
ReadS [TypedAttributeValueRange]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TypedAttributeValueRange]
$creadListPrec :: ReadPrec [TypedAttributeValueRange]
readPrec :: ReadPrec TypedAttributeValueRange
$creadPrec :: ReadPrec TypedAttributeValueRange
readList :: ReadS [TypedAttributeValueRange]
$creadList :: ReadS [TypedAttributeValueRange]
readsPrec :: Int -> ReadS TypedAttributeValueRange
$creadsPrec :: Int -> ReadS TypedAttributeValueRange
Prelude.Read, Int -> TypedAttributeValueRange -> ShowS
[TypedAttributeValueRange] -> ShowS
TypedAttributeValueRange -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TypedAttributeValueRange] -> ShowS
$cshowList :: [TypedAttributeValueRange] -> ShowS
show :: TypedAttributeValueRange -> String
$cshow :: TypedAttributeValueRange -> String
showsPrec :: Int -> TypedAttributeValueRange -> ShowS
$cshowsPrec :: Int -> TypedAttributeValueRange -> ShowS
Prelude.Show, forall x.
Rep TypedAttributeValueRange x -> TypedAttributeValueRange
forall x.
TypedAttributeValueRange -> Rep TypedAttributeValueRange x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep TypedAttributeValueRange x -> TypedAttributeValueRange
$cfrom :: forall x.
TypedAttributeValueRange -> Rep TypedAttributeValueRange x
Prelude.Generic)
newTypedAttributeValueRange ::
RangeMode ->
RangeMode ->
TypedAttributeValueRange
newTypedAttributeValueRange :: RangeMode -> RangeMode -> TypedAttributeValueRange
newTypedAttributeValueRange RangeMode
pStartMode_ RangeMode
pEndMode_ =
TypedAttributeValueRange'
{ $sel:endValue:TypedAttributeValueRange' :: Maybe TypedAttributeValue
endValue =
forall a. Maybe a
Prelude.Nothing,
$sel:startValue:TypedAttributeValueRange' :: Maybe TypedAttributeValue
startValue = forall a. Maybe a
Prelude.Nothing,
$sel:startMode:TypedAttributeValueRange' :: RangeMode
startMode = RangeMode
pStartMode_,
$sel:endMode:TypedAttributeValueRange' :: RangeMode
endMode = RangeMode
pEndMode_
}
typedAttributeValueRange_endValue :: Lens.Lens' TypedAttributeValueRange (Prelude.Maybe TypedAttributeValue)
typedAttributeValueRange_endValue :: Lens' TypedAttributeValueRange (Maybe TypedAttributeValue)
typedAttributeValueRange_endValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TypedAttributeValueRange' {Maybe TypedAttributeValue
endValue :: Maybe TypedAttributeValue
$sel:endValue:TypedAttributeValueRange' :: TypedAttributeValueRange -> Maybe TypedAttributeValue
endValue} -> Maybe TypedAttributeValue
endValue) (\s :: TypedAttributeValueRange
s@TypedAttributeValueRange' {} Maybe TypedAttributeValue
a -> TypedAttributeValueRange
s {$sel:endValue:TypedAttributeValueRange' :: Maybe TypedAttributeValue
endValue = Maybe TypedAttributeValue
a} :: TypedAttributeValueRange)
typedAttributeValueRange_startValue :: Lens.Lens' TypedAttributeValueRange (Prelude.Maybe TypedAttributeValue)
typedAttributeValueRange_startValue :: Lens' TypedAttributeValueRange (Maybe TypedAttributeValue)
typedAttributeValueRange_startValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TypedAttributeValueRange' {Maybe TypedAttributeValue
startValue :: Maybe TypedAttributeValue
$sel:startValue:TypedAttributeValueRange' :: TypedAttributeValueRange -> Maybe TypedAttributeValue
startValue} -> Maybe TypedAttributeValue
startValue) (\s :: TypedAttributeValueRange
s@TypedAttributeValueRange' {} Maybe TypedAttributeValue
a -> TypedAttributeValueRange
s {$sel:startValue:TypedAttributeValueRange' :: Maybe TypedAttributeValue
startValue = Maybe TypedAttributeValue
a} :: TypedAttributeValueRange)
typedAttributeValueRange_startMode :: Lens.Lens' TypedAttributeValueRange RangeMode
typedAttributeValueRange_startMode :: Lens' TypedAttributeValueRange RangeMode
typedAttributeValueRange_startMode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TypedAttributeValueRange' {RangeMode
startMode :: RangeMode
$sel:startMode:TypedAttributeValueRange' :: TypedAttributeValueRange -> RangeMode
startMode} -> RangeMode
startMode) (\s :: TypedAttributeValueRange
s@TypedAttributeValueRange' {} RangeMode
a -> TypedAttributeValueRange
s {$sel:startMode:TypedAttributeValueRange' :: RangeMode
startMode = RangeMode
a} :: TypedAttributeValueRange)
typedAttributeValueRange_endMode :: Lens.Lens' TypedAttributeValueRange RangeMode
typedAttributeValueRange_endMode :: Lens' TypedAttributeValueRange RangeMode
typedAttributeValueRange_endMode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TypedAttributeValueRange' {RangeMode
endMode :: RangeMode
$sel:endMode:TypedAttributeValueRange' :: TypedAttributeValueRange -> RangeMode
endMode} -> RangeMode
endMode) (\s :: TypedAttributeValueRange
s@TypedAttributeValueRange' {} RangeMode
a -> TypedAttributeValueRange
s {$sel:endMode:TypedAttributeValueRange' :: RangeMode
endMode = RangeMode
a} :: TypedAttributeValueRange)
instance Prelude.Hashable TypedAttributeValueRange where
hashWithSalt :: Int -> TypedAttributeValueRange -> Int
hashWithSalt Int
_salt TypedAttributeValueRange' {Maybe TypedAttributeValue
RangeMode
endMode :: RangeMode
startMode :: RangeMode
startValue :: Maybe TypedAttributeValue
endValue :: Maybe TypedAttributeValue
$sel:endMode:TypedAttributeValueRange' :: TypedAttributeValueRange -> RangeMode
$sel:startMode:TypedAttributeValueRange' :: TypedAttributeValueRange -> RangeMode
$sel:startValue:TypedAttributeValueRange' :: TypedAttributeValueRange -> Maybe TypedAttributeValue
$sel:endValue:TypedAttributeValueRange' :: TypedAttributeValueRange -> Maybe TypedAttributeValue
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TypedAttributeValue
endValue
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TypedAttributeValue
startValue
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` RangeMode
startMode
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` RangeMode
endMode
instance Prelude.NFData TypedAttributeValueRange where
rnf :: TypedAttributeValueRange -> ()
rnf TypedAttributeValueRange' {Maybe TypedAttributeValue
RangeMode
endMode :: RangeMode
startMode :: RangeMode
startValue :: Maybe TypedAttributeValue
endValue :: Maybe TypedAttributeValue
$sel:endMode:TypedAttributeValueRange' :: TypedAttributeValueRange -> RangeMode
$sel:startMode:TypedAttributeValueRange' :: TypedAttributeValueRange -> RangeMode
$sel:startValue:TypedAttributeValueRange' :: TypedAttributeValueRange -> Maybe TypedAttributeValue
$sel:endValue:TypedAttributeValueRange' :: TypedAttributeValueRange -> Maybe TypedAttributeValue
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe TypedAttributeValue
endValue
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe TypedAttributeValue
startValue
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf RangeMode
startMode
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf RangeMode
endMode
instance Data.ToJSON TypedAttributeValueRange where
toJSON :: TypedAttributeValueRange -> Value
toJSON TypedAttributeValueRange' {Maybe TypedAttributeValue
RangeMode
endMode :: RangeMode
startMode :: RangeMode
startValue :: Maybe TypedAttributeValue
endValue :: Maybe TypedAttributeValue
$sel:endMode:TypedAttributeValueRange' :: TypedAttributeValueRange -> RangeMode
$sel:startMode:TypedAttributeValueRange' :: TypedAttributeValueRange -> RangeMode
$sel:startValue:TypedAttributeValueRange' :: TypedAttributeValueRange -> Maybe TypedAttributeValue
$sel:endValue:TypedAttributeValueRange' :: TypedAttributeValueRange -> Maybe TypedAttributeValue
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"EndValue" 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 TypedAttributeValue
endValue,
(Key
"StartValue" 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 TypedAttributeValue
startValue,
forall a. a -> Maybe a
Prelude.Just (Key
"StartMode" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= RangeMode
startMode),
forall a. a -> Maybe a
Prelude.Just (Key
"EndMode" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= RangeMode
endMode)
]
)