{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.SDB.PutAttributes
(
PutAttributes (..),
newPutAttributes,
putAttributes_expected,
putAttributes_domainName,
putAttributes_itemName,
putAttributes_attributes,
PutAttributesResponse (..),
newPutAttributesResponse,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SDB.Types
data PutAttributes = PutAttributes'
{
PutAttributes -> Maybe UpdateCondition
expected :: Prelude.Maybe UpdateCondition,
PutAttributes -> Text
domainName :: Prelude.Text,
PutAttributes -> Text
itemName :: Prelude.Text,
PutAttributes -> [ReplaceableAttribute]
attributes :: [ReplaceableAttribute]
}
deriving (PutAttributes -> PutAttributes -> Bool
(PutAttributes -> PutAttributes -> Bool)
-> (PutAttributes -> PutAttributes -> Bool) -> Eq PutAttributes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutAttributes -> PutAttributes -> Bool
$c/= :: PutAttributes -> PutAttributes -> Bool
== :: PutAttributes -> PutAttributes -> Bool
$c== :: PutAttributes -> PutAttributes -> Bool
Prelude.Eq, ReadPrec [PutAttributes]
ReadPrec PutAttributes
Int -> ReadS PutAttributes
ReadS [PutAttributes]
(Int -> ReadS PutAttributes)
-> ReadS [PutAttributes]
-> ReadPrec PutAttributes
-> ReadPrec [PutAttributes]
-> Read PutAttributes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutAttributes]
$creadListPrec :: ReadPrec [PutAttributes]
readPrec :: ReadPrec PutAttributes
$creadPrec :: ReadPrec PutAttributes
readList :: ReadS [PutAttributes]
$creadList :: ReadS [PutAttributes]
readsPrec :: Int -> ReadS PutAttributes
$creadsPrec :: Int -> ReadS PutAttributes
Prelude.Read, Int -> PutAttributes -> ShowS
[PutAttributes] -> ShowS
PutAttributes -> String
(Int -> PutAttributes -> ShowS)
-> (PutAttributes -> String)
-> ([PutAttributes] -> ShowS)
-> Show PutAttributes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutAttributes] -> ShowS
$cshowList :: [PutAttributes] -> ShowS
show :: PutAttributes -> String
$cshow :: PutAttributes -> String
showsPrec :: Int -> PutAttributes -> ShowS
$cshowsPrec :: Int -> PutAttributes -> ShowS
Prelude.Show, (forall x. PutAttributes -> Rep PutAttributes x)
-> (forall x. Rep PutAttributes x -> PutAttributes)
-> Generic PutAttributes
forall x. Rep PutAttributes x -> PutAttributes
forall x. PutAttributes -> Rep PutAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutAttributes x -> PutAttributes
$cfrom :: forall x. PutAttributes -> Rep PutAttributes x
Prelude.Generic)
newPutAttributes ::
Prelude.Text ->
Prelude.Text ->
PutAttributes
newPutAttributes :: Text -> Text -> PutAttributes
newPutAttributes Text
pDomainName_ Text
pItemName_ =
PutAttributes' :: Maybe UpdateCondition
-> Text -> Text -> [ReplaceableAttribute] -> PutAttributes
PutAttributes'
{ $sel:expected:PutAttributes' :: Maybe UpdateCondition
expected = Maybe UpdateCondition
forall a. Maybe a
Prelude.Nothing,
$sel:domainName:PutAttributes' :: Text
domainName = Text
pDomainName_,
$sel:itemName:PutAttributes' :: Text
itemName = Text
pItemName_,
$sel:attributes:PutAttributes' :: [ReplaceableAttribute]
attributes = [ReplaceableAttribute]
forall a. Monoid a => a
Prelude.mempty
}
putAttributes_expected :: Lens.Lens' PutAttributes (Prelude.Maybe UpdateCondition)
putAttributes_expected :: (Maybe UpdateCondition -> f (Maybe UpdateCondition))
-> PutAttributes -> f PutAttributes
putAttributes_expected = (PutAttributes -> Maybe UpdateCondition)
-> (PutAttributes -> Maybe UpdateCondition -> PutAttributes)
-> Lens
PutAttributes
PutAttributes
(Maybe UpdateCondition)
(Maybe UpdateCondition)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAttributes' {Maybe UpdateCondition
expected :: Maybe UpdateCondition
$sel:expected:PutAttributes' :: PutAttributes -> Maybe UpdateCondition
expected} -> Maybe UpdateCondition
expected) (\s :: PutAttributes
s@PutAttributes' {} Maybe UpdateCondition
a -> PutAttributes
s {$sel:expected:PutAttributes' :: Maybe UpdateCondition
expected = Maybe UpdateCondition
a} :: PutAttributes)
putAttributes_domainName :: Lens.Lens' PutAttributes Prelude.Text
putAttributes_domainName :: (Text -> f Text) -> PutAttributes -> f PutAttributes
putAttributes_domainName = (PutAttributes -> Text)
-> (PutAttributes -> Text -> PutAttributes)
-> Lens PutAttributes PutAttributes Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAttributes' {Text
domainName :: Text
$sel:domainName:PutAttributes' :: PutAttributes -> Text
domainName} -> Text
domainName) (\s :: PutAttributes
s@PutAttributes' {} Text
a -> PutAttributes
s {$sel:domainName:PutAttributes' :: Text
domainName = Text
a} :: PutAttributes)
putAttributes_itemName :: Lens.Lens' PutAttributes Prelude.Text
putAttributes_itemName :: (Text -> f Text) -> PutAttributes -> f PutAttributes
putAttributes_itemName = (PutAttributes -> Text)
-> (PutAttributes -> Text -> PutAttributes)
-> Lens PutAttributes PutAttributes Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAttributes' {Text
itemName :: Text
$sel:itemName:PutAttributes' :: PutAttributes -> Text
itemName} -> Text
itemName) (\s :: PutAttributes
s@PutAttributes' {} Text
a -> PutAttributes
s {$sel:itemName:PutAttributes' :: Text
itemName = Text
a} :: PutAttributes)
putAttributes_attributes :: Lens.Lens' PutAttributes [ReplaceableAttribute]
putAttributes_attributes :: ([ReplaceableAttribute] -> f [ReplaceableAttribute])
-> PutAttributes -> f PutAttributes
putAttributes_attributes = (PutAttributes -> [ReplaceableAttribute])
-> (PutAttributes -> [ReplaceableAttribute] -> PutAttributes)
-> Lens
PutAttributes
PutAttributes
[ReplaceableAttribute]
[ReplaceableAttribute]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAttributes' {[ReplaceableAttribute]
attributes :: [ReplaceableAttribute]
$sel:attributes:PutAttributes' :: PutAttributes -> [ReplaceableAttribute]
attributes} -> [ReplaceableAttribute]
attributes) (\s :: PutAttributes
s@PutAttributes' {} [ReplaceableAttribute]
a -> PutAttributes
s {$sel:attributes:PutAttributes' :: [ReplaceableAttribute]
attributes = [ReplaceableAttribute]
a} :: PutAttributes) (([ReplaceableAttribute] -> f [ReplaceableAttribute])
-> PutAttributes -> f PutAttributes)
-> (([ReplaceableAttribute] -> f [ReplaceableAttribute])
-> [ReplaceableAttribute] -> f [ReplaceableAttribute])
-> ([ReplaceableAttribute] -> f [ReplaceableAttribute])
-> PutAttributes
-> f PutAttributes
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 Core.AWSRequest PutAttributes where
type
AWSResponse PutAttributes =
PutAttributesResponse
request :: PutAttributes -> Request PutAttributes
request = Service -> PutAttributes -> Request PutAttributes
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy PutAttributes
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PutAttributes)))
response =
AWSResponse PutAttributes
-> Logger
-> Service
-> Proxy PutAttributes
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PutAttributes)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse PutAttributes
PutAttributesResponse
PutAttributesResponse'
instance Prelude.Hashable PutAttributes
instance Prelude.NFData PutAttributes
instance Core.ToHeaders PutAttributes where
toHeaders :: PutAttributes -> [Header]
toHeaders = [Header] -> PutAttributes -> [Header]
forall a b. a -> b -> a
Prelude.const [Header]
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath PutAttributes where
toPath :: PutAttributes -> ByteString
toPath = ByteString -> PutAttributes -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery PutAttributes where
toQuery :: PutAttributes -> QueryString
toQuery PutAttributes' {[ReplaceableAttribute]
Maybe UpdateCondition
Text
attributes :: [ReplaceableAttribute]
itemName :: Text
domainName :: Text
expected :: Maybe UpdateCondition
$sel:attributes:PutAttributes' :: PutAttributes -> [ReplaceableAttribute]
$sel:itemName:PutAttributes' :: PutAttributes -> Text
$sel:domainName:PutAttributes' :: PutAttributes -> Text
$sel:expected:PutAttributes' :: PutAttributes -> Maybe UpdateCondition
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"PutAttributes" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2009-04-15" :: Prelude.ByteString),
ByteString
"Expected" ByteString -> Maybe UpdateCondition -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe UpdateCondition
expected,
ByteString
"DomainName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
domainName,
ByteString
"ItemName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
itemName,
ByteString -> [ReplaceableAttribute] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"Attribute" [ReplaceableAttribute]
attributes
]
data PutAttributesResponse = PutAttributesResponse'
{
}
deriving (PutAttributesResponse -> PutAttributesResponse -> Bool
(PutAttributesResponse -> PutAttributesResponse -> Bool)
-> (PutAttributesResponse -> PutAttributesResponse -> Bool)
-> Eq PutAttributesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutAttributesResponse -> PutAttributesResponse -> Bool
$c/= :: PutAttributesResponse -> PutAttributesResponse -> Bool
== :: PutAttributesResponse -> PutAttributesResponse -> Bool
$c== :: PutAttributesResponse -> PutAttributesResponse -> Bool
Prelude.Eq, ReadPrec [PutAttributesResponse]
ReadPrec PutAttributesResponse
Int -> ReadS PutAttributesResponse
ReadS [PutAttributesResponse]
(Int -> ReadS PutAttributesResponse)
-> ReadS [PutAttributesResponse]
-> ReadPrec PutAttributesResponse
-> ReadPrec [PutAttributesResponse]
-> Read PutAttributesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutAttributesResponse]
$creadListPrec :: ReadPrec [PutAttributesResponse]
readPrec :: ReadPrec PutAttributesResponse
$creadPrec :: ReadPrec PutAttributesResponse
readList :: ReadS [PutAttributesResponse]
$creadList :: ReadS [PutAttributesResponse]
readsPrec :: Int -> ReadS PutAttributesResponse
$creadsPrec :: Int -> ReadS PutAttributesResponse
Prelude.Read, Int -> PutAttributesResponse -> ShowS
[PutAttributesResponse] -> ShowS
PutAttributesResponse -> String
(Int -> PutAttributesResponse -> ShowS)
-> (PutAttributesResponse -> String)
-> ([PutAttributesResponse] -> ShowS)
-> Show PutAttributesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutAttributesResponse] -> ShowS
$cshowList :: [PutAttributesResponse] -> ShowS
show :: PutAttributesResponse -> String
$cshow :: PutAttributesResponse -> String
showsPrec :: Int -> PutAttributesResponse -> ShowS
$cshowsPrec :: Int -> PutAttributesResponse -> ShowS
Prelude.Show, (forall x. PutAttributesResponse -> Rep PutAttributesResponse x)
-> (forall x. Rep PutAttributesResponse x -> PutAttributesResponse)
-> Generic PutAttributesResponse
forall x. Rep PutAttributesResponse x -> PutAttributesResponse
forall x. PutAttributesResponse -> Rep PutAttributesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutAttributesResponse x -> PutAttributesResponse
$cfrom :: forall x. PutAttributesResponse -> Rep PutAttributesResponse x
Prelude.Generic)
newPutAttributesResponse ::
PutAttributesResponse
newPutAttributesResponse :: PutAttributesResponse
newPutAttributesResponse = PutAttributesResponse
PutAttributesResponse'
instance Prelude.NFData PutAttributesResponse