{-# 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.ReplaceableItem where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SDB.Types.ReplaceableAttribute
data ReplaceableItem = ReplaceableItem'
{
ReplaceableItem -> Text
name :: Prelude.Text,
ReplaceableItem -> [ReplaceableAttribute]
attributes :: [ReplaceableAttribute]
}
deriving (ReplaceableItem -> ReplaceableItem -> Bool
(ReplaceableItem -> ReplaceableItem -> Bool)
-> (ReplaceableItem -> ReplaceableItem -> Bool)
-> Eq ReplaceableItem
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReplaceableItem -> ReplaceableItem -> Bool
$c/= :: ReplaceableItem -> ReplaceableItem -> Bool
== :: ReplaceableItem -> ReplaceableItem -> Bool
$c== :: ReplaceableItem -> ReplaceableItem -> Bool
Prelude.Eq, ReadPrec [ReplaceableItem]
ReadPrec ReplaceableItem
Int -> ReadS ReplaceableItem
ReadS [ReplaceableItem]
(Int -> ReadS ReplaceableItem)
-> ReadS [ReplaceableItem]
-> ReadPrec ReplaceableItem
-> ReadPrec [ReplaceableItem]
-> Read ReplaceableItem
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReplaceableItem]
$creadListPrec :: ReadPrec [ReplaceableItem]
readPrec :: ReadPrec ReplaceableItem
$creadPrec :: ReadPrec ReplaceableItem
readList :: ReadS [ReplaceableItem]
$creadList :: ReadS [ReplaceableItem]
readsPrec :: Int -> ReadS ReplaceableItem
$creadsPrec :: Int -> ReadS ReplaceableItem
Prelude.Read, Int -> ReplaceableItem -> ShowS
[ReplaceableItem] -> ShowS
ReplaceableItem -> String
(Int -> ReplaceableItem -> ShowS)
-> (ReplaceableItem -> String)
-> ([ReplaceableItem] -> ShowS)
-> Show ReplaceableItem
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReplaceableItem] -> ShowS
$cshowList :: [ReplaceableItem] -> ShowS
show :: ReplaceableItem -> String
$cshow :: ReplaceableItem -> String
showsPrec :: Int -> ReplaceableItem -> ShowS
$cshowsPrec :: Int -> ReplaceableItem -> ShowS
Prelude.Show, (forall x. ReplaceableItem -> Rep ReplaceableItem x)
-> (forall x. Rep ReplaceableItem x -> ReplaceableItem)
-> Generic ReplaceableItem
forall x. Rep ReplaceableItem x -> ReplaceableItem
forall x. ReplaceableItem -> Rep ReplaceableItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ReplaceableItem x -> ReplaceableItem
$cfrom :: forall x. ReplaceableItem -> Rep ReplaceableItem x
Prelude.Generic)
newReplaceableItem ::
Prelude.Text ->
ReplaceableItem
newReplaceableItem :: Text -> ReplaceableItem
newReplaceableItem Text
pName_ =
ReplaceableItem' :: Text -> [ReplaceableAttribute] -> ReplaceableItem
ReplaceableItem'
{ $sel:name:ReplaceableItem' :: Text
name = Text
pName_,
$sel:attributes:ReplaceableItem' :: [ReplaceableAttribute]
attributes = [ReplaceableAttribute]
forall a. Monoid a => a
Prelude.mempty
}
replaceableItem_name :: Lens.Lens' ReplaceableItem Prelude.Text
replaceableItem_name :: (Text -> f Text) -> ReplaceableItem -> f ReplaceableItem
replaceableItem_name = (ReplaceableItem -> Text)
-> (ReplaceableItem -> Text -> ReplaceableItem)
-> Lens ReplaceableItem ReplaceableItem Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplaceableItem' {Text
name :: Text
$sel:name:ReplaceableItem' :: ReplaceableItem -> Text
name} -> Text
name) (\s :: ReplaceableItem
s@ReplaceableItem' {} Text
a -> ReplaceableItem
s {$sel:name:ReplaceableItem' :: Text
name = Text
a} :: ReplaceableItem)
replaceableItem_attributes :: Lens.Lens' ReplaceableItem [ReplaceableAttribute]
replaceableItem_attributes :: ([ReplaceableAttribute] -> f [ReplaceableAttribute])
-> ReplaceableItem -> f ReplaceableItem
replaceableItem_attributes = (ReplaceableItem -> [ReplaceableAttribute])
-> (ReplaceableItem -> [ReplaceableAttribute] -> ReplaceableItem)
-> Lens
ReplaceableItem
ReplaceableItem
[ReplaceableAttribute]
[ReplaceableAttribute]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplaceableItem' {[ReplaceableAttribute]
attributes :: [ReplaceableAttribute]
$sel:attributes:ReplaceableItem' :: ReplaceableItem -> [ReplaceableAttribute]
attributes} -> [ReplaceableAttribute]
attributes) (\s :: ReplaceableItem
s@ReplaceableItem' {} [ReplaceableAttribute]
a -> ReplaceableItem
s {$sel:attributes:ReplaceableItem' :: [ReplaceableAttribute]
attributes = [ReplaceableAttribute]
a} :: ReplaceableItem) (([ReplaceableAttribute] -> f [ReplaceableAttribute])
-> ReplaceableItem -> f ReplaceableItem)
-> (([ReplaceableAttribute] -> f [ReplaceableAttribute])
-> [ReplaceableAttribute] -> f [ReplaceableAttribute])
-> ([ReplaceableAttribute] -> f [ReplaceableAttribute])
-> ReplaceableItem
-> f ReplaceableItem
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ReplaceableAttribute] -> f [ReplaceableAttribute])
-> [ReplaceableAttribute] -> f [ReplaceableAttribute]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Prelude.Hashable ReplaceableItem
instance Prelude.NFData ReplaceableItem
instance Core.ToQuery ReplaceableItem where
toQuery :: ReplaceableItem -> QueryString
toQuery ReplaceableItem' {[ReplaceableAttribute]
Text
attributes :: [ReplaceableAttribute]
name :: Text
$sel:attributes:ReplaceableItem' :: ReplaceableItem -> [ReplaceableAttribute]
$sel:name:ReplaceableItem' :: ReplaceableItem -> Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"ItemName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
name,
ByteString -> [ReplaceableAttribute] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"Attribute" [ReplaceableAttribute]
attributes
]