{-# 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.FMS.PutNotificationChannel
(
PutNotificationChannel (..),
newPutNotificationChannel,
putNotificationChannel_snsTopicArn,
putNotificationChannel_snsRoleName,
PutNotificationChannelResponse (..),
newPutNotificationChannelResponse,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.FMS.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data PutNotificationChannel = PutNotificationChannel'
{
PutNotificationChannel -> Text
snsTopicArn :: Prelude.Text,
PutNotificationChannel -> Text
snsRoleName :: Prelude.Text
}
deriving (PutNotificationChannel -> PutNotificationChannel -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutNotificationChannel -> PutNotificationChannel -> Bool
$c/= :: PutNotificationChannel -> PutNotificationChannel -> Bool
== :: PutNotificationChannel -> PutNotificationChannel -> Bool
$c== :: PutNotificationChannel -> PutNotificationChannel -> Bool
Prelude.Eq, ReadPrec [PutNotificationChannel]
ReadPrec PutNotificationChannel
Int -> ReadS PutNotificationChannel
ReadS [PutNotificationChannel]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutNotificationChannel]
$creadListPrec :: ReadPrec [PutNotificationChannel]
readPrec :: ReadPrec PutNotificationChannel
$creadPrec :: ReadPrec PutNotificationChannel
readList :: ReadS [PutNotificationChannel]
$creadList :: ReadS [PutNotificationChannel]
readsPrec :: Int -> ReadS PutNotificationChannel
$creadsPrec :: Int -> ReadS PutNotificationChannel
Prelude.Read, Int -> PutNotificationChannel -> ShowS
[PutNotificationChannel] -> ShowS
PutNotificationChannel -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutNotificationChannel] -> ShowS
$cshowList :: [PutNotificationChannel] -> ShowS
show :: PutNotificationChannel -> String
$cshow :: PutNotificationChannel -> String
showsPrec :: Int -> PutNotificationChannel -> ShowS
$cshowsPrec :: Int -> PutNotificationChannel -> ShowS
Prelude.Show, forall x. Rep PutNotificationChannel x -> PutNotificationChannel
forall x. PutNotificationChannel -> Rep PutNotificationChannel x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutNotificationChannel x -> PutNotificationChannel
$cfrom :: forall x. PutNotificationChannel -> Rep PutNotificationChannel x
Prelude.Generic)
newPutNotificationChannel ::
Prelude.Text ->
Prelude.Text ->
PutNotificationChannel
newPutNotificationChannel :: Text -> Text -> PutNotificationChannel
newPutNotificationChannel Text
pSnsTopicArn_ Text
pSnsRoleName_ =
PutNotificationChannel'
{ $sel:snsTopicArn:PutNotificationChannel' :: Text
snsTopicArn =
Text
pSnsTopicArn_,
$sel:snsRoleName:PutNotificationChannel' :: Text
snsRoleName = Text
pSnsRoleName_
}
putNotificationChannel_snsTopicArn :: Lens.Lens' PutNotificationChannel Prelude.Text
putNotificationChannel_snsTopicArn :: Lens' PutNotificationChannel Text
putNotificationChannel_snsTopicArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutNotificationChannel' {Text
snsTopicArn :: Text
$sel:snsTopicArn:PutNotificationChannel' :: PutNotificationChannel -> Text
snsTopicArn} -> Text
snsTopicArn) (\s :: PutNotificationChannel
s@PutNotificationChannel' {} Text
a -> PutNotificationChannel
s {$sel:snsTopicArn:PutNotificationChannel' :: Text
snsTopicArn = Text
a} :: PutNotificationChannel)
putNotificationChannel_snsRoleName :: Lens.Lens' PutNotificationChannel Prelude.Text
putNotificationChannel_snsRoleName :: Lens' PutNotificationChannel Text
putNotificationChannel_snsRoleName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutNotificationChannel' {Text
snsRoleName :: Text
$sel:snsRoleName:PutNotificationChannel' :: PutNotificationChannel -> Text
snsRoleName} -> Text
snsRoleName) (\s :: PutNotificationChannel
s@PutNotificationChannel' {} Text
a -> PutNotificationChannel
s {$sel:snsRoleName:PutNotificationChannel' :: Text
snsRoleName = Text
a} :: PutNotificationChannel)
instance Core.AWSRequest PutNotificationChannel where
type
AWSResponse PutNotificationChannel =
PutNotificationChannelResponse
request :: (Service -> Service)
-> PutNotificationChannel -> Request PutNotificationChannel
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy PutNotificationChannel
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutNotificationChannel)))
response =
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
PutNotificationChannelResponse
PutNotificationChannelResponse'
instance Prelude.Hashable PutNotificationChannel where
hashWithSalt :: Int -> PutNotificationChannel -> Int
hashWithSalt Int
_salt PutNotificationChannel' {Text
snsRoleName :: Text
snsTopicArn :: Text
$sel:snsRoleName:PutNotificationChannel' :: PutNotificationChannel -> Text
$sel:snsTopicArn:PutNotificationChannel' :: PutNotificationChannel -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
snsTopicArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
snsRoleName
instance Prelude.NFData PutNotificationChannel where
rnf :: PutNotificationChannel -> ()
rnf PutNotificationChannel' {Text
snsRoleName :: Text
snsTopicArn :: Text
$sel:snsRoleName:PutNotificationChannel' :: PutNotificationChannel -> Text
$sel:snsTopicArn:PutNotificationChannel' :: PutNotificationChannel -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
snsTopicArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
snsRoleName
instance Data.ToHeaders PutNotificationChannel where
toHeaders :: PutNotificationChannel -> [Header]
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> [Header]
Data.=# ( ByteString
"AWSFMS_20180101.PutNotificationChannel" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> [Header]
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON PutNotificationChannel where
toJSON :: PutNotificationChannel -> Value
toJSON PutNotificationChannel' {Text
snsRoleName :: Text
snsTopicArn :: Text
$sel:snsRoleName:PutNotificationChannel' :: PutNotificationChannel -> Text
$sel:snsTopicArn:PutNotificationChannel' :: PutNotificationChannel -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"SnsTopicArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
snsTopicArn),
forall a. a -> Maybe a
Prelude.Just (Key
"SnsRoleName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
snsRoleName)
]
)
instance Data.ToPath PutNotificationChannel where
toPath :: PutNotificationChannel -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery PutNotificationChannel where
toQuery :: PutNotificationChannel -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data PutNotificationChannelResponse = PutNotificationChannelResponse'
{
}
deriving (PutNotificationChannelResponse
-> PutNotificationChannelResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutNotificationChannelResponse
-> PutNotificationChannelResponse -> Bool
$c/= :: PutNotificationChannelResponse
-> PutNotificationChannelResponse -> Bool
== :: PutNotificationChannelResponse
-> PutNotificationChannelResponse -> Bool
$c== :: PutNotificationChannelResponse
-> PutNotificationChannelResponse -> Bool
Prelude.Eq, ReadPrec [PutNotificationChannelResponse]
ReadPrec PutNotificationChannelResponse
Int -> ReadS PutNotificationChannelResponse
ReadS [PutNotificationChannelResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutNotificationChannelResponse]
$creadListPrec :: ReadPrec [PutNotificationChannelResponse]
readPrec :: ReadPrec PutNotificationChannelResponse
$creadPrec :: ReadPrec PutNotificationChannelResponse
readList :: ReadS [PutNotificationChannelResponse]
$creadList :: ReadS [PutNotificationChannelResponse]
readsPrec :: Int -> ReadS PutNotificationChannelResponse
$creadsPrec :: Int -> ReadS PutNotificationChannelResponse
Prelude.Read, Int -> PutNotificationChannelResponse -> ShowS
[PutNotificationChannelResponse] -> ShowS
PutNotificationChannelResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutNotificationChannelResponse] -> ShowS
$cshowList :: [PutNotificationChannelResponse] -> ShowS
show :: PutNotificationChannelResponse -> String
$cshow :: PutNotificationChannelResponse -> String
showsPrec :: Int -> PutNotificationChannelResponse -> ShowS
$cshowsPrec :: Int -> PutNotificationChannelResponse -> ShowS
Prelude.Show, forall x.
Rep PutNotificationChannelResponse x
-> PutNotificationChannelResponse
forall x.
PutNotificationChannelResponse
-> Rep PutNotificationChannelResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutNotificationChannelResponse x
-> PutNotificationChannelResponse
$cfrom :: forall x.
PutNotificationChannelResponse
-> Rep PutNotificationChannelResponse x
Prelude.Generic)
newPutNotificationChannelResponse ::
PutNotificationChannelResponse
newPutNotificationChannelResponse :: PutNotificationChannelResponse
newPutNotificationChannelResponse =
PutNotificationChannelResponse
PutNotificationChannelResponse'
instance
Prelude.NFData
PutNotificationChannelResponse
where
rnf :: PutNotificationChannelResponse -> ()
rnf PutNotificationChannelResponse
_ = ()