{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# 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.Types.BackupRuleInput
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Backup.Types.BackupRuleInput where

import Amazonka.Backup.Types.CopyAction
import Amazonka.Backup.Types.Lifecycle
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Specifies a scheduled task used to back up a selection of resources.
--
-- /See:/ 'newBackupRuleInput' smart constructor.
data BackupRuleInput = BackupRuleInput'
  { -- | The lifecycle defines when a protected resource is transitioned to cold
    -- storage and when it expires. Backup will transition and expire backups
    -- automatically according to the lifecycle that you define.
    --
    -- Backups transitioned to cold storage must be stored in cold storage for
    -- a minimum of 90 days. Therefore, the “expire after days” setting must be
    -- 90 days greater than the “transition to cold after days” setting. The
    -- “transition to cold after days” setting cannot be changed after a backup
    -- has been transitioned to cold.
    --
    -- Only Amazon EFS file system backups can be transitioned to cold storage.
    BackupRuleInput -> Maybe Lifecycle
lifecycle :: Prelude.Maybe Lifecycle,
    -- | To help organize your resources, you can assign your own metadata to the
    -- resources that you create. Each tag is a key-value pair.
    BackupRuleInput -> Maybe (Sensitive (HashMap Text Text))
recoveryPointTags :: Prelude.Maybe (Core.Sensitive (Prelude.HashMap Prelude.Text Prelude.Text)),
    -- | A CRON expression in UTC specifying when Backup initiates a backup job.
    BackupRuleInput -> Maybe Text
scheduleExpression :: Prelude.Maybe Prelude.Text,
    -- | Specifies whether Backup creates continuous backups. True causes Backup
    -- to create continuous backups capable of point-in-time restore (PITR).
    -- False (or not specified) causes Backup to create snapshot backups.
    BackupRuleInput -> Maybe Bool
enableContinuousBackup :: Prelude.Maybe Prelude.Bool,
    -- | A value in minutes after a backup job is successfully started before it
    -- must be completed or it will be canceled by Backup. This value is
    -- optional.
    BackupRuleInput -> Maybe Integer
completionWindowMinutes :: Prelude.Maybe Prelude.Integer,
    -- | An array of @CopyAction@ objects, which contains the details of the copy
    -- operation.
    BackupRuleInput -> Maybe [CopyAction]
copyActions :: Prelude.Maybe [CopyAction],
    -- | A value in minutes after a backup is scheduled before a job will be
    -- canceled if it doesn\'t start successfully. This value is optional.
    BackupRuleInput -> Maybe Integer
startWindowMinutes :: Prelude.Maybe Prelude.Integer,
    -- | An optional display name for a backup rule.
    BackupRuleInput -> Text
ruleName :: Prelude.Text,
    -- | The name of a logical container where backups are stored. Backup vaults
    -- are identified by names that are unique to the account used to create
    -- them and the Amazon Web Services Region where they are created. They
    -- consist of lowercase letters, numbers, and hyphens.
    BackupRuleInput -> Text
targetBackupVaultName :: Prelude.Text
  }
  deriving (BackupRuleInput -> BackupRuleInput -> Bool
(BackupRuleInput -> BackupRuleInput -> Bool)
-> (BackupRuleInput -> BackupRuleInput -> Bool)
-> Eq BackupRuleInput
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BackupRuleInput -> BackupRuleInput -> Bool
$c/= :: BackupRuleInput -> BackupRuleInput -> Bool
== :: BackupRuleInput -> BackupRuleInput -> Bool
$c== :: BackupRuleInput -> BackupRuleInput -> Bool
Prelude.Eq, Int -> BackupRuleInput -> ShowS
[BackupRuleInput] -> ShowS
BackupRuleInput -> String
(Int -> BackupRuleInput -> ShowS)
-> (BackupRuleInput -> String)
-> ([BackupRuleInput] -> ShowS)
-> Show BackupRuleInput
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BackupRuleInput] -> ShowS
$cshowList :: [BackupRuleInput] -> ShowS
show :: BackupRuleInput -> String
$cshow :: BackupRuleInput -> String
showsPrec :: Int -> BackupRuleInput -> ShowS
$cshowsPrec :: Int -> BackupRuleInput -> ShowS
Prelude.Show, (forall x. BackupRuleInput -> Rep BackupRuleInput x)
-> (forall x. Rep BackupRuleInput x -> BackupRuleInput)
-> Generic BackupRuleInput
forall x. Rep BackupRuleInput x -> BackupRuleInput
forall x. BackupRuleInput -> Rep BackupRuleInput x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BackupRuleInput x -> BackupRuleInput
$cfrom :: forall x. BackupRuleInput -> Rep BackupRuleInput x
Prelude.Generic)

-- |
-- Create a value of 'BackupRuleInput' 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:
--
-- 'lifecycle', 'backupRuleInput_lifecycle' - The lifecycle defines when a protected resource is transitioned to cold
-- storage and when it expires. Backup will transition and expire backups
-- automatically according to the lifecycle that you define.
--
-- Backups transitioned to cold storage must be stored in cold storage for
-- a minimum of 90 days. Therefore, the “expire after days” setting must be
-- 90 days greater than the “transition to cold after days” setting. The
-- “transition to cold after days” setting cannot be changed after a backup
-- has been transitioned to cold.
--
-- Only Amazon EFS file system backups can be transitioned to cold storage.
--
-- 'recoveryPointTags', 'backupRuleInput_recoveryPointTags' - To help organize your resources, you can assign your own metadata to the
-- resources that you create. Each tag is a key-value pair.
--
-- 'scheduleExpression', 'backupRuleInput_scheduleExpression' - A CRON expression in UTC specifying when Backup initiates a backup job.
--
-- 'enableContinuousBackup', 'backupRuleInput_enableContinuousBackup' - Specifies whether Backup creates continuous backups. True causes Backup
-- to create continuous backups capable of point-in-time restore (PITR).
-- False (or not specified) causes Backup to create snapshot backups.
--
-- 'completionWindowMinutes', 'backupRuleInput_completionWindowMinutes' - A value in minutes after a backup job is successfully started before it
-- must be completed or it will be canceled by Backup. This value is
-- optional.
--
-- 'copyActions', 'backupRuleInput_copyActions' - An array of @CopyAction@ objects, which contains the details of the copy
-- operation.
--
-- 'startWindowMinutes', 'backupRuleInput_startWindowMinutes' - A value in minutes after a backup is scheduled before a job will be
-- canceled if it doesn\'t start successfully. This value is optional.
--
-- 'ruleName', 'backupRuleInput_ruleName' - An optional display name for a backup rule.
--
-- 'targetBackupVaultName', 'backupRuleInput_targetBackupVaultName' - The name of a logical container where backups are stored. Backup vaults
-- are identified by names that are unique to the account used to create
-- them and the Amazon Web Services Region where they are created. They
-- consist of lowercase letters, numbers, and hyphens.
newBackupRuleInput ::
  -- | 'ruleName'
  Prelude.Text ->
  -- | 'targetBackupVaultName'
  Prelude.Text ->
  BackupRuleInput
newBackupRuleInput :: Text -> Text -> BackupRuleInput
newBackupRuleInput Text
pRuleName_ Text
pTargetBackupVaultName_ =
  BackupRuleInput' :: Maybe Lifecycle
-> Maybe (Sensitive (HashMap Text Text))
-> Maybe Text
-> Maybe Bool
-> Maybe Integer
-> Maybe [CopyAction]
-> Maybe Integer
-> Text
-> Text
-> BackupRuleInput
BackupRuleInput'
    { $sel:lifecycle:BackupRuleInput' :: Maybe Lifecycle
lifecycle = Maybe Lifecycle
forall a. Maybe a
Prelude.Nothing,
      $sel:recoveryPointTags:BackupRuleInput' :: Maybe (Sensitive (HashMap Text Text))
recoveryPointTags = Maybe (Sensitive (HashMap Text Text))
forall a. Maybe a
Prelude.Nothing,
      $sel:scheduleExpression:BackupRuleInput' :: Maybe Text
scheduleExpression = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:enableContinuousBackup:BackupRuleInput' :: Maybe Bool
enableContinuousBackup = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:completionWindowMinutes:BackupRuleInput' :: Maybe Integer
completionWindowMinutes = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:copyActions:BackupRuleInput' :: Maybe [CopyAction]
copyActions = Maybe [CopyAction]
forall a. Maybe a
Prelude.Nothing,
      $sel:startWindowMinutes:BackupRuleInput' :: Maybe Integer
startWindowMinutes = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:ruleName:BackupRuleInput' :: Text
ruleName = Text
pRuleName_,
      $sel:targetBackupVaultName:BackupRuleInput' :: Text
targetBackupVaultName = Text
pTargetBackupVaultName_
    }

-- | The lifecycle defines when a protected resource is transitioned to cold
-- storage and when it expires. Backup will transition and expire backups
-- automatically according to the lifecycle that you define.
--
-- Backups transitioned to cold storage must be stored in cold storage for
-- a minimum of 90 days. Therefore, the “expire after days” setting must be
-- 90 days greater than the “transition to cold after days” setting. The
-- “transition to cold after days” setting cannot be changed after a backup
-- has been transitioned to cold.
--
-- Only Amazon EFS file system backups can be transitioned to cold storage.
backupRuleInput_lifecycle :: Lens.Lens' BackupRuleInput (Prelude.Maybe Lifecycle)
backupRuleInput_lifecycle :: (Maybe Lifecycle -> f (Maybe Lifecycle))
-> BackupRuleInput -> f BackupRuleInput
backupRuleInput_lifecycle = (BackupRuleInput -> Maybe Lifecycle)
-> (BackupRuleInput -> Maybe Lifecycle -> BackupRuleInput)
-> Lens
     BackupRuleInput BackupRuleInput (Maybe Lifecycle) (Maybe Lifecycle)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackupRuleInput' {Maybe Lifecycle
lifecycle :: Maybe Lifecycle
$sel:lifecycle:BackupRuleInput' :: BackupRuleInput -> Maybe Lifecycle
lifecycle} -> Maybe Lifecycle
lifecycle) (\s :: BackupRuleInput
s@BackupRuleInput' {} Maybe Lifecycle
a -> BackupRuleInput
s {$sel:lifecycle:BackupRuleInput' :: Maybe Lifecycle
lifecycle = Maybe Lifecycle
a} :: BackupRuleInput)

-- | To help organize your resources, you can assign your own metadata to the
-- resources that you create. Each tag is a key-value pair.
backupRuleInput_recoveryPointTags :: Lens.Lens' BackupRuleInput (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
backupRuleInput_recoveryPointTags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> BackupRuleInput -> f BackupRuleInput
backupRuleInput_recoveryPointTags = (BackupRuleInput -> Maybe (Sensitive (HashMap Text Text)))
-> (BackupRuleInput
    -> Maybe (Sensitive (HashMap Text Text)) -> BackupRuleInput)
-> Lens
     BackupRuleInput
     BackupRuleInput
     (Maybe (Sensitive (HashMap Text Text)))
     (Maybe (Sensitive (HashMap Text Text)))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackupRuleInput' {Maybe (Sensitive (HashMap Text Text))
recoveryPointTags :: Maybe (Sensitive (HashMap Text Text))
$sel:recoveryPointTags:BackupRuleInput' :: BackupRuleInput -> Maybe (Sensitive (HashMap Text Text))
recoveryPointTags} -> Maybe (Sensitive (HashMap Text Text))
recoveryPointTags) (\s :: BackupRuleInput
s@BackupRuleInput' {} Maybe (Sensitive (HashMap Text Text))
a -> BackupRuleInput
s {$sel:recoveryPointTags:BackupRuleInput' :: Maybe (Sensitive (HashMap Text Text))
recoveryPointTags = Maybe (Sensitive (HashMap Text Text))
a} :: BackupRuleInput) ((Maybe (Sensitive (HashMap Text Text))
  -> f (Maybe (Sensitive (HashMap Text Text))))
 -> BackupRuleInput -> f BackupRuleInput)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (Sensitive (HashMap Text Text))
    -> f (Maybe (Sensitive (HashMap Text Text))))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> BackupRuleInput
-> f BackupRuleInput
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (Sensitive (HashMap Text Text))
  (Sensitive (HashMap Text Text))
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (Sensitive (HashMap Text Text)))
     (Maybe (Sensitive (HashMap Text Text)))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
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 (AnIso
  (Sensitive (HashMap Text Text))
  (Sensitive (HashMap Text Text))
  (HashMap Text Text)
  (HashMap Text Text)
forall a. Iso' (Sensitive a) a
Core._Sensitive AnIso
  (Sensitive (HashMap Text Text))
  (Sensitive (HashMap Text Text))
  (HashMap Text Text)
  (HashMap Text Text)
-> (Exchange
      (HashMap Text Text)
      (HashMap Text Text)
      (HashMap Text Text)
      (Identity (HashMap Text Text))
    -> Exchange
         (HashMap Text Text)
         (HashMap Text Text)
         (HashMap Text Text)
         (Identity (HashMap Text Text)))
-> AnIso
     (Sensitive (HashMap Text Text))
     (Sensitive (HashMap Text Text))
     (HashMap Text Text)
     (HashMap Text Text)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Exchange
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (Identity (HashMap Text Text))
-> Exchange
     (HashMap Text Text)
     (HashMap Text Text)
     (HashMap Text Text)
     (Identity (HashMap Text Text))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced)

-- | A CRON expression in UTC specifying when Backup initiates a backup job.
backupRuleInput_scheduleExpression :: Lens.Lens' BackupRuleInput (Prelude.Maybe Prelude.Text)
backupRuleInput_scheduleExpression :: (Maybe Text -> f (Maybe Text))
-> BackupRuleInput -> f BackupRuleInput
backupRuleInput_scheduleExpression = (BackupRuleInput -> Maybe Text)
-> (BackupRuleInput -> Maybe Text -> BackupRuleInput)
-> Lens BackupRuleInput BackupRuleInput (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackupRuleInput' {Maybe Text
scheduleExpression :: Maybe Text
$sel:scheduleExpression:BackupRuleInput' :: BackupRuleInput -> Maybe Text
scheduleExpression} -> Maybe Text
scheduleExpression) (\s :: BackupRuleInput
s@BackupRuleInput' {} Maybe Text
a -> BackupRuleInput
s {$sel:scheduleExpression:BackupRuleInput' :: Maybe Text
scheduleExpression = Maybe Text
a} :: BackupRuleInput)

-- | Specifies whether Backup creates continuous backups. True causes Backup
-- to create continuous backups capable of point-in-time restore (PITR).
-- False (or not specified) causes Backup to create snapshot backups.
backupRuleInput_enableContinuousBackup :: Lens.Lens' BackupRuleInput (Prelude.Maybe Prelude.Bool)
backupRuleInput_enableContinuousBackup :: (Maybe Bool -> f (Maybe Bool))
-> BackupRuleInput -> f BackupRuleInput
backupRuleInput_enableContinuousBackup = (BackupRuleInput -> Maybe Bool)
-> (BackupRuleInput -> Maybe Bool -> BackupRuleInput)
-> Lens BackupRuleInput BackupRuleInput (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackupRuleInput' {Maybe Bool
enableContinuousBackup :: Maybe Bool
$sel:enableContinuousBackup:BackupRuleInput' :: BackupRuleInput -> Maybe Bool
enableContinuousBackup} -> Maybe Bool
enableContinuousBackup) (\s :: BackupRuleInput
s@BackupRuleInput' {} Maybe Bool
a -> BackupRuleInput
s {$sel:enableContinuousBackup:BackupRuleInput' :: Maybe Bool
enableContinuousBackup = Maybe Bool
a} :: BackupRuleInput)

-- | A value in minutes after a backup job is successfully started before it
-- must be completed or it will be canceled by Backup. This value is
-- optional.
backupRuleInput_completionWindowMinutes :: Lens.Lens' BackupRuleInput (Prelude.Maybe Prelude.Integer)
backupRuleInput_completionWindowMinutes :: (Maybe Integer -> f (Maybe Integer))
-> BackupRuleInput -> f BackupRuleInput
backupRuleInput_completionWindowMinutes = (BackupRuleInput -> Maybe Integer)
-> (BackupRuleInput -> Maybe Integer -> BackupRuleInput)
-> Lens
     BackupRuleInput BackupRuleInput (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackupRuleInput' {Maybe Integer
completionWindowMinutes :: Maybe Integer
$sel:completionWindowMinutes:BackupRuleInput' :: BackupRuleInput -> Maybe Integer
completionWindowMinutes} -> Maybe Integer
completionWindowMinutes) (\s :: BackupRuleInput
s@BackupRuleInput' {} Maybe Integer
a -> BackupRuleInput
s {$sel:completionWindowMinutes:BackupRuleInput' :: Maybe Integer
completionWindowMinutes = Maybe Integer
a} :: BackupRuleInput)

-- | An array of @CopyAction@ objects, which contains the details of the copy
-- operation.
backupRuleInput_copyActions :: Lens.Lens' BackupRuleInput (Prelude.Maybe [CopyAction])
backupRuleInput_copyActions :: (Maybe [CopyAction] -> f (Maybe [CopyAction]))
-> BackupRuleInput -> f BackupRuleInput
backupRuleInput_copyActions = (BackupRuleInput -> Maybe [CopyAction])
-> (BackupRuleInput -> Maybe [CopyAction] -> BackupRuleInput)
-> Lens
     BackupRuleInput
     BackupRuleInput
     (Maybe [CopyAction])
     (Maybe [CopyAction])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackupRuleInput' {Maybe [CopyAction]
copyActions :: Maybe [CopyAction]
$sel:copyActions:BackupRuleInput' :: BackupRuleInput -> Maybe [CopyAction]
copyActions} -> Maybe [CopyAction]
copyActions) (\s :: BackupRuleInput
s@BackupRuleInput' {} Maybe [CopyAction]
a -> BackupRuleInput
s {$sel:copyActions:BackupRuleInput' :: Maybe [CopyAction]
copyActions = Maybe [CopyAction]
a} :: BackupRuleInput) ((Maybe [CopyAction] -> f (Maybe [CopyAction]))
 -> BackupRuleInput -> f BackupRuleInput)
-> ((Maybe [CopyAction] -> f (Maybe [CopyAction]))
    -> Maybe [CopyAction] -> f (Maybe [CopyAction]))
-> (Maybe [CopyAction] -> f (Maybe [CopyAction]))
-> BackupRuleInput
-> f BackupRuleInput
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [CopyAction] [CopyAction] [CopyAction] [CopyAction]
-> Iso
     (Maybe [CopyAction])
     (Maybe [CopyAction])
     (Maybe [CopyAction])
     (Maybe [CopyAction])
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 AnIso [CopyAction] [CopyAction] [CopyAction] [CopyAction]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A value in minutes after a backup is scheduled before a job will be
-- canceled if it doesn\'t start successfully. This value is optional.
backupRuleInput_startWindowMinutes :: Lens.Lens' BackupRuleInput (Prelude.Maybe Prelude.Integer)
backupRuleInput_startWindowMinutes :: (Maybe Integer -> f (Maybe Integer))
-> BackupRuleInput -> f BackupRuleInput
backupRuleInput_startWindowMinutes = (BackupRuleInput -> Maybe Integer)
-> (BackupRuleInput -> Maybe Integer -> BackupRuleInput)
-> Lens
     BackupRuleInput BackupRuleInput (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackupRuleInput' {Maybe Integer
startWindowMinutes :: Maybe Integer
$sel:startWindowMinutes:BackupRuleInput' :: BackupRuleInput -> Maybe Integer
startWindowMinutes} -> Maybe Integer
startWindowMinutes) (\s :: BackupRuleInput
s@BackupRuleInput' {} Maybe Integer
a -> BackupRuleInput
s {$sel:startWindowMinutes:BackupRuleInput' :: Maybe Integer
startWindowMinutes = Maybe Integer
a} :: BackupRuleInput)

-- | An optional display name for a backup rule.
backupRuleInput_ruleName :: Lens.Lens' BackupRuleInput Prelude.Text
backupRuleInput_ruleName :: (Text -> f Text) -> BackupRuleInput -> f BackupRuleInput
backupRuleInput_ruleName = (BackupRuleInput -> Text)
-> (BackupRuleInput -> Text -> BackupRuleInput)
-> Lens BackupRuleInput BackupRuleInput Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackupRuleInput' {Text
ruleName :: Text
$sel:ruleName:BackupRuleInput' :: BackupRuleInput -> Text
ruleName} -> Text
ruleName) (\s :: BackupRuleInput
s@BackupRuleInput' {} Text
a -> BackupRuleInput
s {$sel:ruleName:BackupRuleInput' :: Text
ruleName = Text
a} :: BackupRuleInput)

-- | The name of a logical container where backups are stored. Backup vaults
-- are identified by names that are unique to the account used to create
-- them and the Amazon Web Services Region where they are created. They
-- consist of lowercase letters, numbers, and hyphens.
backupRuleInput_targetBackupVaultName :: Lens.Lens' BackupRuleInput Prelude.Text
backupRuleInput_targetBackupVaultName :: (Text -> f Text) -> BackupRuleInput -> f BackupRuleInput
backupRuleInput_targetBackupVaultName = (BackupRuleInput -> Text)
-> (BackupRuleInput -> Text -> BackupRuleInput)
-> Lens BackupRuleInput BackupRuleInput Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackupRuleInput' {Text
targetBackupVaultName :: Text
$sel:targetBackupVaultName:BackupRuleInput' :: BackupRuleInput -> Text
targetBackupVaultName} -> Text
targetBackupVaultName) (\s :: BackupRuleInput
s@BackupRuleInput' {} Text
a -> BackupRuleInput
s {$sel:targetBackupVaultName:BackupRuleInput' :: Text
targetBackupVaultName = Text
a} :: BackupRuleInput)

instance Prelude.Hashable BackupRuleInput

instance Prelude.NFData BackupRuleInput

instance Core.ToJSON BackupRuleInput where
  toJSON :: BackupRuleInput -> Value
toJSON BackupRuleInput' {Maybe Bool
Maybe Integer
Maybe [CopyAction]
Maybe Text
Maybe (Sensitive (HashMap Text Text))
Maybe Lifecycle
Text
targetBackupVaultName :: Text
ruleName :: Text
startWindowMinutes :: Maybe Integer
copyActions :: Maybe [CopyAction]
completionWindowMinutes :: Maybe Integer
enableContinuousBackup :: Maybe Bool
scheduleExpression :: Maybe Text
recoveryPointTags :: Maybe (Sensitive (HashMap Text Text))
lifecycle :: Maybe Lifecycle
$sel:targetBackupVaultName:BackupRuleInput' :: BackupRuleInput -> Text
$sel:ruleName:BackupRuleInput' :: BackupRuleInput -> Text
$sel:startWindowMinutes:BackupRuleInput' :: BackupRuleInput -> Maybe Integer
$sel:copyActions:BackupRuleInput' :: BackupRuleInput -> Maybe [CopyAction]
$sel:completionWindowMinutes:BackupRuleInput' :: BackupRuleInput -> Maybe Integer
$sel:enableContinuousBackup:BackupRuleInput' :: BackupRuleInput -> Maybe Bool
$sel:scheduleExpression:BackupRuleInput' :: BackupRuleInput -> Maybe Text
$sel:recoveryPointTags:BackupRuleInput' :: BackupRuleInput -> Maybe (Sensitive (HashMap Text Text))
$sel:lifecycle:BackupRuleInput' :: BackupRuleInput -> Maybe Lifecycle
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Lifecycle" Text -> Lifecycle -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Lifecycle -> Pair) -> Maybe Lifecycle -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Lifecycle
lifecycle,
            (Text
"RecoveryPointTags" Text -> Sensitive (HashMap Text Text) -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Sensitive (HashMap Text Text) -> Pair)
-> Maybe (Sensitive (HashMap Text Text)) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive (HashMap Text Text))
recoveryPointTags,
            (Text
"ScheduleExpression" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
scheduleExpression,
            (Text
"EnableContinuousBackup" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
enableContinuousBackup,
            (Text
"CompletionWindowMinutes" 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
completionWindowMinutes,
            (Text
"CopyActions" Text -> [CopyAction] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([CopyAction] -> Pair) -> Maybe [CopyAction] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [CopyAction]
copyActions,
            (Text
"StartWindowMinutes" 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
startWindowMinutes,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"RuleName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
ruleName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"TargetBackupVaultName"
                  Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
targetBackupVaultName
              )
          ]
      )