{-# 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.Lens as Lens
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
(TypedAttributeValueRange -> TypedAttributeValueRange -> Bool)
-> (TypedAttributeValueRange -> TypedAttributeValueRange -> Bool)
-> Eq TypedAttributeValueRange
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]
(Int -> ReadS TypedAttributeValueRange)
-> ReadS [TypedAttributeValueRange]
-> ReadPrec TypedAttributeValueRange
-> ReadPrec [TypedAttributeValueRange]
-> Read 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
(Int -> TypedAttributeValueRange -> ShowS)
-> (TypedAttributeValueRange -> String)
-> ([TypedAttributeValueRange] -> ShowS)
-> Show TypedAttributeValueRange
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.
TypedAttributeValueRange -> Rep TypedAttributeValueRange x)
-> (forall x.
Rep TypedAttributeValueRange x -> TypedAttributeValueRange)
-> Generic TypedAttributeValueRange
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' :: Maybe TypedAttributeValue
-> Maybe TypedAttributeValue
-> RangeMode
-> RangeMode
-> TypedAttributeValueRange
TypedAttributeValueRange'
{ $sel:endValue:TypedAttributeValueRange' :: Maybe TypedAttributeValue
endValue =
Maybe TypedAttributeValue
forall a. Maybe a
Prelude.Nothing,
$sel:startValue:TypedAttributeValueRange' :: Maybe TypedAttributeValue
startValue = Maybe TypedAttributeValue
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 :: (Maybe TypedAttributeValue -> f (Maybe TypedAttributeValue))
-> TypedAttributeValueRange -> f TypedAttributeValueRange
typedAttributeValueRange_endValue = (TypedAttributeValueRange -> Maybe TypedAttributeValue)
-> (TypedAttributeValueRange
-> Maybe TypedAttributeValue -> TypedAttributeValueRange)
-> Lens
TypedAttributeValueRange
TypedAttributeValueRange
(Maybe TypedAttributeValue)
(Maybe TypedAttributeValue)
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 :: (Maybe TypedAttributeValue -> f (Maybe TypedAttributeValue))
-> TypedAttributeValueRange -> f TypedAttributeValueRange
typedAttributeValueRange_startValue = (TypedAttributeValueRange -> Maybe TypedAttributeValue)
-> (TypedAttributeValueRange
-> Maybe TypedAttributeValue -> TypedAttributeValueRange)
-> Lens
TypedAttributeValueRange
TypedAttributeValueRange
(Maybe TypedAttributeValue)
(Maybe TypedAttributeValue)
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 :: (RangeMode -> f RangeMode)
-> TypedAttributeValueRange -> f TypedAttributeValueRange
typedAttributeValueRange_startMode = (TypedAttributeValueRange -> RangeMode)
-> (TypedAttributeValueRange
-> RangeMode -> TypedAttributeValueRange)
-> Lens
TypedAttributeValueRange
TypedAttributeValueRange
RangeMode
RangeMode
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 :: (RangeMode -> f RangeMode)
-> TypedAttributeValueRange -> f TypedAttributeValueRange
typedAttributeValueRange_endMode = (TypedAttributeValueRange -> RangeMode)
-> (TypedAttributeValueRange
-> RangeMode -> TypedAttributeValueRange)
-> Lens
TypedAttributeValueRange
TypedAttributeValueRange
RangeMode
RangeMode
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
instance Prelude.NFData TypedAttributeValueRange
instance Core.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
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"EndValue" Text -> TypedAttributeValue -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (TypedAttributeValue -> Pair)
-> Maybe TypedAttributeValue -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TypedAttributeValue
endValue,
(Text
"StartValue" Text -> TypedAttributeValue -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (TypedAttributeValue -> Pair)
-> Maybe TypedAttributeValue -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TypedAttributeValue
startValue,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"StartMode" Text -> RangeMode -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= RangeMode
startMode),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"EndMode" Text -> RangeMode -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= RangeMode
endMode)
]
)