{-# 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.BackupSelectionsListMember
-- 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.BackupSelectionsListMember where

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

-- | Contains metadata about a @BackupSelection@ object.
--
-- /See:/ 'newBackupSelectionsListMember' smart constructor.
data BackupSelectionsListMember = BackupSelectionsListMember'
  { -- | Specifies the IAM role Amazon Resource Name (ARN) to create the target
    -- recovery point; for example, @arn:aws:iam::123456789012:role\/S3Access@.
    BackupSelectionsListMember -> Maybe Text
iamRoleArn :: Prelude.Maybe Prelude.Text,
    -- | The display name of a resource selection document.
    BackupSelectionsListMember -> Maybe Text
selectionName :: Prelude.Maybe Prelude.Text,
    -- | Uniquely identifies a request to assign a set of resources to a backup
    -- plan.
    BackupSelectionsListMember -> Maybe Text
selectionId :: Prelude.Maybe Prelude.Text,
    -- | Uniquely identifies a backup plan.
    BackupSelectionsListMember -> Maybe Text
backupPlanId :: Prelude.Maybe Prelude.Text,
    -- | A unique string that identifies the request and allows failed requests
    -- to be retried without the risk of running the operation twice.
    BackupSelectionsListMember -> Maybe Text
creatorRequestId :: 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.
    BackupSelectionsListMember -> Maybe POSIX
creationDate :: Prelude.Maybe Core.POSIX
  }
  deriving (BackupSelectionsListMember -> BackupSelectionsListMember -> Bool
(BackupSelectionsListMember -> BackupSelectionsListMember -> Bool)
-> (BackupSelectionsListMember
    -> BackupSelectionsListMember -> Bool)
-> Eq BackupSelectionsListMember
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BackupSelectionsListMember -> BackupSelectionsListMember -> Bool
$c/= :: BackupSelectionsListMember -> BackupSelectionsListMember -> Bool
== :: BackupSelectionsListMember -> BackupSelectionsListMember -> Bool
$c== :: BackupSelectionsListMember -> BackupSelectionsListMember -> Bool
Prelude.Eq, ReadPrec [BackupSelectionsListMember]
ReadPrec BackupSelectionsListMember
Int -> ReadS BackupSelectionsListMember
ReadS [BackupSelectionsListMember]
(Int -> ReadS BackupSelectionsListMember)
-> ReadS [BackupSelectionsListMember]
-> ReadPrec BackupSelectionsListMember
-> ReadPrec [BackupSelectionsListMember]
-> Read BackupSelectionsListMember
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BackupSelectionsListMember]
$creadListPrec :: ReadPrec [BackupSelectionsListMember]
readPrec :: ReadPrec BackupSelectionsListMember
$creadPrec :: ReadPrec BackupSelectionsListMember
readList :: ReadS [BackupSelectionsListMember]
$creadList :: ReadS [BackupSelectionsListMember]
readsPrec :: Int -> ReadS BackupSelectionsListMember
$creadsPrec :: Int -> ReadS BackupSelectionsListMember
Prelude.Read, Int -> BackupSelectionsListMember -> ShowS
[BackupSelectionsListMember] -> ShowS
BackupSelectionsListMember -> String
(Int -> BackupSelectionsListMember -> ShowS)
-> (BackupSelectionsListMember -> String)
-> ([BackupSelectionsListMember] -> ShowS)
-> Show BackupSelectionsListMember
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BackupSelectionsListMember] -> ShowS
$cshowList :: [BackupSelectionsListMember] -> ShowS
show :: BackupSelectionsListMember -> String
$cshow :: BackupSelectionsListMember -> String
showsPrec :: Int -> BackupSelectionsListMember -> ShowS
$cshowsPrec :: Int -> BackupSelectionsListMember -> ShowS
Prelude.Show, (forall x.
 BackupSelectionsListMember -> Rep BackupSelectionsListMember x)
-> (forall x.
    Rep BackupSelectionsListMember x -> BackupSelectionsListMember)
-> Generic BackupSelectionsListMember
forall x.
Rep BackupSelectionsListMember x -> BackupSelectionsListMember
forall x.
BackupSelectionsListMember -> Rep BackupSelectionsListMember x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BackupSelectionsListMember x -> BackupSelectionsListMember
$cfrom :: forall x.
BackupSelectionsListMember -> Rep BackupSelectionsListMember x
Prelude.Generic)

-- |
-- Create a value of 'BackupSelectionsListMember' 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:
--
-- 'iamRoleArn', 'backupSelectionsListMember_iamRoleArn' - Specifies the IAM role Amazon Resource Name (ARN) to create the target
-- recovery point; for example, @arn:aws:iam::123456789012:role\/S3Access@.
--
-- 'selectionName', 'backupSelectionsListMember_selectionName' - The display name of a resource selection document.
--
-- 'selectionId', 'backupSelectionsListMember_selectionId' - Uniquely identifies a request to assign a set of resources to a backup
-- plan.
--
-- 'backupPlanId', 'backupSelectionsListMember_backupPlanId' - Uniquely identifies a backup plan.
--
-- 'creatorRequestId', 'backupSelectionsListMember_creatorRequestId' - A unique string that identifies the request and allows failed requests
-- to be retried without the risk of running the operation twice.
--
-- 'creationDate', 'backupSelectionsListMember_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.
newBackupSelectionsListMember ::
  BackupSelectionsListMember
newBackupSelectionsListMember :: BackupSelectionsListMember
newBackupSelectionsListMember =
  BackupSelectionsListMember' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> BackupSelectionsListMember
BackupSelectionsListMember'
    { $sel:iamRoleArn:BackupSelectionsListMember' :: Maybe Text
iamRoleArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:selectionName:BackupSelectionsListMember' :: Maybe Text
selectionName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:selectionId:BackupSelectionsListMember' :: Maybe Text
selectionId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:backupPlanId:BackupSelectionsListMember' :: Maybe Text
backupPlanId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:creatorRequestId:BackupSelectionsListMember' :: Maybe Text
creatorRequestId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:creationDate:BackupSelectionsListMember' :: Maybe POSIX
creationDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
    }

-- | Specifies the IAM role Amazon Resource Name (ARN) to create the target
-- recovery point; for example, @arn:aws:iam::123456789012:role\/S3Access@.
backupSelectionsListMember_iamRoleArn :: Lens.Lens' BackupSelectionsListMember (Prelude.Maybe Prelude.Text)
backupSelectionsListMember_iamRoleArn :: (Maybe Text -> f (Maybe Text))
-> BackupSelectionsListMember -> f BackupSelectionsListMember
backupSelectionsListMember_iamRoleArn = (BackupSelectionsListMember -> Maybe Text)
-> (BackupSelectionsListMember
    -> Maybe Text -> BackupSelectionsListMember)
-> Lens
     BackupSelectionsListMember
     BackupSelectionsListMember
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackupSelectionsListMember' {Maybe Text
iamRoleArn :: Maybe Text
$sel:iamRoleArn:BackupSelectionsListMember' :: BackupSelectionsListMember -> Maybe Text
iamRoleArn} -> Maybe Text
iamRoleArn) (\s :: BackupSelectionsListMember
s@BackupSelectionsListMember' {} Maybe Text
a -> BackupSelectionsListMember
s {$sel:iamRoleArn:BackupSelectionsListMember' :: Maybe Text
iamRoleArn = Maybe Text
a} :: BackupSelectionsListMember)

-- | The display name of a resource selection document.
backupSelectionsListMember_selectionName :: Lens.Lens' BackupSelectionsListMember (Prelude.Maybe Prelude.Text)
backupSelectionsListMember_selectionName :: (Maybe Text -> f (Maybe Text))
-> BackupSelectionsListMember -> f BackupSelectionsListMember
backupSelectionsListMember_selectionName = (BackupSelectionsListMember -> Maybe Text)
-> (BackupSelectionsListMember
    -> Maybe Text -> BackupSelectionsListMember)
-> Lens
     BackupSelectionsListMember
     BackupSelectionsListMember
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackupSelectionsListMember' {Maybe Text
selectionName :: Maybe Text
$sel:selectionName:BackupSelectionsListMember' :: BackupSelectionsListMember -> Maybe Text
selectionName} -> Maybe Text
selectionName) (\s :: BackupSelectionsListMember
s@BackupSelectionsListMember' {} Maybe Text
a -> BackupSelectionsListMember
s {$sel:selectionName:BackupSelectionsListMember' :: Maybe Text
selectionName = Maybe Text
a} :: BackupSelectionsListMember)

-- | Uniquely identifies a request to assign a set of resources to a backup
-- plan.
backupSelectionsListMember_selectionId :: Lens.Lens' BackupSelectionsListMember (Prelude.Maybe Prelude.Text)
backupSelectionsListMember_selectionId :: (Maybe Text -> f (Maybe Text))
-> BackupSelectionsListMember -> f BackupSelectionsListMember
backupSelectionsListMember_selectionId = (BackupSelectionsListMember -> Maybe Text)
-> (BackupSelectionsListMember
    -> Maybe Text -> BackupSelectionsListMember)
-> Lens
     BackupSelectionsListMember
     BackupSelectionsListMember
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackupSelectionsListMember' {Maybe Text
selectionId :: Maybe Text
$sel:selectionId:BackupSelectionsListMember' :: BackupSelectionsListMember -> Maybe Text
selectionId} -> Maybe Text
selectionId) (\s :: BackupSelectionsListMember
s@BackupSelectionsListMember' {} Maybe Text
a -> BackupSelectionsListMember
s {$sel:selectionId:BackupSelectionsListMember' :: Maybe Text
selectionId = Maybe Text
a} :: BackupSelectionsListMember)

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

-- | A unique string that identifies the request and allows failed requests
-- to be retried without the risk of running the operation twice.
backupSelectionsListMember_creatorRequestId :: Lens.Lens' BackupSelectionsListMember (Prelude.Maybe Prelude.Text)
backupSelectionsListMember_creatorRequestId :: (Maybe Text -> f (Maybe Text))
-> BackupSelectionsListMember -> f BackupSelectionsListMember
backupSelectionsListMember_creatorRequestId = (BackupSelectionsListMember -> Maybe Text)
-> (BackupSelectionsListMember
    -> Maybe Text -> BackupSelectionsListMember)
-> Lens
     BackupSelectionsListMember
     BackupSelectionsListMember
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackupSelectionsListMember' {Maybe Text
creatorRequestId :: Maybe Text
$sel:creatorRequestId:BackupSelectionsListMember' :: BackupSelectionsListMember -> Maybe Text
creatorRequestId} -> Maybe Text
creatorRequestId) (\s :: BackupSelectionsListMember
s@BackupSelectionsListMember' {} Maybe Text
a -> BackupSelectionsListMember
s {$sel:creatorRequestId:BackupSelectionsListMember' :: Maybe Text
creatorRequestId = Maybe Text
a} :: BackupSelectionsListMember)

-- | 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.
backupSelectionsListMember_creationDate :: Lens.Lens' BackupSelectionsListMember (Prelude.Maybe Prelude.UTCTime)
backupSelectionsListMember_creationDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> BackupSelectionsListMember -> f BackupSelectionsListMember
backupSelectionsListMember_creationDate = (BackupSelectionsListMember -> Maybe POSIX)
-> (BackupSelectionsListMember
    -> Maybe POSIX -> BackupSelectionsListMember)
-> Lens
     BackupSelectionsListMember
     BackupSelectionsListMember
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackupSelectionsListMember' {Maybe POSIX
creationDate :: Maybe POSIX
$sel:creationDate:BackupSelectionsListMember' :: BackupSelectionsListMember -> Maybe POSIX
creationDate} -> Maybe POSIX
creationDate) (\s :: BackupSelectionsListMember
s@BackupSelectionsListMember' {} Maybe POSIX
a -> BackupSelectionsListMember
s {$sel:creationDate:BackupSelectionsListMember' :: Maybe POSIX
creationDate = Maybe POSIX
a} :: BackupSelectionsListMember) ((Maybe POSIX -> f (Maybe POSIX))
 -> BackupSelectionsListMember -> f BackupSelectionsListMember)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> BackupSelectionsListMember
-> f BackupSelectionsListMember
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

instance Core.FromJSON BackupSelectionsListMember where
  parseJSON :: Value -> Parser BackupSelectionsListMember
parseJSON =
    String
-> (Object -> Parser BackupSelectionsListMember)
-> Value
-> Parser BackupSelectionsListMember
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"BackupSelectionsListMember"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> BackupSelectionsListMember
BackupSelectionsListMember'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> BackupSelectionsListMember)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> BackupSelectionsListMember)
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
"IamRoleArn")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> BackupSelectionsListMember)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> BackupSelectionsListMember)
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
"SelectionName")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> BackupSelectionsListMember)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe POSIX -> BackupSelectionsListMember)
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
"SelectionId")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe POSIX -> BackupSelectionsListMember)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe POSIX -> BackupSelectionsListMember)
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
"BackupPlanId")
            Parser (Maybe Text -> Maybe POSIX -> BackupSelectionsListMember)
-> Parser (Maybe Text)
-> Parser (Maybe POSIX -> BackupSelectionsListMember)
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
"CreatorRequestId")
            Parser (Maybe POSIX -> BackupSelectionsListMember)
-> Parser (Maybe POSIX) -> Parser BackupSelectionsListMember
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreationDate")
      )

instance Prelude.Hashable BackupSelectionsListMember

instance Prelude.NFData BackupSelectionsListMember