{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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'
  { -- | 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],
    -- | 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,
    -- | 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 “retention” 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.
    --
    -- Resource types that are able to be transitioned to cold storage are
    -- listed in the \"Lifecycle to cold storage\" section of the
    -- <https://docs.aws.amazon.com/aws-backup/latest/devguide/whatisbackup.html#features-by-resource Feature availability by resource>
    -- table. Backup ignores this expression for other resource types.
    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 (Data.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,
    -- | 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. If
    -- this value is included, it must be at least 60 minutes to avoid errors.
    BackupRuleInput -> Maybe Integer
startWindowMinutes :: Prelude.Maybe Prelude.Integer,
    -- | A display name for a backup rule. Must contain 1 to 50 alphanumeric or
    -- \'-_.\' characters.
    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
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
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. 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:
--
-- '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.
--
-- '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.
--
-- '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 “retention” 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.
--
-- Resource types that are able to be transitioned to cold storage are
-- listed in the \"Lifecycle to cold storage\" section of the
-- <https://docs.aws.amazon.com/aws-backup/latest/devguide/whatisbackup.html#features-by-resource Feature availability by resource>
-- table. Backup ignores this expression for other resource types.
--
-- '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.
--
-- '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. If
-- this value is included, it must be at least 60 minutes to avoid errors.
--
-- 'ruleName', 'backupRuleInput_ruleName' - A display name for a backup rule. Must contain 1 to 50 alphanumeric or
-- \'-_.\' characters.
--
-- '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'
    { $sel:completionWindowMinutes:BackupRuleInput' :: Maybe Integer
completionWindowMinutes =
        forall a. Maybe a
Prelude.Nothing,
      $sel:copyActions:BackupRuleInput' :: Maybe [CopyAction]
copyActions = forall a. Maybe a
Prelude.Nothing,
      $sel:enableContinuousBackup:BackupRuleInput' :: Maybe Bool
enableContinuousBackup = forall a. Maybe a
Prelude.Nothing,
      $sel:lifecycle:BackupRuleInput' :: Maybe Lifecycle
lifecycle = forall a. Maybe a
Prelude.Nothing,
      $sel:recoveryPointTags:BackupRuleInput' :: Maybe (Sensitive (HashMap Text Text))
recoveryPointTags = forall a. Maybe a
Prelude.Nothing,
      $sel:scheduleExpression:BackupRuleInput' :: Maybe Text
scheduleExpression = forall a. Maybe a
Prelude.Nothing,
      $sel:startWindowMinutes:BackupRuleInput' :: Maybe Integer
startWindowMinutes = forall a. Maybe a
Prelude.Nothing,
      $sel:ruleName:BackupRuleInput' :: Text
ruleName = Text
pRuleName_,
      $sel:targetBackupVaultName:BackupRuleInput' :: Text
targetBackupVaultName = Text
pTargetBackupVaultName_
    }

-- | 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 :: Lens' BackupRuleInput (Maybe Integer)
backupRuleInput_completionWindowMinutes = 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 :: Lens' BackupRuleInput (Maybe [CopyAction])
backupRuleInput_copyActions = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | 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 :: Lens' BackupRuleInput (Maybe Bool)
backupRuleInput_enableContinuousBackup = 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)

-- | 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 “retention” 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.
--
-- Resource types that are able to be transitioned to cold storage are
-- listed in the \"Lifecycle to cold storage\" section of the
-- <https://docs.aws.amazon.com/aws-backup/latest/devguide/whatisbackup.html#features-by-resource Feature availability by resource>
-- table. Backup ignores this expression for other resource types.
backupRuleInput_lifecycle :: Lens.Lens' BackupRuleInput (Prelude.Maybe Lifecycle)
backupRuleInput_lifecycle :: Lens' BackupRuleInput (Maybe Lifecycle)
backupRuleInput_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 :: Lens' BackupRuleInput (Maybe (HashMap Text Text))
backupRuleInput_recoveryPointTags = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 (forall a. Iso' (Sensitive a) a
Data._Sensitive forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 :: Lens' BackupRuleInput (Maybe Text)
backupRuleInput_scheduleExpression = 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)

-- | 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. If
-- this value is included, it must be at least 60 minutes to avoid errors.
backupRuleInput_startWindowMinutes :: Lens.Lens' BackupRuleInput (Prelude.Maybe Prelude.Integer)
backupRuleInput_startWindowMinutes :: Lens' BackupRuleInput (Maybe Integer)
backupRuleInput_startWindowMinutes = 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)

-- | A display name for a backup rule. Must contain 1 to 50 alphanumeric or
-- \'-_.\' characters.
backupRuleInput_ruleName :: Lens.Lens' BackupRuleInput Prelude.Text
backupRuleInput_ruleName :: Lens' BackupRuleInput Text
backupRuleInput_ruleName = 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 :: Lens' BackupRuleInput Text
backupRuleInput_targetBackupVaultName = 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 where
  hashWithSalt :: Int -> BackupRuleInput -> Int
hashWithSalt Int
_salt BackupRuleInput' {Maybe Bool
Maybe Integer
Maybe [CopyAction]
Maybe Text
Maybe (Sensitive (HashMap Text Text))
Maybe Lifecycle
Text
targetBackupVaultName :: Text
ruleName :: Text
startWindowMinutes :: Maybe Integer
scheduleExpression :: Maybe Text
recoveryPointTags :: Maybe (Sensitive (HashMap Text Text))
lifecycle :: Maybe Lifecycle
enableContinuousBackup :: Maybe Bool
copyActions :: Maybe [CopyAction]
completionWindowMinutes :: Maybe Integer
$sel:targetBackupVaultName:BackupRuleInput' :: BackupRuleInput -> Text
$sel:ruleName:BackupRuleInput' :: BackupRuleInput -> Text
$sel:startWindowMinutes:BackupRuleInput' :: BackupRuleInput -> Maybe Integer
$sel:scheduleExpression:BackupRuleInput' :: BackupRuleInput -> Maybe Text
$sel:recoveryPointTags:BackupRuleInput' :: BackupRuleInput -> Maybe (Sensitive (HashMap Text Text))
$sel:lifecycle:BackupRuleInput' :: BackupRuleInput -> Maybe Lifecycle
$sel:enableContinuousBackup:BackupRuleInput' :: BackupRuleInput -> Maybe Bool
$sel:copyActions:BackupRuleInput' :: BackupRuleInput -> Maybe [CopyAction]
$sel:completionWindowMinutes:BackupRuleInput' :: BackupRuleInput -> Maybe Integer
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
completionWindowMinutes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [CopyAction]
copyActions
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
enableContinuousBackup
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Lifecycle
lifecycle
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive (HashMap Text Text))
recoveryPointTags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
scheduleExpression
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
startWindowMinutes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
ruleName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
targetBackupVaultName

instance Prelude.NFData BackupRuleInput where
  rnf :: BackupRuleInput -> ()
rnf BackupRuleInput' {Maybe Bool
Maybe Integer
Maybe [CopyAction]
Maybe Text
Maybe (Sensitive (HashMap Text Text))
Maybe Lifecycle
Text
targetBackupVaultName :: Text
ruleName :: Text
startWindowMinutes :: Maybe Integer
scheduleExpression :: Maybe Text
recoveryPointTags :: Maybe (Sensitive (HashMap Text Text))
lifecycle :: Maybe Lifecycle
enableContinuousBackup :: Maybe Bool
copyActions :: Maybe [CopyAction]
completionWindowMinutes :: Maybe Integer
$sel:targetBackupVaultName:BackupRuleInput' :: BackupRuleInput -> Text
$sel:ruleName:BackupRuleInput' :: BackupRuleInput -> Text
$sel:startWindowMinutes:BackupRuleInput' :: BackupRuleInput -> Maybe Integer
$sel:scheduleExpression:BackupRuleInput' :: BackupRuleInput -> Maybe Text
$sel:recoveryPointTags:BackupRuleInput' :: BackupRuleInput -> Maybe (Sensitive (HashMap Text Text))
$sel:lifecycle:BackupRuleInput' :: BackupRuleInput -> Maybe Lifecycle
$sel:enableContinuousBackup:BackupRuleInput' :: BackupRuleInput -> Maybe Bool
$sel:copyActions:BackupRuleInput' :: BackupRuleInput -> Maybe [CopyAction]
$sel:completionWindowMinutes:BackupRuleInput' :: BackupRuleInput -> Maybe Integer
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
completionWindowMinutes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [CopyAction]
copyActions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
enableContinuousBackup
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Lifecycle
lifecycle
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive (HashMap Text Text))
recoveryPointTags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
scheduleExpression
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
startWindowMinutes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
ruleName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
targetBackupVaultName

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