{-# 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.Snapshot
-- 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.Snapshot 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 Amazonka.EC2.Types.SnapshotState
import Amazonka.EC2.Types.StorageTier
import Amazonka.EC2.Types.Tag
import qualified Amazonka.Prelude as Prelude

-- | Describes a snapshot.
--
-- /See:/ 'newSnapshot' smart constructor.
data Snapshot = Snapshot'
  { -- | The data encryption key identifier for the snapshot. This value is a
    -- unique identifier that corresponds to the data encryption key that was
    -- used to encrypt the original volume or snapshot copy. Because data
    -- encryption keys are inherited by volumes created from snapshots, and
    -- vice versa, if snapshots share the same data encryption key identifier,
    -- then they belong to the same volume\/snapshot lineage. This parameter is
    -- only returned by DescribeSnapshots.
    Snapshot -> Maybe Text
dataEncryptionKeyId :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the Key Management Service (KMS) KMS
    -- key that was used to protect the volume encryption key for the parent
    -- volume.
    Snapshot -> Maybe Text
kmsKeyId :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the Outpost on which the snapshot is stored. For more
    -- information, see
    -- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/snapshots-outposts.html Amazon EBS local snapshots on Outposts>
    -- in the /Amazon Elastic Compute Cloud User Guide/.
    Snapshot -> Maybe Text
outpostArn :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Web Services owner alias, from an Amazon-maintained list
    -- (@amazon@). This is not the user-configured Amazon Web Services account
    -- alias set using the IAM console.
    Snapshot -> Maybe Text
ownerAlias :: Prelude.Maybe Prelude.Text,
    -- | Only for archived snapshots that are temporarily restored. Indicates the
    -- date and time when a temporarily restored snapshot will be automatically
    -- re-archived.
    Snapshot -> Maybe ISO8601
restoreExpiryTime :: Prelude.Maybe Data.ISO8601,
    -- | Encrypted Amazon EBS snapshots are copied asynchronously. If a snapshot
    -- copy operation fails (for example, if the proper Key Management Service
    -- (KMS) permissions are not obtained) this field displays error state
    -- details to help you diagnose why the error occurred. This parameter is
    -- only returned by DescribeSnapshots.
    Snapshot -> Maybe Text
stateMessage :: Prelude.Maybe Prelude.Text,
    -- | The storage tier in which the snapshot is stored. @standard@ indicates
    -- that the snapshot is stored in the standard snapshot storage tier and
    -- that it is ready for use. @archive@ indicates that the snapshot is
    -- currently archived and that it must be restored before it can be used.
    Snapshot -> Maybe StorageTier
storageTier :: Prelude.Maybe StorageTier,
    -- | Any tags assigned to the snapshot.
    Snapshot -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The ID of the snapshot. Each snapshot receives a unique identifier when
    -- it is created.
    Snapshot -> Text
snapshotId :: Prelude.Text,
    -- | The ID of the Amazon Web Services account that owns the EBS snapshot.
    Snapshot -> Text
ownerId :: Prelude.Text,
    -- | The ID of the volume that was used to create the snapshot. Snapshots
    -- created by the CopySnapshot action have an arbitrary volume ID that
    -- should not be used for any purpose.
    Snapshot -> Text
volumeId :: Prelude.Text,
    -- | The size of the volume, in GiB.
    Snapshot -> Int
volumeSize :: Prelude.Int,
    -- | The description for the snapshot.
    Snapshot -> Text
description :: Prelude.Text,
    -- | The time stamp when the snapshot was initiated.
    Snapshot -> ISO8601
startTime :: Data.ISO8601,
    -- | The progress of the snapshot, as a percentage.
    Snapshot -> Text
progress :: Prelude.Text,
    -- | The snapshot state.
    Snapshot -> SnapshotState
state :: SnapshotState,
    -- | Indicates whether the snapshot is encrypted.
    Snapshot -> Bool
encrypted :: Prelude.Bool
  }
  deriving (Snapshot -> Snapshot -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Snapshot -> Snapshot -> Bool
$c/= :: Snapshot -> Snapshot -> Bool
== :: Snapshot -> Snapshot -> Bool
$c== :: Snapshot -> Snapshot -> Bool
Prelude.Eq, ReadPrec [Snapshot]
ReadPrec Snapshot
Int -> ReadS Snapshot
ReadS [Snapshot]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Snapshot]
$creadListPrec :: ReadPrec [Snapshot]
readPrec :: ReadPrec Snapshot
$creadPrec :: ReadPrec Snapshot
readList :: ReadS [Snapshot]
$creadList :: ReadS [Snapshot]
readsPrec :: Int -> ReadS Snapshot
$creadsPrec :: Int -> ReadS Snapshot
Prelude.Read, Int -> Snapshot -> ShowS
[Snapshot] -> ShowS
Snapshot -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Snapshot] -> ShowS
$cshowList :: [Snapshot] -> ShowS
show :: Snapshot -> String
$cshow :: Snapshot -> String
showsPrec :: Int -> Snapshot -> ShowS
$cshowsPrec :: Int -> Snapshot -> ShowS
Prelude.Show, forall x. Rep Snapshot x -> Snapshot
forall x. Snapshot -> Rep Snapshot x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Snapshot x -> Snapshot
$cfrom :: forall x. Snapshot -> Rep Snapshot x
Prelude.Generic)

-- |
-- Create a value of 'Snapshot' 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:
--
-- 'dataEncryptionKeyId', 'snapshot_dataEncryptionKeyId' - The data encryption key identifier for the snapshot. This value is a
-- unique identifier that corresponds to the data encryption key that was
-- used to encrypt the original volume or snapshot copy. Because data
-- encryption keys are inherited by volumes created from snapshots, and
-- vice versa, if snapshots share the same data encryption key identifier,
-- then they belong to the same volume\/snapshot lineage. This parameter is
-- only returned by DescribeSnapshots.
--
-- 'kmsKeyId', 'snapshot_kmsKeyId' - The Amazon Resource Name (ARN) of the Key Management Service (KMS) KMS
-- key that was used to protect the volume encryption key for the parent
-- volume.
--
-- 'outpostArn', 'snapshot_outpostArn' - The ARN of the Outpost on which the snapshot is stored. For more
-- information, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/snapshots-outposts.html Amazon EBS local snapshots on Outposts>
-- in the /Amazon Elastic Compute Cloud User Guide/.
--
-- 'ownerAlias', 'snapshot_ownerAlias' - The Amazon Web Services owner alias, from an Amazon-maintained list
-- (@amazon@). This is not the user-configured Amazon Web Services account
-- alias set using the IAM console.
--
-- 'restoreExpiryTime', 'snapshot_restoreExpiryTime' - Only for archived snapshots that are temporarily restored. Indicates the
-- date and time when a temporarily restored snapshot will be automatically
-- re-archived.
--
-- 'stateMessage', 'snapshot_stateMessage' - Encrypted Amazon EBS snapshots are copied asynchronously. If a snapshot
-- copy operation fails (for example, if the proper Key Management Service
-- (KMS) permissions are not obtained) this field displays error state
-- details to help you diagnose why the error occurred. This parameter is
-- only returned by DescribeSnapshots.
--
-- 'storageTier', 'snapshot_storageTier' - The storage tier in which the snapshot is stored. @standard@ indicates
-- that the snapshot is stored in the standard snapshot storage tier and
-- that it is ready for use. @archive@ indicates that the snapshot is
-- currently archived and that it must be restored before it can be used.
--
-- 'tags', 'snapshot_tags' - Any tags assigned to the snapshot.
--
-- 'snapshotId', 'snapshot_snapshotId' - The ID of the snapshot. Each snapshot receives a unique identifier when
-- it is created.
--
-- 'ownerId', 'snapshot_ownerId' - The ID of the Amazon Web Services account that owns the EBS snapshot.
--
-- 'volumeId', 'snapshot_volumeId' - The ID of the volume that was used to create the snapshot. Snapshots
-- created by the CopySnapshot action have an arbitrary volume ID that
-- should not be used for any purpose.
--
-- 'volumeSize', 'snapshot_volumeSize' - The size of the volume, in GiB.
--
-- 'description', 'snapshot_description' - The description for the snapshot.
--
-- 'startTime', 'snapshot_startTime' - The time stamp when the snapshot was initiated.
--
-- 'progress', 'snapshot_progress' - The progress of the snapshot, as a percentage.
--
-- 'state', 'snapshot_state' - The snapshot state.
--
-- 'encrypted', 'snapshot_encrypted' - Indicates whether the snapshot is encrypted.
newSnapshot ::
  -- | 'snapshotId'
  Prelude.Text ->
  -- | 'ownerId'
  Prelude.Text ->
  -- | 'volumeId'
  Prelude.Text ->
  -- | 'volumeSize'
  Prelude.Int ->
  -- | 'description'
  Prelude.Text ->
  -- | 'startTime'
  Prelude.UTCTime ->
  -- | 'progress'
  Prelude.Text ->
  -- | 'state'
  SnapshotState ->
  -- | 'encrypted'
  Prelude.Bool ->
  Snapshot
newSnapshot :: Text
-> Text
-> Text
-> Int
-> Text
-> UTCTime
-> Text
-> SnapshotState
-> Bool
-> Snapshot
newSnapshot
  Text
pSnapshotId_
  Text
pOwnerId_
  Text
pVolumeId_
  Int
pVolumeSize_
  Text
pDescription_
  UTCTime
pStartTime_
  Text
pProgress_
  SnapshotState
pState_
  Bool
pEncrypted_ =
    Snapshot'
      { $sel:dataEncryptionKeyId:Snapshot' :: Maybe Text
dataEncryptionKeyId = forall a. Maybe a
Prelude.Nothing,
        $sel:kmsKeyId:Snapshot' :: Maybe Text
kmsKeyId = forall a. Maybe a
Prelude.Nothing,
        $sel:outpostArn:Snapshot' :: Maybe Text
outpostArn = forall a. Maybe a
Prelude.Nothing,
        $sel:ownerAlias:Snapshot' :: Maybe Text
ownerAlias = forall a. Maybe a
Prelude.Nothing,
        $sel:restoreExpiryTime:Snapshot' :: Maybe ISO8601
restoreExpiryTime = forall a. Maybe a
Prelude.Nothing,
        $sel:stateMessage:Snapshot' :: Maybe Text
stateMessage = forall a. Maybe a
Prelude.Nothing,
        $sel:storageTier:Snapshot' :: Maybe StorageTier
storageTier = forall a. Maybe a
Prelude.Nothing,
        $sel:tags:Snapshot' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing,
        $sel:snapshotId:Snapshot' :: Text
snapshotId = Text
pSnapshotId_,
        $sel:ownerId:Snapshot' :: Text
ownerId = Text
pOwnerId_,
        $sel:volumeId:Snapshot' :: Text
volumeId = Text
pVolumeId_,
        $sel:volumeSize:Snapshot' :: Int
volumeSize = Int
pVolumeSize_,
        $sel:description:Snapshot' :: Text
description = Text
pDescription_,
        $sel:startTime:Snapshot' :: ISO8601
startTime = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pStartTime_,
        $sel:progress:Snapshot' :: Text
progress = Text
pProgress_,
        $sel:state:Snapshot' :: SnapshotState
state = SnapshotState
pState_,
        $sel:encrypted:Snapshot' :: Bool
encrypted = Bool
pEncrypted_
      }

-- | The data encryption key identifier for the snapshot. This value is a
-- unique identifier that corresponds to the data encryption key that was
-- used to encrypt the original volume or snapshot copy. Because data
-- encryption keys are inherited by volumes created from snapshots, and
-- vice versa, if snapshots share the same data encryption key identifier,
-- then they belong to the same volume\/snapshot lineage. This parameter is
-- only returned by DescribeSnapshots.
snapshot_dataEncryptionKeyId :: Lens.Lens' Snapshot (Prelude.Maybe Prelude.Text)
snapshot_dataEncryptionKeyId :: Lens' Snapshot (Maybe Text)
snapshot_dataEncryptionKeyId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Snapshot' {Maybe Text
dataEncryptionKeyId :: Maybe Text
$sel:dataEncryptionKeyId:Snapshot' :: Snapshot -> Maybe Text
dataEncryptionKeyId} -> Maybe Text
dataEncryptionKeyId) (\s :: Snapshot
s@Snapshot' {} Maybe Text
a -> Snapshot
s {$sel:dataEncryptionKeyId:Snapshot' :: Maybe Text
dataEncryptionKeyId = Maybe Text
a} :: Snapshot)

-- | The Amazon Resource Name (ARN) of the Key Management Service (KMS) KMS
-- key that was used to protect the volume encryption key for the parent
-- volume.
snapshot_kmsKeyId :: Lens.Lens' Snapshot (Prelude.Maybe Prelude.Text)
snapshot_kmsKeyId :: Lens' Snapshot (Maybe Text)
snapshot_kmsKeyId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Snapshot' {Maybe Text
kmsKeyId :: Maybe Text
$sel:kmsKeyId:Snapshot' :: Snapshot -> Maybe Text
kmsKeyId} -> Maybe Text
kmsKeyId) (\s :: Snapshot
s@Snapshot' {} Maybe Text
a -> Snapshot
s {$sel:kmsKeyId:Snapshot' :: Maybe Text
kmsKeyId = Maybe Text
a} :: Snapshot)

-- | The ARN of the Outpost on which the snapshot is stored. For more
-- information, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/snapshots-outposts.html Amazon EBS local snapshots on Outposts>
-- in the /Amazon Elastic Compute Cloud User Guide/.
snapshot_outpostArn :: Lens.Lens' Snapshot (Prelude.Maybe Prelude.Text)
snapshot_outpostArn :: Lens' Snapshot (Maybe Text)
snapshot_outpostArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Snapshot' {Maybe Text
outpostArn :: Maybe Text
$sel:outpostArn:Snapshot' :: Snapshot -> Maybe Text
outpostArn} -> Maybe Text
outpostArn) (\s :: Snapshot
s@Snapshot' {} Maybe Text
a -> Snapshot
s {$sel:outpostArn:Snapshot' :: Maybe Text
outpostArn = Maybe Text
a} :: Snapshot)

-- | The Amazon Web Services owner alias, from an Amazon-maintained list
-- (@amazon@). This is not the user-configured Amazon Web Services account
-- alias set using the IAM console.
snapshot_ownerAlias :: Lens.Lens' Snapshot (Prelude.Maybe Prelude.Text)
snapshot_ownerAlias :: Lens' Snapshot (Maybe Text)
snapshot_ownerAlias = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Snapshot' {Maybe Text
ownerAlias :: Maybe Text
$sel:ownerAlias:Snapshot' :: Snapshot -> Maybe Text
ownerAlias} -> Maybe Text
ownerAlias) (\s :: Snapshot
s@Snapshot' {} Maybe Text
a -> Snapshot
s {$sel:ownerAlias:Snapshot' :: Maybe Text
ownerAlias = Maybe Text
a} :: Snapshot)

-- | Only for archived snapshots that are temporarily restored. Indicates the
-- date and time when a temporarily restored snapshot will be automatically
-- re-archived.
snapshot_restoreExpiryTime :: Lens.Lens' Snapshot (Prelude.Maybe Prelude.UTCTime)
snapshot_restoreExpiryTime :: Lens' Snapshot (Maybe UTCTime)
snapshot_restoreExpiryTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Snapshot' {Maybe ISO8601
restoreExpiryTime :: Maybe ISO8601
$sel:restoreExpiryTime:Snapshot' :: Snapshot -> Maybe ISO8601
restoreExpiryTime} -> Maybe ISO8601
restoreExpiryTime) (\s :: Snapshot
s@Snapshot' {} Maybe ISO8601
a -> Snapshot
s {$sel:restoreExpiryTime:Snapshot' :: Maybe ISO8601
restoreExpiryTime = Maybe ISO8601
a} :: Snapshot) 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

-- | Encrypted Amazon EBS snapshots are copied asynchronously. If a snapshot
-- copy operation fails (for example, if the proper Key Management Service
-- (KMS) permissions are not obtained) this field displays error state
-- details to help you diagnose why the error occurred. This parameter is
-- only returned by DescribeSnapshots.
snapshot_stateMessage :: Lens.Lens' Snapshot (Prelude.Maybe Prelude.Text)
snapshot_stateMessage :: Lens' Snapshot (Maybe Text)
snapshot_stateMessage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Snapshot' {Maybe Text
stateMessage :: Maybe Text
$sel:stateMessage:Snapshot' :: Snapshot -> Maybe Text
stateMessage} -> Maybe Text
stateMessage) (\s :: Snapshot
s@Snapshot' {} Maybe Text
a -> Snapshot
s {$sel:stateMessage:Snapshot' :: Maybe Text
stateMessage = Maybe Text
a} :: Snapshot)

-- | The storage tier in which the snapshot is stored. @standard@ indicates
-- that the snapshot is stored in the standard snapshot storage tier and
-- that it is ready for use. @archive@ indicates that the snapshot is
-- currently archived and that it must be restored before it can be used.
snapshot_storageTier :: Lens.Lens' Snapshot (Prelude.Maybe StorageTier)
snapshot_storageTier :: Lens' Snapshot (Maybe StorageTier)
snapshot_storageTier = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Snapshot' {Maybe StorageTier
storageTier :: Maybe StorageTier
$sel:storageTier:Snapshot' :: Snapshot -> Maybe StorageTier
storageTier} -> Maybe StorageTier
storageTier) (\s :: Snapshot
s@Snapshot' {} Maybe StorageTier
a -> Snapshot
s {$sel:storageTier:Snapshot' :: Maybe StorageTier
storageTier = Maybe StorageTier
a} :: Snapshot)

-- | Any tags assigned to the snapshot.
snapshot_tags :: Lens.Lens' Snapshot (Prelude.Maybe [Tag])
snapshot_tags :: Lens' Snapshot (Maybe [Tag])
snapshot_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Snapshot' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:Snapshot' :: Snapshot -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: Snapshot
s@Snapshot' {} Maybe [Tag]
a -> Snapshot
s {$sel:tags:Snapshot' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: Snapshot) 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 s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The ID of the snapshot. Each snapshot receives a unique identifier when
-- it is created.
snapshot_snapshotId :: Lens.Lens' Snapshot Prelude.Text
snapshot_snapshotId :: Lens' Snapshot Text
snapshot_snapshotId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Snapshot' {Text
snapshotId :: Text
$sel:snapshotId:Snapshot' :: Snapshot -> Text
snapshotId} -> Text
snapshotId) (\s :: Snapshot
s@Snapshot' {} Text
a -> Snapshot
s {$sel:snapshotId:Snapshot' :: Text
snapshotId = Text
a} :: Snapshot)

-- | The ID of the Amazon Web Services account that owns the EBS snapshot.
snapshot_ownerId :: Lens.Lens' Snapshot Prelude.Text
snapshot_ownerId :: Lens' Snapshot Text
snapshot_ownerId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Snapshot' {Text
ownerId :: Text
$sel:ownerId:Snapshot' :: Snapshot -> Text
ownerId} -> Text
ownerId) (\s :: Snapshot
s@Snapshot' {} Text
a -> Snapshot
s {$sel:ownerId:Snapshot' :: Text
ownerId = Text
a} :: Snapshot)

-- | The ID of the volume that was used to create the snapshot. Snapshots
-- created by the CopySnapshot action have an arbitrary volume ID that
-- should not be used for any purpose.
snapshot_volumeId :: Lens.Lens' Snapshot Prelude.Text
snapshot_volumeId :: Lens' Snapshot Text
snapshot_volumeId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Snapshot' {Text
volumeId :: Text
$sel:volumeId:Snapshot' :: Snapshot -> Text
volumeId} -> Text
volumeId) (\s :: Snapshot
s@Snapshot' {} Text
a -> Snapshot
s {$sel:volumeId:Snapshot' :: Text
volumeId = Text
a} :: Snapshot)

-- | The size of the volume, in GiB.
snapshot_volumeSize :: Lens.Lens' Snapshot Prelude.Int
snapshot_volumeSize :: Lens' Snapshot Int
snapshot_volumeSize = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Snapshot' {Int
volumeSize :: Int
$sel:volumeSize:Snapshot' :: Snapshot -> Int
volumeSize} -> Int
volumeSize) (\s :: Snapshot
s@Snapshot' {} Int
a -> Snapshot
s {$sel:volumeSize:Snapshot' :: Int
volumeSize = Int
a} :: Snapshot)

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

-- | The time stamp when the snapshot was initiated.
snapshot_startTime :: Lens.Lens' Snapshot Prelude.UTCTime
snapshot_startTime :: Lens' Snapshot UTCTime
snapshot_startTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Snapshot' {ISO8601
startTime :: ISO8601
$sel:startTime:Snapshot' :: Snapshot -> ISO8601
startTime} -> ISO8601
startTime) (\s :: Snapshot
s@Snapshot' {} ISO8601
a -> Snapshot
s {$sel:startTime:Snapshot' :: ISO8601
startTime = ISO8601
a} :: Snapshot) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The progress of the snapshot, as a percentage.
snapshot_progress :: Lens.Lens' Snapshot Prelude.Text
snapshot_progress :: Lens' Snapshot Text
snapshot_progress = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Snapshot' {Text
progress :: Text
$sel:progress:Snapshot' :: Snapshot -> Text
progress} -> Text
progress) (\s :: Snapshot
s@Snapshot' {} Text
a -> Snapshot
s {$sel:progress:Snapshot' :: Text
progress = Text
a} :: Snapshot)

-- | The snapshot state.
snapshot_state :: Lens.Lens' Snapshot SnapshotState
snapshot_state :: Lens' Snapshot SnapshotState
snapshot_state = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Snapshot' {SnapshotState
state :: SnapshotState
$sel:state:Snapshot' :: Snapshot -> SnapshotState
state} -> SnapshotState
state) (\s :: Snapshot
s@Snapshot' {} SnapshotState
a -> Snapshot
s {$sel:state:Snapshot' :: SnapshotState
state = SnapshotState
a} :: Snapshot)

-- | Indicates whether the snapshot is encrypted.
snapshot_encrypted :: Lens.Lens' Snapshot Prelude.Bool
snapshot_encrypted :: Lens' Snapshot Bool
snapshot_encrypted = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Snapshot' {Bool
encrypted :: Bool
$sel:encrypted:Snapshot' :: Snapshot -> Bool
encrypted} -> Bool
encrypted) (\s :: Snapshot
s@Snapshot' {} Bool
a -> Snapshot
s {$sel:encrypted:Snapshot' :: Bool
encrypted = Bool
a} :: Snapshot)

instance Data.FromXML Snapshot where
  parseXML :: [Node] -> Either String Snapshot
parseXML [Node]
x =
    Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ISO8601
-> Maybe Text
-> Maybe StorageTier
-> Maybe [Tag]
-> Text
-> Text
-> Text
-> Int
-> Text
-> ISO8601
-> Text
-> SnapshotState
-> Bool
-> Snapshot
Snapshot'
      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
"dataEncryptionKeyId")
      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
"kmsKeyId")
      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
"outpostArn")
      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
"ownerAlias")
      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
"restoreExpiryTime")
      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
"statusMessage")
      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
"storageTier")
      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
"tagSet"
                      forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                      forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"item")
                  )
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String 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 a
Data..@ Text
"ownerId")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"volumeId")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"volumeSize")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String 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 a
Data..@ Text
"startTime")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"progress")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"status")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"encrypted")

instance Prelude.Hashable Snapshot where
  hashWithSalt :: Int -> Snapshot -> Int
hashWithSalt Int
_salt Snapshot' {Bool
Int
Maybe [Tag]
Maybe Text
Maybe ISO8601
Maybe StorageTier
Text
ISO8601
SnapshotState
encrypted :: Bool
state :: SnapshotState
progress :: Text
startTime :: ISO8601
description :: Text
volumeSize :: Int
volumeId :: Text
ownerId :: Text
snapshotId :: Text
tags :: Maybe [Tag]
storageTier :: Maybe StorageTier
stateMessage :: Maybe Text
restoreExpiryTime :: Maybe ISO8601
ownerAlias :: Maybe Text
outpostArn :: Maybe Text
kmsKeyId :: Maybe Text
dataEncryptionKeyId :: Maybe Text
$sel:encrypted:Snapshot' :: Snapshot -> Bool
$sel:state:Snapshot' :: Snapshot -> SnapshotState
$sel:progress:Snapshot' :: Snapshot -> Text
$sel:startTime:Snapshot' :: Snapshot -> ISO8601
$sel:description:Snapshot' :: Snapshot -> Text
$sel:volumeSize:Snapshot' :: Snapshot -> Int
$sel:volumeId:Snapshot' :: Snapshot -> Text
$sel:ownerId:Snapshot' :: Snapshot -> Text
$sel:snapshotId:Snapshot' :: Snapshot -> Text
$sel:tags:Snapshot' :: Snapshot -> Maybe [Tag]
$sel:storageTier:Snapshot' :: Snapshot -> Maybe StorageTier
$sel:stateMessage:Snapshot' :: Snapshot -> Maybe Text
$sel:restoreExpiryTime:Snapshot' :: Snapshot -> Maybe ISO8601
$sel:ownerAlias:Snapshot' :: Snapshot -> Maybe Text
$sel:outpostArn:Snapshot' :: Snapshot -> Maybe Text
$sel:kmsKeyId:Snapshot' :: Snapshot -> Maybe Text
$sel:dataEncryptionKeyId:Snapshot' :: Snapshot -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
dataEncryptionKeyId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
kmsKeyId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
outpostArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ownerAlias
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
restoreExpiryTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
stateMessage
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe StorageTier
storageTier
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
snapshotId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
ownerId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
volumeId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Int
volumeSize
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ISO8601
startTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
progress
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` SnapshotState
state
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Bool
encrypted

instance Prelude.NFData Snapshot where
  rnf :: Snapshot -> ()
rnf Snapshot' {Bool
Int
Maybe [Tag]
Maybe Text
Maybe ISO8601
Maybe StorageTier
Text
ISO8601
SnapshotState
encrypted :: Bool
state :: SnapshotState
progress :: Text
startTime :: ISO8601
description :: Text
volumeSize :: Int
volumeId :: Text
ownerId :: Text
snapshotId :: Text
tags :: Maybe [Tag]
storageTier :: Maybe StorageTier
stateMessage :: Maybe Text
restoreExpiryTime :: Maybe ISO8601
ownerAlias :: Maybe Text
outpostArn :: Maybe Text
kmsKeyId :: Maybe Text
dataEncryptionKeyId :: Maybe Text
$sel:encrypted:Snapshot' :: Snapshot -> Bool
$sel:state:Snapshot' :: Snapshot -> SnapshotState
$sel:progress:Snapshot' :: Snapshot -> Text
$sel:startTime:Snapshot' :: Snapshot -> ISO8601
$sel:description:Snapshot' :: Snapshot -> Text
$sel:volumeSize:Snapshot' :: Snapshot -> Int
$sel:volumeId:Snapshot' :: Snapshot -> Text
$sel:ownerId:Snapshot' :: Snapshot -> Text
$sel:snapshotId:Snapshot' :: Snapshot -> Text
$sel:tags:Snapshot' :: Snapshot -> Maybe [Tag]
$sel:storageTier:Snapshot' :: Snapshot -> Maybe StorageTier
$sel:stateMessage:Snapshot' :: Snapshot -> Maybe Text
$sel:restoreExpiryTime:Snapshot' :: Snapshot -> Maybe ISO8601
$sel:ownerAlias:Snapshot' :: Snapshot -> Maybe Text
$sel:outpostArn:Snapshot' :: Snapshot -> Maybe Text
$sel:kmsKeyId:Snapshot' :: Snapshot -> Maybe Text
$sel:dataEncryptionKeyId:Snapshot' :: Snapshot -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
dataEncryptionKeyId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
kmsKeyId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
outpostArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
ownerAlias
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
restoreExpiryTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
stateMessage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe StorageTier
storageTier
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
snapshotId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
ownerId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
volumeId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
volumeSize
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ISO8601
startTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
progress
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf SnapshotState
state
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Bool
encrypted