{-# 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.AutoScaling.PutNotificationConfiguration
(
PutNotificationConfiguration (..),
newPutNotificationConfiguration,
putNotificationConfiguration_autoScalingGroupName,
putNotificationConfiguration_topicARN,
putNotificationConfiguration_notificationTypes,
PutNotificationConfigurationResponse (..),
newPutNotificationConfigurationResponse,
)
where
import Amazonka.AutoScaling.Types
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
data PutNotificationConfiguration = PutNotificationConfiguration'
{
PutNotificationConfiguration -> Text
autoScalingGroupName :: Prelude.Text,
PutNotificationConfiguration -> Text
topicARN :: Prelude.Text,
PutNotificationConfiguration -> [Text]
notificationTypes :: [Prelude.Text]
}
deriving (PutNotificationConfiguration
-> PutNotificationConfiguration -> Bool
(PutNotificationConfiguration
-> PutNotificationConfiguration -> Bool)
-> (PutNotificationConfiguration
-> PutNotificationConfiguration -> Bool)
-> Eq PutNotificationConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutNotificationConfiguration
-> PutNotificationConfiguration -> Bool
$c/= :: PutNotificationConfiguration
-> PutNotificationConfiguration -> Bool
== :: PutNotificationConfiguration
-> PutNotificationConfiguration -> Bool
$c== :: PutNotificationConfiguration
-> PutNotificationConfiguration -> Bool
Prelude.Eq, ReadPrec [PutNotificationConfiguration]
ReadPrec PutNotificationConfiguration
Int -> ReadS PutNotificationConfiguration
ReadS [PutNotificationConfiguration]
(Int -> ReadS PutNotificationConfiguration)
-> ReadS [PutNotificationConfiguration]
-> ReadPrec PutNotificationConfiguration
-> ReadPrec [PutNotificationConfiguration]
-> Read PutNotificationConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutNotificationConfiguration]
$creadListPrec :: ReadPrec [PutNotificationConfiguration]
readPrec :: ReadPrec PutNotificationConfiguration
$creadPrec :: ReadPrec PutNotificationConfiguration
readList :: ReadS [PutNotificationConfiguration]
$creadList :: ReadS [PutNotificationConfiguration]
readsPrec :: Int -> ReadS PutNotificationConfiguration
$creadsPrec :: Int -> ReadS PutNotificationConfiguration
Prelude.Read, Int -> PutNotificationConfiguration -> ShowS
[PutNotificationConfiguration] -> ShowS
PutNotificationConfiguration -> String
(Int -> PutNotificationConfiguration -> ShowS)
-> (PutNotificationConfiguration -> String)
-> ([PutNotificationConfiguration] -> ShowS)
-> Show PutNotificationConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutNotificationConfiguration] -> ShowS
$cshowList :: [PutNotificationConfiguration] -> ShowS
show :: PutNotificationConfiguration -> String
$cshow :: PutNotificationConfiguration -> String
showsPrec :: Int -> PutNotificationConfiguration -> ShowS
$cshowsPrec :: Int -> PutNotificationConfiguration -> ShowS
Prelude.Show, (forall x.
PutNotificationConfiguration -> Rep PutNotificationConfiguration x)
-> (forall x.
Rep PutNotificationConfiguration x -> PutNotificationConfiguration)
-> Generic PutNotificationConfiguration
forall x.
Rep PutNotificationConfiguration x -> PutNotificationConfiguration
forall x.
PutNotificationConfiguration -> Rep PutNotificationConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutNotificationConfiguration x -> PutNotificationConfiguration
$cfrom :: forall x.
PutNotificationConfiguration -> Rep PutNotificationConfiguration x
Prelude.Generic)
newPutNotificationConfiguration ::
Prelude.Text ->
Prelude.Text ->
PutNotificationConfiguration
newPutNotificationConfiguration :: Text -> Text -> PutNotificationConfiguration
newPutNotificationConfiguration
Text
pAutoScalingGroupName_
Text
pTopicARN_ =
PutNotificationConfiguration' :: Text -> Text -> [Text] -> PutNotificationConfiguration
PutNotificationConfiguration'
{ $sel:autoScalingGroupName:PutNotificationConfiguration' :: Text
autoScalingGroupName =
Text
pAutoScalingGroupName_,
$sel:topicARN:PutNotificationConfiguration' :: Text
topicARN = Text
pTopicARN_,
$sel:notificationTypes:PutNotificationConfiguration' :: [Text]
notificationTypes = [Text]
forall a. Monoid a => a
Prelude.mempty
}
putNotificationConfiguration_autoScalingGroupName :: Lens.Lens' PutNotificationConfiguration Prelude.Text
putNotificationConfiguration_autoScalingGroupName :: (Text -> f Text)
-> PutNotificationConfiguration -> f PutNotificationConfiguration
putNotificationConfiguration_autoScalingGroupName = (PutNotificationConfiguration -> Text)
-> (PutNotificationConfiguration
-> Text -> PutNotificationConfiguration)
-> Lens
PutNotificationConfiguration PutNotificationConfiguration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutNotificationConfiguration' {Text
autoScalingGroupName :: Text
$sel:autoScalingGroupName:PutNotificationConfiguration' :: PutNotificationConfiguration -> Text
autoScalingGroupName} -> Text
autoScalingGroupName) (\s :: PutNotificationConfiguration
s@PutNotificationConfiguration' {} Text
a -> PutNotificationConfiguration
s {$sel:autoScalingGroupName:PutNotificationConfiguration' :: Text
autoScalingGroupName = Text
a} :: PutNotificationConfiguration)
putNotificationConfiguration_topicARN :: Lens.Lens' PutNotificationConfiguration Prelude.Text
putNotificationConfiguration_topicARN :: (Text -> f Text)
-> PutNotificationConfiguration -> f PutNotificationConfiguration
putNotificationConfiguration_topicARN = (PutNotificationConfiguration -> Text)
-> (PutNotificationConfiguration
-> Text -> PutNotificationConfiguration)
-> Lens
PutNotificationConfiguration PutNotificationConfiguration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutNotificationConfiguration' {Text
topicARN :: Text
$sel:topicARN:PutNotificationConfiguration' :: PutNotificationConfiguration -> Text
topicARN} -> Text
topicARN) (\s :: PutNotificationConfiguration
s@PutNotificationConfiguration' {} Text
a -> PutNotificationConfiguration
s {$sel:topicARN:PutNotificationConfiguration' :: Text
topicARN = Text
a} :: PutNotificationConfiguration)
putNotificationConfiguration_notificationTypes :: Lens.Lens' PutNotificationConfiguration [Prelude.Text]
putNotificationConfiguration_notificationTypes :: ([Text] -> f [Text])
-> PutNotificationConfiguration -> f PutNotificationConfiguration
putNotificationConfiguration_notificationTypes = (PutNotificationConfiguration -> [Text])
-> (PutNotificationConfiguration
-> [Text] -> PutNotificationConfiguration)
-> Lens
PutNotificationConfiguration
PutNotificationConfiguration
[Text]
[Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutNotificationConfiguration' {[Text]
notificationTypes :: [Text]
$sel:notificationTypes:PutNotificationConfiguration' :: PutNotificationConfiguration -> [Text]
notificationTypes} -> [Text]
notificationTypes) (\s :: PutNotificationConfiguration
s@PutNotificationConfiguration' {} [Text]
a -> PutNotificationConfiguration
s {$sel:notificationTypes:PutNotificationConfiguration' :: [Text]
notificationTypes = [Text]
a} :: PutNotificationConfiguration) (([Text] -> f [Text])
-> PutNotificationConfiguration -> f PutNotificationConfiguration)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> PutNotificationConfiguration
-> f PutNotificationConfiguration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest PutNotificationConfiguration where
type
AWSResponse PutNotificationConfiguration =
PutNotificationConfigurationResponse
request :: PutNotificationConfiguration
-> Request PutNotificationConfiguration
request = Service
-> PutNotificationConfiguration
-> Request PutNotificationConfiguration
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy PutNotificationConfiguration
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutNotificationConfiguration)))
response =
AWSResponse PutNotificationConfiguration
-> Logger
-> Service
-> Proxy PutNotificationConfiguration
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutNotificationConfiguration)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
AWSResponse PutNotificationConfiguration
PutNotificationConfigurationResponse
PutNotificationConfigurationResponse'
instance
Prelude.Hashable
PutNotificationConfiguration
instance Prelude.NFData PutNotificationConfiguration
instance Core.ToHeaders PutNotificationConfiguration where
toHeaders :: PutNotificationConfiguration -> [Header]
toHeaders = [Header] -> PutNotificationConfiguration -> [Header]
forall a b. a -> b -> a
Prelude.const [Header]
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath PutNotificationConfiguration where
toPath :: PutNotificationConfiguration -> ByteString
toPath = ByteString -> PutNotificationConfiguration -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery PutNotificationConfiguration where
toQuery :: PutNotificationConfiguration -> QueryString
toQuery PutNotificationConfiguration' {[Text]
Text
notificationTypes :: [Text]
topicARN :: Text
autoScalingGroupName :: Text
$sel:notificationTypes:PutNotificationConfiguration' :: PutNotificationConfiguration -> [Text]
$sel:topicARN:PutNotificationConfiguration' :: PutNotificationConfiguration -> Text
$sel:autoScalingGroupName:PutNotificationConfiguration' :: PutNotificationConfiguration -> Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ( ByteString
"PutNotificationConfiguration" ::
Prelude.ByteString
),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2011-01-01" :: Prelude.ByteString),
ByteString
"AutoScalingGroupName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
autoScalingGroupName,
ByteString
"TopicARN" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
topicARN,
ByteString
"NotificationTypes"
ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" [Text]
notificationTypes
]
data PutNotificationConfigurationResponse = PutNotificationConfigurationResponse'
{
}
deriving (PutNotificationConfigurationResponse
-> PutNotificationConfigurationResponse -> Bool
(PutNotificationConfigurationResponse
-> PutNotificationConfigurationResponse -> Bool)
-> (PutNotificationConfigurationResponse
-> PutNotificationConfigurationResponse -> Bool)
-> Eq PutNotificationConfigurationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutNotificationConfigurationResponse
-> PutNotificationConfigurationResponse -> Bool
$c/= :: PutNotificationConfigurationResponse
-> PutNotificationConfigurationResponse -> Bool
== :: PutNotificationConfigurationResponse
-> PutNotificationConfigurationResponse -> Bool
$c== :: PutNotificationConfigurationResponse
-> PutNotificationConfigurationResponse -> Bool
Prelude.Eq, ReadPrec [PutNotificationConfigurationResponse]
ReadPrec PutNotificationConfigurationResponse
Int -> ReadS PutNotificationConfigurationResponse
ReadS [PutNotificationConfigurationResponse]
(Int -> ReadS PutNotificationConfigurationResponse)
-> ReadS [PutNotificationConfigurationResponse]
-> ReadPrec PutNotificationConfigurationResponse
-> ReadPrec [PutNotificationConfigurationResponse]
-> Read PutNotificationConfigurationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutNotificationConfigurationResponse]
$creadListPrec :: ReadPrec [PutNotificationConfigurationResponse]
readPrec :: ReadPrec PutNotificationConfigurationResponse
$creadPrec :: ReadPrec PutNotificationConfigurationResponse
readList :: ReadS [PutNotificationConfigurationResponse]
$creadList :: ReadS [PutNotificationConfigurationResponse]
readsPrec :: Int -> ReadS PutNotificationConfigurationResponse
$creadsPrec :: Int -> ReadS PutNotificationConfigurationResponse
Prelude.Read, Int -> PutNotificationConfigurationResponse -> ShowS
[PutNotificationConfigurationResponse] -> ShowS
PutNotificationConfigurationResponse -> String
(Int -> PutNotificationConfigurationResponse -> ShowS)
-> (PutNotificationConfigurationResponse -> String)
-> ([PutNotificationConfigurationResponse] -> ShowS)
-> Show PutNotificationConfigurationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutNotificationConfigurationResponse] -> ShowS
$cshowList :: [PutNotificationConfigurationResponse] -> ShowS
show :: PutNotificationConfigurationResponse -> String
$cshow :: PutNotificationConfigurationResponse -> String
showsPrec :: Int -> PutNotificationConfigurationResponse -> ShowS
$cshowsPrec :: Int -> PutNotificationConfigurationResponse -> ShowS
Prelude.Show, (forall x.
PutNotificationConfigurationResponse
-> Rep PutNotificationConfigurationResponse x)
-> (forall x.
Rep PutNotificationConfigurationResponse x
-> PutNotificationConfigurationResponse)
-> Generic PutNotificationConfigurationResponse
forall x.
Rep PutNotificationConfigurationResponse x
-> PutNotificationConfigurationResponse
forall x.
PutNotificationConfigurationResponse
-> Rep PutNotificationConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutNotificationConfigurationResponse x
-> PutNotificationConfigurationResponse
$cfrom :: forall x.
PutNotificationConfigurationResponse
-> Rep PutNotificationConfigurationResponse x
Prelude.Generic)
newPutNotificationConfigurationResponse ::
PutNotificationConfigurationResponse
newPutNotificationConfigurationResponse :: PutNotificationConfigurationResponse
newPutNotificationConfigurationResponse =
PutNotificationConfigurationResponse
PutNotificationConfigurationResponse'
instance
Prelude.NFData
PutNotificationConfigurationResponse