{-# 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.EC2.RestoreSnapshotFromRecycleBin
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Restores a snapshot from the Recycle Bin. For more information, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/recycle-bin-working-with-snaps.html#recycle-bin-restore-snaps Restore snapshots from the Recycle Bin>
-- in the /Amazon Elastic Compute Cloud User Guide/.
module Amazonka.EC2.RestoreSnapshotFromRecycleBin
  ( -- * Creating a Request
    RestoreSnapshotFromRecycleBin (..),
    newRestoreSnapshotFromRecycleBin,

    -- * Request Lenses
    restoreSnapshotFromRecycleBin_dryRun,
    restoreSnapshotFromRecycleBin_snapshotId,

    -- * Destructuring the Response
    RestoreSnapshotFromRecycleBinResponse (..),
    newRestoreSnapshotFromRecycleBinResponse,

    -- * Response Lenses
    restoreSnapshotFromRecycleBinResponse_description,
    restoreSnapshotFromRecycleBinResponse_encrypted,
    restoreSnapshotFromRecycleBinResponse_outpostArn,
    restoreSnapshotFromRecycleBinResponse_ownerId,
    restoreSnapshotFromRecycleBinResponse_progress,
    restoreSnapshotFromRecycleBinResponse_snapshotId,
    restoreSnapshotFromRecycleBinResponse_startTime,
    restoreSnapshotFromRecycleBinResponse_state,
    restoreSnapshotFromRecycleBinResponse_volumeId,
    restoreSnapshotFromRecycleBinResponse_volumeSize,
    restoreSnapshotFromRecycleBinResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newRestoreSnapshotFromRecycleBin' smart constructor.
data RestoreSnapshotFromRecycleBin = RestoreSnapshotFromRecycleBin'
  { -- | Checks whether you have the required permissions for the action, without
    -- actually making the request, and provides an error response. If you have
    -- the required permissions, the error response is @DryRunOperation@.
    -- Otherwise, it is @UnauthorizedOperation@.
    RestoreSnapshotFromRecycleBin -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool,
    -- | The ID of the snapshot to restore.
    RestoreSnapshotFromRecycleBin -> Text
snapshotId :: Prelude.Text
  }
  deriving (RestoreSnapshotFromRecycleBin
-> RestoreSnapshotFromRecycleBin -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RestoreSnapshotFromRecycleBin
-> RestoreSnapshotFromRecycleBin -> Bool
$c/= :: RestoreSnapshotFromRecycleBin
-> RestoreSnapshotFromRecycleBin -> Bool
== :: RestoreSnapshotFromRecycleBin
-> RestoreSnapshotFromRecycleBin -> Bool
$c== :: RestoreSnapshotFromRecycleBin
-> RestoreSnapshotFromRecycleBin -> Bool
Prelude.Eq, ReadPrec [RestoreSnapshotFromRecycleBin]
ReadPrec RestoreSnapshotFromRecycleBin
Int -> ReadS RestoreSnapshotFromRecycleBin
ReadS [RestoreSnapshotFromRecycleBin]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RestoreSnapshotFromRecycleBin]
$creadListPrec :: ReadPrec [RestoreSnapshotFromRecycleBin]
readPrec :: ReadPrec RestoreSnapshotFromRecycleBin
$creadPrec :: ReadPrec RestoreSnapshotFromRecycleBin
readList :: ReadS [RestoreSnapshotFromRecycleBin]
$creadList :: ReadS [RestoreSnapshotFromRecycleBin]
readsPrec :: Int -> ReadS RestoreSnapshotFromRecycleBin
$creadsPrec :: Int -> ReadS RestoreSnapshotFromRecycleBin
Prelude.Read, Int -> RestoreSnapshotFromRecycleBin -> ShowS
[RestoreSnapshotFromRecycleBin] -> ShowS
RestoreSnapshotFromRecycleBin -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RestoreSnapshotFromRecycleBin] -> ShowS
$cshowList :: [RestoreSnapshotFromRecycleBin] -> ShowS
show :: RestoreSnapshotFromRecycleBin -> String
$cshow :: RestoreSnapshotFromRecycleBin -> String
showsPrec :: Int -> RestoreSnapshotFromRecycleBin -> ShowS
$cshowsPrec :: Int -> RestoreSnapshotFromRecycleBin -> ShowS
Prelude.Show, forall x.
Rep RestoreSnapshotFromRecycleBin x
-> RestoreSnapshotFromRecycleBin
forall x.
RestoreSnapshotFromRecycleBin
-> Rep RestoreSnapshotFromRecycleBin x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RestoreSnapshotFromRecycleBin x
-> RestoreSnapshotFromRecycleBin
$cfrom :: forall x.
RestoreSnapshotFromRecycleBin
-> Rep RestoreSnapshotFromRecycleBin x
Prelude.Generic)

-- |
-- Create a value of 'RestoreSnapshotFromRecycleBin' 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:
--
-- 'dryRun', 'restoreSnapshotFromRecycleBin_dryRun' - Checks whether you have the required permissions for the action, without
-- actually making the request, and provides an error response. If you have
-- the required permissions, the error response is @DryRunOperation@.
-- Otherwise, it is @UnauthorizedOperation@.
--
-- 'snapshotId', 'restoreSnapshotFromRecycleBin_snapshotId' - The ID of the snapshot to restore.
newRestoreSnapshotFromRecycleBin ::
  -- | 'snapshotId'
  Prelude.Text ->
  RestoreSnapshotFromRecycleBin
newRestoreSnapshotFromRecycleBin :: Text -> RestoreSnapshotFromRecycleBin
newRestoreSnapshotFromRecycleBin Text
pSnapshotId_ =
  RestoreSnapshotFromRecycleBin'
    { $sel:dryRun:RestoreSnapshotFromRecycleBin' :: Maybe Bool
dryRun =
        forall a. Maybe a
Prelude.Nothing,
      $sel:snapshotId:RestoreSnapshotFromRecycleBin' :: Text
snapshotId = Text
pSnapshotId_
    }

-- | Checks whether you have the required permissions for the action, without
-- actually making the request, and provides an error response. If you have
-- the required permissions, the error response is @DryRunOperation@.
-- Otherwise, it is @UnauthorizedOperation@.
restoreSnapshotFromRecycleBin_dryRun :: Lens.Lens' RestoreSnapshotFromRecycleBin (Prelude.Maybe Prelude.Bool)
restoreSnapshotFromRecycleBin_dryRun :: Lens' RestoreSnapshotFromRecycleBin (Maybe Bool)
restoreSnapshotFromRecycleBin_dryRun = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreSnapshotFromRecycleBin' {Maybe Bool
dryRun :: Maybe Bool
$sel:dryRun:RestoreSnapshotFromRecycleBin' :: RestoreSnapshotFromRecycleBin -> Maybe Bool
dryRun} -> Maybe Bool
dryRun) (\s :: RestoreSnapshotFromRecycleBin
s@RestoreSnapshotFromRecycleBin' {} Maybe Bool
a -> RestoreSnapshotFromRecycleBin
s {$sel:dryRun:RestoreSnapshotFromRecycleBin' :: Maybe Bool
dryRun = Maybe Bool
a} :: RestoreSnapshotFromRecycleBin)

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

instance
  Core.AWSRequest
    RestoreSnapshotFromRecycleBin
  where
  type
    AWSResponse RestoreSnapshotFromRecycleBin =
      RestoreSnapshotFromRecycleBinResponse
  request :: (Service -> Service)
-> RestoreSnapshotFromRecycleBin
-> Request RestoreSnapshotFromRecycleBin
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy RestoreSnapshotFromRecycleBin
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse RestoreSnapshotFromRecycleBin)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXML
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ISO8601
-> Maybe SnapshotState
-> Maybe Text
-> Maybe Int
-> Int
-> RestoreSnapshotFromRecycleBinResponse
RestoreSnapshotFromRecycleBinResponse'
            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
"encrypted")
            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
"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 (Maybe 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 (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
"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 (Maybe 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 (Maybe 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 (Maybe a)
Data..@? Text
"volumeSize")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    RestoreSnapshotFromRecycleBin
  where
  hashWithSalt :: Int -> RestoreSnapshotFromRecycleBin -> Int
hashWithSalt Int
_salt RestoreSnapshotFromRecycleBin' {Maybe Bool
Text
snapshotId :: Text
dryRun :: Maybe Bool
$sel:snapshotId:RestoreSnapshotFromRecycleBin' :: RestoreSnapshotFromRecycleBin -> Text
$sel:dryRun:RestoreSnapshotFromRecycleBin' :: RestoreSnapshotFromRecycleBin -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
dryRun
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
snapshotId

instance Prelude.NFData RestoreSnapshotFromRecycleBin where
  rnf :: RestoreSnapshotFromRecycleBin -> ()
rnf RestoreSnapshotFromRecycleBin' {Maybe Bool
Text
snapshotId :: Text
dryRun :: Maybe Bool
$sel:snapshotId:RestoreSnapshotFromRecycleBin' :: RestoreSnapshotFromRecycleBin -> Text
$sel:dryRun:RestoreSnapshotFromRecycleBin' :: RestoreSnapshotFromRecycleBin -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
dryRun
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
snapshotId

instance Data.ToHeaders RestoreSnapshotFromRecycleBin where
  toHeaders :: RestoreSnapshotFromRecycleBin -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

instance Data.ToPath RestoreSnapshotFromRecycleBin where
  toPath :: RestoreSnapshotFromRecycleBin -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Data.ToQuery RestoreSnapshotFromRecycleBin where
  toQuery :: RestoreSnapshotFromRecycleBin -> QueryString
toQuery RestoreSnapshotFromRecycleBin' {Maybe Bool
Text
snapshotId :: Text
dryRun :: Maybe Bool
$sel:snapshotId:RestoreSnapshotFromRecycleBin' :: RestoreSnapshotFromRecycleBin -> Text
$sel:dryRun:RestoreSnapshotFromRecycleBin' :: RestoreSnapshotFromRecycleBin -> Maybe Bool
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ( ByteString
"RestoreSnapshotFromRecycleBin" ::
                      Prelude.ByteString
                  ),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2016-11-15" :: Prelude.ByteString),
        ByteString
"DryRun" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
dryRun,
        ByteString
"SnapshotId" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
snapshotId
      ]

-- | /See:/ 'newRestoreSnapshotFromRecycleBinResponse' smart constructor.
data RestoreSnapshotFromRecycleBinResponse = RestoreSnapshotFromRecycleBinResponse'
  { -- | The description for the snapshot.
    RestoreSnapshotFromRecycleBinResponse -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | Indicates whether the snapshot is encrypted.
    RestoreSnapshotFromRecycleBinResponse -> Maybe Bool
encrypted :: Prelude.Maybe Prelude.Bool,
    -- | 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/.
    RestoreSnapshotFromRecycleBinResponse -> Maybe Text
outpostArn :: Prelude.Maybe Prelude.Text,
    -- | The ID of the Amazon Web Services account that owns the EBS snapshot.
    RestoreSnapshotFromRecycleBinResponse -> Maybe Text
ownerId :: Prelude.Maybe Prelude.Text,
    -- | The progress of the snapshot, as a percentage.
    RestoreSnapshotFromRecycleBinResponse -> Maybe Text
progress :: Prelude.Maybe Prelude.Text,
    -- | The ID of the snapshot.
    RestoreSnapshotFromRecycleBinResponse -> Maybe Text
snapshotId :: Prelude.Maybe Prelude.Text,
    -- | The time stamp when the snapshot was initiated.
    RestoreSnapshotFromRecycleBinResponse -> Maybe ISO8601
startTime :: Prelude.Maybe Data.ISO8601,
    -- | The state of the snapshot.
    RestoreSnapshotFromRecycleBinResponse -> Maybe SnapshotState
state :: Prelude.Maybe SnapshotState,
    -- | The ID of the volume that was used to create the snapshot.
    RestoreSnapshotFromRecycleBinResponse -> Maybe Text
volumeId :: Prelude.Maybe Prelude.Text,
    -- | The size of the volume, in GiB.
    RestoreSnapshotFromRecycleBinResponse -> Maybe Int
volumeSize :: Prelude.Maybe Prelude.Int,
    -- | The response's http status code.
    RestoreSnapshotFromRecycleBinResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (RestoreSnapshotFromRecycleBinResponse
-> RestoreSnapshotFromRecycleBinResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RestoreSnapshotFromRecycleBinResponse
-> RestoreSnapshotFromRecycleBinResponse -> Bool
$c/= :: RestoreSnapshotFromRecycleBinResponse
-> RestoreSnapshotFromRecycleBinResponse -> Bool
== :: RestoreSnapshotFromRecycleBinResponse
-> RestoreSnapshotFromRecycleBinResponse -> Bool
$c== :: RestoreSnapshotFromRecycleBinResponse
-> RestoreSnapshotFromRecycleBinResponse -> Bool
Prelude.Eq, ReadPrec [RestoreSnapshotFromRecycleBinResponse]
ReadPrec RestoreSnapshotFromRecycleBinResponse
Int -> ReadS RestoreSnapshotFromRecycleBinResponse
ReadS [RestoreSnapshotFromRecycleBinResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RestoreSnapshotFromRecycleBinResponse]
$creadListPrec :: ReadPrec [RestoreSnapshotFromRecycleBinResponse]
readPrec :: ReadPrec RestoreSnapshotFromRecycleBinResponse
$creadPrec :: ReadPrec RestoreSnapshotFromRecycleBinResponse
readList :: ReadS [RestoreSnapshotFromRecycleBinResponse]
$creadList :: ReadS [RestoreSnapshotFromRecycleBinResponse]
readsPrec :: Int -> ReadS RestoreSnapshotFromRecycleBinResponse
$creadsPrec :: Int -> ReadS RestoreSnapshotFromRecycleBinResponse
Prelude.Read, Int -> RestoreSnapshotFromRecycleBinResponse -> ShowS
[RestoreSnapshotFromRecycleBinResponse] -> ShowS
RestoreSnapshotFromRecycleBinResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RestoreSnapshotFromRecycleBinResponse] -> ShowS
$cshowList :: [RestoreSnapshotFromRecycleBinResponse] -> ShowS
show :: RestoreSnapshotFromRecycleBinResponse -> String
$cshow :: RestoreSnapshotFromRecycleBinResponse -> String
showsPrec :: Int -> RestoreSnapshotFromRecycleBinResponse -> ShowS
$cshowsPrec :: Int -> RestoreSnapshotFromRecycleBinResponse -> ShowS
Prelude.Show, forall x.
Rep RestoreSnapshotFromRecycleBinResponse x
-> RestoreSnapshotFromRecycleBinResponse
forall x.
RestoreSnapshotFromRecycleBinResponse
-> Rep RestoreSnapshotFromRecycleBinResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RestoreSnapshotFromRecycleBinResponse x
-> RestoreSnapshotFromRecycleBinResponse
$cfrom :: forall x.
RestoreSnapshotFromRecycleBinResponse
-> Rep RestoreSnapshotFromRecycleBinResponse x
Prelude.Generic)

-- |
-- Create a value of 'RestoreSnapshotFromRecycleBinResponse' 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', 'restoreSnapshotFromRecycleBinResponse_description' - The description for the snapshot.
--
-- 'encrypted', 'restoreSnapshotFromRecycleBinResponse_encrypted' - Indicates whether the snapshot is encrypted.
--
-- 'outpostArn', 'restoreSnapshotFromRecycleBinResponse_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/.
--
-- 'ownerId', 'restoreSnapshotFromRecycleBinResponse_ownerId' - The ID of the Amazon Web Services account that owns the EBS snapshot.
--
-- 'progress', 'restoreSnapshotFromRecycleBinResponse_progress' - The progress of the snapshot, as a percentage.
--
-- 'snapshotId', 'restoreSnapshotFromRecycleBinResponse_snapshotId' - The ID of the snapshot.
--
-- 'startTime', 'restoreSnapshotFromRecycleBinResponse_startTime' - The time stamp when the snapshot was initiated.
--
-- 'state', 'restoreSnapshotFromRecycleBinResponse_state' - The state of the snapshot.
--
-- 'volumeId', 'restoreSnapshotFromRecycleBinResponse_volumeId' - The ID of the volume that was used to create the snapshot.
--
-- 'volumeSize', 'restoreSnapshotFromRecycleBinResponse_volumeSize' - The size of the volume, in GiB.
--
-- 'httpStatus', 'restoreSnapshotFromRecycleBinResponse_httpStatus' - The response's http status code.
newRestoreSnapshotFromRecycleBinResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  RestoreSnapshotFromRecycleBinResponse
newRestoreSnapshotFromRecycleBinResponse :: Int -> RestoreSnapshotFromRecycleBinResponse
newRestoreSnapshotFromRecycleBinResponse Int
pHttpStatus_ =
  RestoreSnapshotFromRecycleBinResponse'
    { $sel:description:RestoreSnapshotFromRecycleBinResponse' :: Maybe Text
description =
        forall a. Maybe a
Prelude.Nothing,
      $sel:encrypted:RestoreSnapshotFromRecycleBinResponse' :: Maybe Bool
encrypted = forall a. Maybe a
Prelude.Nothing,
      $sel:outpostArn:RestoreSnapshotFromRecycleBinResponse' :: Maybe Text
outpostArn = forall a. Maybe a
Prelude.Nothing,
      $sel:ownerId:RestoreSnapshotFromRecycleBinResponse' :: Maybe Text
ownerId = forall a. Maybe a
Prelude.Nothing,
      $sel:progress:RestoreSnapshotFromRecycleBinResponse' :: Maybe Text
progress = forall a. Maybe a
Prelude.Nothing,
      $sel:snapshotId:RestoreSnapshotFromRecycleBinResponse' :: Maybe Text
snapshotId = forall a. Maybe a
Prelude.Nothing,
      $sel:startTime:RestoreSnapshotFromRecycleBinResponse' :: Maybe ISO8601
startTime = forall a. Maybe a
Prelude.Nothing,
      $sel:state:RestoreSnapshotFromRecycleBinResponse' :: Maybe SnapshotState
state = forall a. Maybe a
Prelude.Nothing,
      $sel:volumeId:RestoreSnapshotFromRecycleBinResponse' :: Maybe Text
volumeId = forall a. Maybe a
Prelude.Nothing,
      $sel:volumeSize:RestoreSnapshotFromRecycleBinResponse' :: Maybe Int
volumeSize = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:RestoreSnapshotFromRecycleBinResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

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

-- | 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/.
restoreSnapshotFromRecycleBinResponse_outpostArn :: Lens.Lens' RestoreSnapshotFromRecycleBinResponse (Prelude.Maybe Prelude.Text)
restoreSnapshotFromRecycleBinResponse_outpostArn :: Lens' RestoreSnapshotFromRecycleBinResponse (Maybe Text)
restoreSnapshotFromRecycleBinResponse_outpostArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreSnapshotFromRecycleBinResponse' {Maybe Text
outpostArn :: Maybe Text
$sel:outpostArn:RestoreSnapshotFromRecycleBinResponse' :: RestoreSnapshotFromRecycleBinResponse -> Maybe Text
outpostArn} -> Maybe Text
outpostArn) (\s :: RestoreSnapshotFromRecycleBinResponse
s@RestoreSnapshotFromRecycleBinResponse' {} Maybe Text
a -> RestoreSnapshotFromRecycleBinResponse
s {$sel:outpostArn:RestoreSnapshotFromRecycleBinResponse' :: Maybe Text
outpostArn = Maybe Text
a} :: RestoreSnapshotFromRecycleBinResponse)

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

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

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

-- | The time stamp when the snapshot was initiated.
restoreSnapshotFromRecycleBinResponse_startTime :: Lens.Lens' RestoreSnapshotFromRecycleBinResponse (Prelude.Maybe Prelude.UTCTime)
restoreSnapshotFromRecycleBinResponse_startTime :: Lens' RestoreSnapshotFromRecycleBinResponse (Maybe UTCTime)
restoreSnapshotFromRecycleBinResponse_startTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreSnapshotFromRecycleBinResponse' {Maybe ISO8601
startTime :: Maybe ISO8601
$sel:startTime:RestoreSnapshotFromRecycleBinResponse' :: RestoreSnapshotFromRecycleBinResponse -> Maybe ISO8601
startTime} -> Maybe ISO8601
startTime) (\s :: RestoreSnapshotFromRecycleBinResponse
s@RestoreSnapshotFromRecycleBinResponse' {} Maybe ISO8601
a -> RestoreSnapshotFromRecycleBinResponse
s {$sel:startTime:RestoreSnapshotFromRecycleBinResponse' :: Maybe ISO8601
startTime = Maybe ISO8601
a} :: RestoreSnapshotFromRecycleBinResponse) 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 state of the snapshot.
restoreSnapshotFromRecycleBinResponse_state :: Lens.Lens' RestoreSnapshotFromRecycleBinResponse (Prelude.Maybe SnapshotState)
restoreSnapshotFromRecycleBinResponse_state :: Lens' RestoreSnapshotFromRecycleBinResponse (Maybe SnapshotState)
restoreSnapshotFromRecycleBinResponse_state = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreSnapshotFromRecycleBinResponse' {Maybe SnapshotState
state :: Maybe SnapshotState
$sel:state:RestoreSnapshotFromRecycleBinResponse' :: RestoreSnapshotFromRecycleBinResponse -> Maybe SnapshotState
state} -> Maybe SnapshotState
state) (\s :: RestoreSnapshotFromRecycleBinResponse
s@RestoreSnapshotFromRecycleBinResponse' {} Maybe SnapshotState
a -> RestoreSnapshotFromRecycleBinResponse
s {$sel:state:RestoreSnapshotFromRecycleBinResponse' :: Maybe SnapshotState
state = Maybe SnapshotState
a} :: RestoreSnapshotFromRecycleBinResponse)

-- | The ID of the volume that was used to create the snapshot.
restoreSnapshotFromRecycleBinResponse_volumeId :: Lens.Lens' RestoreSnapshotFromRecycleBinResponse (Prelude.Maybe Prelude.Text)
restoreSnapshotFromRecycleBinResponse_volumeId :: Lens' RestoreSnapshotFromRecycleBinResponse (Maybe Text)
restoreSnapshotFromRecycleBinResponse_volumeId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreSnapshotFromRecycleBinResponse' {Maybe Text
volumeId :: Maybe Text
$sel:volumeId:RestoreSnapshotFromRecycleBinResponse' :: RestoreSnapshotFromRecycleBinResponse -> Maybe Text
volumeId} -> Maybe Text
volumeId) (\s :: RestoreSnapshotFromRecycleBinResponse
s@RestoreSnapshotFromRecycleBinResponse' {} Maybe Text
a -> RestoreSnapshotFromRecycleBinResponse
s {$sel:volumeId:RestoreSnapshotFromRecycleBinResponse' :: Maybe Text
volumeId = Maybe Text
a} :: RestoreSnapshotFromRecycleBinResponse)

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

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

instance
  Prelude.NFData
    RestoreSnapshotFromRecycleBinResponse
  where
  rnf :: RestoreSnapshotFromRecycleBinResponse -> ()
rnf RestoreSnapshotFromRecycleBinResponse' {Int
Maybe Bool
Maybe Int
Maybe Text
Maybe ISO8601
Maybe SnapshotState
httpStatus :: Int
volumeSize :: Maybe Int
volumeId :: Maybe Text
state :: Maybe SnapshotState
startTime :: Maybe ISO8601
snapshotId :: Maybe Text
progress :: Maybe Text
ownerId :: Maybe Text
outpostArn :: Maybe Text
encrypted :: Maybe Bool
description :: Maybe Text
$sel:httpStatus:RestoreSnapshotFromRecycleBinResponse' :: RestoreSnapshotFromRecycleBinResponse -> Int
$sel:volumeSize:RestoreSnapshotFromRecycleBinResponse' :: RestoreSnapshotFromRecycleBinResponse -> Maybe Int
$sel:volumeId:RestoreSnapshotFromRecycleBinResponse' :: RestoreSnapshotFromRecycleBinResponse -> Maybe Text
$sel:state:RestoreSnapshotFromRecycleBinResponse' :: RestoreSnapshotFromRecycleBinResponse -> Maybe SnapshotState
$sel:startTime:RestoreSnapshotFromRecycleBinResponse' :: RestoreSnapshotFromRecycleBinResponse -> Maybe ISO8601
$sel:snapshotId:RestoreSnapshotFromRecycleBinResponse' :: RestoreSnapshotFromRecycleBinResponse -> Maybe Text
$sel:progress:RestoreSnapshotFromRecycleBinResponse' :: RestoreSnapshotFromRecycleBinResponse -> Maybe Text
$sel:ownerId:RestoreSnapshotFromRecycleBinResponse' :: RestoreSnapshotFromRecycleBinResponse -> Maybe Text
$sel:outpostArn:RestoreSnapshotFromRecycleBinResponse' :: RestoreSnapshotFromRecycleBinResponse -> Maybe Text
$sel:encrypted:RestoreSnapshotFromRecycleBinResponse' :: RestoreSnapshotFromRecycleBinResponse -> Maybe Bool
$sel:description:RestoreSnapshotFromRecycleBinResponse' :: RestoreSnapshotFromRecycleBinResponse -> 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 Bool
encrypted
      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
ownerId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
progress
      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 ISO8601
startTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SnapshotState
state
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
volumeId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
volumeSize
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus