{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Backup.Types.BackupPlanTemplatesListMember
-- 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)
module Amazonka.Backup.Types.BackupPlanTemplatesListMember where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | An object specifying metadata associated with a backup plan template.
--
-- /See:/ 'newBackupPlanTemplatesListMember' smart constructor.
data BackupPlanTemplatesListMember = BackupPlanTemplatesListMember'
  { -- | The optional display name of a backup plan template.
    BackupPlanTemplatesListMember -> Maybe Text
backupPlanTemplateName :: Prelude.Maybe Prelude.Text,
    -- | Uniquely identifies a stored backup plan template.
    BackupPlanTemplatesListMember -> Maybe Text
backupPlanTemplateId :: Prelude.Maybe Prelude.Text
  }
  deriving (BackupPlanTemplatesListMember
-> BackupPlanTemplatesListMember -> Bool
(BackupPlanTemplatesListMember
 -> BackupPlanTemplatesListMember -> Bool)
-> (BackupPlanTemplatesListMember
    -> BackupPlanTemplatesListMember -> Bool)
-> Eq BackupPlanTemplatesListMember
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BackupPlanTemplatesListMember
-> BackupPlanTemplatesListMember -> Bool
$c/= :: BackupPlanTemplatesListMember
-> BackupPlanTemplatesListMember -> Bool
== :: BackupPlanTemplatesListMember
-> BackupPlanTemplatesListMember -> Bool
$c== :: BackupPlanTemplatesListMember
-> BackupPlanTemplatesListMember -> Bool
Prelude.Eq, ReadPrec [BackupPlanTemplatesListMember]
ReadPrec BackupPlanTemplatesListMember
Int -> ReadS BackupPlanTemplatesListMember
ReadS [BackupPlanTemplatesListMember]
(Int -> ReadS BackupPlanTemplatesListMember)
-> ReadS [BackupPlanTemplatesListMember]
-> ReadPrec BackupPlanTemplatesListMember
-> ReadPrec [BackupPlanTemplatesListMember]
-> Read BackupPlanTemplatesListMember
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BackupPlanTemplatesListMember]
$creadListPrec :: ReadPrec [BackupPlanTemplatesListMember]
readPrec :: ReadPrec BackupPlanTemplatesListMember
$creadPrec :: ReadPrec BackupPlanTemplatesListMember
readList :: ReadS [BackupPlanTemplatesListMember]
$creadList :: ReadS [BackupPlanTemplatesListMember]
readsPrec :: Int -> ReadS BackupPlanTemplatesListMember
$creadsPrec :: Int -> ReadS BackupPlanTemplatesListMember
Prelude.Read, Int -> BackupPlanTemplatesListMember -> ShowS
[BackupPlanTemplatesListMember] -> ShowS
BackupPlanTemplatesListMember -> String
(Int -> BackupPlanTemplatesListMember -> ShowS)
-> (BackupPlanTemplatesListMember -> String)
-> ([BackupPlanTemplatesListMember] -> ShowS)
-> Show BackupPlanTemplatesListMember
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BackupPlanTemplatesListMember] -> ShowS
$cshowList :: [BackupPlanTemplatesListMember] -> ShowS
show :: BackupPlanTemplatesListMember -> String
$cshow :: BackupPlanTemplatesListMember -> String
showsPrec :: Int -> BackupPlanTemplatesListMember -> ShowS
$cshowsPrec :: Int -> BackupPlanTemplatesListMember -> ShowS
Prelude.Show, (forall x.
 BackupPlanTemplatesListMember
 -> Rep BackupPlanTemplatesListMember x)
-> (forall x.
    Rep BackupPlanTemplatesListMember x
    -> BackupPlanTemplatesListMember)
-> Generic BackupPlanTemplatesListMember
forall x.
Rep BackupPlanTemplatesListMember x
-> BackupPlanTemplatesListMember
forall x.
BackupPlanTemplatesListMember
-> Rep BackupPlanTemplatesListMember x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BackupPlanTemplatesListMember x
-> BackupPlanTemplatesListMember
$cfrom :: forall x.
BackupPlanTemplatesListMember
-> Rep BackupPlanTemplatesListMember x
Prelude.Generic)

-- |
-- Create a value of 'BackupPlanTemplatesListMember' 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:
--
-- 'backupPlanTemplateName', 'backupPlanTemplatesListMember_backupPlanTemplateName' - The optional display name of a backup plan template.
--
-- 'backupPlanTemplateId', 'backupPlanTemplatesListMember_backupPlanTemplateId' - Uniquely identifies a stored backup plan template.
newBackupPlanTemplatesListMember ::
  BackupPlanTemplatesListMember
newBackupPlanTemplatesListMember :: BackupPlanTemplatesListMember
newBackupPlanTemplatesListMember =
  BackupPlanTemplatesListMember' :: Maybe Text -> Maybe Text -> BackupPlanTemplatesListMember
BackupPlanTemplatesListMember'
    { $sel:backupPlanTemplateName:BackupPlanTemplatesListMember' :: Maybe Text
backupPlanTemplateName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:backupPlanTemplateId:BackupPlanTemplatesListMember' :: Maybe Text
backupPlanTemplateId = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The optional display name of a backup plan template.
backupPlanTemplatesListMember_backupPlanTemplateName :: Lens.Lens' BackupPlanTemplatesListMember (Prelude.Maybe Prelude.Text)
backupPlanTemplatesListMember_backupPlanTemplateName :: (Maybe Text -> f (Maybe Text))
-> BackupPlanTemplatesListMember -> f BackupPlanTemplatesListMember
backupPlanTemplatesListMember_backupPlanTemplateName = (BackupPlanTemplatesListMember -> Maybe Text)
-> (BackupPlanTemplatesListMember
    -> Maybe Text -> BackupPlanTemplatesListMember)
-> Lens
     BackupPlanTemplatesListMember
     BackupPlanTemplatesListMember
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackupPlanTemplatesListMember' {Maybe Text
backupPlanTemplateName :: Maybe Text
$sel:backupPlanTemplateName:BackupPlanTemplatesListMember' :: BackupPlanTemplatesListMember -> Maybe Text
backupPlanTemplateName} -> Maybe Text
backupPlanTemplateName) (\s :: BackupPlanTemplatesListMember
s@BackupPlanTemplatesListMember' {} Maybe Text
a -> BackupPlanTemplatesListMember
s {$sel:backupPlanTemplateName:BackupPlanTemplatesListMember' :: Maybe Text
backupPlanTemplateName = Maybe Text
a} :: BackupPlanTemplatesListMember)

-- | Uniquely identifies a stored backup plan template.
backupPlanTemplatesListMember_backupPlanTemplateId :: Lens.Lens' BackupPlanTemplatesListMember (Prelude.Maybe Prelude.Text)
backupPlanTemplatesListMember_backupPlanTemplateId :: (Maybe Text -> f (Maybe Text))
-> BackupPlanTemplatesListMember -> f BackupPlanTemplatesListMember
backupPlanTemplatesListMember_backupPlanTemplateId = (BackupPlanTemplatesListMember -> Maybe Text)
-> (BackupPlanTemplatesListMember
    -> Maybe Text -> BackupPlanTemplatesListMember)
-> Lens
     BackupPlanTemplatesListMember
     BackupPlanTemplatesListMember
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackupPlanTemplatesListMember' {Maybe Text
backupPlanTemplateId :: Maybe Text
$sel:backupPlanTemplateId:BackupPlanTemplatesListMember' :: BackupPlanTemplatesListMember -> Maybe Text
backupPlanTemplateId} -> Maybe Text
backupPlanTemplateId) (\s :: BackupPlanTemplatesListMember
s@BackupPlanTemplatesListMember' {} Maybe Text
a -> BackupPlanTemplatesListMember
s {$sel:backupPlanTemplateId:BackupPlanTemplatesListMember' :: Maybe Text
backupPlanTemplateId = Maybe Text
a} :: BackupPlanTemplatesListMember)

instance Core.FromJSON BackupPlanTemplatesListMember where
  parseJSON :: Value -> Parser BackupPlanTemplatesListMember
parseJSON =
    String
-> (Object -> Parser BackupPlanTemplatesListMember)
-> Value
-> Parser BackupPlanTemplatesListMember
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"BackupPlanTemplatesListMember"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> BackupPlanTemplatesListMember
BackupPlanTemplatesListMember'
            (Maybe Text -> Maybe Text -> BackupPlanTemplatesListMember)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> BackupPlanTemplatesListMember)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"BackupPlanTemplateName")
            Parser (Maybe Text -> BackupPlanTemplatesListMember)
-> Parser (Maybe Text) -> Parser BackupPlanTemplatesListMember
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"BackupPlanTemplateId")
      )

instance
  Prelude.Hashable
    BackupPlanTemplatesListMember

instance Prelude.NFData BackupPlanTemplatesListMember