{-# 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.Glacier.GetVaultNotifications
(
GetVaultNotifications (..),
newGetVaultNotifications,
getVaultNotifications_accountId,
getVaultNotifications_vaultName,
GetVaultNotificationsResponse (..),
newGetVaultNotificationsResponse,
getVaultNotificationsResponse_vaultNotificationConfig,
getVaultNotificationsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.Glacier.Types
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 GetVaultNotifications = GetVaultNotifications'
{
GetVaultNotifications -> Text
accountId :: Prelude.Text,
GetVaultNotifications -> Text
vaultName :: Prelude.Text
}
deriving (GetVaultNotifications -> GetVaultNotifications -> Bool
(GetVaultNotifications -> GetVaultNotifications -> Bool)
-> (GetVaultNotifications -> GetVaultNotifications -> Bool)
-> Eq GetVaultNotifications
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetVaultNotifications -> GetVaultNotifications -> Bool
$c/= :: GetVaultNotifications -> GetVaultNotifications -> Bool
== :: GetVaultNotifications -> GetVaultNotifications -> Bool
$c== :: GetVaultNotifications -> GetVaultNotifications -> Bool
Prelude.Eq, ReadPrec [GetVaultNotifications]
ReadPrec GetVaultNotifications
Int -> ReadS GetVaultNotifications
ReadS [GetVaultNotifications]
(Int -> ReadS GetVaultNotifications)
-> ReadS [GetVaultNotifications]
-> ReadPrec GetVaultNotifications
-> ReadPrec [GetVaultNotifications]
-> Read GetVaultNotifications
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetVaultNotifications]
$creadListPrec :: ReadPrec [GetVaultNotifications]
readPrec :: ReadPrec GetVaultNotifications
$creadPrec :: ReadPrec GetVaultNotifications
readList :: ReadS [GetVaultNotifications]
$creadList :: ReadS [GetVaultNotifications]
readsPrec :: Int -> ReadS GetVaultNotifications
$creadsPrec :: Int -> ReadS GetVaultNotifications
Prelude.Read, Int -> GetVaultNotifications -> ShowS
[GetVaultNotifications] -> ShowS
GetVaultNotifications -> String
(Int -> GetVaultNotifications -> ShowS)
-> (GetVaultNotifications -> String)
-> ([GetVaultNotifications] -> ShowS)
-> Show GetVaultNotifications
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetVaultNotifications] -> ShowS
$cshowList :: [GetVaultNotifications] -> ShowS
show :: GetVaultNotifications -> String
$cshow :: GetVaultNotifications -> String
showsPrec :: Int -> GetVaultNotifications -> ShowS
$cshowsPrec :: Int -> GetVaultNotifications -> ShowS
Prelude.Show, (forall x. GetVaultNotifications -> Rep GetVaultNotifications x)
-> (forall x. Rep GetVaultNotifications x -> GetVaultNotifications)
-> Generic GetVaultNotifications
forall x. Rep GetVaultNotifications x -> GetVaultNotifications
forall x. GetVaultNotifications -> Rep GetVaultNotifications x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetVaultNotifications x -> GetVaultNotifications
$cfrom :: forall x. GetVaultNotifications -> Rep GetVaultNotifications x
Prelude.Generic)
newGetVaultNotifications ::
Prelude.Text ->
Prelude.Text ->
GetVaultNotifications
newGetVaultNotifications :: Text -> Text -> GetVaultNotifications
newGetVaultNotifications Text
pAccountId_ Text
pVaultName_ =
GetVaultNotifications' :: Text -> Text -> GetVaultNotifications
GetVaultNotifications'
{ $sel:accountId:GetVaultNotifications' :: Text
accountId = Text
pAccountId_,
$sel:vaultName:GetVaultNotifications' :: Text
vaultName = Text
pVaultName_
}
getVaultNotifications_accountId :: Lens.Lens' GetVaultNotifications Prelude.Text
getVaultNotifications_accountId :: (Text -> f Text)
-> GetVaultNotifications -> f GetVaultNotifications
getVaultNotifications_accountId = (GetVaultNotifications -> Text)
-> (GetVaultNotifications -> Text -> GetVaultNotifications)
-> Lens GetVaultNotifications GetVaultNotifications Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetVaultNotifications' {Text
accountId :: Text
$sel:accountId:GetVaultNotifications' :: GetVaultNotifications -> Text
accountId} -> Text
accountId) (\s :: GetVaultNotifications
s@GetVaultNotifications' {} Text
a -> GetVaultNotifications
s {$sel:accountId:GetVaultNotifications' :: Text
accountId = Text
a} :: GetVaultNotifications)
getVaultNotifications_vaultName :: Lens.Lens' GetVaultNotifications Prelude.Text
getVaultNotifications_vaultName :: (Text -> f Text)
-> GetVaultNotifications -> f GetVaultNotifications
getVaultNotifications_vaultName = (GetVaultNotifications -> Text)
-> (GetVaultNotifications -> Text -> GetVaultNotifications)
-> Lens GetVaultNotifications GetVaultNotifications Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetVaultNotifications' {Text
vaultName :: Text
$sel:vaultName:GetVaultNotifications' :: GetVaultNotifications -> Text
vaultName} -> Text
vaultName) (\s :: GetVaultNotifications
s@GetVaultNotifications' {} Text
a -> GetVaultNotifications
s {$sel:vaultName:GetVaultNotifications' :: Text
vaultName = Text
a} :: GetVaultNotifications)
instance Core.AWSRequest GetVaultNotifications where
type
AWSResponse GetVaultNotifications =
GetVaultNotificationsResponse
request :: GetVaultNotifications -> Request GetVaultNotifications
request =
ByteString
-> Request GetVaultNotifications -> Request GetVaultNotifications
forall a. ByteString -> Request a -> Request a
Request.glacierVersionHeader (Service -> ByteString
Core._serviceVersion Service
defaultService)
(Request GetVaultNotifications -> Request GetVaultNotifications)
-> (GetVaultNotifications -> Request GetVaultNotifications)
-> GetVaultNotifications
-> Request GetVaultNotifications
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Service -> GetVaultNotifications -> Request GetVaultNotifications
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy GetVaultNotifications
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetVaultNotifications)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetVaultNotifications))
-> Logger
-> Service
-> Proxy GetVaultNotifications
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetVaultNotifications)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe VaultNotificationConfig
-> Int -> GetVaultNotificationsResponse
GetVaultNotificationsResponse'
(Maybe VaultNotificationConfig
-> Int -> GetVaultNotificationsResponse)
-> Either String (Maybe VaultNotificationConfig)
-> Either String (Int -> GetVaultNotificationsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object -> Either String (Maybe VaultNotificationConfig)
forall a. FromJSON a => Object -> Either String a
Core.eitherParseJSON Object
x)
Either String (Int -> GetVaultNotificationsResponse)
-> Either String Int -> Either String GetVaultNotificationsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable GetVaultNotifications
instance Prelude.NFData GetVaultNotifications
instance Core.ToHeaders GetVaultNotifications where
toHeaders :: GetVaultNotifications -> ResponseHeaders
toHeaders = ResponseHeaders -> GetVaultNotifications -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath GetVaultNotifications where
toPath :: GetVaultNotifications -> ByteString
toPath GetVaultNotifications' {Text
vaultName :: Text
accountId :: Text
$sel:vaultName:GetVaultNotifications' :: GetVaultNotifications -> Text
$sel:accountId:GetVaultNotifications' :: GetVaultNotifications -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
accountId,
ByteString
"/vaults/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
vaultName,
ByteString
"/notification-configuration"
]
instance Core.ToQuery GetVaultNotifications where
toQuery :: GetVaultNotifications -> QueryString
toQuery = QueryString -> GetVaultNotifications -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetVaultNotificationsResponse = GetVaultNotificationsResponse'
{
GetVaultNotificationsResponse -> Maybe VaultNotificationConfig
vaultNotificationConfig :: Prelude.Maybe VaultNotificationConfig,
GetVaultNotificationsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetVaultNotificationsResponse
-> GetVaultNotificationsResponse -> Bool
(GetVaultNotificationsResponse
-> GetVaultNotificationsResponse -> Bool)
-> (GetVaultNotificationsResponse
-> GetVaultNotificationsResponse -> Bool)
-> Eq GetVaultNotificationsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetVaultNotificationsResponse
-> GetVaultNotificationsResponse -> Bool
$c/= :: GetVaultNotificationsResponse
-> GetVaultNotificationsResponse -> Bool
== :: GetVaultNotificationsResponse
-> GetVaultNotificationsResponse -> Bool
$c== :: GetVaultNotificationsResponse
-> GetVaultNotificationsResponse -> Bool
Prelude.Eq, ReadPrec [GetVaultNotificationsResponse]
ReadPrec GetVaultNotificationsResponse
Int -> ReadS GetVaultNotificationsResponse
ReadS [GetVaultNotificationsResponse]
(Int -> ReadS GetVaultNotificationsResponse)
-> ReadS [GetVaultNotificationsResponse]
-> ReadPrec GetVaultNotificationsResponse
-> ReadPrec [GetVaultNotificationsResponse]
-> Read GetVaultNotificationsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetVaultNotificationsResponse]
$creadListPrec :: ReadPrec [GetVaultNotificationsResponse]
readPrec :: ReadPrec GetVaultNotificationsResponse
$creadPrec :: ReadPrec GetVaultNotificationsResponse
readList :: ReadS [GetVaultNotificationsResponse]
$creadList :: ReadS [GetVaultNotificationsResponse]
readsPrec :: Int -> ReadS GetVaultNotificationsResponse
$creadsPrec :: Int -> ReadS GetVaultNotificationsResponse
Prelude.Read, Int -> GetVaultNotificationsResponse -> ShowS
[GetVaultNotificationsResponse] -> ShowS
GetVaultNotificationsResponse -> String
(Int -> GetVaultNotificationsResponse -> ShowS)
-> (GetVaultNotificationsResponse -> String)
-> ([GetVaultNotificationsResponse] -> ShowS)
-> Show GetVaultNotificationsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetVaultNotificationsResponse] -> ShowS
$cshowList :: [GetVaultNotificationsResponse] -> ShowS
show :: GetVaultNotificationsResponse -> String
$cshow :: GetVaultNotificationsResponse -> String
showsPrec :: Int -> GetVaultNotificationsResponse -> ShowS
$cshowsPrec :: Int -> GetVaultNotificationsResponse -> ShowS
Prelude.Show, (forall x.
GetVaultNotificationsResponse
-> Rep GetVaultNotificationsResponse x)
-> (forall x.
Rep GetVaultNotificationsResponse x
-> GetVaultNotificationsResponse)
-> Generic GetVaultNotificationsResponse
forall x.
Rep GetVaultNotificationsResponse x
-> GetVaultNotificationsResponse
forall x.
GetVaultNotificationsResponse
-> Rep GetVaultNotificationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetVaultNotificationsResponse x
-> GetVaultNotificationsResponse
$cfrom :: forall x.
GetVaultNotificationsResponse
-> Rep GetVaultNotificationsResponse x
Prelude.Generic)
newGetVaultNotificationsResponse ::
Prelude.Int ->
GetVaultNotificationsResponse
newGetVaultNotificationsResponse :: Int -> GetVaultNotificationsResponse
newGetVaultNotificationsResponse Int
pHttpStatus_ =
GetVaultNotificationsResponse' :: Maybe VaultNotificationConfig
-> Int -> GetVaultNotificationsResponse
GetVaultNotificationsResponse'
{ $sel:vaultNotificationConfig:GetVaultNotificationsResponse' :: Maybe VaultNotificationConfig
vaultNotificationConfig =
Maybe VaultNotificationConfig
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetVaultNotificationsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getVaultNotificationsResponse_vaultNotificationConfig :: Lens.Lens' GetVaultNotificationsResponse (Prelude.Maybe VaultNotificationConfig)
getVaultNotificationsResponse_vaultNotificationConfig :: (Maybe VaultNotificationConfig
-> f (Maybe VaultNotificationConfig))
-> GetVaultNotificationsResponse -> f GetVaultNotificationsResponse
getVaultNotificationsResponse_vaultNotificationConfig = (GetVaultNotificationsResponse -> Maybe VaultNotificationConfig)
-> (GetVaultNotificationsResponse
-> Maybe VaultNotificationConfig -> GetVaultNotificationsResponse)
-> Lens
GetVaultNotificationsResponse
GetVaultNotificationsResponse
(Maybe VaultNotificationConfig)
(Maybe VaultNotificationConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetVaultNotificationsResponse' {Maybe VaultNotificationConfig
vaultNotificationConfig :: Maybe VaultNotificationConfig
$sel:vaultNotificationConfig:GetVaultNotificationsResponse' :: GetVaultNotificationsResponse -> Maybe VaultNotificationConfig
vaultNotificationConfig} -> Maybe VaultNotificationConfig
vaultNotificationConfig) (\s :: GetVaultNotificationsResponse
s@GetVaultNotificationsResponse' {} Maybe VaultNotificationConfig
a -> GetVaultNotificationsResponse
s {$sel:vaultNotificationConfig:GetVaultNotificationsResponse' :: Maybe VaultNotificationConfig
vaultNotificationConfig = Maybe VaultNotificationConfig
a} :: GetVaultNotificationsResponse)
getVaultNotificationsResponse_httpStatus :: Lens.Lens' GetVaultNotificationsResponse Prelude.Int
getVaultNotificationsResponse_httpStatus :: (Int -> f Int)
-> GetVaultNotificationsResponse -> f GetVaultNotificationsResponse
getVaultNotificationsResponse_httpStatus = (GetVaultNotificationsResponse -> Int)
-> (GetVaultNotificationsResponse
-> Int -> GetVaultNotificationsResponse)
-> Lens
GetVaultNotificationsResponse GetVaultNotificationsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetVaultNotificationsResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetVaultNotificationsResponse' :: GetVaultNotificationsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetVaultNotificationsResponse
s@GetVaultNotificationsResponse' {} Int
a -> GetVaultNotificationsResponse
s {$sel:httpStatus:GetVaultNotificationsResponse' :: Int
httpStatus = Int
a} :: GetVaultNotificationsResponse)
instance Prelude.NFData GetVaultNotificationsResponse