{-# 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.GetBackupVaultNotifications
(
GetBackupVaultNotifications (..),
newGetBackupVaultNotifications,
getBackupVaultNotifications_backupVaultName,
GetBackupVaultNotificationsResponse (..),
newGetBackupVaultNotificationsResponse,
getBackupVaultNotificationsResponse_backupVaultArn,
getBackupVaultNotificationsResponse_backupVaultEvents,
getBackupVaultNotificationsResponse_backupVaultName,
getBackupVaultNotificationsResponse_sNSTopicArn,
getBackupVaultNotificationsResponse_httpStatus,
)
where
import Amazonka.Backup.Types
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
data GetBackupVaultNotifications = GetBackupVaultNotifications'
{
GetBackupVaultNotifications -> Text
backupVaultName :: Prelude.Text
}
deriving (GetBackupVaultNotifications -> GetBackupVaultNotifications -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetBackupVaultNotifications -> GetBackupVaultNotifications -> Bool
$c/= :: GetBackupVaultNotifications -> GetBackupVaultNotifications -> Bool
== :: GetBackupVaultNotifications -> GetBackupVaultNotifications -> Bool
$c== :: GetBackupVaultNotifications -> GetBackupVaultNotifications -> Bool
Prelude.Eq, ReadPrec [GetBackupVaultNotifications]
ReadPrec GetBackupVaultNotifications
Int -> ReadS GetBackupVaultNotifications
ReadS [GetBackupVaultNotifications]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetBackupVaultNotifications]
$creadListPrec :: ReadPrec [GetBackupVaultNotifications]
readPrec :: ReadPrec GetBackupVaultNotifications
$creadPrec :: ReadPrec GetBackupVaultNotifications
readList :: ReadS [GetBackupVaultNotifications]
$creadList :: ReadS [GetBackupVaultNotifications]
readsPrec :: Int -> ReadS GetBackupVaultNotifications
$creadsPrec :: Int -> ReadS GetBackupVaultNotifications
Prelude.Read, Int -> GetBackupVaultNotifications -> ShowS
[GetBackupVaultNotifications] -> ShowS
GetBackupVaultNotifications -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetBackupVaultNotifications] -> ShowS
$cshowList :: [GetBackupVaultNotifications] -> ShowS
show :: GetBackupVaultNotifications -> String
$cshow :: GetBackupVaultNotifications -> String
showsPrec :: Int -> GetBackupVaultNotifications -> ShowS
$cshowsPrec :: Int -> GetBackupVaultNotifications -> ShowS
Prelude.Show, forall x.
Rep GetBackupVaultNotifications x -> GetBackupVaultNotifications
forall x.
GetBackupVaultNotifications -> Rep GetBackupVaultNotifications x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetBackupVaultNotifications x -> GetBackupVaultNotifications
$cfrom :: forall x.
GetBackupVaultNotifications -> Rep GetBackupVaultNotifications x
Prelude.Generic)
newGetBackupVaultNotifications ::
Prelude.Text ->
GetBackupVaultNotifications
newGetBackupVaultNotifications :: Text -> GetBackupVaultNotifications
newGetBackupVaultNotifications Text
pBackupVaultName_ =
GetBackupVaultNotifications'
{ $sel:backupVaultName:GetBackupVaultNotifications' :: Text
backupVaultName =
Text
pBackupVaultName_
}
getBackupVaultNotifications_backupVaultName :: Lens.Lens' GetBackupVaultNotifications Prelude.Text
getBackupVaultNotifications_backupVaultName :: Lens' GetBackupVaultNotifications Text
getBackupVaultNotifications_backupVaultName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBackupVaultNotifications' {Text
backupVaultName :: Text
$sel:backupVaultName:GetBackupVaultNotifications' :: GetBackupVaultNotifications -> Text
backupVaultName} -> Text
backupVaultName) (\s :: GetBackupVaultNotifications
s@GetBackupVaultNotifications' {} Text
a -> GetBackupVaultNotifications
s {$sel:backupVaultName:GetBackupVaultNotifications' :: Text
backupVaultName = Text
a} :: GetBackupVaultNotifications)
instance Core.AWSRequest GetBackupVaultNotifications where
type
AWSResponse GetBackupVaultNotifications =
GetBackupVaultNotificationsResponse
request :: (Service -> Service)
-> GetBackupVaultNotifications
-> Request GetBackupVaultNotifications
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetBackupVaultNotifications
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetBackupVaultNotifications)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text
-> Maybe [BackupVaultEvent]
-> Maybe Text
-> Maybe Text
-> Int
-> GetBackupVaultNotificationsResponse
GetBackupVaultNotificationsResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"BackupVaultArn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"BackupVaultEvents"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"BackupVaultName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"SNSTopicArn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable GetBackupVaultNotifications where
hashWithSalt :: Int -> GetBackupVaultNotifications -> Int
hashWithSalt Int
_salt GetBackupVaultNotifications' {Text
backupVaultName :: Text
$sel:backupVaultName:GetBackupVaultNotifications' :: GetBackupVaultNotifications -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
backupVaultName
instance Prelude.NFData GetBackupVaultNotifications where
rnf :: GetBackupVaultNotifications -> ()
rnf GetBackupVaultNotifications' {Text
backupVaultName :: Text
$sel:backupVaultName:GetBackupVaultNotifications' :: GetBackupVaultNotifications -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
backupVaultName
instance Data.ToHeaders GetBackupVaultNotifications where
toHeaders :: GetBackupVaultNotifications -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToPath GetBackupVaultNotifications where
toPath :: GetBackupVaultNotifications -> ByteString
toPath GetBackupVaultNotifications' {Text
backupVaultName :: Text
$sel:backupVaultName:GetBackupVaultNotifications' :: GetBackupVaultNotifications -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/backup-vaults/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
backupVaultName,
ByteString
"/notification-configuration"
]
instance Data.ToQuery GetBackupVaultNotifications where
toQuery :: GetBackupVaultNotifications -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data GetBackupVaultNotificationsResponse = GetBackupVaultNotificationsResponse'
{
GetBackupVaultNotificationsResponse -> Maybe Text
backupVaultArn :: Prelude.Maybe Prelude.Text,
GetBackupVaultNotificationsResponse -> Maybe [BackupVaultEvent]
backupVaultEvents :: Prelude.Maybe [BackupVaultEvent],
GetBackupVaultNotificationsResponse -> Maybe Text
backupVaultName :: Prelude.Maybe Prelude.Text,
GetBackupVaultNotificationsResponse -> Maybe Text
sNSTopicArn :: Prelude.Maybe Prelude.Text,
GetBackupVaultNotificationsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetBackupVaultNotificationsResponse
-> GetBackupVaultNotificationsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetBackupVaultNotificationsResponse
-> GetBackupVaultNotificationsResponse -> Bool
$c/= :: GetBackupVaultNotificationsResponse
-> GetBackupVaultNotificationsResponse -> Bool
== :: GetBackupVaultNotificationsResponse
-> GetBackupVaultNotificationsResponse -> Bool
$c== :: GetBackupVaultNotificationsResponse
-> GetBackupVaultNotificationsResponse -> Bool
Prelude.Eq, ReadPrec [GetBackupVaultNotificationsResponse]
ReadPrec GetBackupVaultNotificationsResponse
Int -> ReadS GetBackupVaultNotificationsResponse
ReadS [GetBackupVaultNotificationsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetBackupVaultNotificationsResponse]
$creadListPrec :: ReadPrec [GetBackupVaultNotificationsResponse]
readPrec :: ReadPrec GetBackupVaultNotificationsResponse
$creadPrec :: ReadPrec GetBackupVaultNotificationsResponse
readList :: ReadS [GetBackupVaultNotificationsResponse]
$creadList :: ReadS [GetBackupVaultNotificationsResponse]
readsPrec :: Int -> ReadS GetBackupVaultNotificationsResponse
$creadsPrec :: Int -> ReadS GetBackupVaultNotificationsResponse
Prelude.Read, Int -> GetBackupVaultNotificationsResponse -> ShowS
[GetBackupVaultNotificationsResponse] -> ShowS
GetBackupVaultNotificationsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetBackupVaultNotificationsResponse] -> ShowS
$cshowList :: [GetBackupVaultNotificationsResponse] -> ShowS
show :: GetBackupVaultNotificationsResponse -> String
$cshow :: GetBackupVaultNotificationsResponse -> String
showsPrec :: Int -> GetBackupVaultNotificationsResponse -> ShowS
$cshowsPrec :: Int -> GetBackupVaultNotificationsResponse -> ShowS
Prelude.Show, forall x.
Rep GetBackupVaultNotificationsResponse x
-> GetBackupVaultNotificationsResponse
forall x.
GetBackupVaultNotificationsResponse
-> Rep GetBackupVaultNotificationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetBackupVaultNotificationsResponse x
-> GetBackupVaultNotificationsResponse
$cfrom :: forall x.
GetBackupVaultNotificationsResponse
-> Rep GetBackupVaultNotificationsResponse x
Prelude.Generic)
newGetBackupVaultNotificationsResponse ::
Prelude.Int ->
GetBackupVaultNotificationsResponse
newGetBackupVaultNotificationsResponse :: Int -> GetBackupVaultNotificationsResponse
newGetBackupVaultNotificationsResponse Int
pHttpStatus_ =
GetBackupVaultNotificationsResponse'
{ $sel:backupVaultArn:GetBackupVaultNotificationsResponse' :: Maybe Text
backupVaultArn =
forall a. Maybe a
Prelude.Nothing,
$sel:backupVaultEvents:GetBackupVaultNotificationsResponse' :: Maybe [BackupVaultEvent]
backupVaultEvents = forall a. Maybe a
Prelude.Nothing,
$sel:backupVaultName:GetBackupVaultNotificationsResponse' :: Maybe Text
backupVaultName = forall a. Maybe a
Prelude.Nothing,
$sel:sNSTopicArn:GetBackupVaultNotificationsResponse' :: Maybe Text
sNSTopicArn = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetBackupVaultNotificationsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getBackupVaultNotificationsResponse_backupVaultArn :: Lens.Lens' GetBackupVaultNotificationsResponse (Prelude.Maybe Prelude.Text)
getBackupVaultNotificationsResponse_backupVaultArn :: Lens' GetBackupVaultNotificationsResponse (Maybe Text)
getBackupVaultNotificationsResponse_backupVaultArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBackupVaultNotificationsResponse' {Maybe Text
backupVaultArn :: Maybe Text
$sel:backupVaultArn:GetBackupVaultNotificationsResponse' :: GetBackupVaultNotificationsResponse -> Maybe Text
backupVaultArn} -> Maybe Text
backupVaultArn) (\s :: GetBackupVaultNotificationsResponse
s@GetBackupVaultNotificationsResponse' {} Maybe Text
a -> GetBackupVaultNotificationsResponse
s {$sel:backupVaultArn:GetBackupVaultNotificationsResponse' :: Maybe Text
backupVaultArn = Maybe Text
a} :: GetBackupVaultNotificationsResponse)
getBackupVaultNotificationsResponse_backupVaultEvents :: Lens.Lens' GetBackupVaultNotificationsResponse (Prelude.Maybe [BackupVaultEvent])
getBackupVaultNotificationsResponse_backupVaultEvents :: Lens'
GetBackupVaultNotificationsResponse (Maybe [BackupVaultEvent])
getBackupVaultNotificationsResponse_backupVaultEvents = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBackupVaultNotificationsResponse' {Maybe [BackupVaultEvent]
backupVaultEvents :: Maybe [BackupVaultEvent]
$sel:backupVaultEvents:GetBackupVaultNotificationsResponse' :: GetBackupVaultNotificationsResponse -> Maybe [BackupVaultEvent]
backupVaultEvents} -> Maybe [BackupVaultEvent]
backupVaultEvents) (\s :: GetBackupVaultNotificationsResponse
s@GetBackupVaultNotificationsResponse' {} Maybe [BackupVaultEvent]
a -> GetBackupVaultNotificationsResponse
s {$sel:backupVaultEvents:GetBackupVaultNotificationsResponse' :: Maybe [BackupVaultEvent]
backupVaultEvents = Maybe [BackupVaultEvent]
a} :: GetBackupVaultNotificationsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
getBackupVaultNotificationsResponse_backupVaultName :: Lens.Lens' GetBackupVaultNotificationsResponse (Prelude.Maybe Prelude.Text)
getBackupVaultNotificationsResponse_backupVaultName :: Lens' GetBackupVaultNotificationsResponse (Maybe Text)
getBackupVaultNotificationsResponse_backupVaultName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBackupVaultNotificationsResponse' {Maybe Text
backupVaultName :: Maybe Text
$sel:backupVaultName:GetBackupVaultNotificationsResponse' :: GetBackupVaultNotificationsResponse -> Maybe Text
backupVaultName} -> Maybe Text
backupVaultName) (\s :: GetBackupVaultNotificationsResponse
s@GetBackupVaultNotificationsResponse' {} Maybe Text
a -> GetBackupVaultNotificationsResponse
s {$sel:backupVaultName:GetBackupVaultNotificationsResponse' :: Maybe Text
backupVaultName = Maybe Text
a} :: GetBackupVaultNotificationsResponse)
getBackupVaultNotificationsResponse_sNSTopicArn :: Lens.Lens' GetBackupVaultNotificationsResponse (Prelude.Maybe Prelude.Text)
getBackupVaultNotificationsResponse_sNSTopicArn :: Lens' GetBackupVaultNotificationsResponse (Maybe Text)
getBackupVaultNotificationsResponse_sNSTopicArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBackupVaultNotificationsResponse' {Maybe Text
sNSTopicArn :: Maybe Text
$sel:sNSTopicArn:GetBackupVaultNotificationsResponse' :: GetBackupVaultNotificationsResponse -> Maybe Text
sNSTopicArn} -> Maybe Text
sNSTopicArn) (\s :: GetBackupVaultNotificationsResponse
s@GetBackupVaultNotificationsResponse' {} Maybe Text
a -> GetBackupVaultNotificationsResponse
s {$sel:sNSTopicArn:GetBackupVaultNotificationsResponse' :: Maybe Text
sNSTopicArn = Maybe Text
a} :: GetBackupVaultNotificationsResponse)
getBackupVaultNotificationsResponse_httpStatus :: Lens.Lens' GetBackupVaultNotificationsResponse Prelude.Int
getBackupVaultNotificationsResponse_httpStatus :: Lens' GetBackupVaultNotificationsResponse Int
getBackupVaultNotificationsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBackupVaultNotificationsResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetBackupVaultNotificationsResponse' :: GetBackupVaultNotificationsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetBackupVaultNotificationsResponse
s@GetBackupVaultNotificationsResponse' {} Int
a -> GetBackupVaultNotificationsResponse
s {$sel:httpStatus:GetBackupVaultNotificationsResponse' :: Int
httpStatus = Int
a} :: GetBackupVaultNotificationsResponse)
instance
Prelude.NFData
GetBackupVaultNotificationsResponse
where
rnf :: GetBackupVaultNotificationsResponse -> ()
rnf GetBackupVaultNotificationsResponse' {Int
Maybe [BackupVaultEvent]
Maybe Text
httpStatus :: Int
sNSTopicArn :: Maybe Text
backupVaultName :: Maybe Text
backupVaultEvents :: Maybe [BackupVaultEvent]
backupVaultArn :: Maybe Text
$sel:httpStatus:GetBackupVaultNotificationsResponse' :: GetBackupVaultNotificationsResponse -> Int
$sel:sNSTopicArn:GetBackupVaultNotificationsResponse' :: GetBackupVaultNotificationsResponse -> Maybe Text
$sel:backupVaultName:GetBackupVaultNotificationsResponse' :: GetBackupVaultNotificationsResponse -> Maybe Text
$sel:backupVaultEvents:GetBackupVaultNotificationsResponse' :: GetBackupVaultNotificationsResponse -> Maybe [BackupVaultEvent]
$sel:backupVaultArn:GetBackupVaultNotificationsResponse' :: GetBackupVaultNotificationsResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
backupVaultArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [BackupVaultEvent]
backupVaultEvents
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
backupVaultName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
sNSTopicArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus