{-# 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.UpdateRecoveryPointLifecycle
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Sets the transition lifecycle of a recovery point.
--
-- 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.
--
-- This operation does not support continuous backups.
module Amazonka.Backup.UpdateRecoveryPointLifecycle
  ( -- * Creating a Request
    UpdateRecoveryPointLifecycle (..),
    newUpdateRecoveryPointLifecycle,

    -- * Request Lenses
    updateRecoveryPointLifecycle_lifecycle,
    updateRecoveryPointLifecycle_backupVaultName,
    updateRecoveryPointLifecycle_recoveryPointArn,

    -- * Destructuring the Response
    UpdateRecoveryPointLifecycleResponse (..),
    newUpdateRecoveryPointLifecycleResponse,

    -- * Response Lenses
    updateRecoveryPointLifecycleResponse_backupVaultArn,
    updateRecoveryPointLifecycleResponse_calculatedLifecycle,
    updateRecoveryPointLifecycleResponse_lifecycle,
    updateRecoveryPointLifecycleResponse_recoveryPointArn,
    updateRecoveryPointLifecycleResponse_httpStatus,
  )
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:/ 'newUpdateRecoveryPointLifecycle' smart constructor.
data UpdateRecoveryPointLifecycle = UpdateRecoveryPointLifecycle'
  { -- | 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.
    UpdateRecoveryPointLifecycle -> Maybe Lifecycle
lifecycle :: Prelude.Maybe Lifecycle,
    -- | 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.
    UpdateRecoveryPointLifecycle -> Text
backupVaultName :: Prelude.Text,
    -- | An Amazon Resource Name (ARN) that uniquely identifies a recovery point;
    -- for example,
    -- @arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45@.
    UpdateRecoveryPointLifecycle -> Text
recoveryPointArn :: Prelude.Text
  }
  deriving (UpdateRecoveryPointLifecycle
-> UpdateRecoveryPointLifecycle -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateRecoveryPointLifecycle
-> UpdateRecoveryPointLifecycle -> Bool
$c/= :: UpdateRecoveryPointLifecycle
-> UpdateRecoveryPointLifecycle -> Bool
== :: UpdateRecoveryPointLifecycle
-> UpdateRecoveryPointLifecycle -> Bool
$c== :: UpdateRecoveryPointLifecycle
-> UpdateRecoveryPointLifecycle -> Bool
Prelude.Eq, ReadPrec [UpdateRecoveryPointLifecycle]
ReadPrec UpdateRecoveryPointLifecycle
Int -> ReadS UpdateRecoveryPointLifecycle
ReadS [UpdateRecoveryPointLifecycle]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateRecoveryPointLifecycle]
$creadListPrec :: ReadPrec [UpdateRecoveryPointLifecycle]
readPrec :: ReadPrec UpdateRecoveryPointLifecycle
$creadPrec :: ReadPrec UpdateRecoveryPointLifecycle
readList :: ReadS [UpdateRecoveryPointLifecycle]
$creadList :: ReadS [UpdateRecoveryPointLifecycle]
readsPrec :: Int -> ReadS UpdateRecoveryPointLifecycle
$creadsPrec :: Int -> ReadS UpdateRecoveryPointLifecycle
Prelude.Read, Int -> UpdateRecoveryPointLifecycle -> ShowS
[UpdateRecoveryPointLifecycle] -> ShowS
UpdateRecoveryPointLifecycle -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateRecoveryPointLifecycle] -> ShowS
$cshowList :: [UpdateRecoveryPointLifecycle] -> ShowS
show :: UpdateRecoveryPointLifecycle -> String
$cshow :: UpdateRecoveryPointLifecycle -> String
showsPrec :: Int -> UpdateRecoveryPointLifecycle -> ShowS
$cshowsPrec :: Int -> UpdateRecoveryPointLifecycle -> ShowS
Prelude.Show, forall x.
Rep UpdateRecoveryPointLifecycle x -> UpdateRecoveryPointLifecycle
forall x.
UpdateRecoveryPointLifecycle -> Rep UpdateRecoveryPointLifecycle x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateRecoveryPointLifecycle x -> UpdateRecoveryPointLifecycle
$cfrom :: forall x.
UpdateRecoveryPointLifecycle -> Rep UpdateRecoveryPointLifecycle x
Prelude.Generic)

-- |
-- Create a value of 'UpdateRecoveryPointLifecycle' 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', 'updateRecoveryPointLifecycle_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.
--
-- 'backupVaultName', 'updateRecoveryPointLifecycle_backupVaultName' - 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.
--
-- 'recoveryPointArn', 'updateRecoveryPointLifecycle_recoveryPointArn' - An Amazon Resource Name (ARN) that uniquely identifies a recovery point;
-- for example,
-- @arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45@.
newUpdateRecoveryPointLifecycle ::
  -- | 'backupVaultName'
  Prelude.Text ->
  -- | 'recoveryPointArn'
  Prelude.Text ->
  UpdateRecoveryPointLifecycle
newUpdateRecoveryPointLifecycle :: Text -> Text -> UpdateRecoveryPointLifecycle
newUpdateRecoveryPointLifecycle
  Text
pBackupVaultName_
  Text
pRecoveryPointArn_ =
    UpdateRecoveryPointLifecycle'
      { $sel:lifecycle:UpdateRecoveryPointLifecycle' :: Maybe Lifecycle
lifecycle =
          forall a. Maybe a
Prelude.Nothing,
        $sel:backupVaultName:UpdateRecoveryPointLifecycle' :: Text
backupVaultName = Text
pBackupVaultName_,
        $sel:recoveryPointArn:UpdateRecoveryPointLifecycle' :: Text
recoveryPointArn = Text
pRecoveryPointArn_
      }

-- | 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.
updateRecoveryPointLifecycle_lifecycle :: Lens.Lens' UpdateRecoveryPointLifecycle (Prelude.Maybe Lifecycle)
updateRecoveryPointLifecycle_lifecycle :: Lens' UpdateRecoveryPointLifecycle (Maybe Lifecycle)
updateRecoveryPointLifecycle_lifecycle = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRecoveryPointLifecycle' {Maybe Lifecycle
lifecycle :: Maybe Lifecycle
$sel:lifecycle:UpdateRecoveryPointLifecycle' :: UpdateRecoveryPointLifecycle -> Maybe Lifecycle
lifecycle} -> Maybe Lifecycle
lifecycle) (\s :: UpdateRecoveryPointLifecycle
s@UpdateRecoveryPointLifecycle' {} Maybe Lifecycle
a -> UpdateRecoveryPointLifecycle
s {$sel:lifecycle:UpdateRecoveryPointLifecycle' :: Maybe Lifecycle
lifecycle = Maybe Lifecycle
a} :: UpdateRecoveryPointLifecycle)

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

-- | An Amazon Resource Name (ARN) that uniquely identifies a recovery point;
-- for example,
-- @arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45@.
updateRecoveryPointLifecycle_recoveryPointArn :: Lens.Lens' UpdateRecoveryPointLifecycle Prelude.Text
updateRecoveryPointLifecycle_recoveryPointArn :: Lens' UpdateRecoveryPointLifecycle Text
updateRecoveryPointLifecycle_recoveryPointArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRecoveryPointLifecycle' {Text
recoveryPointArn :: Text
$sel:recoveryPointArn:UpdateRecoveryPointLifecycle' :: UpdateRecoveryPointLifecycle -> Text
recoveryPointArn} -> Text
recoveryPointArn) (\s :: UpdateRecoveryPointLifecycle
s@UpdateRecoveryPointLifecycle' {} Text
a -> UpdateRecoveryPointLifecycle
s {$sel:recoveryPointArn:UpdateRecoveryPointLifecycle' :: Text
recoveryPointArn = Text
a} :: UpdateRecoveryPointLifecycle)

instance Core.AWSRequest UpdateRecoveryPointLifecycle where
  type
    AWSResponse UpdateRecoveryPointLifecycle =
      UpdateRecoveryPointLifecycleResponse
  request :: (Service -> Service)
-> UpdateRecoveryPointLifecycle
-> Request UpdateRecoveryPointLifecycle
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateRecoveryPointLifecycle
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateRecoveryPointLifecycle)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe CalculatedLifecycle
-> Maybe Lifecycle
-> Maybe Text
-> Int
-> UpdateRecoveryPointLifecycleResponse
UpdateRecoveryPointLifecycleResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"BackupVaultArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"CalculatedLifecycle")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (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 -> Either String (Maybe a)
Data..?> Key
"RecoveryPointArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    UpdateRecoveryPointLifecycle
  where
  hashWithSalt :: Int -> UpdateRecoveryPointLifecycle -> Int
hashWithSalt Int
_salt UpdateRecoveryPointLifecycle' {Maybe Lifecycle
Text
recoveryPointArn :: Text
backupVaultName :: Text
lifecycle :: Maybe Lifecycle
$sel:recoveryPointArn:UpdateRecoveryPointLifecycle' :: UpdateRecoveryPointLifecycle -> Text
$sel:backupVaultName:UpdateRecoveryPointLifecycle' :: UpdateRecoveryPointLifecycle -> Text
$sel:lifecycle:UpdateRecoveryPointLifecycle' :: UpdateRecoveryPointLifecycle -> Maybe Lifecycle
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Lifecycle
lifecycle
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
backupVaultName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
recoveryPointArn

instance Prelude.NFData UpdateRecoveryPointLifecycle where
  rnf :: UpdateRecoveryPointLifecycle -> ()
rnf UpdateRecoveryPointLifecycle' {Maybe Lifecycle
Text
recoveryPointArn :: Text
backupVaultName :: Text
lifecycle :: Maybe Lifecycle
$sel:recoveryPointArn:UpdateRecoveryPointLifecycle' :: UpdateRecoveryPointLifecycle -> Text
$sel:backupVaultName:UpdateRecoveryPointLifecycle' :: UpdateRecoveryPointLifecycle -> Text
$sel:lifecycle:UpdateRecoveryPointLifecycle' :: UpdateRecoveryPointLifecycle -> Maybe Lifecycle
..} =
    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 Text
backupVaultName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
recoveryPointArn

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

instance Data.ToJSON UpdateRecoveryPointLifecycle where
  toJSON :: UpdateRecoveryPointLifecycle -> Value
toJSON UpdateRecoveryPointLifecycle' {Maybe Lifecycle
Text
recoveryPointArn :: Text
backupVaultName :: Text
lifecycle :: Maybe Lifecycle
$sel:recoveryPointArn:UpdateRecoveryPointLifecycle' :: UpdateRecoveryPointLifecycle -> Text
$sel:backupVaultName:UpdateRecoveryPointLifecycle' :: UpdateRecoveryPointLifecycle -> Text
$sel:lifecycle:UpdateRecoveryPointLifecycle' :: UpdateRecoveryPointLifecycle -> Maybe Lifecycle
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [(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]
      )

instance Data.ToPath UpdateRecoveryPointLifecycle where
  toPath :: UpdateRecoveryPointLifecycle -> ByteString
toPath UpdateRecoveryPointLifecycle' {Maybe Lifecycle
Text
recoveryPointArn :: Text
backupVaultName :: Text
lifecycle :: Maybe Lifecycle
$sel:recoveryPointArn:UpdateRecoveryPointLifecycle' :: UpdateRecoveryPointLifecycle -> Text
$sel:backupVaultName:UpdateRecoveryPointLifecycle' :: UpdateRecoveryPointLifecycle -> Text
$sel:lifecycle:UpdateRecoveryPointLifecycle' :: UpdateRecoveryPointLifecycle -> Maybe Lifecycle
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/backup-vaults/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
backupVaultName,
        ByteString
"/recovery-points/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
recoveryPointArn
      ]

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

-- | /See:/ 'newUpdateRecoveryPointLifecycleResponse' smart constructor.
data UpdateRecoveryPointLifecycleResponse = UpdateRecoveryPointLifecycleResponse'
  { -- | An ARN that uniquely identifies a backup vault; for example,
    -- @arn:aws:backup:us-east-1:123456789012:vault:aBackupVault@.
    UpdateRecoveryPointLifecycleResponse -> Maybe Text
backupVaultArn :: Prelude.Maybe Prelude.Text,
    -- | A @CalculatedLifecycle@ object containing @DeleteAt@ and
    -- @MoveToColdStorageAt@ timestamps.
    UpdateRecoveryPointLifecycleResponse -> Maybe CalculatedLifecycle
calculatedLifecycle :: Prelude.Maybe CalculatedLifecycle,
    -- | 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.
    UpdateRecoveryPointLifecycleResponse -> Maybe Lifecycle
lifecycle :: Prelude.Maybe Lifecycle,
    -- | An Amazon Resource Name (ARN) that uniquely identifies a recovery point;
    -- for example,
    -- @arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45@.
    UpdateRecoveryPointLifecycleResponse -> Maybe Text
recoveryPointArn :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    UpdateRecoveryPointLifecycleResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateRecoveryPointLifecycleResponse
-> UpdateRecoveryPointLifecycleResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateRecoveryPointLifecycleResponse
-> UpdateRecoveryPointLifecycleResponse -> Bool
$c/= :: UpdateRecoveryPointLifecycleResponse
-> UpdateRecoveryPointLifecycleResponse -> Bool
== :: UpdateRecoveryPointLifecycleResponse
-> UpdateRecoveryPointLifecycleResponse -> Bool
$c== :: UpdateRecoveryPointLifecycleResponse
-> UpdateRecoveryPointLifecycleResponse -> Bool
Prelude.Eq, ReadPrec [UpdateRecoveryPointLifecycleResponse]
ReadPrec UpdateRecoveryPointLifecycleResponse
Int -> ReadS UpdateRecoveryPointLifecycleResponse
ReadS [UpdateRecoveryPointLifecycleResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateRecoveryPointLifecycleResponse]
$creadListPrec :: ReadPrec [UpdateRecoveryPointLifecycleResponse]
readPrec :: ReadPrec UpdateRecoveryPointLifecycleResponse
$creadPrec :: ReadPrec UpdateRecoveryPointLifecycleResponse
readList :: ReadS [UpdateRecoveryPointLifecycleResponse]
$creadList :: ReadS [UpdateRecoveryPointLifecycleResponse]
readsPrec :: Int -> ReadS UpdateRecoveryPointLifecycleResponse
$creadsPrec :: Int -> ReadS UpdateRecoveryPointLifecycleResponse
Prelude.Read, Int -> UpdateRecoveryPointLifecycleResponse -> ShowS
[UpdateRecoveryPointLifecycleResponse] -> ShowS
UpdateRecoveryPointLifecycleResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateRecoveryPointLifecycleResponse] -> ShowS
$cshowList :: [UpdateRecoveryPointLifecycleResponse] -> ShowS
show :: UpdateRecoveryPointLifecycleResponse -> String
$cshow :: UpdateRecoveryPointLifecycleResponse -> String
showsPrec :: Int -> UpdateRecoveryPointLifecycleResponse -> ShowS
$cshowsPrec :: Int -> UpdateRecoveryPointLifecycleResponse -> ShowS
Prelude.Show, forall x.
Rep UpdateRecoveryPointLifecycleResponse x
-> UpdateRecoveryPointLifecycleResponse
forall x.
UpdateRecoveryPointLifecycleResponse
-> Rep UpdateRecoveryPointLifecycleResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateRecoveryPointLifecycleResponse x
-> UpdateRecoveryPointLifecycleResponse
$cfrom :: forall x.
UpdateRecoveryPointLifecycleResponse
-> Rep UpdateRecoveryPointLifecycleResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateRecoveryPointLifecycleResponse' 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:
--
-- 'backupVaultArn', 'updateRecoveryPointLifecycleResponse_backupVaultArn' - An ARN that uniquely identifies a backup vault; for example,
-- @arn:aws:backup:us-east-1:123456789012:vault:aBackupVault@.
--
-- 'calculatedLifecycle', 'updateRecoveryPointLifecycleResponse_calculatedLifecycle' - A @CalculatedLifecycle@ object containing @DeleteAt@ and
-- @MoveToColdStorageAt@ timestamps.
--
-- 'lifecycle', 'updateRecoveryPointLifecycleResponse_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.
--
-- 'recoveryPointArn', 'updateRecoveryPointLifecycleResponse_recoveryPointArn' - An Amazon Resource Name (ARN) that uniquely identifies a recovery point;
-- for example,
-- @arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45@.
--
-- 'httpStatus', 'updateRecoveryPointLifecycleResponse_httpStatus' - The response's http status code.
newUpdateRecoveryPointLifecycleResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateRecoveryPointLifecycleResponse
newUpdateRecoveryPointLifecycleResponse :: Int -> UpdateRecoveryPointLifecycleResponse
newUpdateRecoveryPointLifecycleResponse Int
pHttpStatus_ =
  UpdateRecoveryPointLifecycleResponse'
    { $sel:backupVaultArn:UpdateRecoveryPointLifecycleResponse' :: Maybe Text
backupVaultArn =
        forall a. Maybe a
Prelude.Nothing,
      $sel:calculatedLifecycle:UpdateRecoveryPointLifecycleResponse' :: Maybe CalculatedLifecycle
calculatedLifecycle = forall a. Maybe a
Prelude.Nothing,
      $sel:lifecycle:UpdateRecoveryPointLifecycleResponse' :: Maybe Lifecycle
lifecycle = forall a. Maybe a
Prelude.Nothing,
      $sel:recoveryPointArn:UpdateRecoveryPointLifecycleResponse' :: Maybe Text
recoveryPointArn = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateRecoveryPointLifecycleResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An ARN that uniquely identifies a backup vault; for example,
-- @arn:aws:backup:us-east-1:123456789012:vault:aBackupVault@.
updateRecoveryPointLifecycleResponse_backupVaultArn :: Lens.Lens' UpdateRecoveryPointLifecycleResponse (Prelude.Maybe Prelude.Text)
updateRecoveryPointLifecycleResponse_backupVaultArn :: Lens' UpdateRecoveryPointLifecycleResponse (Maybe Text)
updateRecoveryPointLifecycleResponse_backupVaultArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRecoveryPointLifecycleResponse' {Maybe Text
backupVaultArn :: Maybe Text
$sel:backupVaultArn:UpdateRecoveryPointLifecycleResponse' :: UpdateRecoveryPointLifecycleResponse -> Maybe Text
backupVaultArn} -> Maybe Text
backupVaultArn) (\s :: UpdateRecoveryPointLifecycleResponse
s@UpdateRecoveryPointLifecycleResponse' {} Maybe Text
a -> UpdateRecoveryPointLifecycleResponse
s {$sel:backupVaultArn:UpdateRecoveryPointLifecycleResponse' :: Maybe Text
backupVaultArn = Maybe Text
a} :: UpdateRecoveryPointLifecycleResponse)

-- | A @CalculatedLifecycle@ object containing @DeleteAt@ and
-- @MoveToColdStorageAt@ timestamps.
updateRecoveryPointLifecycleResponse_calculatedLifecycle :: Lens.Lens' UpdateRecoveryPointLifecycleResponse (Prelude.Maybe CalculatedLifecycle)
updateRecoveryPointLifecycleResponse_calculatedLifecycle :: Lens'
  UpdateRecoveryPointLifecycleResponse (Maybe CalculatedLifecycle)
updateRecoveryPointLifecycleResponse_calculatedLifecycle = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRecoveryPointLifecycleResponse' {Maybe CalculatedLifecycle
calculatedLifecycle :: Maybe CalculatedLifecycle
$sel:calculatedLifecycle:UpdateRecoveryPointLifecycleResponse' :: UpdateRecoveryPointLifecycleResponse -> Maybe CalculatedLifecycle
calculatedLifecycle} -> Maybe CalculatedLifecycle
calculatedLifecycle) (\s :: UpdateRecoveryPointLifecycleResponse
s@UpdateRecoveryPointLifecycleResponse' {} Maybe CalculatedLifecycle
a -> UpdateRecoveryPointLifecycleResponse
s {$sel:calculatedLifecycle:UpdateRecoveryPointLifecycleResponse' :: Maybe CalculatedLifecycle
calculatedLifecycle = Maybe CalculatedLifecycle
a} :: UpdateRecoveryPointLifecycleResponse)

-- | 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.
updateRecoveryPointLifecycleResponse_lifecycle :: Lens.Lens' UpdateRecoveryPointLifecycleResponse (Prelude.Maybe Lifecycle)
updateRecoveryPointLifecycleResponse_lifecycle :: Lens' UpdateRecoveryPointLifecycleResponse (Maybe Lifecycle)
updateRecoveryPointLifecycleResponse_lifecycle = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRecoveryPointLifecycleResponse' {Maybe Lifecycle
lifecycle :: Maybe Lifecycle
$sel:lifecycle:UpdateRecoveryPointLifecycleResponse' :: UpdateRecoveryPointLifecycleResponse -> Maybe Lifecycle
lifecycle} -> Maybe Lifecycle
lifecycle) (\s :: UpdateRecoveryPointLifecycleResponse
s@UpdateRecoveryPointLifecycleResponse' {} Maybe Lifecycle
a -> UpdateRecoveryPointLifecycleResponse
s {$sel:lifecycle:UpdateRecoveryPointLifecycleResponse' :: Maybe Lifecycle
lifecycle = Maybe Lifecycle
a} :: UpdateRecoveryPointLifecycleResponse)

-- | An Amazon Resource Name (ARN) that uniquely identifies a recovery point;
-- for example,
-- @arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45@.
updateRecoveryPointLifecycleResponse_recoveryPointArn :: Lens.Lens' UpdateRecoveryPointLifecycleResponse (Prelude.Maybe Prelude.Text)
updateRecoveryPointLifecycleResponse_recoveryPointArn :: Lens' UpdateRecoveryPointLifecycleResponse (Maybe Text)
updateRecoveryPointLifecycleResponse_recoveryPointArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRecoveryPointLifecycleResponse' {Maybe Text
recoveryPointArn :: Maybe Text
$sel:recoveryPointArn:UpdateRecoveryPointLifecycleResponse' :: UpdateRecoveryPointLifecycleResponse -> Maybe Text
recoveryPointArn} -> Maybe Text
recoveryPointArn) (\s :: UpdateRecoveryPointLifecycleResponse
s@UpdateRecoveryPointLifecycleResponse' {} Maybe Text
a -> UpdateRecoveryPointLifecycleResponse
s {$sel:recoveryPointArn:UpdateRecoveryPointLifecycleResponse' :: Maybe Text
recoveryPointArn = Maybe Text
a} :: UpdateRecoveryPointLifecycleResponse)

-- | The response's http status code.
updateRecoveryPointLifecycleResponse_httpStatus :: Lens.Lens' UpdateRecoveryPointLifecycleResponse Prelude.Int
updateRecoveryPointLifecycleResponse_httpStatus :: Lens' UpdateRecoveryPointLifecycleResponse Int
updateRecoveryPointLifecycleResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRecoveryPointLifecycleResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateRecoveryPointLifecycleResponse' :: UpdateRecoveryPointLifecycleResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateRecoveryPointLifecycleResponse
s@UpdateRecoveryPointLifecycleResponse' {} Int
a -> UpdateRecoveryPointLifecycleResponse
s {$sel:httpStatus:UpdateRecoveryPointLifecycleResponse' :: Int
httpStatus = Int
a} :: UpdateRecoveryPointLifecycleResponse)

instance
  Prelude.NFData
    UpdateRecoveryPointLifecycleResponse
  where
  rnf :: UpdateRecoveryPointLifecycleResponse -> ()
rnf UpdateRecoveryPointLifecycleResponse' {Int
Maybe Text
Maybe CalculatedLifecycle
Maybe Lifecycle
httpStatus :: Int
recoveryPointArn :: Maybe Text
lifecycle :: Maybe Lifecycle
calculatedLifecycle :: Maybe CalculatedLifecycle
backupVaultArn :: Maybe Text
$sel:httpStatus:UpdateRecoveryPointLifecycleResponse' :: UpdateRecoveryPointLifecycleResponse -> Int
$sel:recoveryPointArn:UpdateRecoveryPointLifecycleResponse' :: UpdateRecoveryPointLifecycleResponse -> Maybe Text
$sel:lifecycle:UpdateRecoveryPointLifecycleResponse' :: UpdateRecoveryPointLifecycleResponse -> Maybe Lifecycle
$sel:calculatedLifecycle:UpdateRecoveryPointLifecycleResponse' :: UpdateRecoveryPointLifecycleResponse -> Maybe CalculatedLifecycle
$sel:backupVaultArn:UpdateRecoveryPointLifecycleResponse' :: UpdateRecoveryPointLifecycleResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
backupVaultArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe CalculatedLifecycle
calculatedLifecycle
      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 Text
recoveryPointArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus