{-# 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.Backup.PutBackupVaultNotifications
(
PutBackupVaultNotifications (..),
newPutBackupVaultNotifications,
putBackupVaultNotifications_backupVaultName,
putBackupVaultNotifications_sNSTopicArn,
putBackupVaultNotifications_backupVaultEvents,
PutBackupVaultNotificationsResponse (..),
newPutBackupVaultNotificationsResponse,
)
where
import Amazonka.Backup.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 PutBackupVaultNotifications = PutBackupVaultNotifications'
{
PutBackupVaultNotifications -> Text
backupVaultName :: Prelude.Text,
PutBackupVaultNotifications -> Text
sNSTopicArn :: Prelude.Text,
PutBackupVaultNotifications -> [BackupVaultEvent]
backupVaultEvents :: [BackupVaultEvent]
}
deriving (PutBackupVaultNotifications -> PutBackupVaultNotifications -> Bool
(PutBackupVaultNotifications
-> PutBackupVaultNotifications -> Bool)
-> (PutBackupVaultNotifications
-> PutBackupVaultNotifications -> Bool)
-> Eq PutBackupVaultNotifications
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutBackupVaultNotifications -> PutBackupVaultNotifications -> Bool
$c/= :: PutBackupVaultNotifications -> PutBackupVaultNotifications -> Bool
== :: PutBackupVaultNotifications -> PutBackupVaultNotifications -> Bool
$c== :: PutBackupVaultNotifications -> PutBackupVaultNotifications -> Bool
Prelude.Eq, ReadPrec [PutBackupVaultNotifications]
ReadPrec PutBackupVaultNotifications
Int -> ReadS PutBackupVaultNotifications
ReadS [PutBackupVaultNotifications]
(Int -> ReadS PutBackupVaultNotifications)
-> ReadS [PutBackupVaultNotifications]
-> ReadPrec PutBackupVaultNotifications
-> ReadPrec [PutBackupVaultNotifications]
-> Read PutBackupVaultNotifications
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutBackupVaultNotifications]
$creadListPrec :: ReadPrec [PutBackupVaultNotifications]
readPrec :: ReadPrec PutBackupVaultNotifications
$creadPrec :: ReadPrec PutBackupVaultNotifications
readList :: ReadS [PutBackupVaultNotifications]
$creadList :: ReadS [PutBackupVaultNotifications]
readsPrec :: Int -> ReadS PutBackupVaultNotifications
$creadsPrec :: Int -> ReadS PutBackupVaultNotifications
Prelude.Read, Int -> PutBackupVaultNotifications -> ShowS
[PutBackupVaultNotifications] -> ShowS
PutBackupVaultNotifications -> String
(Int -> PutBackupVaultNotifications -> ShowS)
-> (PutBackupVaultNotifications -> String)
-> ([PutBackupVaultNotifications] -> ShowS)
-> Show PutBackupVaultNotifications
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutBackupVaultNotifications] -> ShowS
$cshowList :: [PutBackupVaultNotifications] -> ShowS
show :: PutBackupVaultNotifications -> String
$cshow :: PutBackupVaultNotifications -> String
showsPrec :: Int -> PutBackupVaultNotifications -> ShowS
$cshowsPrec :: Int -> PutBackupVaultNotifications -> ShowS
Prelude.Show, (forall x.
PutBackupVaultNotifications -> Rep PutBackupVaultNotifications x)
-> (forall x.
Rep PutBackupVaultNotifications x -> PutBackupVaultNotifications)
-> Generic PutBackupVaultNotifications
forall x.
Rep PutBackupVaultNotifications x -> PutBackupVaultNotifications
forall x.
PutBackupVaultNotifications -> Rep PutBackupVaultNotifications x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutBackupVaultNotifications x -> PutBackupVaultNotifications
$cfrom :: forall x.
PutBackupVaultNotifications -> Rep PutBackupVaultNotifications x
Prelude.Generic)
newPutBackupVaultNotifications ::
Prelude.Text ->
Prelude.Text ->
PutBackupVaultNotifications
newPutBackupVaultNotifications :: Text -> Text -> PutBackupVaultNotifications
newPutBackupVaultNotifications
Text
pBackupVaultName_
Text
pSNSTopicArn_ =
PutBackupVaultNotifications' :: Text -> Text -> [BackupVaultEvent] -> PutBackupVaultNotifications
PutBackupVaultNotifications'
{ $sel:backupVaultName:PutBackupVaultNotifications' :: Text
backupVaultName =
Text
pBackupVaultName_,
$sel:sNSTopicArn:PutBackupVaultNotifications' :: Text
sNSTopicArn = Text
pSNSTopicArn_,
$sel:backupVaultEvents:PutBackupVaultNotifications' :: [BackupVaultEvent]
backupVaultEvents = [BackupVaultEvent]
forall a. Monoid a => a
Prelude.mempty
}
putBackupVaultNotifications_backupVaultName :: Lens.Lens' PutBackupVaultNotifications Prelude.Text
putBackupVaultNotifications_backupVaultName :: (Text -> f Text)
-> PutBackupVaultNotifications -> f PutBackupVaultNotifications
putBackupVaultNotifications_backupVaultName = (PutBackupVaultNotifications -> Text)
-> (PutBackupVaultNotifications
-> Text -> PutBackupVaultNotifications)
-> Lens
PutBackupVaultNotifications PutBackupVaultNotifications Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBackupVaultNotifications' {Text
backupVaultName :: Text
$sel:backupVaultName:PutBackupVaultNotifications' :: PutBackupVaultNotifications -> Text
backupVaultName} -> Text
backupVaultName) (\s :: PutBackupVaultNotifications
s@PutBackupVaultNotifications' {} Text
a -> PutBackupVaultNotifications
s {$sel:backupVaultName:PutBackupVaultNotifications' :: Text
backupVaultName = Text
a} :: PutBackupVaultNotifications)
putBackupVaultNotifications_sNSTopicArn :: Lens.Lens' PutBackupVaultNotifications Prelude.Text
putBackupVaultNotifications_sNSTopicArn :: (Text -> f Text)
-> PutBackupVaultNotifications -> f PutBackupVaultNotifications
putBackupVaultNotifications_sNSTopicArn = (PutBackupVaultNotifications -> Text)
-> (PutBackupVaultNotifications
-> Text -> PutBackupVaultNotifications)
-> Lens
PutBackupVaultNotifications PutBackupVaultNotifications Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBackupVaultNotifications' {Text
sNSTopicArn :: Text
$sel:sNSTopicArn:PutBackupVaultNotifications' :: PutBackupVaultNotifications -> Text
sNSTopicArn} -> Text
sNSTopicArn) (\s :: PutBackupVaultNotifications
s@PutBackupVaultNotifications' {} Text
a -> PutBackupVaultNotifications
s {$sel:sNSTopicArn:PutBackupVaultNotifications' :: Text
sNSTopicArn = Text
a} :: PutBackupVaultNotifications)
putBackupVaultNotifications_backupVaultEvents :: Lens.Lens' PutBackupVaultNotifications [BackupVaultEvent]
putBackupVaultNotifications_backupVaultEvents :: ([BackupVaultEvent] -> f [BackupVaultEvent])
-> PutBackupVaultNotifications -> f PutBackupVaultNotifications
putBackupVaultNotifications_backupVaultEvents = (PutBackupVaultNotifications -> [BackupVaultEvent])
-> (PutBackupVaultNotifications
-> [BackupVaultEvent] -> PutBackupVaultNotifications)
-> Lens
PutBackupVaultNotifications
PutBackupVaultNotifications
[BackupVaultEvent]
[BackupVaultEvent]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBackupVaultNotifications' {[BackupVaultEvent]
backupVaultEvents :: [BackupVaultEvent]
$sel:backupVaultEvents:PutBackupVaultNotifications' :: PutBackupVaultNotifications -> [BackupVaultEvent]
backupVaultEvents} -> [BackupVaultEvent]
backupVaultEvents) (\s :: PutBackupVaultNotifications
s@PutBackupVaultNotifications' {} [BackupVaultEvent]
a -> PutBackupVaultNotifications
s {$sel:backupVaultEvents:PutBackupVaultNotifications' :: [BackupVaultEvent]
backupVaultEvents = [BackupVaultEvent]
a} :: PutBackupVaultNotifications) (([BackupVaultEvent] -> f [BackupVaultEvent])
-> PutBackupVaultNotifications -> f PutBackupVaultNotifications)
-> (([BackupVaultEvent] -> f [BackupVaultEvent])
-> [BackupVaultEvent] -> f [BackupVaultEvent])
-> ([BackupVaultEvent] -> f [BackupVaultEvent])
-> PutBackupVaultNotifications
-> f PutBackupVaultNotifications
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([BackupVaultEvent] -> f [BackupVaultEvent])
-> [BackupVaultEvent] -> f [BackupVaultEvent]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest PutBackupVaultNotifications where
type
AWSResponse PutBackupVaultNotifications =
PutBackupVaultNotificationsResponse
request :: PutBackupVaultNotifications -> Request PutBackupVaultNotifications
request = Service
-> PutBackupVaultNotifications
-> Request PutBackupVaultNotifications
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
response :: Logger
-> Service
-> Proxy PutBackupVaultNotifications
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutBackupVaultNotifications)))
response =
AWSResponse PutBackupVaultNotifications
-> Logger
-> Service
-> Proxy PutBackupVaultNotifications
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutBackupVaultNotifications)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
AWSResponse PutBackupVaultNotifications
PutBackupVaultNotificationsResponse
PutBackupVaultNotificationsResponse'
instance Prelude.Hashable PutBackupVaultNotifications
instance Prelude.NFData PutBackupVaultNotifications
instance Core.ToHeaders PutBackupVaultNotifications where
toHeaders :: PutBackupVaultNotifications -> [Header]
toHeaders =
[Header] -> PutBackupVaultNotifications -> [Header]
forall a b. a -> b -> a
Prelude.const
( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON PutBackupVaultNotifications where
toJSON :: PutBackupVaultNotifications -> Value
toJSON PutBackupVaultNotifications' {[BackupVaultEvent]
Text
backupVaultEvents :: [BackupVaultEvent]
sNSTopicArn :: Text
backupVaultName :: Text
$sel:backupVaultEvents:PutBackupVaultNotifications' :: PutBackupVaultNotifications -> [BackupVaultEvent]
$sel:sNSTopicArn:PutBackupVaultNotifications' :: PutBackupVaultNotifications -> Text
$sel:backupVaultName:PutBackupVaultNotifications' :: PutBackupVaultNotifications -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"SNSTopicArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
sNSTopicArn),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"BackupVaultEvents" Text -> [BackupVaultEvent] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [BackupVaultEvent]
backupVaultEvents)
]
)
instance Core.ToPath PutBackupVaultNotifications where
toPath :: PutBackupVaultNotifications -> ByteString
toPath PutBackupVaultNotifications' {[BackupVaultEvent]
Text
backupVaultEvents :: [BackupVaultEvent]
sNSTopicArn :: Text
backupVaultName :: Text
$sel:backupVaultEvents:PutBackupVaultNotifications' :: PutBackupVaultNotifications -> [BackupVaultEvent]
$sel:sNSTopicArn:PutBackupVaultNotifications' :: PutBackupVaultNotifications -> Text
$sel:backupVaultName:PutBackupVaultNotifications' :: PutBackupVaultNotifications -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/backup-vaults/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
backupVaultName,
ByteString
"/notification-configuration"
]
instance Core.ToQuery PutBackupVaultNotifications where
toQuery :: PutBackupVaultNotifications -> QueryString
toQuery = QueryString -> PutBackupVaultNotifications -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data PutBackupVaultNotificationsResponse = PutBackupVaultNotificationsResponse'
{
}
deriving (PutBackupVaultNotificationsResponse
-> PutBackupVaultNotificationsResponse -> Bool
(PutBackupVaultNotificationsResponse
-> PutBackupVaultNotificationsResponse -> Bool)
-> (PutBackupVaultNotificationsResponse
-> PutBackupVaultNotificationsResponse -> Bool)
-> Eq PutBackupVaultNotificationsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutBackupVaultNotificationsResponse
-> PutBackupVaultNotificationsResponse -> Bool
$c/= :: PutBackupVaultNotificationsResponse
-> PutBackupVaultNotificationsResponse -> Bool
== :: PutBackupVaultNotificationsResponse
-> PutBackupVaultNotificationsResponse -> Bool
$c== :: PutBackupVaultNotificationsResponse
-> PutBackupVaultNotificationsResponse -> Bool
Prelude.Eq, ReadPrec [PutBackupVaultNotificationsResponse]
ReadPrec PutBackupVaultNotificationsResponse
Int -> ReadS PutBackupVaultNotificationsResponse
ReadS [PutBackupVaultNotificationsResponse]
(Int -> ReadS PutBackupVaultNotificationsResponse)
-> ReadS [PutBackupVaultNotificationsResponse]
-> ReadPrec PutBackupVaultNotificationsResponse
-> ReadPrec [PutBackupVaultNotificationsResponse]
-> Read PutBackupVaultNotificationsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutBackupVaultNotificationsResponse]
$creadListPrec :: ReadPrec [PutBackupVaultNotificationsResponse]
readPrec :: ReadPrec PutBackupVaultNotificationsResponse
$creadPrec :: ReadPrec PutBackupVaultNotificationsResponse
readList :: ReadS [PutBackupVaultNotificationsResponse]
$creadList :: ReadS [PutBackupVaultNotificationsResponse]
readsPrec :: Int -> ReadS PutBackupVaultNotificationsResponse
$creadsPrec :: Int -> ReadS PutBackupVaultNotificationsResponse
Prelude.Read, Int -> PutBackupVaultNotificationsResponse -> ShowS
[PutBackupVaultNotificationsResponse] -> ShowS
PutBackupVaultNotificationsResponse -> String
(Int -> PutBackupVaultNotificationsResponse -> ShowS)
-> (PutBackupVaultNotificationsResponse -> String)
-> ([PutBackupVaultNotificationsResponse] -> ShowS)
-> Show PutBackupVaultNotificationsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutBackupVaultNotificationsResponse] -> ShowS
$cshowList :: [PutBackupVaultNotificationsResponse] -> ShowS
show :: PutBackupVaultNotificationsResponse -> String
$cshow :: PutBackupVaultNotificationsResponse -> String
showsPrec :: Int -> PutBackupVaultNotificationsResponse -> ShowS
$cshowsPrec :: Int -> PutBackupVaultNotificationsResponse -> ShowS
Prelude.Show, (forall x.
PutBackupVaultNotificationsResponse
-> Rep PutBackupVaultNotificationsResponse x)
-> (forall x.
Rep PutBackupVaultNotificationsResponse x
-> PutBackupVaultNotificationsResponse)
-> Generic PutBackupVaultNotificationsResponse
forall x.
Rep PutBackupVaultNotificationsResponse x
-> PutBackupVaultNotificationsResponse
forall x.
PutBackupVaultNotificationsResponse
-> Rep PutBackupVaultNotificationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutBackupVaultNotificationsResponse x
-> PutBackupVaultNotificationsResponse
$cfrom :: forall x.
PutBackupVaultNotificationsResponse
-> Rep PutBackupVaultNotificationsResponse x
Prelude.Generic)
newPutBackupVaultNotificationsResponse ::
PutBackupVaultNotificationsResponse
newPutBackupVaultNotificationsResponse :: PutBackupVaultNotificationsResponse
newPutBackupVaultNotificationsResponse =
PutBackupVaultNotificationsResponse
PutBackupVaultNotificationsResponse'
instance
Prelude.NFData
PutBackupVaultNotificationsResponse