{-# 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.SetVaultNotifications
(
SetVaultNotifications (..),
newSetVaultNotifications,
setVaultNotifications_vaultNotificationConfig,
setVaultNotifications_accountId,
setVaultNotifications_vaultName,
SetVaultNotificationsResponse (..),
newSetVaultNotificationsResponse,
)
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 SetVaultNotifications = SetVaultNotifications'
{
SetVaultNotifications -> Maybe VaultNotificationConfig
vaultNotificationConfig :: Prelude.Maybe VaultNotificationConfig,
SetVaultNotifications -> Text
accountId :: Prelude.Text,
SetVaultNotifications -> Text
vaultName :: Prelude.Text
}
deriving (SetVaultNotifications -> SetVaultNotifications -> Bool
(SetVaultNotifications -> SetVaultNotifications -> Bool)
-> (SetVaultNotifications -> SetVaultNotifications -> Bool)
-> Eq SetVaultNotifications
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SetVaultNotifications -> SetVaultNotifications -> Bool
$c/= :: SetVaultNotifications -> SetVaultNotifications -> Bool
== :: SetVaultNotifications -> SetVaultNotifications -> Bool
$c== :: SetVaultNotifications -> SetVaultNotifications -> Bool
Prelude.Eq, ReadPrec [SetVaultNotifications]
ReadPrec SetVaultNotifications
Int -> ReadS SetVaultNotifications
ReadS [SetVaultNotifications]
(Int -> ReadS SetVaultNotifications)
-> ReadS [SetVaultNotifications]
-> ReadPrec SetVaultNotifications
-> ReadPrec [SetVaultNotifications]
-> Read SetVaultNotifications
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SetVaultNotifications]
$creadListPrec :: ReadPrec [SetVaultNotifications]
readPrec :: ReadPrec SetVaultNotifications
$creadPrec :: ReadPrec SetVaultNotifications
readList :: ReadS [SetVaultNotifications]
$creadList :: ReadS [SetVaultNotifications]
readsPrec :: Int -> ReadS SetVaultNotifications
$creadsPrec :: Int -> ReadS SetVaultNotifications
Prelude.Read, Int -> SetVaultNotifications -> ShowS
[SetVaultNotifications] -> ShowS
SetVaultNotifications -> String
(Int -> SetVaultNotifications -> ShowS)
-> (SetVaultNotifications -> String)
-> ([SetVaultNotifications] -> ShowS)
-> Show SetVaultNotifications
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SetVaultNotifications] -> ShowS
$cshowList :: [SetVaultNotifications] -> ShowS
show :: SetVaultNotifications -> String
$cshow :: SetVaultNotifications -> String
showsPrec :: Int -> SetVaultNotifications -> ShowS
$cshowsPrec :: Int -> SetVaultNotifications -> ShowS
Prelude.Show, (forall x. SetVaultNotifications -> Rep SetVaultNotifications x)
-> (forall x. Rep SetVaultNotifications x -> SetVaultNotifications)
-> Generic SetVaultNotifications
forall x. Rep SetVaultNotifications x -> SetVaultNotifications
forall x. SetVaultNotifications -> Rep SetVaultNotifications x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SetVaultNotifications x -> SetVaultNotifications
$cfrom :: forall x. SetVaultNotifications -> Rep SetVaultNotifications x
Prelude.Generic)
newSetVaultNotifications ::
Prelude.Text ->
Prelude.Text ->
SetVaultNotifications
newSetVaultNotifications :: Text -> Text -> SetVaultNotifications
newSetVaultNotifications Text
pAccountId_ Text
pVaultName_ =
SetVaultNotifications' :: Maybe VaultNotificationConfig
-> Text -> Text -> SetVaultNotifications
SetVaultNotifications'
{ $sel:vaultNotificationConfig:SetVaultNotifications' :: Maybe VaultNotificationConfig
vaultNotificationConfig =
Maybe VaultNotificationConfig
forall a. Maybe a
Prelude.Nothing,
$sel:accountId:SetVaultNotifications' :: Text
accountId = Text
pAccountId_,
$sel:vaultName:SetVaultNotifications' :: Text
vaultName = Text
pVaultName_
}
setVaultNotifications_vaultNotificationConfig :: Lens.Lens' SetVaultNotifications (Prelude.Maybe VaultNotificationConfig)
setVaultNotifications_vaultNotificationConfig :: (Maybe VaultNotificationConfig
-> f (Maybe VaultNotificationConfig))
-> SetVaultNotifications -> f SetVaultNotifications
setVaultNotifications_vaultNotificationConfig = (SetVaultNotifications -> Maybe VaultNotificationConfig)
-> (SetVaultNotifications
-> Maybe VaultNotificationConfig -> SetVaultNotifications)
-> Lens
SetVaultNotifications
SetVaultNotifications
(Maybe VaultNotificationConfig)
(Maybe VaultNotificationConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetVaultNotifications' {Maybe VaultNotificationConfig
vaultNotificationConfig :: Maybe VaultNotificationConfig
$sel:vaultNotificationConfig:SetVaultNotifications' :: SetVaultNotifications -> Maybe VaultNotificationConfig
vaultNotificationConfig} -> Maybe VaultNotificationConfig
vaultNotificationConfig) (\s :: SetVaultNotifications
s@SetVaultNotifications' {} Maybe VaultNotificationConfig
a -> SetVaultNotifications
s {$sel:vaultNotificationConfig:SetVaultNotifications' :: Maybe VaultNotificationConfig
vaultNotificationConfig = Maybe VaultNotificationConfig
a} :: SetVaultNotifications)
setVaultNotifications_accountId :: Lens.Lens' SetVaultNotifications Prelude.Text
setVaultNotifications_accountId :: (Text -> f Text)
-> SetVaultNotifications -> f SetVaultNotifications
setVaultNotifications_accountId = (SetVaultNotifications -> Text)
-> (SetVaultNotifications -> Text -> SetVaultNotifications)
-> Lens SetVaultNotifications SetVaultNotifications Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetVaultNotifications' {Text
accountId :: Text
$sel:accountId:SetVaultNotifications' :: SetVaultNotifications -> Text
accountId} -> Text
accountId) (\s :: SetVaultNotifications
s@SetVaultNotifications' {} Text
a -> SetVaultNotifications
s {$sel:accountId:SetVaultNotifications' :: Text
accountId = Text
a} :: SetVaultNotifications)
setVaultNotifications_vaultName :: Lens.Lens' SetVaultNotifications Prelude.Text
setVaultNotifications_vaultName :: (Text -> f Text)
-> SetVaultNotifications -> f SetVaultNotifications
setVaultNotifications_vaultName = (SetVaultNotifications -> Text)
-> (SetVaultNotifications -> Text -> SetVaultNotifications)
-> Lens SetVaultNotifications SetVaultNotifications Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetVaultNotifications' {Text
vaultName :: Text
$sel:vaultName:SetVaultNotifications' :: SetVaultNotifications -> Text
vaultName} -> Text
vaultName) (\s :: SetVaultNotifications
s@SetVaultNotifications' {} Text
a -> SetVaultNotifications
s {$sel:vaultName:SetVaultNotifications' :: Text
vaultName = Text
a} :: SetVaultNotifications)
instance Core.AWSRequest SetVaultNotifications where
type
AWSResponse SetVaultNotifications =
SetVaultNotificationsResponse
request :: SetVaultNotifications -> Request SetVaultNotifications
request =
ByteString
-> Request SetVaultNotifications -> Request SetVaultNotifications
forall a. ByteString -> Request a -> Request a
Request.glacierVersionHeader (Service -> ByteString
Core._serviceVersion Service
defaultService)
(Request SetVaultNotifications -> Request SetVaultNotifications)
-> (SetVaultNotifications -> Request SetVaultNotifications)
-> SetVaultNotifications
-> Request SetVaultNotifications
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Service -> SetVaultNotifications -> Request SetVaultNotifications
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
response :: Logger
-> Service
-> Proxy SetVaultNotifications
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse SetVaultNotifications)))
response =
AWSResponse SetVaultNotifications
-> Logger
-> Service
-> Proxy SetVaultNotifications
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse SetVaultNotifications)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse SetVaultNotifications
SetVaultNotificationsResponse
SetVaultNotificationsResponse'
instance Prelude.Hashable SetVaultNotifications
instance Prelude.NFData SetVaultNotifications
instance Core.ToHeaders SetVaultNotifications where
toHeaders :: SetVaultNotifications -> [Header]
toHeaders = [Header] -> SetVaultNotifications -> [Header]
forall a b. a -> b -> a
Prelude.const [Header]
forall a. Monoid a => a
Prelude.mempty
instance Core.ToJSON SetVaultNotifications where
toJSON :: SetVaultNotifications -> Value
toJSON SetVaultNotifications' {Maybe VaultNotificationConfig
Text
vaultName :: Text
accountId :: Text
vaultNotificationConfig :: Maybe VaultNotificationConfig
$sel:vaultName:SetVaultNotifications' :: SetVaultNotifications -> Text
$sel:accountId:SetVaultNotifications' :: SetVaultNotifications -> Text
$sel:vaultNotificationConfig:SetVaultNotifications' :: SetVaultNotifications -> Maybe VaultNotificationConfig
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"vaultNotificationConfig" Text -> VaultNotificationConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(VaultNotificationConfig -> Pair)
-> Maybe VaultNotificationConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe VaultNotificationConfig
vaultNotificationConfig
]
)
instance Core.ToPath SetVaultNotifications where
toPath :: SetVaultNotifications -> ByteString
toPath SetVaultNotifications' {Maybe VaultNotificationConfig
Text
vaultName :: Text
accountId :: Text
vaultNotificationConfig :: Maybe VaultNotificationConfig
$sel:vaultName:SetVaultNotifications' :: SetVaultNotifications -> Text
$sel:accountId:SetVaultNotifications' :: SetVaultNotifications -> Text
$sel:vaultNotificationConfig:SetVaultNotifications' :: SetVaultNotifications -> Maybe VaultNotificationConfig
..} =
[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 SetVaultNotifications where
toQuery :: SetVaultNotifications -> QueryString
toQuery = QueryString -> SetVaultNotifications -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data SetVaultNotificationsResponse = SetVaultNotificationsResponse'
{
}
deriving (SetVaultNotificationsResponse
-> SetVaultNotificationsResponse -> Bool
(SetVaultNotificationsResponse
-> SetVaultNotificationsResponse -> Bool)
-> (SetVaultNotificationsResponse
-> SetVaultNotificationsResponse -> Bool)
-> Eq SetVaultNotificationsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SetVaultNotificationsResponse
-> SetVaultNotificationsResponse -> Bool
$c/= :: SetVaultNotificationsResponse
-> SetVaultNotificationsResponse -> Bool
== :: SetVaultNotificationsResponse
-> SetVaultNotificationsResponse -> Bool
$c== :: SetVaultNotificationsResponse
-> SetVaultNotificationsResponse -> Bool
Prelude.Eq, ReadPrec [SetVaultNotificationsResponse]
ReadPrec SetVaultNotificationsResponse
Int -> ReadS SetVaultNotificationsResponse
ReadS [SetVaultNotificationsResponse]
(Int -> ReadS SetVaultNotificationsResponse)
-> ReadS [SetVaultNotificationsResponse]
-> ReadPrec SetVaultNotificationsResponse
-> ReadPrec [SetVaultNotificationsResponse]
-> Read SetVaultNotificationsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SetVaultNotificationsResponse]
$creadListPrec :: ReadPrec [SetVaultNotificationsResponse]
readPrec :: ReadPrec SetVaultNotificationsResponse
$creadPrec :: ReadPrec SetVaultNotificationsResponse
readList :: ReadS [SetVaultNotificationsResponse]
$creadList :: ReadS [SetVaultNotificationsResponse]
readsPrec :: Int -> ReadS SetVaultNotificationsResponse
$creadsPrec :: Int -> ReadS SetVaultNotificationsResponse
Prelude.Read, Int -> SetVaultNotificationsResponse -> ShowS
[SetVaultNotificationsResponse] -> ShowS
SetVaultNotificationsResponse -> String
(Int -> SetVaultNotificationsResponse -> ShowS)
-> (SetVaultNotificationsResponse -> String)
-> ([SetVaultNotificationsResponse] -> ShowS)
-> Show SetVaultNotificationsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SetVaultNotificationsResponse] -> ShowS
$cshowList :: [SetVaultNotificationsResponse] -> ShowS
show :: SetVaultNotificationsResponse -> String
$cshow :: SetVaultNotificationsResponse -> String
showsPrec :: Int -> SetVaultNotificationsResponse -> ShowS
$cshowsPrec :: Int -> SetVaultNotificationsResponse -> ShowS
Prelude.Show, (forall x.
SetVaultNotificationsResponse
-> Rep SetVaultNotificationsResponse x)
-> (forall x.
Rep SetVaultNotificationsResponse x
-> SetVaultNotificationsResponse)
-> Generic SetVaultNotificationsResponse
forall x.
Rep SetVaultNotificationsResponse x
-> SetVaultNotificationsResponse
forall x.
SetVaultNotificationsResponse
-> Rep SetVaultNotificationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SetVaultNotificationsResponse x
-> SetVaultNotificationsResponse
$cfrom :: forall x.
SetVaultNotificationsResponse
-> Rep SetVaultNotificationsResponse x
Prelude.Generic)
newSetVaultNotificationsResponse ::
SetVaultNotificationsResponse
newSetVaultNotificationsResponse :: SetVaultNotificationsResponse
newSetVaultNotificationsResponse =
SetVaultNotificationsResponse
SetVaultNotificationsResponse'
instance Prelude.NFData SetVaultNotificationsResponse