{-# 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.BackupRule
-- 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.BackupRule 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:/ 'newBackupRule' smart constructor.
data BackupRule = BackupRule'
  { -- | 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.
    BackupRule -> Maybe Integer
completionWindowMinutes :: Prelude.Maybe Prelude.Integer,
    -- | An array of @CopyAction@ objects, which contains the details of the copy
    -- operation.
    BackupRule -> 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.
    BackupRule -> Maybe Bool
enableContinuousBackup :: Prelude.Maybe Prelude.Bool,
    -- | The lifecycle defines when a protected resource is transitioned to cold
    -- storage and when it expires. Backup transitions and expires 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.
    BackupRule -> Maybe Lifecycle
lifecycle :: Prelude.Maybe Lifecycle,
    -- | An array of key-value pair strings that are assigned to resources that
    -- are associated with this rule when restored from backup.
    BackupRule -> Maybe (Sensitive (HashMap Text Text))
recoveryPointTags :: Prelude.Maybe (Data.Sensitive (Prelude.HashMap Prelude.Text Prelude.Text)),
    -- | Uniquely identifies a rule that is used to schedule the backup of a
    -- selection of resources.
    BackupRule -> Maybe Text
ruleId :: Prelude.Maybe Prelude.Text,
    -- | A cron expression in UTC specifying when Backup initiates a backup job.
    -- For more information about Amazon Web Services cron expressions, see
    -- <https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html Schedule Expressions for Rules>
    -- in the /Amazon CloudWatch Events User Guide./. Two examples of Amazon
    -- Web Services cron expressions are @ 15 * ? * * *@ (take a backup every
    -- hour at 15 minutes past the hour) and @0 12 * * ? *@ (take a backup
    -- every day at 12 noon UTC). For a table of examples, click the preceding
    -- link and scroll down the page.
    BackupRule -> 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.
    BackupRule -> Maybe Integer
startWindowMinutes :: Prelude.Maybe Prelude.Integer,
    -- | A display name for a backup rule. Must contain 1 to 50 alphanumeric or
    -- \'-_.\' characters.
    BackupRule -> 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.
    BackupRule -> Text
targetBackupVaultName :: Prelude.Text
  }
  deriving (BackupRule -> BackupRule -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BackupRule -> BackupRule -> Bool
$c/= :: BackupRule -> BackupRule -> Bool
== :: BackupRule -> BackupRule -> Bool
$c== :: BackupRule -> BackupRule -> Bool
Prelude.Eq, Int -> BackupRule -> ShowS
[BackupRule] -> ShowS
BackupRule -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BackupRule] -> ShowS
$cshowList :: [BackupRule] -> ShowS
show :: BackupRule -> String
$cshow :: BackupRule -> String
showsPrec :: Int -> BackupRule -> ShowS
$cshowsPrec :: Int -> BackupRule -> ShowS
Prelude.Show, forall x. Rep BackupRule x -> BackupRule
forall x. BackupRule -> Rep BackupRule x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BackupRule x -> BackupRule
$cfrom :: forall x. BackupRule -> Rep BackupRule x
Prelude.Generic)

-- |
-- Create a value of 'BackupRule' 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', 'backupRule_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', 'backupRule_copyActions' - An array of @CopyAction@ objects, which contains the details of the copy
-- operation.
--
-- 'enableContinuousBackup', 'backupRule_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', 'backupRule_lifecycle' - The lifecycle defines when a protected resource is transitioned to cold
-- storage and when it expires. Backup transitions and expires 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', 'backupRule_recoveryPointTags' - An array of key-value pair strings that are assigned to resources that
-- are associated with this rule when restored from backup.
--
-- 'ruleId', 'backupRule_ruleId' - Uniquely identifies a rule that is used to schedule the backup of a
-- selection of resources.
--
-- 'scheduleExpression', 'backupRule_scheduleExpression' - A cron expression in UTC specifying when Backup initiates a backup job.
-- For more information about Amazon Web Services cron expressions, see
-- <https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html Schedule Expressions for Rules>
-- in the /Amazon CloudWatch Events User Guide./. Two examples of Amazon
-- Web Services cron expressions are @ 15 * ? * * *@ (take a backup every
-- hour at 15 minutes past the hour) and @0 12 * * ? *@ (take a backup
-- every day at 12 noon UTC). For a table of examples, click the preceding
-- link and scroll down the page.
--
-- 'startWindowMinutes', 'backupRule_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', 'backupRule_ruleName' - A display name for a backup rule. Must contain 1 to 50 alphanumeric or
-- \'-_.\' characters.
--
-- 'targetBackupVaultName', 'backupRule_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.
newBackupRule ::
  -- | 'ruleName'
  Prelude.Text ->
  -- | 'targetBackupVaultName'
  Prelude.Text ->
  BackupRule
newBackupRule :: Text -> Text -> BackupRule
newBackupRule Text
pRuleName_ Text
pTargetBackupVaultName_ =
  BackupRule'
    { $sel:completionWindowMinutes:BackupRule' :: Maybe Integer
completionWindowMinutes =
        forall a. Maybe a
Prelude.Nothing,
      $sel:copyActions:BackupRule' :: Maybe [CopyAction]
copyActions = forall a. Maybe a
Prelude.Nothing,
      $sel:enableContinuousBackup:BackupRule' :: Maybe Bool
enableContinuousBackup = forall a. Maybe a
Prelude.Nothing,
      $sel:lifecycle:BackupRule' :: Maybe Lifecycle
lifecycle = forall a. Maybe a
Prelude.Nothing,
      $sel:recoveryPointTags:BackupRule' :: Maybe (Sensitive (HashMap Text Text))
recoveryPointTags = forall a. Maybe a
Prelude.Nothing,
      $sel:ruleId:BackupRule' :: Maybe Text
ruleId = forall a. Maybe a
Prelude.Nothing,
      $sel:scheduleExpression:BackupRule' :: Maybe Text
scheduleExpression = forall a. Maybe a
Prelude.Nothing,
      $sel:startWindowMinutes:BackupRule' :: Maybe Integer
startWindowMinutes = forall a. Maybe a
Prelude.Nothing,
      $sel:ruleName:BackupRule' :: Text
ruleName = Text
pRuleName_,
      $sel:targetBackupVaultName:BackupRule' :: 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.
backupRule_completionWindowMinutes :: Lens.Lens' BackupRule (Prelude.Maybe Prelude.Integer)
backupRule_completionWindowMinutes :: Lens' BackupRule (Maybe Integer)
backupRule_completionWindowMinutes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackupRule' {Maybe Integer
completionWindowMinutes :: Maybe Integer
$sel:completionWindowMinutes:BackupRule' :: BackupRule -> Maybe Integer
completionWindowMinutes} -> Maybe Integer
completionWindowMinutes) (\s :: BackupRule
s@BackupRule' {} Maybe Integer
a -> BackupRule
s {$sel:completionWindowMinutes:BackupRule' :: Maybe Integer
completionWindowMinutes = Maybe Integer
a} :: BackupRule)

-- | An array of @CopyAction@ objects, which contains the details of the copy
-- operation.
backupRule_copyActions :: Lens.Lens' BackupRule (Prelude.Maybe [CopyAction])
backupRule_copyActions :: Lens' BackupRule (Maybe [CopyAction])
backupRule_copyActions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackupRule' {Maybe [CopyAction]
copyActions :: Maybe [CopyAction]
$sel:copyActions:BackupRule' :: BackupRule -> Maybe [CopyAction]
copyActions} -> Maybe [CopyAction]
copyActions) (\s :: BackupRule
s@BackupRule' {} Maybe [CopyAction]
a -> BackupRule
s {$sel:copyActions:BackupRule' :: Maybe [CopyAction]
copyActions = Maybe [CopyAction]
a} :: BackupRule) 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.
backupRule_enableContinuousBackup :: Lens.Lens' BackupRule (Prelude.Maybe Prelude.Bool)
backupRule_enableContinuousBackup :: Lens' BackupRule (Maybe Bool)
backupRule_enableContinuousBackup = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackupRule' {Maybe Bool
enableContinuousBackup :: Maybe Bool
$sel:enableContinuousBackup:BackupRule' :: BackupRule -> Maybe Bool
enableContinuousBackup} -> Maybe Bool
enableContinuousBackup) (\s :: BackupRule
s@BackupRule' {} Maybe Bool
a -> BackupRule
s {$sel:enableContinuousBackup:BackupRule' :: Maybe Bool
enableContinuousBackup = Maybe Bool
a} :: BackupRule)

-- | The lifecycle defines when a protected resource is transitioned to cold
-- storage and when it expires. Backup transitions and expires 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.
backupRule_lifecycle :: Lens.Lens' BackupRule (Prelude.Maybe Lifecycle)
backupRule_lifecycle :: Lens' BackupRule (Maybe Lifecycle)
backupRule_lifecycle = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackupRule' {Maybe Lifecycle
lifecycle :: Maybe Lifecycle
$sel:lifecycle:BackupRule' :: BackupRule -> Maybe Lifecycle
lifecycle} -> Maybe Lifecycle
lifecycle) (\s :: BackupRule
s@BackupRule' {} Maybe Lifecycle
a -> BackupRule
s {$sel:lifecycle:BackupRule' :: Maybe Lifecycle
lifecycle = Maybe Lifecycle
a} :: BackupRule)

-- | An array of key-value pair strings that are assigned to resources that
-- are associated with this rule when restored from backup.
backupRule_recoveryPointTags :: Lens.Lens' BackupRule (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
backupRule_recoveryPointTags :: Lens' BackupRule (Maybe (HashMap Text Text))
backupRule_recoveryPointTags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackupRule' {Maybe (Sensitive (HashMap Text Text))
recoveryPointTags :: Maybe (Sensitive (HashMap Text Text))
$sel:recoveryPointTags:BackupRule' :: BackupRule -> Maybe (Sensitive (HashMap Text Text))
recoveryPointTags} -> Maybe (Sensitive (HashMap Text Text))
recoveryPointTags) (\s :: BackupRule
s@BackupRule' {} Maybe (Sensitive (HashMap Text Text))
a -> BackupRule
s {$sel:recoveryPointTags:BackupRule' :: Maybe (Sensitive (HashMap Text Text))
recoveryPointTags = Maybe (Sensitive (HashMap Text Text))
a} :: BackupRule) 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)

-- | Uniquely identifies a rule that is used to schedule the backup of a
-- selection of resources.
backupRule_ruleId :: Lens.Lens' BackupRule (Prelude.Maybe Prelude.Text)
backupRule_ruleId :: Lens' BackupRule (Maybe Text)
backupRule_ruleId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackupRule' {Maybe Text
ruleId :: Maybe Text
$sel:ruleId:BackupRule' :: BackupRule -> Maybe Text
ruleId} -> Maybe Text
ruleId) (\s :: BackupRule
s@BackupRule' {} Maybe Text
a -> BackupRule
s {$sel:ruleId:BackupRule' :: Maybe Text
ruleId = Maybe Text
a} :: BackupRule)

-- | A cron expression in UTC specifying when Backup initiates a backup job.
-- For more information about Amazon Web Services cron expressions, see
-- <https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html Schedule Expressions for Rules>
-- in the /Amazon CloudWatch Events User Guide./. Two examples of Amazon
-- Web Services cron expressions are @ 15 * ? * * *@ (take a backup every
-- hour at 15 minutes past the hour) and @0 12 * * ? *@ (take a backup
-- every day at 12 noon UTC). For a table of examples, click the preceding
-- link and scroll down the page.
backupRule_scheduleExpression :: Lens.Lens' BackupRule (Prelude.Maybe Prelude.Text)
backupRule_scheduleExpression :: Lens' BackupRule (Maybe Text)
backupRule_scheduleExpression = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackupRule' {Maybe Text
scheduleExpression :: Maybe Text
$sel:scheduleExpression:BackupRule' :: BackupRule -> Maybe Text
scheduleExpression} -> Maybe Text
scheduleExpression) (\s :: BackupRule
s@BackupRule' {} Maybe Text
a -> BackupRule
s {$sel:scheduleExpression:BackupRule' :: Maybe Text
scheduleExpression = Maybe Text
a} :: BackupRule)

-- | 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.
backupRule_startWindowMinutes :: Lens.Lens' BackupRule (Prelude.Maybe Prelude.Integer)
backupRule_startWindowMinutes :: Lens' BackupRule (Maybe Integer)
backupRule_startWindowMinutes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackupRule' {Maybe Integer
startWindowMinutes :: Maybe Integer
$sel:startWindowMinutes:BackupRule' :: BackupRule -> Maybe Integer
startWindowMinutes} -> Maybe Integer
startWindowMinutes) (\s :: BackupRule
s@BackupRule' {} Maybe Integer
a -> BackupRule
s {$sel:startWindowMinutes:BackupRule' :: Maybe Integer
startWindowMinutes = Maybe Integer
a} :: BackupRule)

-- | A display name for a backup rule. Must contain 1 to 50 alphanumeric or
-- \'-_.\' characters.
backupRule_ruleName :: Lens.Lens' BackupRule Prelude.Text
backupRule_ruleName :: Lens' BackupRule Text
backupRule_ruleName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackupRule' {Text
ruleName :: Text
$sel:ruleName:BackupRule' :: BackupRule -> Text
ruleName} -> Text
ruleName) (\s :: BackupRule
s@BackupRule' {} Text
a -> BackupRule
s {$sel:ruleName:BackupRule' :: Text
ruleName = Text
a} :: BackupRule)

-- | 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.
backupRule_targetBackupVaultName :: Lens.Lens' BackupRule Prelude.Text
backupRule_targetBackupVaultName :: Lens' BackupRule Text
backupRule_targetBackupVaultName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackupRule' {Text
targetBackupVaultName :: Text
$sel:targetBackupVaultName:BackupRule' :: BackupRule -> Text
targetBackupVaultName} -> Text
targetBackupVaultName) (\s :: BackupRule
s@BackupRule' {} Text
a -> BackupRule
s {$sel:targetBackupVaultName:BackupRule' :: Text
targetBackupVaultName = Text
a} :: BackupRule)

instance Data.FromJSON BackupRule where
  parseJSON :: Value -> Parser BackupRule
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"BackupRule"
      ( \Object
x ->
          Maybe Integer
-> Maybe [CopyAction]
-> Maybe Bool
-> Maybe Lifecycle
-> Maybe (Sensitive (HashMap Text Text))
-> Maybe Text
-> Maybe Text
-> Maybe Integer
-> Text
-> Text
-> BackupRule
BackupRule'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"CompletionWindowMinutes")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"CopyActions" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"EnableContinuousBackup")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Lifecycle")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"RecoveryPointTags"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"RuleId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ScheduleExpression")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"StartWindowMinutes")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"RuleName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"TargetBackupVaultName")
      )

instance Prelude.Hashable BackupRule where
  hashWithSalt :: Int -> BackupRule -> Int
hashWithSalt Int
_salt BackupRule' {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
ruleId :: Maybe Text
recoveryPointTags :: Maybe (Sensitive (HashMap Text Text))
lifecycle :: Maybe Lifecycle
enableContinuousBackup :: Maybe Bool
copyActions :: Maybe [CopyAction]
completionWindowMinutes :: Maybe Integer
$sel:targetBackupVaultName:BackupRule' :: BackupRule -> Text
$sel:ruleName:BackupRule' :: BackupRule -> Text
$sel:startWindowMinutes:BackupRule' :: BackupRule -> Maybe Integer
$sel:scheduleExpression:BackupRule' :: BackupRule -> Maybe Text
$sel:ruleId:BackupRule' :: BackupRule -> Maybe Text
$sel:recoveryPointTags:BackupRule' :: BackupRule -> Maybe (Sensitive (HashMap Text Text))
$sel:lifecycle:BackupRule' :: BackupRule -> Maybe Lifecycle
$sel:enableContinuousBackup:BackupRule' :: BackupRule -> Maybe Bool
$sel:copyActions:BackupRule' :: BackupRule -> Maybe [CopyAction]
$sel:completionWindowMinutes:BackupRule' :: BackupRule -> 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
ruleId
      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 BackupRule where
  rnf :: BackupRule -> ()
rnf BackupRule' {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
ruleId :: Maybe Text
recoveryPointTags :: Maybe (Sensitive (HashMap Text Text))
lifecycle :: Maybe Lifecycle
enableContinuousBackup :: Maybe Bool
copyActions :: Maybe [CopyAction]
completionWindowMinutes :: Maybe Integer
$sel:targetBackupVaultName:BackupRule' :: BackupRule -> Text
$sel:ruleName:BackupRule' :: BackupRule -> Text
$sel:startWindowMinutes:BackupRule' :: BackupRule -> Maybe Integer
$sel:scheduleExpression:BackupRule' :: BackupRule -> Maybe Text
$sel:ruleId:BackupRule' :: BackupRule -> Maybe Text
$sel:recoveryPointTags:BackupRule' :: BackupRule -> Maybe (Sensitive (HashMap Text Text))
$sel:lifecycle:BackupRule' :: BackupRule -> Maybe Lifecycle
$sel:enableContinuousBackup:BackupRule' :: BackupRule -> Maybe Bool
$sel:copyActions:BackupRule' :: BackupRule -> Maybe [CopyAction]
$sel:completionWindowMinutes:BackupRule' :: BackupRule -> 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
ruleId
      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