{-# 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.SDB.Types.UpdateCondition where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data UpdateCondition = UpdateCondition'
{
UpdateCondition -> Maybe Bool
exists :: Prelude.Maybe Prelude.Bool,
UpdateCondition -> Maybe Text
value :: Prelude.Maybe Prelude.Text,
UpdateCondition -> Maybe Text
name :: Prelude.Maybe Prelude.Text
}
deriving (UpdateCondition -> UpdateCondition -> Bool
(UpdateCondition -> UpdateCondition -> Bool)
-> (UpdateCondition -> UpdateCondition -> Bool)
-> Eq UpdateCondition
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateCondition -> UpdateCondition -> Bool
$c/= :: UpdateCondition -> UpdateCondition -> Bool
== :: UpdateCondition -> UpdateCondition -> Bool
$c== :: UpdateCondition -> UpdateCondition -> Bool
Prelude.Eq, ReadPrec [UpdateCondition]
ReadPrec UpdateCondition
Int -> ReadS UpdateCondition
ReadS [UpdateCondition]
(Int -> ReadS UpdateCondition)
-> ReadS [UpdateCondition]
-> ReadPrec UpdateCondition
-> ReadPrec [UpdateCondition]
-> Read UpdateCondition
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateCondition]
$creadListPrec :: ReadPrec [UpdateCondition]
readPrec :: ReadPrec UpdateCondition
$creadPrec :: ReadPrec UpdateCondition
readList :: ReadS [UpdateCondition]
$creadList :: ReadS [UpdateCondition]
readsPrec :: Int -> ReadS UpdateCondition
$creadsPrec :: Int -> ReadS UpdateCondition
Prelude.Read, Int -> UpdateCondition -> ShowS
[UpdateCondition] -> ShowS
UpdateCondition -> String
(Int -> UpdateCondition -> ShowS)
-> (UpdateCondition -> String)
-> ([UpdateCondition] -> ShowS)
-> Show UpdateCondition
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateCondition] -> ShowS
$cshowList :: [UpdateCondition] -> ShowS
show :: UpdateCondition -> String
$cshow :: UpdateCondition -> String
showsPrec :: Int -> UpdateCondition -> ShowS
$cshowsPrec :: Int -> UpdateCondition -> ShowS
Prelude.Show, (forall x. UpdateCondition -> Rep UpdateCondition x)
-> (forall x. Rep UpdateCondition x -> UpdateCondition)
-> Generic UpdateCondition
forall x. Rep UpdateCondition x -> UpdateCondition
forall x. UpdateCondition -> Rep UpdateCondition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateCondition x -> UpdateCondition
$cfrom :: forall x. UpdateCondition -> Rep UpdateCondition x
Prelude.Generic)
newUpdateCondition ::
UpdateCondition
newUpdateCondition :: UpdateCondition
newUpdateCondition =
UpdateCondition' :: Maybe Bool -> Maybe Text -> Maybe Text -> UpdateCondition
UpdateCondition'
{ $sel:exists:UpdateCondition' :: Maybe Bool
exists = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:value:UpdateCondition' :: Maybe Text
value = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:UpdateCondition' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
updateCondition_exists :: Lens.Lens' UpdateCondition (Prelude.Maybe Prelude.Bool)
updateCondition_exists :: (Maybe Bool -> f (Maybe Bool))
-> UpdateCondition -> f UpdateCondition
updateCondition_exists = (UpdateCondition -> Maybe Bool)
-> (UpdateCondition -> Maybe Bool -> UpdateCondition)
-> Lens UpdateCondition UpdateCondition (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCondition' {Maybe Bool
exists :: Maybe Bool
$sel:exists:UpdateCondition' :: UpdateCondition -> Maybe Bool
exists} -> Maybe Bool
exists) (\s :: UpdateCondition
s@UpdateCondition' {} Maybe Bool
a -> UpdateCondition
s {$sel:exists:UpdateCondition' :: Maybe Bool
exists = Maybe Bool
a} :: UpdateCondition)
updateCondition_value :: Lens.Lens' UpdateCondition (Prelude.Maybe Prelude.Text)
updateCondition_value :: (Maybe Text -> f (Maybe Text))
-> UpdateCondition -> f UpdateCondition
updateCondition_value = (UpdateCondition -> Maybe Text)
-> (UpdateCondition -> Maybe Text -> UpdateCondition)
-> Lens UpdateCondition UpdateCondition (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCondition' {Maybe Text
value :: Maybe Text
$sel:value:UpdateCondition' :: UpdateCondition -> Maybe Text
value} -> Maybe Text
value) (\s :: UpdateCondition
s@UpdateCondition' {} Maybe Text
a -> UpdateCondition
s {$sel:value:UpdateCondition' :: Maybe Text
value = Maybe Text
a} :: UpdateCondition)
updateCondition_name :: Lens.Lens' UpdateCondition (Prelude.Maybe Prelude.Text)
updateCondition_name :: (Maybe Text -> f (Maybe Text))
-> UpdateCondition -> f UpdateCondition
updateCondition_name = (UpdateCondition -> Maybe Text)
-> (UpdateCondition -> Maybe Text -> UpdateCondition)
-> Lens UpdateCondition UpdateCondition (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCondition' {Maybe Text
name :: Maybe Text
$sel:name:UpdateCondition' :: UpdateCondition -> Maybe Text
name} -> Maybe Text
name) (\s :: UpdateCondition
s@UpdateCondition' {} Maybe Text
a -> UpdateCondition
s {$sel:name:UpdateCondition' :: Maybe Text
name = Maybe Text
a} :: UpdateCondition)
instance Prelude.Hashable UpdateCondition
instance Prelude.NFData UpdateCondition
instance Core.ToQuery UpdateCondition where
toQuery :: UpdateCondition -> QueryString
toQuery UpdateCondition' {Maybe Bool
Maybe Text
name :: Maybe Text
value :: Maybe Text
exists :: Maybe Bool
$sel:name:UpdateCondition' :: UpdateCondition -> Maybe Text
$sel:value:UpdateCondition' :: UpdateCondition -> Maybe Text
$sel:exists:UpdateCondition' :: UpdateCondition -> Maybe Bool
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Exists" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
exists,
ByteString
"Value" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
value,
ByteString
"Name" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
name
]