{-# 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.EC2.Types.SnapshotRecycleBinInfo
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.EC2.Types.SnapshotRecycleBinInfo where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Internal
import qualified Amazonka.Prelude as Prelude

-- | Information about a snapshot that is currently in the Recycle Bin.
--
-- /See:/ 'newSnapshotRecycleBinInfo' smart constructor.
data SnapshotRecycleBinInfo = SnapshotRecycleBinInfo'
  { -- | The description for the snapshot.
    SnapshotRecycleBinInfo -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The date and time when the snaphsot entered the Recycle Bin.
    SnapshotRecycleBinInfo -> Maybe ISO8601
recycleBinEnterTime :: Prelude.Maybe Data.ISO8601,
    -- | The date and time when the snapshot is to be permanently deleted from
    -- the Recycle Bin.
    SnapshotRecycleBinInfo -> Maybe ISO8601
recycleBinExitTime :: Prelude.Maybe Data.ISO8601,
    -- | The ID of the snapshot.
    SnapshotRecycleBinInfo -> Maybe Text
snapshotId :: Prelude.Maybe Prelude.Text,
    -- | The ID of the volume from which the snapshot was created.
    SnapshotRecycleBinInfo -> Maybe Text
volumeId :: Prelude.Maybe Prelude.Text
  }
  deriving (SnapshotRecycleBinInfo -> SnapshotRecycleBinInfo -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SnapshotRecycleBinInfo -> SnapshotRecycleBinInfo -> Bool
$c/= :: SnapshotRecycleBinInfo -> SnapshotRecycleBinInfo -> Bool
== :: SnapshotRecycleBinInfo -> SnapshotRecycleBinInfo -> Bool
$c== :: SnapshotRecycleBinInfo -> SnapshotRecycleBinInfo -> Bool
Prelude.Eq, ReadPrec [SnapshotRecycleBinInfo]
ReadPrec SnapshotRecycleBinInfo
Int -> ReadS SnapshotRecycleBinInfo
ReadS [SnapshotRecycleBinInfo]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SnapshotRecycleBinInfo]
$creadListPrec :: ReadPrec [SnapshotRecycleBinInfo]
readPrec :: ReadPrec SnapshotRecycleBinInfo
$creadPrec :: ReadPrec SnapshotRecycleBinInfo
readList :: ReadS [SnapshotRecycleBinInfo]
$creadList :: ReadS [SnapshotRecycleBinInfo]
readsPrec :: Int -> ReadS SnapshotRecycleBinInfo
$creadsPrec :: Int -> ReadS SnapshotRecycleBinInfo
Prelude.Read, Int -> SnapshotRecycleBinInfo -> ShowS
[SnapshotRecycleBinInfo] -> ShowS
SnapshotRecycleBinInfo -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SnapshotRecycleBinInfo] -> ShowS
$cshowList :: [SnapshotRecycleBinInfo] -> ShowS
show :: SnapshotRecycleBinInfo -> String
$cshow :: SnapshotRecycleBinInfo -> String
showsPrec :: Int -> SnapshotRecycleBinInfo -> ShowS
$cshowsPrec :: Int -> SnapshotRecycleBinInfo -> ShowS
Prelude.Show, forall x. Rep SnapshotRecycleBinInfo x -> SnapshotRecycleBinInfo
forall x. SnapshotRecycleBinInfo -> Rep SnapshotRecycleBinInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SnapshotRecycleBinInfo x -> SnapshotRecycleBinInfo
$cfrom :: forall x. SnapshotRecycleBinInfo -> Rep SnapshotRecycleBinInfo x
Prelude.Generic)

-- |
-- Create a value of 'SnapshotRecycleBinInfo' 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:
--
-- 'description', 'snapshotRecycleBinInfo_description' - The description for the snapshot.
--
-- 'recycleBinEnterTime', 'snapshotRecycleBinInfo_recycleBinEnterTime' - The date and time when the snaphsot entered the Recycle Bin.
--
-- 'recycleBinExitTime', 'snapshotRecycleBinInfo_recycleBinExitTime' - The date and time when the snapshot is to be permanently deleted from
-- the Recycle Bin.
--
-- 'snapshotId', 'snapshotRecycleBinInfo_snapshotId' - The ID of the snapshot.
--
-- 'volumeId', 'snapshotRecycleBinInfo_volumeId' - The ID of the volume from which the snapshot was created.
newSnapshotRecycleBinInfo ::
  SnapshotRecycleBinInfo
newSnapshotRecycleBinInfo :: SnapshotRecycleBinInfo
newSnapshotRecycleBinInfo =
  SnapshotRecycleBinInfo'
    { $sel:description:SnapshotRecycleBinInfo' :: Maybe Text
description =
        forall a. Maybe a
Prelude.Nothing,
      $sel:recycleBinEnterTime:SnapshotRecycleBinInfo' :: Maybe ISO8601
recycleBinEnterTime = forall a. Maybe a
Prelude.Nothing,
      $sel:recycleBinExitTime:SnapshotRecycleBinInfo' :: Maybe ISO8601
recycleBinExitTime = forall a. Maybe a
Prelude.Nothing,
      $sel:snapshotId:SnapshotRecycleBinInfo' :: Maybe Text
snapshotId = forall a. Maybe a
Prelude.Nothing,
      $sel:volumeId:SnapshotRecycleBinInfo' :: Maybe Text
volumeId = forall a. Maybe a
Prelude.Nothing
    }

-- | The description for the snapshot.
snapshotRecycleBinInfo_description :: Lens.Lens' SnapshotRecycleBinInfo (Prelude.Maybe Prelude.Text)
snapshotRecycleBinInfo_description :: Lens' SnapshotRecycleBinInfo (Maybe Text)
snapshotRecycleBinInfo_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SnapshotRecycleBinInfo' {Maybe Text
description :: Maybe Text
$sel:description:SnapshotRecycleBinInfo' :: SnapshotRecycleBinInfo -> Maybe Text
description} -> Maybe Text
description) (\s :: SnapshotRecycleBinInfo
s@SnapshotRecycleBinInfo' {} Maybe Text
a -> SnapshotRecycleBinInfo
s {$sel:description:SnapshotRecycleBinInfo' :: Maybe Text
description = Maybe Text
a} :: SnapshotRecycleBinInfo)

-- | The date and time when the snaphsot entered the Recycle Bin.
snapshotRecycleBinInfo_recycleBinEnterTime :: Lens.Lens' SnapshotRecycleBinInfo (Prelude.Maybe Prelude.UTCTime)
snapshotRecycleBinInfo_recycleBinEnterTime :: Lens' SnapshotRecycleBinInfo (Maybe UTCTime)
snapshotRecycleBinInfo_recycleBinEnterTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SnapshotRecycleBinInfo' {Maybe ISO8601
recycleBinEnterTime :: Maybe ISO8601
$sel:recycleBinEnterTime:SnapshotRecycleBinInfo' :: SnapshotRecycleBinInfo -> Maybe ISO8601
recycleBinEnterTime} -> Maybe ISO8601
recycleBinEnterTime) (\s :: SnapshotRecycleBinInfo
s@SnapshotRecycleBinInfo' {} Maybe ISO8601
a -> SnapshotRecycleBinInfo
s {$sel:recycleBinEnterTime:SnapshotRecycleBinInfo' :: Maybe ISO8601
recycleBinEnterTime = Maybe ISO8601
a} :: SnapshotRecycleBinInfo) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The date and time when the snapshot is to be permanently deleted from
-- the Recycle Bin.
snapshotRecycleBinInfo_recycleBinExitTime :: Lens.Lens' SnapshotRecycleBinInfo (Prelude.Maybe Prelude.UTCTime)
snapshotRecycleBinInfo_recycleBinExitTime :: Lens' SnapshotRecycleBinInfo (Maybe UTCTime)
snapshotRecycleBinInfo_recycleBinExitTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SnapshotRecycleBinInfo' {Maybe ISO8601
recycleBinExitTime :: Maybe ISO8601
$sel:recycleBinExitTime:SnapshotRecycleBinInfo' :: SnapshotRecycleBinInfo -> Maybe ISO8601
recycleBinExitTime} -> Maybe ISO8601
recycleBinExitTime) (\s :: SnapshotRecycleBinInfo
s@SnapshotRecycleBinInfo' {} Maybe ISO8601
a -> SnapshotRecycleBinInfo
s {$sel:recycleBinExitTime:SnapshotRecycleBinInfo' :: Maybe ISO8601
recycleBinExitTime = Maybe ISO8601
a} :: SnapshotRecycleBinInfo) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The ID of the snapshot.
snapshotRecycleBinInfo_snapshotId :: Lens.Lens' SnapshotRecycleBinInfo (Prelude.Maybe Prelude.Text)
snapshotRecycleBinInfo_snapshotId :: Lens' SnapshotRecycleBinInfo (Maybe Text)
snapshotRecycleBinInfo_snapshotId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SnapshotRecycleBinInfo' {Maybe Text
snapshotId :: Maybe Text
$sel:snapshotId:SnapshotRecycleBinInfo' :: SnapshotRecycleBinInfo -> Maybe Text
snapshotId} -> Maybe Text
snapshotId) (\s :: SnapshotRecycleBinInfo
s@SnapshotRecycleBinInfo' {} Maybe Text
a -> SnapshotRecycleBinInfo
s {$sel:snapshotId:SnapshotRecycleBinInfo' :: Maybe Text
snapshotId = Maybe Text
a} :: SnapshotRecycleBinInfo)

-- | The ID of the volume from which the snapshot was created.
snapshotRecycleBinInfo_volumeId :: Lens.Lens' SnapshotRecycleBinInfo (Prelude.Maybe Prelude.Text)
snapshotRecycleBinInfo_volumeId :: Lens' SnapshotRecycleBinInfo (Maybe Text)
snapshotRecycleBinInfo_volumeId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SnapshotRecycleBinInfo' {Maybe Text
volumeId :: Maybe Text
$sel:volumeId:SnapshotRecycleBinInfo' :: SnapshotRecycleBinInfo -> Maybe Text
volumeId} -> Maybe Text
volumeId) (\s :: SnapshotRecycleBinInfo
s@SnapshotRecycleBinInfo' {} Maybe Text
a -> SnapshotRecycleBinInfo
s {$sel:volumeId:SnapshotRecycleBinInfo' :: Maybe Text
volumeId = Maybe Text
a} :: SnapshotRecycleBinInfo)

instance Data.FromXML SnapshotRecycleBinInfo where
  parseXML :: [Node] -> Either String SnapshotRecycleBinInfo
parseXML [Node]
x =
    Maybe Text
-> Maybe ISO8601
-> Maybe ISO8601
-> Maybe Text
-> Maybe Text
-> SnapshotRecycleBinInfo
SnapshotRecycleBinInfo'
      forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"description")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"recycleBinEnterTime")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"recycleBinExitTime")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"snapshotId")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"volumeId")

instance Prelude.Hashable SnapshotRecycleBinInfo where
  hashWithSalt :: Int -> SnapshotRecycleBinInfo -> Int
hashWithSalt Int
_salt SnapshotRecycleBinInfo' {Maybe Text
Maybe ISO8601
volumeId :: Maybe Text
snapshotId :: Maybe Text
recycleBinExitTime :: Maybe ISO8601
recycleBinEnterTime :: Maybe ISO8601
description :: Maybe Text
$sel:volumeId:SnapshotRecycleBinInfo' :: SnapshotRecycleBinInfo -> Maybe Text
$sel:snapshotId:SnapshotRecycleBinInfo' :: SnapshotRecycleBinInfo -> Maybe Text
$sel:recycleBinExitTime:SnapshotRecycleBinInfo' :: SnapshotRecycleBinInfo -> Maybe ISO8601
$sel:recycleBinEnterTime:SnapshotRecycleBinInfo' :: SnapshotRecycleBinInfo -> Maybe ISO8601
$sel:description:SnapshotRecycleBinInfo' :: SnapshotRecycleBinInfo -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
recycleBinEnterTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
recycleBinExitTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
snapshotId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
volumeId

instance Prelude.NFData SnapshotRecycleBinInfo where
  rnf :: SnapshotRecycleBinInfo -> ()
rnf SnapshotRecycleBinInfo' {Maybe Text
Maybe ISO8601
volumeId :: Maybe Text
snapshotId :: Maybe Text
recycleBinExitTime :: Maybe ISO8601
recycleBinEnterTime :: Maybe ISO8601
description :: Maybe Text
$sel:volumeId:SnapshotRecycleBinInfo' :: SnapshotRecycleBinInfo -> Maybe Text
$sel:snapshotId:SnapshotRecycleBinInfo' :: SnapshotRecycleBinInfo -> Maybe Text
$sel:recycleBinExitTime:SnapshotRecycleBinInfo' :: SnapshotRecycleBinInfo -> Maybe ISO8601
$sel:recycleBinEnterTime:SnapshotRecycleBinInfo' :: SnapshotRecycleBinInfo -> Maybe ISO8601
$sel:description:SnapshotRecycleBinInfo' :: SnapshotRecycleBinInfo -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
recycleBinEnterTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
recycleBinExitTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
snapshotId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
volumeId