{-# 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.UpdateBackupPlan
-- 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)
--
-- Updates an existing backup plan identified by its @backupPlanId@ with
-- the input document in JSON format. The new version is uniquely
-- identified by a @VersionId@.
module Amazonka.Backup.UpdateBackupPlan
  ( -- * Creating a Request
    UpdateBackupPlan (..),
    newUpdateBackupPlan,

    -- * Request Lenses
    updateBackupPlan_backupPlanId,
    updateBackupPlan_backupPlan,

    -- * Destructuring the Response
    UpdateBackupPlanResponse (..),
    newUpdateBackupPlanResponse,

    -- * Response Lenses
    updateBackupPlanResponse_versionId,
    updateBackupPlanResponse_advancedBackupSettings,
    updateBackupPlanResponse_backupPlanId,
    updateBackupPlanResponse_backupPlanArn,
    updateBackupPlanResponse_creationDate,
    updateBackupPlanResponse_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:/ 'newUpdateBackupPlan' smart constructor.
data UpdateBackupPlan = UpdateBackupPlan'
  { -- | Uniquely identifies a backup plan.
    UpdateBackupPlan -> Text
backupPlanId :: Prelude.Text,
    -- | Specifies the body of a backup plan. Includes a @BackupPlanName@ and one
    -- or more sets of @Rules@.
    UpdateBackupPlan -> BackupPlanInput
backupPlan :: BackupPlanInput
  }
  deriving (UpdateBackupPlan -> UpdateBackupPlan -> Bool
(UpdateBackupPlan -> UpdateBackupPlan -> Bool)
-> (UpdateBackupPlan -> UpdateBackupPlan -> Bool)
-> Eq UpdateBackupPlan
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateBackupPlan -> UpdateBackupPlan -> Bool
$c/= :: UpdateBackupPlan -> UpdateBackupPlan -> Bool
== :: UpdateBackupPlan -> UpdateBackupPlan -> Bool
$c== :: UpdateBackupPlan -> UpdateBackupPlan -> Bool
Prelude.Eq, Int -> UpdateBackupPlan -> ShowS
[UpdateBackupPlan] -> ShowS
UpdateBackupPlan -> String
(Int -> UpdateBackupPlan -> ShowS)
-> (UpdateBackupPlan -> String)
-> ([UpdateBackupPlan] -> ShowS)
-> Show UpdateBackupPlan
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateBackupPlan] -> ShowS
$cshowList :: [UpdateBackupPlan] -> ShowS
show :: UpdateBackupPlan -> String
$cshow :: UpdateBackupPlan -> String
showsPrec :: Int -> UpdateBackupPlan -> ShowS
$cshowsPrec :: Int -> UpdateBackupPlan -> ShowS
Prelude.Show, (forall x. UpdateBackupPlan -> Rep UpdateBackupPlan x)
-> (forall x. Rep UpdateBackupPlan x -> UpdateBackupPlan)
-> Generic UpdateBackupPlan
forall x. Rep UpdateBackupPlan x -> UpdateBackupPlan
forall x. UpdateBackupPlan -> Rep UpdateBackupPlan x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateBackupPlan x -> UpdateBackupPlan
$cfrom :: forall x. UpdateBackupPlan -> Rep UpdateBackupPlan x
Prelude.Generic)

-- |
-- Create a value of 'UpdateBackupPlan' 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:
--
-- 'backupPlanId', 'updateBackupPlan_backupPlanId' - Uniquely identifies a backup plan.
--
-- 'backupPlan', 'updateBackupPlan_backupPlan' - Specifies the body of a backup plan. Includes a @BackupPlanName@ and one
-- or more sets of @Rules@.
newUpdateBackupPlan ::
  -- | 'backupPlanId'
  Prelude.Text ->
  -- | 'backupPlan'
  BackupPlanInput ->
  UpdateBackupPlan
newUpdateBackupPlan :: Text -> BackupPlanInput -> UpdateBackupPlan
newUpdateBackupPlan Text
pBackupPlanId_ BackupPlanInput
pBackupPlan_ =
  UpdateBackupPlan' :: Text -> BackupPlanInput -> UpdateBackupPlan
UpdateBackupPlan'
    { $sel:backupPlanId:UpdateBackupPlan' :: Text
backupPlanId = Text
pBackupPlanId_,
      $sel:backupPlan:UpdateBackupPlan' :: BackupPlanInput
backupPlan = BackupPlanInput
pBackupPlan_
    }

-- | Uniquely identifies a backup plan.
updateBackupPlan_backupPlanId :: Lens.Lens' UpdateBackupPlan Prelude.Text
updateBackupPlan_backupPlanId :: (Text -> f Text) -> UpdateBackupPlan -> f UpdateBackupPlan
updateBackupPlan_backupPlanId = (UpdateBackupPlan -> Text)
-> (UpdateBackupPlan -> Text -> UpdateBackupPlan)
-> Lens UpdateBackupPlan UpdateBackupPlan Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBackupPlan' {Text
backupPlanId :: Text
$sel:backupPlanId:UpdateBackupPlan' :: UpdateBackupPlan -> Text
backupPlanId} -> Text
backupPlanId) (\s :: UpdateBackupPlan
s@UpdateBackupPlan' {} Text
a -> UpdateBackupPlan
s {$sel:backupPlanId:UpdateBackupPlan' :: Text
backupPlanId = Text
a} :: UpdateBackupPlan)

-- | Specifies the body of a backup plan. Includes a @BackupPlanName@ and one
-- or more sets of @Rules@.
updateBackupPlan_backupPlan :: Lens.Lens' UpdateBackupPlan BackupPlanInput
updateBackupPlan_backupPlan :: (BackupPlanInput -> f BackupPlanInput)
-> UpdateBackupPlan -> f UpdateBackupPlan
updateBackupPlan_backupPlan = (UpdateBackupPlan -> BackupPlanInput)
-> (UpdateBackupPlan -> BackupPlanInput -> UpdateBackupPlan)
-> Lens
     UpdateBackupPlan UpdateBackupPlan BackupPlanInput BackupPlanInput
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBackupPlan' {BackupPlanInput
backupPlan :: BackupPlanInput
$sel:backupPlan:UpdateBackupPlan' :: UpdateBackupPlan -> BackupPlanInput
backupPlan} -> BackupPlanInput
backupPlan) (\s :: UpdateBackupPlan
s@UpdateBackupPlan' {} BackupPlanInput
a -> UpdateBackupPlan
s {$sel:backupPlan:UpdateBackupPlan' :: BackupPlanInput
backupPlan = BackupPlanInput
a} :: UpdateBackupPlan)

instance Core.AWSRequest UpdateBackupPlan where
  type
    AWSResponse UpdateBackupPlan =
      UpdateBackupPlanResponse
  request :: UpdateBackupPlan -> Request UpdateBackupPlan
request = Service -> UpdateBackupPlan -> Request UpdateBackupPlan
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateBackupPlan
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateBackupPlan)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateBackupPlan))
-> Logger
-> Service
-> Proxy UpdateBackupPlan
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateBackupPlan)))
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 Text
-> Maybe [AdvancedBackupSetting]
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Int
-> UpdateBackupPlanResponse
UpdateBackupPlanResponse'
            (Maybe Text
 -> Maybe [AdvancedBackupSetting]
 -> Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Int
 -> UpdateBackupPlanResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [AdvancedBackupSetting]
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Int
      -> UpdateBackupPlanResponse)
forall (f :: * -> *) a b. Functor 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
"VersionId")
            Either
  String
  (Maybe [AdvancedBackupSetting]
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Int
   -> UpdateBackupPlanResponse)
-> Either String (Maybe [AdvancedBackupSetting])
-> Either
     String
     (Maybe Text
      -> Maybe Text -> Maybe POSIX -> Int -> UpdateBackupPlanResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text -> Either String (Maybe (Maybe [AdvancedBackupSetting]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"AdvancedBackupSettings"
                            Either String (Maybe (Maybe [AdvancedBackupSetting]))
-> Maybe [AdvancedBackupSetting]
-> Either String (Maybe [AdvancedBackupSetting])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [AdvancedBackupSetting]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either
  String
  (Maybe Text
   -> Maybe Text -> Maybe POSIX -> Int -> UpdateBackupPlanResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text -> Maybe POSIX -> Int -> UpdateBackupPlanResponse)
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
"BackupPlanId")
            Either
  String
  (Maybe Text -> Maybe POSIX -> Int -> UpdateBackupPlanResponse)
-> Either String (Maybe Text)
-> Either String (Maybe POSIX -> Int -> UpdateBackupPlanResponse)
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
"BackupPlanArn")
            Either String (Maybe POSIX -> Int -> UpdateBackupPlanResponse)
-> Either String (Maybe POSIX)
-> Either String (Int -> UpdateBackupPlanResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CreationDate")
            Either String (Int -> UpdateBackupPlanResponse)
-> Either String Int -> Either String UpdateBackupPlanResponse
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 UpdateBackupPlan

instance Prelude.NFData UpdateBackupPlan

instance Core.ToHeaders UpdateBackupPlan where
  toHeaders :: UpdateBackupPlan -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateBackupPlan -> 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 UpdateBackupPlan where
  toJSON :: UpdateBackupPlan -> Value
toJSON UpdateBackupPlan' {Text
BackupPlanInput
backupPlan :: BackupPlanInput
backupPlanId :: Text
$sel:backupPlan:UpdateBackupPlan' :: UpdateBackupPlan -> BackupPlanInput
$sel:backupPlanId:UpdateBackupPlan' :: UpdateBackupPlan -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"BackupPlan" Text -> BackupPlanInput -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= BackupPlanInput
backupPlan)]
      )

instance Core.ToPath UpdateBackupPlan where
  toPath :: UpdateBackupPlan -> ByteString
toPath UpdateBackupPlan' {Text
BackupPlanInput
backupPlan :: BackupPlanInput
backupPlanId :: Text
$sel:backupPlan:UpdateBackupPlan' :: UpdateBackupPlan -> BackupPlanInput
$sel:backupPlanId:UpdateBackupPlan' :: UpdateBackupPlan -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/backup/plans/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
backupPlanId]

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

-- | /See:/ 'newUpdateBackupPlanResponse' smart constructor.
data UpdateBackupPlanResponse = UpdateBackupPlanResponse'
  { -- | Unique, randomly generated, Unicode, UTF-8 encoded strings that are at
    -- most 1,024 bytes long. Version Ids cannot be edited.
    UpdateBackupPlanResponse -> Maybe Text
versionId :: Prelude.Maybe Prelude.Text,
    -- | Contains a list of @BackupOptions@ for each resource type.
    UpdateBackupPlanResponse -> Maybe [AdvancedBackupSetting]
advancedBackupSettings :: Prelude.Maybe [AdvancedBackupSetting],
    -- | Uniquely identifies a backup plan.
    UpdateBackupPlanResponse -> Maybe Text
backupPlanId :: Prelude.Maybe Prelude.Text,
    -- | An Amazon Resource Name (ARN) that uniquely identifies a backup plan;
    -- for example,
    -- @arn:aws:backup:us-east-1:123456789012:plan:8F81F553-3A74-4A3F-B93D-B3360DC80C50@.
    UpdateBackupPlanResponse -> Maybe Text
backupPlanArn :: Prelude.Maybe Prelude.Text,
    -- | The date and time a backup plan is created, in Unix format and
    -- Coordinated Universal Time (UTC). The value of @CreationDate@ is
    -- accurate to milliseconds. For example, the value 1516925490.087
    -- represents Friday, January 26, 2018 12:11:30.087 AM.
    UpdateBackupPlanResponse -> Maybe POSIX
creationDate :: Prelude.Maybe Core.POSIX,
    -- | The response's http status code.
    UpdateBackupPlanResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateBackupPlanResponse -> UpdateBackupPlanResponse -> Bool
(UpdateBackupPlanResponse -> UpdateBackupPlanResponse -> Bool)
-> (UpdateBackupPlanResponse -> UpdateBackupPlanResponse -> Bool)
-> Eq UpdateBackupPlanResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateBackupPlanResponse -> UpdateBackupPlanResponse -> Bool
$c/= :: UpdateBackupPlanResponse -> UpdateBackupPlanResponse -> Bool
== :: UpdateBackupPlanResponse -> UpdateBackupPlanResponse -> Bool
$c== :: UpdateBackupPlanResponse -> UpdateBackupPlanResponse -> Bool
Prelude.Eq, ReadPrec [UpdateBackupPlanResponse]
ReadPrec UpdateBackupPlanResponse
Int -> ReadS UpdateBackupPlanResponse
ReadS [UpdateBackupPlanResponse]
(Int -> ReadS UpdateBackupPlanResponse)
-> ReadS [UpdateBackupPlanResponse]
-> ReadPrec UpdateBackupPlanResponse
-> ReadPrec [UpdateBackupPlanResponse]
-> Read UpdateBackupPlanResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateBackupPlanResponse]
$creadListPrec :: ReadPrec [UpdateBackupPlanResponse]
readPrec :: ReadPrec UpdateBackupPlanResponse
$creadPrec :: ReadPrec UpdateBackupPlanResponse
readList :: ReadS [UpdateBackupPlanResponse]
$creadList :: ReadS [UpdateBackupPlanResponse]
readsPrec :: Int -> ReadS UpdateBackupPlanResponse
$creadsPrec :: Int -> ReadS UpdateBackupPlanResponse
Prelude.Read, Int -> UpdateBackupPlanResponse -> ShowS
[UpdateBackupPlanResponse] -> ShowS
UpdateBackupPlanResponse -> String
(Int -> UpdateBackupPlanResponse -> ShowS)
-> (UpdateBackupPlanResponse -> String)
-> ([UpdateBackupPlanResponse] -> ShowS)
-> Show UpdateBackupPlanResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateBackupPlanResponse] -> ShowS
$cshowList :: [UpdateBackupPlanResponse] -> ShowS
show :: UpdateBackupPlanResponse -> String
$cshow :: UpdateBackupPlanResponse -> String
showsPrec :: Int -> UpdateBackupPlanResponse -> ShowS
$cshowsPrec :: Int -> UpdateBackupPlanResponse -> ShowS
Prelude.Show, (forall x.
 UpdateBackupPlanResponse -> Rep UpdateBackupPlanResponse x)
-> (forall x.
    Rep UpdateBackupPlanResponse x -> UpdateBackupPlanResponse)
-> Generic UpdateBackupPlanResponse
forall x.
Rep UpdateBackupPlanResponse x -> UpdateBackupPlanResponse
forall x.
UpdateBackupPlanResponse -> Rep UpdateBackupPlanResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateBackupPlanResponse x -> UpdateBackupPlanResponse
$cfrom :: forall x.
UpdateBackupPlanResponse -> Rep UpdateBackupPlanResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateBackupPlanResponse' 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:
--
-- 'versionId', 'updateBackupPlanResponse_versionId' - Unique, randomly generated, Unicode, UTF-8 encoded strings that are at
-- most 1,024 bytes long. Version Ids cannot be edited.
--
-- 'advancedBackupSettings', 'updateBackupPlanResponse_advancedBackupSettings' - Contains a list of @BackupOptions@ for each resource type.
--
-- 'backupPlanId', 'updateBackupPlanResponse_backupPlanId' - Uniquely identifies a backup plan.
--
-- 'backupPlanArn', 'updateBackupPlanResponse_backupPlanArn' - An Amazon Resource Name (ARN) that uniquely identifies a backup plan;
-- for example,
-- @arn:aws:backup:us-east-1:123456789012:plan:8F81F553-3A74-4A3F-B93D-B3360DC80C50@.
--
-- 'creationDate', 'updateBackupPlanResponse_creationDate' - The date and time a backup plan is created, in Unix format and
-- Coordinated Universal Time (UTC). The value of @CreationDate@ is
-- accurate to milliseconds. For example, the value 1516925490.087
-- represents Friday, January 26, 2018 12:11:30.087 AM.
--
-- 'httpStatus', 'updateBackupPlanResponse_httpStatus' - The response's http status code.
newUpdateBackupPlanResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateBackupPlanResponse
newUpdateBackupPlanResponse :: Int -> UpdateBackupPlanResponse
newUpdateBackupPlanResponse Int
pHttpStatus_ =
  UpdateBackupPlanResponse' :: Maybe Text
-> Maybe [AdvancedBackupSetting]
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Int
-> UpdateBackupPlanResponse
UpdateBackupPlanResponse'
    { $sel:versionId:UpdateBackupPlanResponse' :: Maybe Text
versionId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:advancedBackupSettings:UpdateBackupPlanResponse' :: Maybe [AdvancedBackupSetting]
advancedBackupSettings = Maybe [AdvancedBackupSetting]
forall a. Maybe a
Prelude.Nothing,
      $sel:backupPlanId:UpdateBackupPlanResponse' :: Maybe Text
backupPlanId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:backupPlanArn:UpdateBackupPlanResponse' :: Maybe Text
backupPlanArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:creationDate:UpdateBackupPlanResponse' :: Maybe POSIX
creationDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateBackupPlanResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Unique, randomly generated, Unicode, UTF-8 encoded strings that are at
-- most 1,024 bytes long. Version Ids cannot be edited.
updateBackupPlanResponse_versionId :: Lens.Lens' UpdateBackupPlanResponse (Prelude.Maybe Prelude.Text)
updateBackupPlanResponse_versionId :: (Maybe Text -> f (Maybe Text))
-> UpdateBackupPlanResponse -> f UpdateBackupPlanResponse
updateBackupPlanResponse_versionId = (UpdateBackupPlanResponse -> Maybe Text)
-> (UpdateBackupPlanResponse
    -> Maybe Text -> UpdateBackupPlanResponse)
-> Lens
     UpdateBackupPlanResponse
     UpdateBackupPlanResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBackupPlanResponse' {Maybe Text
versionId :: Maybe Text
$sel:versionId:UpdateBackupPlanResponse' :: UpdateBackupPlanResponse -> Maybe Text
versionId} -> Maybe Text
versionId) (\s :: UpdateBackupPlanResponse
s@UpdateBackupPlanResponse' {} Maybe Text
a -> UpdateBackupPlanResponse
s {$sel:versionId:UpdateBackupPlanResponse' :: Maybe Text
versionId = Maybe Text
a} :: UpdateBackupPlanResponse)

-- | Contains a list of @BackupOptions@ for each resource type.
updateBackupPlanResponse_advancedBackupSettings :: Lens.Lens' UpdateBackupPlanResponse (Prelude.Maybe [AdvancedBackupSetting])
updateBackupPlanResponse_advancedBackupSettings :: (Maybe [AdvancedBackupSetting]
 -> f (Maybe [AdvancedBackupSetting]))
-> UpdateBackupPlanResponse -> f UpdateBackupPlanResponse
updateBackupPlanResponse_advancedBackupSettings = (UpdateBackupPlanResponse -> Maybe [AdvancedBackupSetting])
-> (UpdateBackupPlanResponse
    -> Maybe [AdvancedBackupSetting] -> UpdateBackupPlanResponse)
-> Lens
     UpdateBackupPlanResponse
     UpdateBackupPlanResponse
     (Maybe [AdvancedBackupSetting])
     (Maybe [AdvancedBackupSetting])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBackupPlanResponse' {Maybe [AdvancedBackupSetting]
advancedBackupSettings :: Maybe [AdvancedBackupSetting]
$sel:advancedBackupSettings:UpdateBackupPlanResponse' :: UpdateBackupPlanResponse -> Maybe [AdvancedBackupSetting]
advancedBackupSettings} -> Maybe [AdvancedBackupSetting]
advancedBackupSettings) (\s :: UpdateBackupPlanResponse
s@UpdateBackupPlanResponse' {} Maybe [AdvancedBackupSetting]
a -> UpdateBackupPlanResponse
s {$sel:advancedBackupSettings:UpdateBackupPlanResponse' :: Maybe [AdvancedBackupSetting]
advancedBackupSettings = Maybe [AdvancedBackupSetting]
a} :: UpdateBackupPlanResponse) ((Maybe [AdvancedBackupSetting]
  -> f (Maybe [AdvancedBackupSetting]))
 -> UpdateBackupPlanResponse -> f UpdateBackupPlanResponse)
-> ((Maybe [AdvancedBackupSetting]
     -> f (Maybe [AdvancedBackupSetting]))
    -> Maybe [AdvancedBackupSetting]
    -> f (Maybe [AdvancedBackupSetting]))
-> (Maybe [AdvancedBackupSetting]
    -> f (Maybe [AdvancedBackupSetting]))
-> UpdateBackupPlanResponse
-> f UpdateBackupPlanResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [AdvancedBackupSetting]
  [AdvancedBackupSetting]
  [AdvancedBackupSetting]
  [AdvancedBackupSetting]
-> Iso
     (Maybe [AdvancedBackupSetting])
     (Maybe [AdvancedBackupSetting])
     (Maybe [AdvancedBackupSetting])
     (Maybe [AdvancedBackupSetting])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [AdvancedBackupSetting]
  [AdvancedBackupSetting]
  [AdvancedBackupSetting]
  [AdvancedBackupSetting]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Uniquely identifies a backup plan.
updateBackupPlanResponse_backupPlanId :: Lens.Lens' UpdateBackupPlanResponse (Prelude.Maybe Prelude.Text)
updateBackupPlanResponse_backupPlanId :: (Maybe Text -> f (Maybe Text))
-> UpdateBackupPlanResponse -> f UpdateBackupPlanResponse
updateBackupPlanResponse_backupPlanId = (UpdateBackupPlanResponse -> Maybe Text)
-> (UpdateBackupPlanResponse
    -> Maybe Text -> UpdateBackupPlanResponse)
-> Lens
     UpdateBackupPlanResponse
     UpdateBackupPlanResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBackupPlanResponse' {Maybe Text
backupPlanId :: Maybe Text
$sel:backupPlanId:UpdateBackupPlanResponse' :: UpdateBackupPlanResponse -> Maybe Text
backupPlanId} -> Maybe Text
backupPlanId) (\s :: UpdateBackupPlanResponse
s@UpdateBackupPlanResponse' {} Maybe Text
a -> UpdateBackupPlanResponse
s {$sel:backupPlanId:UpdateBackupPlanResponse' :: Maybe Text
backupPlanId = Maybe Text
a} :: UpdateBackupPlanResponse)

-- | An Amazon Resource Name (ARN) that uniquely identifies a backup plan;
-- for example,
-- @arn:aws:backup:us-east-1:123456789012:plan:8F81F553-3A74-4A3F-B93D-B3360DC80C50@.
updateBackupPlanResponse_backupPlanArn :: Lens.Lens' UpdateBackupPlanResponse (Prelude.Maybe Prelude.Text)
updateBackupPlanResponse_backupPlanArn :: (Maybe Text -> f (Maybe Text))
-> UpdateBackupPlanResponse -> f UpdateBackupPlanResponse
updateBackupPlanResponse_backupPlanArn = (UpdateBackupPlanResponse -> Maybe Text)
-> (UpdateBackupPlanResponse
    -> Maybe Text -> UpdateBackupPlanResponse)
-> Lens
     UpdateBackupPlanResponse
     UpdateBackupPlanResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBackupPlanResponse' {Maybe Text
backupPlanArn :: Maybe Text
$sel:backupPlanArn:UpdateBackupPlanResponse' :: UpdateBackupPlanResponse -> Maybe Text
backupPlanArn} -> Maybe Text
backupPlanArn) (\s :: UpdateBackupPlanResponse
s@UpdateBackupPlanResponse' {} Maybe Text
a -> UpdateBackupPlanResponse
s {$sel:backupPlanArn:UpdateBackupPlanResponse' :: Maybe Text
backupPlanArn = Maybe Text
a} :: UpdateBackupPlanResponse)

-- | The date and time a backup plan is created, in Unix format and
-- Coordinated Universal Time (UTC). The value of @CreationDate@ is
-- accurate to milliseconds. For example, the value 1516925490.087
-- represents Friday, January 26, 2018 12:11:30.087 AM.
updateBackupPlanResponse_creationDate :: Lens.Lens' UpdateBackupPlanResponse (Prelude.Maybe Prelude.UTCTime)
updateBackupPlanResponse_creationDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> UpdateBackupPlanResponse -> f UpdateBackupPlanResponse
updateBackupPlanResponse_creationDate = (UpdateBackupPlanResponse -> Maybe POSIX)
-> (UpdateBackupPlanResponse
    -> Maybe POSIX -> UpdateBackupPlanResponse)
-> Lens
     UpdateBackupPlanResponse
     UpdateBackupPlanResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBackupPlanResponse' {Maybe POSIX
creationDate :: Maybe POSIX
$sel:creationDate:UpdateBackupPlanResponse' :: UpdateBackupPlanResponse -> Maybe POSIX
creationDate} -> Maybe POSIX
creationDate) (\s :: UpdateBackupPlanResponse
s@UpdateBackupPlanResponse' {} Maybe POSIX
a -> UpdateBackupPlanResponse
s {$sel:creationDate:UpdateBackupPlanResponse' :: Maybe POSIX
creationDate = Maybe POSIX
a} :: UpdateBackupPlanResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> UpdateBackupPlanResponse -> f UpdateBackupPlanResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> UpdateBackupPlanResponse
-> f UpdateBackupPlanResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

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

instance Prelude.NFData UpdateBackupPlanResponse