{-# 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.SNS.SetTopicAttributes
(
SetTopicAttributes (..),
newSetTopicAttributes,
setTopicAttributes_attributeValue,
setTopicAttributes_topicArn,
setTopicAttributes_attributeName,
SetTopicAttributesResponse (..),
newSetTopicAttributesResponse,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SNS.Types
data SetTopicAttributes = SetTopicAttributes'
{
SetTopicAttributes -> Maybe Text
attributeValue :: Prelude.Maybe Prelude.Text,
SetTopicAttributes -> Text
topicArn :: Prelude.Text,
SetTopicAttributes -> Text
attributeName :: Prelude.Text
}
deriving (SetTopicAttributes -> SetTopicAttributes -> Bool
(SetTopicAttributes -> SetTopicAttributes -> Bool)
-> (SetTopicAttributes -> SetTopicAttributes -> Bool)
-> Eq SetTopicAttributes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SetTopicAttributes -> SetTopicAttributes -> Bool
== :: SetTopicAttributes -> SetTopicAttributes -> Bool
$c/= :: SetTopicAttributes -> SetTopicAttributes -> Bool
/= :: SetTopicAttributes -> SetTopicAttributes -> Bool
Prelude.Eq, ReadPrec [SetTopicAttributes]
ReadPrec SetTopicAttributes
Int -> ReadS SetTopicAttributes
ReadS [SetTopicAttributes]
(Int -> ReadS SetTopicAttributes)
-> ReadS [SetTopicAttributes]
-> ReadPrec SetTopicAttributes
-> ReadPrec [SetTopicAttributes]
-> Read SetTopicAttributes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS SetTopicAttributes
readsPrec :: Int -> ReadS SetTopicAttributes
$creadList :: ReadS [SetTopicAttributes]
readList :: ReadS [SetTopicAttributes]
$creadPrec :: ReadPrec SetTopicAttributes
readPrec :: ReadPrec SetTopicAttributes
$creadListPrec :: ReadPrec [SetTopicAttributes]
readListPrec :: ReadPrec [SetTopicAttributes]
Prelude.Read, Int -> SetTopicAttributes -> ShowS
[SetTopicAttributes] -> ShowS
SetTopicAttributes -> String
(Int -> SetTopicAttributes -> ShowS)
-> (SetTopicAttributes -> String)
-> ([SetTopicAttributes] -> ShowS)
-> Show SetTopicAttributes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SetTopicAttributes -> ShowS
showsPrec :: Int -> SetTopicAttributes -> ShowS
$cshow :: SetTopicAttributes -> String
show :: SetTopicAttributes -> String
$cshowList :: [SetTopicAttributes] -> ShowS
showList :: [SetTopicAttributes] -> ShowS
Prelude.Show, (forall x. SetTopicAttributes -> Rep SetTopicAttributes x)
-> (forall x. Rep SetTopicAttributes x -> SetTopicAttributes)
-> Generic SetTopicAttributes
forall x. Rep SetTopicAttributes x -> SetTopicAttributes
forall x. SetTopicAttributes -> Rep SetTopicAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. SetTopicAttributes -> Rep SetTopicAttributes x
from :: forall x. SetTopicAttributes -> Rep SetTopicAttributes x
$cto :: forall x. Rep SetTopicAttributes x -> SetTopicAttributes
to :: forall x. Rep SetTopicAttributes x -> SetTopicAttributes
Prelude.Generic)
newSetTopicAttributes ::
Prelude.Text ->
Prelude.Text ->
SetTopicAttributes
newSetTopicAttributes :: Text -> Text -> SetTopicAttributes
newSetTopicAttributes Text
pTopicArn_ Text
pAttributeName_ =
SetTopicAttributes'
{ attributeValue :: Maybe Text
attributeValue =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
topicArn :: Text
topicArn = Text
pTopicArn_,
attributeName :: Text
attributeName = Text
pAttributeName_
}
setTopicAttributes_attributeValue :: Lens.Lens' SetTopicAttributes (Prelude.Maybe Prelude.Text)
setTopicAttributes_attributeValue :: Lens' SetTopicAttributes (Maybe Text)
setTopicAttributes_attributeValue = (SetTopicAttributes -> Maybe Text)
-> (SetTopicAttributes -> Maybe Text -> SetTopicAttributes)
-> Lens' SetTopicAttributes (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetTopicAttributes' {Maybe Text
attributeValue :: SetTopicAttributes -> Maybe Text
attributeValue :: Maybe Text
attributeValue} -> Maybe Text
attributeValue) (\s :: SetTopicAttributes
s@SetTopicAttributes' {} Maybe Text
a -> SetTopicAttributes
s {attributeValue = a} :: SetTopicAttributes)
setTopicAttributes_topicArn :: Lens.Lens' SetTopicAttributes Prelude.Text
setTopicAttributes_topicArn :: Lens' SetTopicAttributes Text
setTopicAttributes_topicArn = (SetTopicAttributes -> Text)
-> (SetTopicAttributes -> Text -> SetTopicAttributes)
-> Lens' SetTopicAttributes Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetTopicAttributes' {Text
topicArn :: SetTopicAttributes -> Text
topicArn :: Text
topicArn} -> Text
topicArn) (\s :: SetTopicAttributes
s@SetTopicAttributes' {} Text
a -> SetTopicAttributes
s {topicArn = a} :: SetTopicAttributes)
setTopicAttributes_attributeName :: Lens.Lens' SetTopicAttributes Prelude.Text
setTopicAttributes_attributeName :: Lens' SetTopicAttributes Text
setTopicAttributes_attributeName = (SetTopicAttributes -> Text)
-> (SetTopicAttributes -> Text -> SetTopicAttributes)
-> Lens' SetTopicAttributes Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetTopicAttributes' {Text
attributeName :: SetTopicAttributes -> Text
attributeName :: Text
attributeName} -> Text
attributeName) (\s :: SetTopicAttributes
s@SetTopicAttributes' {} Text
a -> SetTopicAttributes
s {attributeName = a} :: SetTopicAttributes)
instance Core.AWSRequest SetTopicAttributes where
type
AWSResponse SetTopicAttributes =
SetTopicAttributesResponse
request :: (Service -> Service)
-> SetTopicAttributes -> Request SetTopicAttributes
request Service -> Service
overrides =
Service -> SetTopicAttributes -> Request SetTopicAttributes
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy SetTopicAttributes
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse SetTopicAttributes)))
response =
AWSResponse SetTopicAttributes
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy SetTopicAttributes
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse SetTopicAttributes)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse SetTopicAttributes
SetTopicAttributesResponse
SetTopicAttributesResponse'
instance Prelude.Hashable SetTopicAttributes where
hashWithSalt :: Int -> SetTopicAttributes -> Int
hashWithSalt Int
_salt SetTopicAttributes' {Maybe Text
Text
attributeValue :: SetTopicAttributes -> Maybe Text
topicArn :: SetTopicAttributes -> Text
attributeName :: SetTopicAttributes -> Text
attributeValue :: Maybe Text
topicArn :: Text
attributeName :: Text
..} =
Int
_salt
Int -> Maybe Text -> Int
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
attributeValue
Int -> Text -> Int
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
topicArn
Int -> Text -> Int
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
attributeName
instance Prelude.NFData SetTopicAttributes where
rnf :: SetTopicAttributes -> ()
rnf SetTopicAttributes' {Maybe Text
Text
attributeValue :: SetTopicAttributes -> Maybe Text
topicArn :: SetTopicAttributes -> Text
attributeName :: SetTopicAttributes -> Text
attributeValue :: Maybe Text
topicArn :: Text
attributeName :: Text
..} =
Maybe Text -> ()
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
attributeValue () -> () -> ()
forall a b. a -> b -> b
`Prelude.seq`
Text -> ()
forall a. NFData a => a -> ()
Prelude.rnf Text
topicArn () -> () -> ()
forall a b. a -> b -> b
`Prelude.seq`
Text -> ()
forall a. NFData a => a -> ()
Prelude.rnf Text
attributeName
instance Data.ToHeaders SetTopicAttributes where
toHeaders :: SetTopicAttributes -> [Header]
toHeaders = [Header] -> SetTopicAttributes -> [Header]
forall a b. a -> b -> a
Prelude.const [Header]
forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath SetTopicAttributes where
toPath :: SetTopicAttributes -> ByteString
toPath = ByteString -> SetTopicAttributes -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery SetTopicAttributes where
toQuery :: SetTopicAttributes -> QueryString
toQuery SetTopicAttributes' {Maybe Text
Text
attributeValue :: SetTopicAttributes -> Maybe Text
topicArn :: SetTopicAttributes -> Text
attributeName :: SetTopicAttributes -> Text
attributeValue :: Maybe Text
topicArn :: Text
attributeName :: Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"SetTopicAttributes" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2010-03-31" :: Prelude.ByteString),
ByteString
"AttributeValue" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
attributeValue,
ByteString
"TopicArn" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
topicArn,
ByteString
"AttributeName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
attributeName
]
data SetTopicAttributesResponse = SetTopicAttributesResponse'
{
}
deriving (SetTopicAttributesResponse -> SetTopicAttributesResponse -> Bool
(SetTopicAttributesResponse -> SetTopicAttributesResponse -> Bool)
-> (SetTopicAttributesResponse
-> SetTopicAttributesResponse -> Bool)
-> Eq SetTopicAttributesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SetTopicAttributesResponse -> SetTopicAttributesResponse -> Bool
== :: SetTopicAttributesResponse -> SetTopicAttributesResponse -> Bool
$c/= :: SetTopicAttributesResponse -> SetTopicAttributesResponse -> Bool
/= :: SetTopicAttributesResponse -> SetTopicAttributesResponse -> Bool
Prelude.Eq, ReadPrec [SetTopicAttributesResponse]
ReadPrec SetTopicAttributesResponse
Int -> ReadS SetTopicAttributesResponse
ReadS [SetTopicAttributesResponse]
(Int -> ReadS SetTopicAttributesResponse)
-> ReadS [SetTopicAttributesResponse]
-> ReadPrec SetTopicAttributesResponse
-> ReadPrec [SetTopicAttributesResponse]
-> Read SetTopicAttributesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS SetTopicAttributesResponse
readsPrec :: Int -> ReadS SetTopicAttributesResponse
$creadList :: ReadS [SetTopicAttributesResponse]
readList :: ReadS [SetTopicAttributesResponse]
$creadPrec :: ReadPrec SetTopicAttributesResponse
readPrec :: ReadPrec SetTopicAttributesResponse
$creadListPrec :: ReadPrec [SetTopicAttributesResponse]
readListPrec :: ReadPrec [SetTopicAttributesResponse]
Prelude.Read, Int -> SetTopicAttributesResponse -> ShowS
[SetTopicAttributesResponse] -> ShowS
SetTopicAttributesResponse -> String
(Int -> SetTopicAttributesResponse -> ShowS)
-> (SetTopicAttributesResponse -> String)
-> ([SetTopicAttributesResponse] -> ShowS)
-> Show SetTopicAttributesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SetTopicAttributesResponse -> ShowS
showsPrec :: Int -> SetTopicAttributesResponse -> ShowS
$cshow :: SetTopicAttributesResponse -> String
show :: SetTopicAttributesResponse -> String
$cshowList :: [SetTopicAttributesResponse] -> ShowS
showList :: [SetTopicAttributesResponse] -> ShowS
Prelude.Show, (forall x.
SetTopicAttributesResponse -> Rep SetTopicAttributesResponse x)
-> (forall x.
Rep SetTopicAttributesResponse x -> SetTopicAttributesResponse)
-> Generic SetTopicAttributesResponse
forall x.
Rep SetTopicAttributesResponse x -> SetTopicAttributesResponse
forall x.
SetTopicAttributesResponse -> Rep SetTopicAttributesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
SetTopicAttributesResponse -> Rep SetTopicAttributesResponse x
from :: forall x.
SetTopicAttributesResponse -> Rep SetTopicAttributesResponse x
$cto :: forall x.
Rep SetTopicAttributesResponse x -> SetTopicAttributesResponse
to :: forall x.
Rep SetTopicAttributesResponse x -> SetTopicAttributesResponse
Prelude.Generic)
newSetTopicAttributesResponse ::
SetTopicAttributesResponse
newSetTopicAttributesResponse :: SetTopicAttributesResponse
newSetTopicAttributesResponse =
SetTopicAttributesResponse
SetTopicAttributesResponse'
instance Prelude.NFData SetTopicAttributesResponse where
rnf :: SetTopicAttributesResponse -> ()
rnf SetTopicAttributesResponse
_ = ()