{-# 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.DeleteAttributes
(
DeleteAttributes (..),
newDeleteAttributes,
deleteAttributes_attributes,
deleteAttributes_expected,
deleteAttributes_domainName,
deleteAttributes_itemName,
DeleteAttributesResponse (..),
newDeleteAttributesResponse,
)
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 DeleteAttributes = DeleteAttributes'
{
DeleteAttributes -> Maybe [Attribute]
attributes :: Prelude.Maybe [Attribute],
DeleteAttributes -> Maybe UpdateCondition
expected :: Prelude.Maybe UpdateCondition,
DeleteAttributes -> Text
domainName :: Prelude.Text,
DeleteAttributes -> Text
itemName :: Prelude.Text
}
deriving (DeleteAttributes -> DeleteAttributes -> Bool
(DeleteAttributes -> DeleteAttributes -> Bool)
-> (DeleteAttributes -> DeleteAttributes -> Bool)
-> Eq DeleteAttributes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteAttributes -> DeleteAttributes -> Bool
$c/= :: DeleteAttributes -> DeleteAttributes -> Bool
== :: DeleteAttributes -> DeleteAttributes -> Bool
$c== :: DeleteAttributes -> DeleteAttributes -> Bool
Prelude.Eq, ReadPrec [DeleteAttributes]
ReadPrec DeleteAttributes
Int -> ReadS DeleteAttributes
ReadS [DeleteAttributes]
(Int -> ReadS DeleteAttributes)
-> ReadS [DeleteAttributes]
-> ReadPrec DeleteAttributes
-> ReadPrec [DeleteAttributes]
-> Read DeleteAttributes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteAttributes]
$creadListPrec :: ReadPrec [DeleteAttributes]
readPrec :: ReadPrec DeleteAttributes
$creadPrec :: ReadPrec DeleteAttributes
readList :: ReadS [DeleteAttributes]
$creadList :: ReadS [DeleteAttributes]
readsPrec :: Int -> ReadS DeleteAttributes
$creadsPrec :: Int -> ReadS DeleteAttributes
Prelude.Read, Int -> DeleteAttributes -> ShowS
[DeleteAttributes] -> ShowS
DeleteAttributes -> String
(Int -> DeleteAttributes -> ShowS)
-> (DeleteAttributes -> String)
-> ([DeleteAttributes] -> ShowS)
-> Show DeleteAttributes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteAttributes] -> ShowS
$cshowList :: [DeleteAttributes] -> ShowS
show :: DeleteAttributes -> String
$cshow :: DeleteAttributes -> String
showsPrec :: Int -> DeleteAttributes -> ShowS
$cshowsPrec :: Int -> DeleteAttributes -> ShowS
Prelude.Show, (forall x. DeleteAttributes -> Rep DeleteAttributes x)
-> (forall x. Rep DeleteAttributes x -> DeleteAttributes)
-> Generic DeleteAttributes
forall x. Rep DeleteAttributes x -> DeleteAttributes
forall x. DeleteAttributes -> Rep DeleteAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteAttributes x -> DeleteAttributes
$cfrom :: forall x. DeleteAttributes -> Rep DeleteAttributes x
Prelude.Generic)
newDeleteAttributes ::
Prelude.Text ->
Prelude.Text ->
DeleteAttributes
newDeleteAttributes :: Text -> Text -> DeleteAttributes
newDeleteAttributes Text
pDomainName_ Text
pItemName_ =
DeleteAttributes' :: Maybe [Attribute]
-> Maybe UpdateCondition -> Text -> Text -> DeleteAttributes
DeleteAttributes'
{ $sel:attributes:DeleteAttributes' :: Maybe [Attribute]
attributes = Maybe [Attribute]
forall a. Maybe a
Prelude.Nothing,
$sel:expected:DeleteAttributes' :: Maybe UpdateCondition
expected = Maybe UpdateCondition
forall a. Maybe a
Prelude.Nothing,
$sel:domainName:DeleteAttributes' :: Text
domainName = Text
pDomainName_,
$sel:itemName:DeleteAttributes' :: Text
itemName = Text
pItemName_
}
deleteAttributes_attributes :: Lens.Lens' DeleteAttributes (Prelude.Maybe [Attribute])
deleteAttributes_attributes :: (Maybe [Attribute] -> f (Maybe [Attribute]))
-> DeleteAttributes -> f DeleteAttributes
deleteAttributes_attributes = (DeleteAttributes -> Maybe [Attribute])
-> (DeleteAttributes -> Maybe [Attribute] -> DeleteAttributes)
-> Lens
DeleteAttributes
DeleteAttributes
(Maybe [Attribute])
(Maybe [Attribute])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAttributes' {Maybe [Attribute]
attributes :: Maybe [Attribute]
$sel:attributes:DeleteAttributes' :: DeleteAttributes -> Maybe [Attribute]
attributes} -> Maybe [Attribute]
attributes) (\s :: DeleteAttributes
s@DeleteAttributes' {} Maybe [Attribute]
a -> DeleteAttributes
s {$sel:attributes:DeleteAttributes' :: Maybe [Attribute]
attributes = Maybe [Attribute]
a} :: DeleteAttributes) ((Maybe [Attribute] -> f (Maybe [Attribute]))
-> DeleteAttributes -> f DeleteAttributes)
-> ((Maybe [Attribute] -> f (Maybe [Attribute]))
-> Maybe [Attribute] -> f (Maybe [Attribute]))
-> (Maybe [Attribute] -> f (Maybe [Attribute]))
-> DeleteAttributes
-> f DeleteAttributes
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Attribute] [Attribute] [Attribute] [Attribute]
-> Iso
(Maybe [Attribute])
(Maybe [Attribute])
(Maybe [Attribute])
(Maybe [Attribute])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Attribute] [Attribute] [Attribute] [Attribute]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
deleteAttributes_expected :: Lens.Lens' DeleteAttributes (Prelude.Maybe UpdateCondition)
deleteAttributes_expected :: (Maybe UpdateCondition -> f (Maybe UpdateCondition))
-> DeleteAttributes -> f DeleteAttributes
deleteAttributes_expected = (DeleteAttributes -> Maybe UpdateCondition)
-> (DeleteAttributes -> Maybe UpdateCondition -> DeleteAttributes)
-> Lens
DeleteAttributes
DeleteAttributes
(Maybe UpdateCondition)
(Maybe UpdateCondition)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAttributes' {Maybe UpdateCondition
expected :: Maybe UpdateCondition
$sel:expected:DeleteAttributes' :: DeleteAttributes -> Maybe UpdateCondition
expected} -> Maybe UpdateCondition
expected) (\s :: DeleteAttributes
s@DeleteAttributes' {} Maybe UpdateCondition
a -> DeleteAttributes
s {$sel:expected:DeleteAttributes' :: Maybe UpdateCondition
expected = Maybe UpdateCondition
a} :: DeleteAttributes)
deleteAttributes_domainName :: Lens.Lens' DeleteAttributes Prelude.Text
deleteAttributes_domainName :: (Text -> f Text) -> DeleteAttributes -> f DeleteAttributes
deleteAttributes_domainName = (DeleteAttributes -> Text)
-> (DeleteAttributes -> Text -> DeleteAttributes)
-> Lens DeleteAttributes DeleteAttributes Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAttributes' {Text
domainName :: Text
$sel:domainName:DeleteAttributes' :: DeleteAttributes -> Text
domainName} -> Text
domainName) (\s :: DeleteAttributes
s@DeleteAttributes' {} Text
a -> DeleteAttributes
s {$sel:domainName:DeleteAttributes' :: Text
domainName = Text
a} :: DeleteAttributes)
deleteAttributes_itemName :: Lens.Lens' DeleteAttributes Prelude.Text
deleteAttributes_itemName :: (Text -> f Text) -> DeleteAttributes -> f DeleteAttributes
deleteAttributes_itemName = (DeleteAttributes -> Text)
-> (DeleteAttributes -> Text -> DeleteAttributes)
-> Lens DeleteAttributes DeleteAttributes Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAttributes' {Text
itemName :: Text
$sel:itemName:DeleteAttributes' :: DeleteAttributes -> Text
itemName} -> Text
itemName) (\s :: DeleteAttributes
s@DeleteAttributes' {} Text
a -> DeleteAttributes
s {$sel:itemName:DeleteAttributes' :: Text
itemName = Text
a} :: DeleteAttributes)
instance Core.AWSRequest DeleteAttributes where
type
AWSResponse DeleteAttributes =
DeleteAttributesResponse
request :: DeleteAttributes -> Request DeleteAttributes
request = Service -> DeleteAttributes -> Request DeleteAttributes
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteAttributes
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteAttributes)))
response =
AWSResponse DeleteAttributes
-> Logger
-> Service
-> Proxy DeleteAttributes
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteAttributes)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse DeleteAttributes
DeleteAttributesResponse
DeleteAttributesResponse'
instance Prelude.Hashable DeleteAttributes
instance Prelude.NFData DeleteAttributes
instance Core.ToHeaders DeleteAttributes where
toHeaders :: DeleteAttributes -> [Header]
toHeaders = [Header] -> DeleteAttributes -> [Header]
forall a b. a -> b -> a
Prelude.const [Header]
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath DeleteAttributes where
toPath :: DeleteAttributes -> ByteString
toPath = ByteString -> DeleteAttributes -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteAttributes where
toQuery :: DeleteAttributes -> QueryString
toQuery DeleteAttributes' {Maybe [Attribute]
Maybe UpdateCondition
Text
itemName :: Text
domainName :: Text
expected :: Maybe UpdateCondition
attributes :: Maybe [Attribute]
$sel:itemName:DeleteAttributes' :: DeleteAttributes -> Text
$sel:domainName:DeleteAttributes' :: DeleteAttributes -> Text
$sel:expected:DeleteAttributes' :: DeleteAttributes -> Maybe UpdateCondition
$sel:attributes:DeleteAttributes' :: DeleteAttributes -> Maybe [Attribute]
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"DeleteAttributes" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2009-04-15" :: Prelude.ByteString),
Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
( ByteString -> [Attribute] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"Attribute"
([Attribute] -> QueryString)
-> Maybe [Attribute] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Attribute]
attributes
),
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
]
data DeleteAttributesResponse = DeleteAttributesResponse'
{
}
deriving (DeleteAttributesResponse -> DeleteAttributesResponse -> Bool
(DeleteAttributesResponse -> DeleteAttributesResponse -> Bool)
-> (DeleteAttributesResponse -> DeleteAttributesResponse -> Bool)
-> Eq DeleteAttributesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteAttributesResponse -> DeleteAttributesResponse -> Bool
$c/= :: DeleteAttributesResponse -> DeleteAttributesResponse -> Bool
== :: DeleteAttributesResponse -> DeleteAttributesResponse -> Bool
$c== :: DeleteAttributesResponse -> DeleteAttributesResponse -> Bool
Prelude.Eq, ReadPrec [DeleteAttributesResponse]
ReadPrec DeleteAttributesResponse
Int -> ReadS DeleteAttributesResponse
ReadS [DeleteAttributesResponse]
(Int -> ReadS DeleteAttributesResponse)
-> ReadS [DeleteAttributesResponse]
-> ReadPrec DeleteAttributesResponse
-> ReadPrec [DeleteAttributesResponse]
-> Read DeleteAttributesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteAttributesResponse]
$creadListPrec :: ReadPrec [DeleteAttributesResponse]
readPrec :: ReadPrec DeleteAttributesResponse
$creadPrec :: ReadPrec DeleteAttributesResponse
readList :: ReadS [DeleteAttributesResponse]
$creadList :: ReadS [DeleteAttributesResponse]
readsPrec :: Int -> ReadS DeleteAttributesResponse
$creadsPrec :: Int -> ReadS DeleteAttributesResponse
Prelude.Read, Int -> DeleteAttributesResponse -> ShowS
[DeleteAttributesResponse] -> ShowS
DeleteAttributesResponse -> String
(Int -> DeleteAttributesResponse -> ShowS)
-> (DeleteAttributesResponse -> String)
-> ([DeleteAttributesResponse] -> ShowS)
-> Show DeleteAttributesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteAttributesResponse] -> ShowS
$cshowList :: [DeleteAttributesResponse] -> ShowS
show :: DeleteAttributesResponse -> String
$cshow :: DeleteAttributesResponse -> String
showsPrec :: Int -> DeleteAttributesResponse -> ShowS
$cshowsPrec :: Int -> DeleteAttributesResponse -> ShowS
Prelude.Show, (forall x.
DeleteAttributesResponse -> Rep DeleteAttributesResponse x)
-> (forall x.
Rep DeleteAttributesResponse x -> DeleteAttributesResponse)
-> Generic DeleteAttributesResponse
forall x.
Rep DeleteAttributesResponse x -> DeleteAttributesResponse
forall x.
DeleteAttributesResponse -> Rep DeleteAttributesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteAttributesResponse x -> DeleteAttributesResponse
$cfrom :: forall x.
DeleteAttributesResponse -> Rep DeleteAttributesResponse x
Prelude.Generic)
newDeleteAttributesResponse ::
DeleteAttributesResponse
newDeleteAttributesResponse :: DeleteAttributesResponse
newDeleteAttributesResponse =
DeleteAttributesResponse
DeleteAttributesResponse'
instance Prelude.NFData DeleteAttributesResponse