{-# 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.PutBackupVaultLockConfiguration
(
PutBackupVaultLockConfiguration (..),
newPutBackupVaultLockConfiguration,
putBackupVaultLockConfiguration_maxRetentionDays,
putBackupVaultLockConfiguration_changeableForDays,
putBackupVaultLockConfiguration_minRetentionDays,
putBackupVaultLockConfiguration_backupVaultName,
PutBackupVaultLockConfigurationResponse (..),
newPutBackupVaultLockConfigurationResponse,
)
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 PutBackupVaultLockConfiguration = PutBackupVaultLockConfiguration'
{
PutBackupVaultLockConfiguration -> Maybe Integer
maxRetentionDays :: Prelude.Maybe Prelude.Integer,
PutBackupVaultLockConfiguration -> Maybe Integer
changeableForDays :: Prelude.Maybe Prelude.Integer,
PutBackupVaultLockConfiguration -> Maybe Integer
minRetentionDays :: Prelude.Maybe Prelude.Integer,
PutBackupVaultLockConfiguration -> Text
backupVaultName :: Prelude.Text
}
deriving (PutBackupVaultLockConfiguration
-> PutBackupVaultLockConfiguration -> Bool
(PutBackupVaultLockConfiguration
-> PutBackupVaultLockConfiguration -> Bool)
-> (PutBackupVaultLockConfiguration
-> PutBackupVaultLockConfiguration -> Bool)
-> Eq PutBackupVaultLockConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutBackupVaultLockConfiguration
-> PutBackupVaultLockConfiguration -> Bool
$c/= :: PutBackupVaultLockConfiguration
-> PutBackupVaultLockConfiguration -> Bool
== :: PutBackupVaultLockConfiguration
-> PutBackupVaultLockConfiguration -> Bool
$c== :: PutBackupVaultLockConfiguration
-> PutBackupVaultLockConfiguration -> Bool
Prelude.Eq, ReadPrec [PutBackupVaultLockConfiguration]
ReadPrec PutBackupVaultLockConfiguration
Int -> ReadS PutBackupVaultLockConfiguration
ReadS [PutBackupVaultLockConfiguration]
(Int -> ReadS PutBackupVaultLockConfiguration)
-> ReadS [PutBackupVaultLockConfiguration]
-> ReadPrec PutBackupVaultLockConfiguration
-> ReadPrec [PutBackupVaultLockConfiguration]
-> Read PutBackupVaultLockConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutBackupVaultLockConfiguration]
$creadListPrec :: ReadPrec [PutBackupVaultLockConfiguration]
readPrec :: ReadPrec PutBackupVaultLockConfiguration
$creadPrec :: ReadPrec PutBackupVaultLockConfiguration
readList :: ReadS [PutBackupVaultLockConfiguration]
$creadList :: ReadS [PutBackupVaultLockConfiguration]
readsPrec :: Int -> ReadS PutBackupVaultLockConfiguration
$creadsPrec :: Int -> ReadS PutBackupVaultLockConfiguration
Prelude.Read, Int -> PutBackupVaultLockConfiguration -> ShowS
[PutBackupVaultLockConfiguration] -> ShowS
PutBackupVaultLockConfiguration -> String
(Int -> PutBackupVaultLockConfiguration -> ShowS)
-> (PutBackupVaultLockConfiguration -> String)
-> ([PutBackupVaultLockConfiguration] -> ShowS)
-> Show PutBackupVaultLockConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutBackupVaultLockConfiguration] -> ShowS
$cshowList :: [PutBackupVaultLockConfiguration] -> ShowS
show :: PutBackupVaultLockConfiguration -> String
$cshow :: PutBackupVaultLockConfiguration -> String
showsPrec :: Int -> PutBackupVaultLockConfiguration -> ShowS
$cshowsPrec :: Int -> PutBackupVaultLockConfiguration -> ShowS
Prelude.Show, (forall x.
PutBackupVaultLockConfiguration
-> Rep PutBackupVaultLockConfiguration x)
-> (forall x.
Rep PutBackupVaultLockConfiguration x
-> PutBackupVaultLockConfiguration)
-> Generic PutBackupVaultLockConfiguration
forall x.
Rep PutBackupVaultLockConfiguration x
-> PutBackupVaultLockConfiguration
forall x.
PutBackupVaultLockConfiguration
-> Rep PutBackupVaultLockConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutBackupVaultLockConfiguration x
-> PutBackupVaultLockConfiguration
$cfrom :: forall x.
PutBackupVaultLockConfiguration
-> Rep PutBackupVaultLockConfiguration x
Prelude.Generic)
newPutBackupVaultLockConfiguration ::
Prelude.Text ->
PutBackupVaultLockConfiguration
newPutBackupVaultLockConfiguration :: Text -> PutBackupVaultLockConfiguration
newPutBackupVaultLockConfiguration Text
pBackupVaultName_ =
PutBackupVaultLockConfiguration' :: Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> Text
-> PutBackupVaultLockConfiguration
PutBackupVaultLockConfiguration'
{ $sel:maxRetentionDays:PutBackupVaultLockConfiguration' :: Maybe Integer
maxRetentionDays =
Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:changeableForDays:PutBackupVaultLockConfiguration' :: Maybe Integer
changeableForDays = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:minRetentionDays:PutBackupVaultLockConfiguration' :: Maybe Integer
minRetentionDays = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:backupVaultName:PutBackupVaultLockConfiguration' :: Text
backupVaultName = Text
pBackupVaultName_
}
putBackupVaultLockConfiguration_maxRetentionDays :: Lens.Lens' PutBackupVaultLockConfiguration (Prelude.Maybe Prelude.Integer)
putBackupVaultLockConfiguration_maxRetentionDays :: (Maybe Integer -> f (Maybe Integer))
-> PutBackupVaultLockConfiguration
-> f PutBackupVaultLockConfiguration
putBackupVaultLockConfiguration_maxRetentionDays = (PutBackupVaultLockConfiguration -> Maybe Integer)
-> (PutBackupVaultLockConfiguration
-> Maybe Integer -> PutBackupVaultLockConfiguration)
-> Lens
PutBackupVaultLockConfiguration
PutBackupVaultLockConfiguration
(Maybe Integer)
(Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBackupVaultLockConfiguration' {Maybe Integer
maxRetentionDays :: Maybe Integer
$sel:maxRetentionDays:PutBackupVaultLockConfiguration' :: PutBackupVaultLockConfiguration -> Maybe Integer
maxRetentionDays} -> Maybe Integer
maxRetentionDays) (\s :: PutBackupVaultLockConfiguration
s@PutBackupVaultLockConfiguration' {} Maybe Integer
a -> PutBackupVaultLockConfiguration
s {$sel:maxRetentionDays:PutBackupVaultLockConfiguration' :: Maybe Integer
maxRetentionDays = Maybe Integer
a} :: PutBackupVaultLockConfiguration)
putBackupVaultLockConfiguration_changeableForDays :: Lens.Lens' PutBackupVaultLockConfiguration (Prelude.Maybe Prelude.Integer)
putBackupVaultLockConfiguration_changeableForDays :: (Maybe Integer -> f (Maybe Integer))
-> PutBackupVaultLockConfiguration
-> f PutBackupVaultLockConfiguration
putBackupVaultLockConfiguration_changeableForDays = (PutBackupVaultLockConfiguration -> Maybe Integer)
-> (PutBackupVaultLockConfiguration
-> Maybe Integer -> PutBackupVaultLockConfiguration)
-> Lens
PutBackupVaultLockConfiguration
PutBackupVaultLockConfiguration
(Maybe Integer)
(Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBackupVaultLockConfiguration' {Maybe Integer
changeableForDays :: Maybe Integer
$sel:changeableForDays:PutBackupVaultLockConfiguration' :: PutBackupVaultLockConfiguration -> Maybe Integer
changeableForDays} -> Maybe Integer
changeableForDays) (\s :: PutBackupVaultLockConfiguration
s@PutBackupVaultLockConfiguration' {} Maybe Integer
a -> PutBackupVaultLockConfiguration
s {$sel:changeableForDays:PutBackupVaultLockConfiguration' :: Maybe Integer
changeableForDays = Maybe Integer
a} :: PutBackupVaultLockConfiguration)
putBackupVaultLockConfiguration_minRetentionDays :: Lens.Lens' PutBackupVaultLockConfiguration (Prelude.Maybe Prelude.Integer)
putBackupVaultLockConfiguration_minRetentionDays :: (Maybe Integer -> f (Maybe Integer))
-> PutBackupVaultLockConfiguration
-> f PutBackupVaultLockConfiguration
putBackupVaultLockConfiguration_minRetentionDays = (PutBackupVaultLockConfiguration -> Maybe Integer)
-> (PutBackupVaultLockConfiguration
-> Maybe Integer -> PutBackupVaultLockConfiguration)
-> Lens
PutBackupVaultLockConfiguration
PutBackupVaultLockConfiguration
(Maybe Integer)
(Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBackupVaultLockConfiguration' {Maybe Integer
minRetentionDays :: Maybe Integer
$sel:minRetentionDays:PutBackupVaultLockConfiguration' :: PutBackupVaultLockConfiguration -> Maybe Integer
minRetentionDays} -> Maybe Integer
minRetentionDays) (\s :: PutBackupVaultLockConfiguration
s@PutBackupVaultLockConfiguration' {} Maybe Integer
a -> PutBackupVaultLockConfiguration
s {$sel:minRetentionDays:PutBackupVaultLockConfiguration' :: Maybe Integer
minRetentionDays = Maybe Integer
a} :: PutBackupVaultLockConfiguration)
putBackupVaultLockConfiguration_backupVaultName :: Lens.Lens' PutBackupVaultLockConfiguration Prelude.Text
putBackupVaultLockConfiguration_backupVaultName :: (Text -> f Text)
-> PutBackupVaultLockConfiguration
-> f PutBackupVaultLockConfiguration
putBackupVaultLockConfiguration_backupVaultName = (PutBackupVaultLockConfiguration -> Text)
-> (PutBackupVaultLockConfiguration
-> Text -> PutBackupVaultLockConfiguration)
-> Lens
PutBackupVaultLockConfiguration
PutBackupVaultLockConfiguration
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBackupVaultLockConfiguration' {Text
backupVaultName :: Text
$sel:backupVaultName:PutBackupVaultLockConfiguration' :: PutBackupVaultLockConfiguration -> Text
backupVaultName} -> Text
backupVaultName) (\s :: PutBackupVaultLockConfiguration
s@PutBackupVaultLockConfiguration' {} Text
a -> PutBackupVaultLockConfiguration
s {$sel:backupVaultName:PutBackupVaultLockConfiguration' :: Text
backupVaultName = Text
a} :: PutBackupVaultLockConfiguration)
instance
Core.AWSRequest
PutBackupVaultLockConfiguration
where
type
AWSResponse PutBackupVaultLockConfiguration =
PutBackupVaultLockConfigurationResponse
request :: PutBackupVaultLockConfiguration
-> Request PutBackupVaultLockConfiguration
request = Service
-> PutBackupVaultLockConfiguration
-> Request PutBackupVaultLockConfiguration
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
response :: Logger
-> Service
-> Proxy PutBackupVaultLockConfiguration
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse PutBackupVaultLockConfiguration)))
response =
AWSResponse PutBackupVaultLockConfiguration
-> Logger
-> Service
-> Proxy PutBackupVaultLockConfiguration
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse PutBackupVaultLockConfiguration)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
AWSResponse PutBackupVaultLockConfiguration
PutBackupVaultLockConfigurationResponse
PutBackupVaultLockConfigurationResponse'
instance
Prelude.Hashable
PutBackupVaultLockConfiguration
instance
Prelude.NFData
PutBackupVaultLockConfiguration
instance
Core.ToHeaders
PutBackupVaultLockConfiguration
where
toHeaders :: PutBackupVaultLockConfiguration -> [Header]
toHeaders =
[Header] -> PutBackupVaultLockConfiguration -> [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 PutBackupVaultLockConfiguration where
toJSON :: PutBackupVaultLockConfiguration -> Value
toJSON PutBackupVaultLockConfiguration' {Maybe Integer
Text
backupVaultName :: Text
minRetentionDays :: Maybe Integer
changeableForDays :: Maybe Integer
maxRetentionDays :: Maybe Integer
$sel:backupVaultName:PutBackupVaultLockConfiguration' :: PutBackupVaultLockConfiguration -> Text
$sel:minRetentionDays:PutBackupVaultLockConfiguration' :: PutBackupVaultLockConfiguration -> Maybe Integer
$sel:changeableForDays:PutBackupVaultLockConfiguration' :: PutBackupVaultLockConfiguration -> Maybe Integer
$sel:maxRetentionDays:PutBackupVaultLockConfiguration' :: PutBackupVaultLockConfiguration -> Maybe Integer
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"MaxRetentionDays" Text -> Integer -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Integer -> Pair) -> Maybe Integer -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Integer
maxRetentionDays,
(Text
"ChangeableForDays" Text -> Integer -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Integer -> Pair) -> Maybe Integer -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Integer
changeableForDays,
(Text
"MinRetentionDays" Text -> Integer -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Integer -> Pair) -> Maybe Integer -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Integer
minRetentionDays
]
)
instance Core.ToPath PutBackupVaultLockConfiguration where
toPath :: PutBackupVaultLockConfiguration -> ByteString
toPath PutBackupVaultLockConfiguration' {Maybe Integer
Text
backupVaultName :: Text
minRetentionDays :: Maybe Integer
changeableForDays :: Maybe Integer
maxRetentionDays :: Maybe Integer
$sel:backupVaultName:PutBackupVaultLockConfiguration' :: PutBackupVaultLockConfiguration -> Text
$sel:minRetentionDays:PutBackupVaultLockConfiguration' :: PutBackupVaultLockConfiguration -> Maybe Integer
$sel:changeableForDays:PutBackupVaultLockConfiguration' :: PutBackupVaultLockConfiguration -> Maybe Integer
$sel:maxRetentionDays:PutBackupVaultLockConfiguration' :: PutBackupVaultLockConfiguration -> Maybe Integer
..} =
[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
"/vault-lock"
]
instance Core.ToQuery PutBackupVaultLockConfiguration where
toQuery :: PutBackupVaultLockConfiguration -> QueryString
toQuery = QueryString -> PutBackupVaultLockConfiguration -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data PutBackupVaultLockConfigurationResponse = PutBackupVaultLockConfigurationResponse'
{
}
deriving (PutBackupVaultLockConfigurationResponse
-> PutBackupVaultLockConfigurationResponse -> Bool
(PutBackupVaultLockConfigurationResponse
-> PutBackupVaultLockConfigurationResponse -> Bool)
-> (PutBackupVaultLockConfigurationResponse
-> PutBackupVaultLockConfigurationResponse -> Bool)
-> Eq PutBackupVaultLockConfigurationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutBackupVaultLockConfigurationResponse
-> PutBackupVaultLockConfigurationResponse -> Bool
$c/= :: PutBackupVaultLockConfigurationResponse
-> PutBackupVaultLockConfigurationResponse -> Bool
== :: PutBackupVaultLockConfigurationResponse
-> PutBackupVaultLockConfigurationResponse -> Bool
$c== :: PutBackupVaultLockConfigurationResponse
-> PutBackupVaultLockConfigurationResponse -> Bool
Prelude.Eq, ReadPrec [PutBackupVaultLockConfigurationResponse]
ReadPrec PutBackupVaultLockConfigurationResponse
Int -> ReadS PutBackupVaultLockConfigurationResponse
ReadS [PutBackupVaultLockConfigurationResponse]
(Int -> ReadS PutBackupVaultLockConfigurationResponse)
-> ReadS [PutBackupVaultLockConfigurationResponse]
-> ReadPrec PutBackupVaultLockConfigurationResponse
-> ReadPrec [PutBackupVaultLockConfigurationResponse]
-> Read PutBackupVaultLockConfigurationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutBackupVaultLockConfigurationResponse]
$creadListPrec :: ReadPrec [PutBackupVaultLockConfigurationResponse]
readPrec :: ReadPrec PutBackupVaultLockConfigurationResponse
$creadPrec :: ReadPrec PutBackupVaultLockConfigurationResponse
readList :: ReadS [PutBackupVaultLockConfigurationResponse]
$creadList :: ReadS [PutBackupVaultLockConfigurationResponse]
readsPrec :: Int -> ReadS PutBackupVaultLockConfigurationResponse
$creadsPrec :: Int -> ReadS PutBackupVaultLockConfigurationResponse
Prelude.Read, Int -> PutBackupVaultLockConfigurationResponse -> ShowS
[PutBackupVaultLockConfigurationResponse] -> ShowS
PutBackupVaultLockConfigurationResponse -> String
(Int -> PutBackupVaultLockConfigurationResponse -> ShowS)
-> (PutBackupVaultLockConfigurationResponse -> String)
-> ([PutBackupVaultLockConfigurationResponse] -> ShowS)
-> Show PutBackupVaultLockConfigurationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutBackupVaultLockConfigurationResponse] -> ShowS
$cshowList :: [PutBackupVaultLockConfigurationResponse] -> ShowS
show :: PutBackupVaultLockConfigurationResponse -> String
$cshow :: PutBackupVaultLockConfigurationResponse -> String
showsPrec :: Int -> PutBackupVaultLockConfigurationResponse -> ShowS
$cshowsPrec :: Int -> PutBackupVaultLockConfigurationResponse -> ShowS
Prelude.Show, (forall x.
PutBackupVaultLockConfigurationResponse
-> Rep PutBackupVaultLockConfigurationResponse x)
-> (forall x.
Rep PutBackupVaultLockConfigurationResponse x
-> PutBackupVaultLockConfigurationResponse)
-> Generic PutBackupVaultLockConfigurationResponse
forall x.
Rep PutBackupVaultLockConfigurationResponse x
-> PutBackupVaultLockConfigurationResponse
forall x.
PutBackupVaultLockConfigurationResponse
-> Rep PutBackupVaultLockConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutBackupVaultLockConfigurationResponse x
-> PutBackupVaultLockConfigurationResponse
$cfrom :: forall x.
PutBackupVaultLockConfigurationResponse
-> Rep PutBackupVaultLockConfigurationResponse x
Prelude.Generic)
newPutBackupVaultLockConfigurationResponse ::
PutBackupVaultLockConfigurationResponse
newPutBackupVaultLockConfigurationResponse :: PutBackupVaultLockConfigurationResponse
newPutBackupVaultLockConfigurationResponse =
PutBackupVaultLockConfigurationResponse
PutBackupVaultLockConfigurationResponse'
instance
Prelude.NFData
PutBackupVaultLockConfigurationResponse