{-# 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-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)
--
-- 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 “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.
--
-- 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_calculatedLifecycle,
    updateRecoveryPointLifecycleResponse_lifecycle,
    updateRecoveryPointLifecycleResponse_backupVaultArn,
    updateRecoveryPointLifecycleResponse_recoveryPointArn,
    updateRecoveryPointLifecycleResponse_httpStatus,
  )
where

import Amazonka.Backup.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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 “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.
    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
(UpdateRecoveryPointLifecycle
 -> UpdateRecoveryPointLifecycle -> Bool)
-> (UpdateRecoveryPointLifecycle
    -> UpdateRecoveryPointLifecycle -> Bool)
-> Eq UpdateRecoveryPointLifecycle
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]
(Int -> ReadS UpdateRecoveryPointLifecycle)
-> ReadS [UpdateRecoveryPointLifecycle]
-> ReadPrec UpdateRecoveryPointLifecycle
-> ReadPrec [UpdateRecoveryPointLifecycle]
-> Read 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
(Int -> UpdateRecoveryPointLifecycle -> ShowS)
-> (UpdateRecoveryPointLifecycle -> String)
-> ([UpdateRecoveryPointLifecycle] -> ShowS)
-> Show UpdateRecoveryPointLifecycle
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.
 UpdateRecoveryPointLifecycle -> Rep UpdateRecoveryPointLifecycle x)
-> (forall x.
    Rep UpdateRecoveryPointLifecycle x -> UpdateRecoveryPointLifecycle)
-> Generic UpdateRecoveryPointLifecycle
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 “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.
--
-- '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' :: Maybe Lifecycle -> Text -> Text -> UpdateRecoveryPointLifecycle
UpdateRecoveryPointLifecycle'
      { $sel:lifecycle:UpdateRecoveryPointLifecycle' :: Maybe Lifecycle
lifecycle =
          Maybe 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 “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.
updateRecoveryPointLifecycle_lifecycle :: Lens.Lens' UpdateRecoveryPointLifecycle (Prelude.Maybe Lifecycle)
updateRecoveryPointLifecycle_lifecycle :: (Maybe Lifecycle -> f (Maybe Lifecycle))
-> UpdateRecoveryPointLifecycle -> f UpdateRecoveryPointLifecycle
updateRecoveryPointLifecycle_lifecycle = (UpdateRecoveryPointLifecycle -> Maybe Lifecycle)
-> (UpdateRecoveryPointLifecycle
    -> Maybe Lifecycle -> UpdateRecoveryPointLifecycle)
-> Lens
     UpdateRecoveryPointLifecycle
     UpdateRecoveryPointLifecycle
     (Maybe Lifecycle)
     (Maybe 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 :: (Text -> f Text)
-> UpdateRecoveryPointLifecycle -> f UpdateRecoveryPointLifecycle
updateRecoveryPointLifecycle_backupVaultName = (UpdateRecoveryPointLifecycle -> Text)
-> (UpdateRecoveryPointLifecycle
    -> Text -> UpdateRecoveryPointLifecycle)
-> Lens
     UpdateRecoveryPointLifecycle UpdateRecoveryPointLifecycle Text Text
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 :: (Text -> f Text)
-> UpdateRecoveryPointLifecycle -> f UpdateRecoveryPointLifecycle
updateRecoveryPointLifecycle_recoveryPointArn = (UpdateRecoveryPointLifecycle -> Text)
-> (UpdateRecoveryPointLifecycle
    -> Text -> UpdateRecoveryPointLifecycle)
-> Lens
     UpdateRecoveryPointLifecycle UpdateRecoveryPointLifecycle Text Text
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 :: UpdateRecoveryPointLifecycle
-> Request UpdateRecoveryPointLifecycle
request = Service
-> UpdateRecoveryPointLifecycle
-> Request UpdateRecoveryPointLifecycle
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateRecoveryPointLifecycle
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateRecoveryPointLifecycle)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateRecoveryPointLifecycle))
-> Logger
-> Service
-> Proxy UpdateRecoveryPointLifecycle
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateRecoveryPointLifecycle)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe CalculatedLifecycle
-> Maybe Lifecycle
-> Maybe Text
-> Maybe Text
-> Int
-> UpdateRecoveryPointLifecycleResponse
UpdateRecoveryPointLifecycleResponse'
            (Maybe CalculatedLifecycle
 -> Maybe Lifecycle
 -> Maybe Text
 -> Maybe Text
 -> Int
 -> UpdateRecoveryPointLifecycleResponse)
-> Either String (Maybe CalculatedLifecycle)
-> Either
     String
     (Maybe Lifecycle
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> UpdateRecoveryPointLifecycleResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe CalculatedLifecycle)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CalculatedLifecycle")
            Either
  String
  (Maybe Lifecycle
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> UpdateRecoveryPointLifecycleResponse)
-> Either String (Maybe Lifecycle)
-> Either
     String
     (Maybe Text
      -> Maybe Text -> Int -> UpdateRecoveryPointLifecycleResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Lifecycle)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Lifecycle")
            Either
  String
  (Maybe Text
   -> Maybe Text -> Int -> UpdateRecoveryPointLifecycleResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe Text -> Int -> UpdateRecoveryPointLifecycleResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"BackupVaultArn")
            Either
  String (Maybe Text -> Int -> UpdateRecoveryPointLifecycleResponse)
-> Either String (Maybe Text)
-> Either String (Int -> UpdateRecoveryPointLifecycleResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"RecoveryPointArn")
            Either String (Int -> UpdateRecoveryPointLifecycleResponse)
-> Either String Int
-> Either String UpdateRecoveryPointLifecycleResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    UpdateRecoveryPointLifecycle

instance Prelude.NFData UpdateRecoveryPointLifecycle

instance Core.ToHeaders UpdateRecoveryPointLifecycle where
  toHeaders :: UpdateRecoveryPointLifecycle -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateRecoveryPointLifecycle -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.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
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]
      )

instance Core.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
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/backup-vaults/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
backupVaultName,
        ByteString
"/recovery-points/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
recoveryPointArn
      ]

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

-- | /See:/ 'newUpdateRecoveryPointLifecycleResponse' smart constructor.
data UpdateRecoveryPointLifecycleResponse = UpdateRecoveryPointLifecycleResponse'
  { -- | 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 “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.
    UpdateRecoveryPointLifecycleResponse -> Maybe Lifecycle
lifecycle :: Prelude.Maybe Lifecycle,
    -- | 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,
    -- | 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
(UpdateRecoveryPointLifecycleResponse
 -> UpdateRecoveryPointLifecycleResponse -> Bool)
-> (UpdateRecoveryPointLifecycleResponse
    -> UpdateRecoveryPointLifecycleResponse -> Bool)
-> Eq UpdateRecoveryPointLifecycleResponse
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]
(Int -> ReadS UpdateRecoveryPointLifecycleResponse)
-> ReadS [UpdateRecoveryPointLifecycleResponse]
-> ReadPrec UpdateRecoveryPointLifecycleResponse
-> ReadPrec [UpdateRecoveryPointLifecycleResponse]
-> Read 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
(Int -> UpdateRecoveryPointLifecycleResponse -> ShowS)
-> (UpdateRecoveryPointLifecycleResponse -> String)
-> ([UpdateRecoveryPointLifecycleResponse] -> ShowS)
-> Show UpdateRecoveryPointLifecycleResponse
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.
 UpdateRecoveryPointLifecycleResponse
 -> Rep UpdateRecoveryPointLifecycleResponse x)
-> (forall x.
    Rep UpdateRecoveryPointLifecycleResponse x
    -> UpdateRecoveryPointLifecycleResponse)
-> Generic UpdateRecoveryPointLifecycleResponse
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:
--
-- '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 “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.
--
-- 'backupVaultArn', 'updateRecoveryPointLifecycleResponse_backupVaultArn' - An ARN that uniquely identifies a backup vault; for example,
-- @arn:aws:backup:us-east-1:123456789012:vault:aBackupVault@.
--
-- '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' :: Maybe CalculatedLifecycle
-> Maybe Lifecycle
-> Maybe Text
-> Maybe Text
-> Int
-> UpdateRecoveryPointLifecycleResponse
UpdateRecoveryPointLifecycleResponse'
    { $sel:calculatedLifecycle:UpdateRecoveryPointLifecycleResponse' :: Maybe CalculatedLifecycle
calculatedLifecycle =
        Maybe CalculatedLifecycle
forall a. Maybe a
Prelude.Nothing,
      $sel:lifecycle:UpdateRecoveryPointLifecycleResponse' :: Maybe Lifecycle
lifecycle = Maybe Lifecycle
forall a. Maybe a
Prelude.Nothing,
      $sel:backupVaultArn:UpdateRecoveryPointLifecycleResponse' :: Maybe Text
backupVaultArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:recoveryPointArn:UpdateRecoveryPointLifecycleResponse' :: Maybe Text
recoveryPointArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateRecoveryPointLifecycleResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A @CalculatedLifecycle@ object containing @DeleteAt@ and
-- @MoveToColdStorageAt@ timestamps.
updateRecoveryPointLifecycleResponse_calculatedLifecycle :: Lens.Lens' UpdateRecoveryPointLifecycleResponse (Prelude.Maybe CalculatedLifecycle)
updateRecoveryPointLifecycleResponse_calculatedLifecycle :: (Maybe CalculatedLifecycle -> f (Maybe CalculatedLifecycle))
-> UpdateRecoveryPointLifecycleResponse
-> f UpdateRecoveryPointLifecycleResponse
updateRecoveryPointLifecycleResponse_calculatedLifecycle = (UpdateRecoveryPointLifecycleResponse -> Maybe CalculatedLifecycle)
-> (UpdateRecoveryPointLifecycleResponse
    -> Maybe CalculatedLifecycle
    -> UpdateRecoveryPointLifecycleResponse)
-> Lens
     UpdateRecoveryPointLifecycleResponse
     UpdateRecoveryPointLifecycleResponse
     (Maybe CalculatedLifecycle)
     (Maybe 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 “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.
updateRecoveryPointLifecycleResponse_lifecycle :: Lens.Lens' UpdateRecoveryPointLifecycleResponse (Prelude.Maybe Lifecycle)
updateRecoveryPointLifecycleResponse_lifecycle :: (Maybe Lifecycle -> f (Maybe Lifecycle))
-> UpdateRecoveryPointLifecycleResponse
-> f UpdateRecoveryPointLifecycleResponse
updateRecoveryPointLifecycleResponse_lifecycle = (UpdateRecoveryPointLifecycleResponse -> Maybe Lifecycle)
-> (UpdateRecoveryPointLifecycleResponse
    -> Maybe Lifecycle -> UpdateRecoveryPointLifecycleResponse)
-> Lens
     UpdateRecoveryPointLifecycleResponse
     UpdateRecoveryPointLifecycleResponse
     (Maybe Lifecycle)
     (Maybe 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 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 :: (Maybe Text -> f (Maybe Text))
-> UpdateRecoveryPointLifecycleResponse
-> f UpdateRecoveryPointLifecycleResponse
updateRecoveryPointLifecycleResponse_backupVaultArn = (UpdateRecoveryPointLifecycleResponse -> Maybe Text)
-> (UpdateRecoveryPointLifecycleResponse
    -> Maybe Text -> UpdateRecoveryPointLifecycleResponse)
-> Lens
     UpdateRecoveryPointLifecycleResponse
     UpdateRecoveryPointLifecycleResponse
     (Maybe Text)
     (Maybe Text)
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)

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> UpdateRecoveryPointLifecycleResponse
-> f UpdateRecoveryPointLifecycleResponse
updateRecoveryPointLifecycleResponse_recoveryPointArn = (UpdateRecoveryPointLifecycleResponse -> Maybe Text)
-> (UpdateRecoveryPointLifecycleResponse
    -> Maybe Text -> UpdateRecoveryPointLifecycleResponse)
-> Lens
     UpdateRecoveryPointLifecycleResponse
     UpdateRecoveryPointLifecycleResponse
     (Maybe Text)
     (Maybe Text)
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 :: (Int -> f Int)
-> UpdateRecoveryPointLifecycleResponse
-> f UpdateRecoveryPointLifecycleResponse
updateRecoveryPointLifecycleResponse_httpStatus = (UpdateRecoveryPointLifecycleResponse -> Int)
-> (UpdateRecoveryPointLifecycleResponse
    -> Int -> UpdateRecoveryPointLifecycleResponse)
-> Lens
     UpdateRecoveryPointLifecycleResponse
     UpdateRecoveryPointLifecycleResponse
     Int
     Int
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