{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Backup.PutBackupVaultLockConfiguration
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Applies Backup Vault Lock to a backup vault, preventing attempts to
-- delete any recovery point stored in or created in a backup vault. Vault
-- Lock also prevents attempts to update the lifecycle policy that controls
-- the retention period of any recovery point currently stored in a backup
-- vault. If specified, Vault Lock enforces a minimum and maximum retention
-- period for future backup and copy jobs that target a backup vault.
--
-- Backup Vault Lock has yet to receive a third-party assessment for SEC
-- 17a-4(f) and CFTC.
module Amazonka.Backup.PutBackupVaultLockConfiguration
  ( -- * Creating a Request
    PutBackupVaultLockConfiguration (..),
    newPutBackupVaultLockConfiguration,

    -- * Request Lenses
    putBackupVaultLockConfiguration_changeableForDays,
    putBackupVaultLockConfiguration_maxRetentionDays,
    putBackupVaultLockConfiguration_minRetentionDays,
    putBackupVaultLockConfiguration_backupVaultName,

    -- * Destructuring the Response
    PutBackupVaultLockConfigurationResponse (..),
    newPutBackupVaultLockConfigurationResponse,
  )
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

-- | /See:/ 'newPutBackupVaultLockConfiguration' smart constructor.
data PutBackupVaultLockConfiguration = PutBackupVaultLockConfiguration'
  { -- | The Backup Vault Lock configuration that specifies the number of days
    -- before the lock date. For example, setting @ChangeableForDays@ to 30 on
    -- Jan. 1, 2022 at 8pm UTC will set the lock date to Jan. 31, 2022 at 8pm
    -- UTC.
    --
    -- Backup enforces a 72-hour cooling-off period before Vault Lock takes
    -- effect and becomes immutable. Therefore, you must set
    -- @ChangeableForDays@ to 3 or greater.
    --
    -- Before the lock date, you can delete Vault Lock from the vault using
    -- @DeleteBackupVaultLockConfiguration@ or change the Vault Lock
    -- configuration using @PutBackupVaultLockConfiguration@. On and after the
    -- lock date, the Vault Lock becomes immutable and cannot be changed or
    -- deleted.
    --
    -- If this parameter is not specified, you can delete Vault Lock from the
    -- vault using @DeleteBackupVaultLockConfiguration@ or change the Vault
    -- Lock configuration using @PutBackupVaultLockConfiguration@ at any time.
    PutBackupVaultLockConfiguration -> Maybe Integer
changeableForDays :: Prelude.Maybe Prelude.Integer,
    -- | The Backup Vault Lock configuration that specifies the maximum retention
    -- period that the vault retains its recovery points. This setting can be
    -- useful if, for example, your organization\'s policies require you to
    -- destroy certain data after retaining it for four years (1460 days).
    --
    -- If this parameter is not included, Vault Lock does not enforce a maximum
    -- retention period on the recovery points in the vault. If this parameter
    -- is included without a value, Vault Lock will not enforce a maximum
    -- retention period.
    --
    -- If this parameter is specified, any backup or copy job to the vault must
    -- have a lifecycle policy with a retention period equal to or shorter than
    -- the maximum retention period. If the job\'s retention period is longer
    -- than that maximum retention period, then the vault fails the backup or
    -- copy job, and you should either modify your lifecycle settings or use a
    -- different vault. The longest maximum retention period you can specify is
    -- 36500 days (approximately 100 years). Recovery points already saved in
    -- the vault prior to Vault Lock are not affected.
    PutBackupVaultLockConfiguration -> Maybe Integer
maxRetentionDays :: Prelude.Maybe Prelude.Integer,
    -- | The Backup Vault Lock configuration that specifies the minimum retention
    -- period that the vault retains its recovery points. This setting can be
    -- useful if, for example, your organization\'s policies require you to
    -- retain certain data for at least seven years (2555 days).
    --
    -- If this parameter is not specified, Vault Lock will not enforce a
    -- minimum retention period.
    --
    -- If this parameter is specified, any backup or copy job to the vault must
    -- have a lifecycle policy with a retention period equal to or longer than
    -- the minimum retention period. If the job\'s retention period is shorter
    -- than that minimum retention period, then the vault fails that backup or
    -- copy job, and you should either modify your lifecycle settings or use a
    -- different vault. The shortest minimum retention period you can specify
    -- is 1 day. Recovery points already saved in the vault prior to Vault Lock
    -- are not affected.
    PutBackupVaultLockConfiguration -> Maybe Integer
minRetentionDays :: Prelude.Maybe Prelude.Integer,
    -- | The Backup Vault Lock configuration that specifies the name of the
    -- backup vault it protects.
    PutBackupVaultLockConfiguration -> Text
backupVaultName :: Prelude.Text
  }
  deriving (PutBackupVaultLockConfiguration
-> PutBackupVaultLockConfiguration -> Bool
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]
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
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.
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)

-- |
-- Create a value of 'PutBackupVaultLockConfiguration' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'changeableForDays', 'putBackupVaultLockConfiguration_changeableForDays' - The Backup Vault Lock configuration that specifies the number of days
-- before the lock date. For example, setting @ChangeableForDays@ to 30 on
-- Jan. 1, 2022 at 8pm UTC will set the lock date to Jan. 31, 2022 at 8pm
-- UTC.
--
-- Backup enforces a 72-hour cooling-off period before Vault Lock takes
-- effect and becomes immutable. Therefore, you must set
-- @ChangeableForDays@ to 3 or greater.
--
-- Before the lock date, you can delete Vault Lock from the vault using
-- @DeleteBackupVaultLockConfiguration@ or change the Vault Lock
-- configuration using @PutBackupVaultLockConfiguration@. On and after the
-- lock date, the Vault Lock becomes immutable and cannot be changed or
-- deleted.
--
-- If this parameter is not specified, you can delete Vault Lock from the
-- vault using @DeleteBackupVaultLockConfiguration@ or change the Vault
-- Lock configuration using @PutBackupVaultLockConfiguration@ at any time.
--
-- 'maxRetentionDays', 'putBackupVaultLockConfiguration_maxRetentionDays' - The Backup Vault Lock configuration that specifies the maximum retention
-- period that the vault retains its recovery points. This setting can be
-- useful if, for example, your organization\'s policies require you to
-- destroy certain data after retaining it for four years (1460 days).
--
-- If this parameter is not included, Vault Lock does not enforce a maximum
-- retention period on the recovery points in the vault. If this parameter
-- is included without a value, Vault Lock will not enforce a maximum
-- retention period.
--
-- If this parameter is specified, any backup or copy job to the vault must
-- have a lifecycle policy with a retention period equal to or shorter than
-- the maximum retention period. If the job\'s retention period is longer
-- than that maximum retention period, then the vault fails the backup or
-- copy job, and you should either modify your lifecycle settings or use a
-- different vault. The longest maximum retention period you can specify is
-- 36500 days (approximately 100 years). Recovery points already saved in
-- the vault prior to Vault Lock are not affected.
--
-- 'minRetentionDays', 'putBackupVaultLockConfiguration_minRetentionDays' - The Backup Vault Lock configuration that specifies the minimum retention
-- period that the vault retains its recovery points. This setting can be
-- useful if, for example, your organization\'s policies require you to
-- retain certain data for at least seven years (2555 days).
--
-- If this parameter is not specified, Vault Lock will not enforce a
-- minimum retention period.
--
-- If this parameter is specified, any backup or copy job to the vault must
-- have a lifecycle policy with a retention period equal to or longer than
-- the minimum retention period. If the job\'s retention period is shorter
-- than that minimum retention period, then the vault fails that backup or
-- copy job, and you should either modify your lifecycle settings or use a
-- different vault. The shortest minimum retention period you can specify
-- is 1 day. Recovery points already saved in the vault prior to Vault Lock
-- are not affected.
--
-- 'backupVaultName', 'putBackupVaultLockConfiguration_backupVaultName' - The Backup Vault Lock configuration that specifies the name of the
-- backup vault it protects.
newPutBackupVaultLockConfiguration ::
  -- | 'backupVaultName'
  Prelude.Text ->
  PutBackupVaultLockConfiguration
newPutBackupVaultLockConfiguration :: Text -> PutBackupVaultLockConfiguration
newPutBackupVaultLockConfiguration Text
pBackupVaultName_ =
  PutBackupVaultLockConfiguration'
    { $sel:changeableForDays:PutBackupVaultLockConfiguration' :: Maybe Integer
changeableForDays =
        forall a. Maybe a
Prelude.Nothing,
      $sel:maxRetentionDays:PutBackupVaultLockConfiguration' :: Maybe Integer
maxRetentionDays = forall a. Maybe a
Prelude.Nothing,
      $sel:minRetentionDays:PutBackupVaultLockConfiguration' :: Maybe Integer
minRetentionDays = forall a. Maybe a
Prelude.Nothing,
      $sel:backupVaultName:PutBackupVaultLockConfiguration' :: Text
backupVaultName = Text
pBackupVaultName_
    }

-- | The Backup Vault Lock configuration that specifies the number of days
-- before the lock date. For example, setting @ChangeableForDays@ to 30 on
-- Jan. 1, 2022 at 8pm UTC will set the lock date to Jan. 31, 2022 at 8pm
-- UTC.
--
-- Backup enforces a 72-hour cooling-off period before Vault Lock takes
-- effect and becomes immutable. Therefore, you must set
-- @ChangeableForDays@ to 3 or greater.
--
-- Before the lock date, you can delete Vault Lock from the vault using
-- @DeleteBackupVaultLockConfiguration@ or change the Vault Lock
-- configuration using @PutBackupVaultLockConfiguration@. On and after the
-- lock date, the Vault Lock becomes immutable and cannot be changed or
-- deleted.
--
-- If this parameter is not specified, you can delete Vault Lock from the
-- vault using @DeleteBackupVaultLockConfiguration@ or change the Vault
-- Lock configuration using @PutBackupVaultLockConfiguration@ at any time.
putBackupVaultLockConfiguration_changeableForDays :: Lens.Lens' PutBackupVaultLockConfiguration (Prelude.Maybe Prelude.Integer)
putBackupVaultLockConfiguration_changeableForDays :: Lens' PutBackupVaultLockConfiguration (Maybe Integer)
putBackupVaultLockConfiguration_changeableForDays = 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)

-- | The Backup Vault Lock configuration that specifies the maximum retention
-- period that the vault retains its recovery points. This setting can be
-- useful if, for example, your organization\'s policies require you to
-- destroy certain data after retaining it for four years (1460 days).
--
-- If this parameter is not included, Vault Lock does not enforce a maximum
-- retention period on the recovery points in the vault. If this parameter
-- is included without a value, Vault Lock will not enforce a maximum
-- retention period.
--
-- If this parameter is specified, any backup or copy job to the vault must
-- have a lifecycle policy with a retention period equal to or shorter than
-- the maximum retention period. If the job\'s retention period is longer
-- than that maximum retention period, then the vault fails the backup or
-- copy job, and you should either modify your lifecycle settings or use a
-- different vault. The longest maximum retention period you can specify is
-- 36500 days (approximately 100 years). Recovery points already saved in
-- the vault prior to Vault Lock are not affected.
putBackupVaultLockConfiguration_maxRetentionDays :: Lens.Lens' PutBackupVaultLockConfiguration (Prelude.Maybe Prelude.Integer)
putBackupVaultLockConfiguration_maxRetentionDays :: Lens' PutBackupVaultLockConfiguration (Maybe Integer)
putBackupVaultLockConfiguration_maxRetentionDays = 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)

-- | The Backup Vault Lock configuration that specifies the minimum retention
-- period that the vault retains its recovery points. This setting can be
-- useful if, for example, your organization\'s policies require you to
-- retain certain data for at least seven years (2555 days).
--
-- If this parameter is not specified, Vault Lock will not enforce a
-- minimum retention period.
--
-- If this parameter is specified, any backup or copy job to the vault must
-- have a lifecycle policy with a retention period equal to or longer than
-- the minimum retention period. If the job\'s retention period is shorter
-- than that minimum retention period, then the vault fails that backup or
-- copy job, and you should either modify your lifecycle settings or use a
-- different vault. The shortest minimum retention period you can specify
-- is 1 day. Recovery points already saved in the vault prior to Vault Lock
-- are not affected.
putBackupVaultLockConfiguration_minRetentionDays :: Lens.Lens' PutBackupVaultLockConfiguration (Prelude.Maybe Prelude.Integer)
putBackupVaultLockConfiguration_minRetentionDays :: Lens' PutBackupVaultLockConfiguration (Maybe Integer)
putBackupVaultLockConfiguration_minRetentionDays = 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)

-- | The Backup Vault Lock configuration that specifies the name of the
-- backup vault it protects.
putBackupVaultLockConfiguration_backupVaultName :: Lens.Lens' PutBackupVaultLockConfiguration Prelude.Text
putBackupVaultLockConfiguration_backupVaultName :: Lens' PutBackupVaultLockConfiguration Text
putBackupVaultLockConfiguration_backupVaultName = 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 :: (Service -> Service)
-> PutBackupVaultLockConfiguration
-> Request PutBackupVaultLockConfiguration
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy PutBackupVaultLockConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse PutBackupVaultLockConfiguration)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
      PutBackupVaultLockConfigurationResponse
PutBackupVaultLockConfigurationResponse'

instance
  Prelude.Hashable
    PutBackupVaultLockConfiguration
  where
  hashWithSalt :: Int -> PutBackupVaultLockConfiguration -> Int
hashWithSalt
    Int
_salt
    PutBackupVaultLockConfiguration' {Maybe Integer
Text
backupVaultName :: Text
minRetentionDays :: Maybe Integer
maxRetentionDays :: Maybe Integer
changeableForDays :: Maybe Integer
$sel:backupVaultName:PutBackupVaultLockConfiguration' :: PutBackupVaultLockConfiguration -> Text
$sel:minRetentionDays:PutBackupVaultLockConfiguration' :: PutBackupVaultLockConfiguration -> Maybe Integer
$sel:maxRetentionDays:PutBackupVaultLockConfiguration' :: PutBackupVaultLockConfiguration -> Maybe Integer
$sel:changeableForDays:PutBackupVaultLockConfiguration' :: PutBackupVaultLockConfiguration -> Maybe Integer
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
changeableForDays
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
maxRetentionDays
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
minRetentionDays
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
backupVaultName

instance
  Prelude.NFData
    PutBackupVaultLockConfiguration
  where
  rnf :: PutBackupVaultLockConfiguration -> ()
rnf PutBackupVaultLockConfiguration' {Maybe Integer
Text
backupVaultName :: Text
minRetentionDays :: Maybe Integer
maxRetentionDays :: Maybe Integer
changeableForDays :: Maybe Integer
$sel:backupVaultName:PutBackupVaultLockConfiguration' :: PutBackupVaultLockConfiguration -> Text
$sel:minRetentionDays:PutBackupVaultLockConfiguration' :: PutBackupVaultLockConfiguration -> Maybe Integer
$sel:maxRetentionDays:PutBackupVaultLockConfiguration' :: PutBackupVaultLockConfiguration -> Maybe Integer
$sel:changeableForDays:PutBackupVaultLockConfiguration' :: PutBackupVaultLockConfiguration -> Maybe Integer
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
changeableForDays
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
maxRetentionDays
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
minRetentionDays
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
backupVaultName

instance
  Data.ToHeaders
    PutBackupVaultLockConfiguration
  where
  toHeaders :: PutBackupVaultLockConfiguration -> [Header]
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 -> [Header]
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON PutBackupVaultLockConfiguration where
  toJSON :: PutBackupVaultLockConfiguration -> Value
toJSON PutBackupVaultLockConfiguration' {Maybe Integer
Text
backupVaultName :: Text
minRetentionDays :: Maybe Integer
maxRetentionDays :: Maybe Integer
changeableForDays :: Maybe Integer
$sel:backupVaultName:PutBackupVaultLockConfiguration' :: PutBackupVaultLockConfiguration -> Text
$sel:minRetentionDays:PutBackupVaultLockConfiguration' :: PutBackupVaultLockConfiguration -> Maybe Integer
$sel:maxRetentionDays:PutBackupVaultLockConfiguration' :: PutBackupVaultLockConfiguration -> Maybe Integer
$sel:changeableForDays:PutBackupVaultLockConfiguration' :: PutBackupVaultLockConfiguration -> Maybe Integer
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"ChangeableForDays" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Integer
changeableForDays,
            (Key
"MaxRetentionDays" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Integer
maxRetentionDays,
            (Key
"MinRetentionDays" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Integer
minRetentionDays
          ]
      )

instance Data.ToPath PutBackupVaultLockConfiguration where
  toPath :: PutBackupVaultLockConfiguration -> ByteString
toPath PutBackupVaultLockConfiguration' {Maybe Integer
Text
backupVaultName :: Text
minRetentionDays :: Maybe Integer
maxRetentionDays :: Maybe Integer
changeableForDays :: Maybe Integer
$sel:backupVaultName:PutBackupVaultLockConfiguration' :: PutBackupVaultLockConfiguration -> Text
$sel:minRetentionDays:PutBackupVaultLockConfiguration' :: PutBackupVaultLockConfiguration -> Maybe Integer
$sel:maxRetentionDays:PutBackupVaultLockConfiguration' :: PutBackupVaultLockConfiguration -> Maybe Integer
$sel:changeableForDays:PutBackupVaultLockConfiguration' :: PutBackupVaultLockConfiguration -> Maybe Integer
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/backup-vaults/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
backupVaultName,
        ByteString
"/vault-lock"
      ]

instance Data.ToQuery PutBackupVaultLockConfiguration where
  toQuery :: PutBackupVaultLockConfiguration -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newPutBackupVaultLockConfigurationResponse' smart constructor.
data PutBackupVaultLockConfigurationResponse = PutBackupVaultLockConfigurationResponse'
  {
  }
  deriving (PutBackupVaultLockConfigurationResponse
-> PutBackupVaultLockConfigurationResponse -> Bool
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]
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
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.
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)

-- |
-- Create a value of 'PutBackupVaultLockConfigurationResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
newPutBackupVaultLockConfigurationResponse ::
  PutBackupVaultLockConfigurationResponse
newPutBackupVaultLockConfigurationResponse :: PutBackupVaultLockConfigurationResponse
newPutBackupVaultLockConfigurationResponse =
  PutBackupVaultLockConfigurationResponse
PutBackupVaultLockConfigurationResponse'

instance
  Prelude.NFData
    PutBackupVaultLockConfigurationResponse
  where
  rnf :: PutBackupVaultLockConfigurationResponse -> ()
rnf PutBackupVaultLockConfigurationResponse
_ = ()