{-# 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.EBS.ListSnapshotBlocks
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns information about the blocks in an Amazon Elastic Block Store
-- snapshot.
module Amazonka.EBS.ListSnapshotBlocks
  ( -- * Creating a Request
    ListSnapshotBlocks (..),
    newListSnapshotBlocks,

    -- * Request Lenses
    listSnapshotBlocks_maxResults,
    listSnapshotBlocks_nextToken,
    listSnapshotBlocks_startingBlockIndex,
    listSnapshotBlocks_snapshotId,

    -- * Destructuring the Response
    ListSnapshotBlocksResponse (..),
    newListSnapshotBlocksResponse,

    -- * Response Lenses
    listSnapshotBlocksResponse_blockSize,
    listSnapshotBlocksResponse_blocks,
    listSnapshotBlocksResponse_expiryTime,
    listSnapshotBlocksResponse_nextToken,
    listSnapshotBlocksResponse_volumeSize,
    listSnapshotBlocksResponse_httpStatus,
  )
where

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

-- | /See:/ 'newListSnapshotBlocks' smart constructor.
data ListSnapshotBlocks = ListSnapshotBlocks'
  { -- | The maximum number of blocks to be returned by the request.
    --
    -- Even if additional blocks can be retrieved from the snapshot, the
    -- request can return less blocks than __MaxResults__ or an empty array of
    -- blocks.
    --
    -- To retrieve the next set of blocks from the snapshot, make another
    -- request with the returned __NextToken__ value. The value of
    -- __NextToken__ is @null@ when there are no more blocks to return.
    ListSnapshotBlocks -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The token to request the next page of results.
    --
    -- If you specify __NextToken__, then __StartingBlockIndex__ is ignored.
    ListSnapshotBlocks -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The block index from which the list should start. The list in the
    -- response will start from this block index or the next valid block index
    -- in the snapshot.
    --
    -- If you specify __NextToken__, then __StartingBlockIndex__ is ignored.
    ListSnapshotBlocks -> Maybe Natural
startingBlockIndex :: Prelude.Maybe Prelude.Natural,
    -- | The ID of the snapshot from which to get block indexes and block tokens.
    ListSnapshotBlocks -> Text
snapshotId :: Prelude.Text
  }
  deriving (ListSnapshotBlocks -> ListSnapshotBlocks -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSnapshotBlocks -> ListSnapshotBlocks -> Bool
$c/= :: ListSnapshotBlocks -> ListSnapshotBlocks -> Bool
== :: ListSnapshotBlocks -> ListSnapshotBlocks -> Bool
$c== :: ListSnapshotBlocks -> ListSnapshotBlocks -> Bool
Prelude.Eq, ReadPrec [ListSnapshotBlocks]
ReadPrec ListSnapshotBlocks
Int -> ReadS ListSnapshotBlocks
ReadS [ListSnapshotBlocks]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListSnapshotBlocks]
$creadListPrec :: ReadPrec [ListSnapshotBlocks]
readPrec :: ReadPrec ListSnapshotBlocks
$creadPrec :: ReadPrec ListSnapshotBlocks
readList :: ReadS [ListSnapshotBlocks]
$creadList :: ReadS [ListSnapshotBlocks]
readsPrec :: Int -> ReadS ListSnapshotBlocks
$creadsPrec :: Int -> ReadS ListSnapshotBlocks
Prelude.Read, Int -> ListSnapshotBlocks -> ShowS
[ListSnapshotBlocks] -> ShowS
ListSnapshotBlocks -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSnapshotBlocks] -> ShowS
$cshowList :: [ListSnapshotBlocks] -> ShowS
show :: ListSnapshotBlocks -> String
$cshow :: ListSnapshotBlocks -> String
showsPrec :: Int -> ListSnapshotBlocks -> ShowS
$cshowsPrec :: Int -> ListSnapshotBlocks -> ShowS
Prelude.Show, forall x. Rep ListSnapshotBlocks x -> ListSnapshotBlocks
forall x. ListSnapshotBlocks -> Rep ListSnapshotBlocks x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListSnapshotBlocks x -> ListSnapshotBlocks
$cfrom :: forall x. ListSnapshotBlocks -> Rep ListSnapshotBlocks x
Prelude.Generic)

-- |
-- Create a value of 'ListSnapshotBlocks' 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:
--
-- 'maxResults', 'listSnapshotBlocks_maxResults' - The maximum number of blocks to be returned by the request.
--
-- Even if additional blocks can be retrieved from the snapshot, the
-- request can return less blocks than __MaxResults__ or an empty array of
-- blocks.
--
-- To retrieve the next set of blocks from the snapshot, make another
-- request with the returned __NextToken__ value. The value of
-- __NextToken__ is @null@ when there are no more blocks to return.
--
-- 'nextToken', 'listSnapshotBlocks_nextToken' - The token to request the next page of results.
--
-- If you specify __NextToken__, then __StartingBlockIndex__ is ignored.
--
-- 'startingBlockIndex', 'listSnapshotBlocks_startingBlockIndex' - The block index from which the list should start. The list in the
-- response will start from this block index or the next valid block index
-- in the snapshot.
--
-- If you specify __NextToken__, then __StartingBlockIndex__ is ignored.
--
-- 'snapshotId', 'listSnapshotBlocks_snapshotId' - The ID of the snapshot from which to get block indexes and block tokens.
newListSnapshotBlocks ::
  -- | 'snapshotId'
  Prelude.Text ->
  ListSnapshotBlocks
newListSnapshotBlocks :: Text -> ListSnapshotBlocks
newListSnapshotBlocks Text
pSnapshotId_ =
  ListSnapshotBlocks'
    { $sel:maxResults:ListSnapshotBlocks' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListSnapshotBlocks' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:startingBlockIndex:ListSnapshotBlocks' :: Maybe Natural
startingBlockIndex = forall a. Maybe a
Prelude.Nothing,
      $sel:snapshotId:ListSnapshotBlocks' :: Text
snapshotId = Text
pSnapshotId_
    }

-- | The maximum number of blocks to be returned by the request.
--
-- Even if additional blocks can be retrieved from the snapshot, the
-- request can return less blocks than __MaxResults__ or an empty array of
-- blocks.
--
-- To retrieve the next set of blocks from the snapshot, make another
-- request with the returned __NextToken__ value. The value of
-- __NextToken__ is @null@ when there are no more blocks to return.
listSnapshotBlocks_maxResults :: Lens.Lens' ListSnapshotBlocks (Prelude.Maybe Prelude.Natural)
listSnapshotBlocks_maxResults :: Lens' ListSnapshotBlocks (Maybe Natural)
listSnapshotBlocks_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSnapshotBlocks' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListSnapshotBlocks' :: ListSnapshotBlocks -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListSnapshotBlocks
s@ListSnapshotBlocks' {} Maybe Natural
a -> ListSnapshotBlocks
s {$sel:maxResults:ListSnapshotBlocks' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListSnapshotBlocks)

-- | The token to request the next page of results.
--
-- If you specify __NextToken__, then __StartingBlockIndex__ is ignored.
listSnapshotBlocks_nextToken :: Lens.Lens' ListSnapshotBlocks (Prelude.Maybe Prelude.Text)
listSnapshotBlocks_nextToken :: Lens' ListSnapshotBlocks (Maybe Text)
listSnapshotBlocks_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSnapshotBlocks' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListSnapshotBlocks' :: ListSnapshotBlocks -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListSnapshotBlocks
s@ListSnapshotBlocks' {} Maybe Text
a -> ListSnapshotBlocks
s {$sel:nextToken:ListSnapshotBlocks' :: Maybe Text
nextToken = Maybe Text
a} :: ListSnapshotBlocks)

-- | The block index from which the list should start. The list in the
-- response will start from this block index or the next valid block index
-- in the snapshot.
--
-- If you specify __NextToken__, then __StartingBlockIndex__ is ignored.
listSnapshotBlocks_startingBlockIndex :: Lens.Lens' ListSnapshotBlocks (Prelude.Maybe Prelude.Natural)
listSnapshotBlocks_startingBlockIndex :: Lens' ListSnapshotBlocks (Maybe Natural)
listSnapshotBlocks_startingBlockIndex = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSnapshotBlocks' {Maybe Natural
startingBlockIndex :: Maybe Natural
$sel:startingBlockIndex:ListSnapshotBlocks' :: ListSnapshotBlocks -> Maybe Natural
startingBlockIndex} -> Maybe Natural
startingBlockIndex) (\s :: ListSnapshotBlocks
s@ListSnapshotBlocks' {} Maybe Natural
a -> ListSnapshotBlocks
s {$sel:startingBlockIndex:ListSnapshotBlocks' :: Maybe Natural
startingBlockIndex = Maybe Natural
a} :: ListSnapshotBlocks)

-- | The ID of the snapshot from which to get block indexes and block tokens.
listSnapshotBlocks_snapshotId :: Lens.Lens' ListSnapshotBlocks Prelude.Text
listSnapshotBlocks_snapshotId :: Lens' ListSnapshotBlocks Text
listSnapshotBlocks_snapshotId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSnapshotBlocks' {Text
snapshotId :: Text
$sel:snapshotId:ListSnapshotBlocks' :: ListSnapshotBlocks -> Text
snapshotId} -> Text
snapshotId) (\s :: ListSnapshotBlocks
s@ListSnapshotBlocks' {} Text
a -> ListSnapshotBlocks
s {$sel:snapshotId:ListSnapshotBlocks' :: Text
snapshotId = Text
a} :: ListSnapshotBlocks)

instance Core.AWSRequest ListSnapshotBlocks where
  type
    AWSResponse ListSnapshotBlocks =
      ListSnapshotBlocksResponse
  request :: (Service -> Service)
-> ListSnapshotBlocks -> Request ListSnapshotBlocks
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListSnapshotBlocks
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListSnapshotBlocks)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Int
-> Maybe (Sensitive [Block])
-> Maybe POSIX
-> Maybe Text
-> Maybe Natural
-> Int
-> ListSnapshotBlocksResponse
ListSnapshotBlocksResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"BlockSize")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Blocks" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ExpiryTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"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 ListSnapshotBlocks where
  hashWithSalt :: Int -> ListSnapshotBlocks -> Int
hashWithSalt Int
_salt ListSnapshotBlocks' {Maybe Natural
Maybe Text
Text
snapshotId :: Text
startingBlockIndex :: Maybe Natural
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:snapshotId:ListSnapshotBlocks' :: ListSnapshotBlocks -> Text
$sel:startingBlockIndex:ListSnapshotBlocks' :: ListSnapshotBlocks -> Maybe Natural
$sel:nextToken:ListSnapshotBlocks' :: ListSnapshotBlocks -> Maybe Text
$sel:maxResults:ListSnapshotBlocks' :: ListSnapshotBlocks -> Maybe Natural
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
startingBlockIndex
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
snapshotId

instance Prelude.NFData ListSnapshotBlocks where
  rnf :: ListSnapshotBlocks -> ()
rnf ListSnapshotBlocks' {Maybe Natural
Maybe Text
Text
snapshotId :: Text
startingBlockIndex :: Maybe Natural
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:snapshotId:ListSnapshotBlocks' :: ListSnapshotBlocks -> Text
$sel:startingBlockIndex:ListSnapshotBlocks' :: ListSnapshotBlocks -> Maybe Natural
$sel:nextToken:ListSnapshotBlocks' :: ListSnapshotBlocks -> Maybe Text
$sel:maxResults:ListSnapshotBlocks' :: ListSnapshotBlocks -> Maybe Natural
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
startingBlockIndex
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
snapshotId

instance Data.ToHeaders ListSnapshotBlocks where
  toHeaders :: ListSnapshotBlocks -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToPath ListSnapshotBlocks where
  toPath :: ListSnapshotBlocks -> ByteString
toPath ListSnapshotBlocks' {Maybe Natural
Maybe Text
Text
snapshotId :: Text
startingBlockIndex :: Maybe Natural
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:snapshotId:ListSnapshotBlocks' :: ListSnapshotBlocks -> Text
$sel:startingBlockIndex:ListSnapshotBlocks' :: ListSnapshotBlocks -> Maybe Natural
$sel:nextToken:ListSnapshotBlocks' :: ListSnapshotBlocks -> Maybe Text
$sel:maxResults:ListSnapshotBlocks' :: ListSnapshotBlocks -> Maybe Natural
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/snapshots/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
snapshotId, ByteString
"/blocks"]

instance Data.ToQuery ListSnapshotBlocks where
  toQuery :: ListSnapshotBlocks -> QueryString
toQuery ListSnapshotBlocks' {Maybe Natural
Maybe Text
Text
snapshotId :: Text
startingBlockIndex :: Maybe Natural
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:snapshotId:ListSnapshotBlocks' :: ListSnapshotBlocks -> Text
$sel:startingBlockIndex:ListSnapshotBlocks' :: ListSnapshotBlocks -> Maybe Natural
$sel:nextToken:ListSnapshotBlocks' :: ListSnapshotBlocks -> Maybe Text
$sel:maxResults:ListSnapshotBlocks' :: ListSnapshotBlocks -> Maybe Natural
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"maxResults" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxResults,
        ByteString
"pageToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken,
        ByteString
"startingBlockIndex" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
startingBlockIndex
      ]

-- | /See:/ 'newListSnapshotBlocksResponse' smart constructor.
data ListSnapshotBlocksResponse = ListSnapshotBlocksResponse'
  { -- | The size of the blocks in the snapshot, in bytes.
    ListSnapshotBlocksResponse -> Maybe Int
blockSize :: Prelude.Maybe Prelude.Int,
    -- | An array of objects containing information about the blocks.
    ListSnapshotBlocksResponse -> Maybe (Sensitive [Block])
blocks :: Prelude.Maybe (Data.Sensitive [Block]),
    -- | The time when the @BlockToken@ expires.
    ListSnapshotBlocksResponse -> Maybe POSIX
expiryTime :: Prelude.Maybe Data.POSIX,
    -- | The token to use to retrieve the next page of results. This value is
    -- null when there are no more results to return.
    ListSnapshotBlocksResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The size of the volume in GB.
    ListSnapshotBlocksResponse -> Maybe Natural
volumeSize :: Prelude.Maybe Prelude.Natural,
    -- | The response's http status code.
    ListSnapshotBlocksResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListSnapshotBlocksResponse -> ListSnapshotBlocksResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSnapshotBlocksResponse -> ListSnapshotBlocksResponse -> Bool
$c/= :: ListSnapshotBlocksResponse -> ListSnapshotBlocksResponse -> Bool
== :: ListSnapshotBlocksResponse -> ListSnapshotBlocksResponse -> Bool
$c== :: ListSnapshotBlocksResponse -> ListSnapshotBlocksResponse -> Bool
Prelude.Eq, Int -> ListSnapshotBlocksResponse -> ShowS
[ListSnapshotBlocksResponse] -> ShowS
ListSnapshotBlocksResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSnapshotBlocksResponse] -> ShowS
$cshowList :: [ListSnapshotBlocksResponse] -> ShowS
show :: ListSnapshotBlocksResponse -> String
$cshow :: ListSnapshotBlocksResponse -> String
showsPrec :: Int -> ListSnapshotBlocksResponse -> ShowS
$cshowsPrec :: Int -> ListSnapshotBlocksResponse -> ShowS
Prelude.Show, forall x.
Rep ListSnapshotBlocksResponse x -> ListSnapshotBlocksResponse
forall x.
ListSnapshotBlocksResponse -> Rep ListSnapshotBlocksResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListSnapshotBlocksResponse x -> ListSnapshotBlocksResponse
$cfrom :: forall x.
ListSnapshotBlocksResponse -> Rep ListSnapshotBlocksResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListSnapshotBlocksResponse' 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:
--
-- 'blockSize', 'listSnapshotBlocksResponse_blockSize' - The size of the blocks in the snapshot, in bytes.
--
-- 'blocks', 'listSnapshotBlocksResponse_blocks' - An array of objects containing information about the blocks.
--
-- 'expiryTime', 'listSnapshotBlocksResponse_expiryTime' - The time when the @BlockToken@ expires.
--
-- 'nextToken', 'listSnapshotBlocksResponse_nextToken' - The token to use to retrieve the next page of results. This value is
-- null when there are no more results to return.
--
-- 'volumeSize', 'listSnapshotBlocksResponse_volumeSize' - The size of the volume in GB.
--
-- 'httpStatus', 'listSnapshotBlocksResponse_httpStatus' - The response's http status code.
newListSnapshotBlocksResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListSnapshotBlocksResponse
newListSnapshotBlocksResponse :: Int -> ListSnapshotBlocksResponse
newListSnapshotBlocksResponse Int
pHttpStatus_ =
  ListSnapshotBlocksResponse'
    { $sel:blockSize:ListSnapshotBlocksResponse' :: Maybe Int
blockSize =
        forall a. Maybe a
Prelude.Nothing,
      $sel:blocks:ListSnapshotBlocksResponse' :: Maybe (Sensitive [Block])
blocks = forall a. Maybe a
Prelude.Nothing,
      $sel:expiryTime:ListSnapshotBlocksResponse' :: Maybe POSIX
expiryTime = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListSnapshotBlocksResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:volumeSize:ListSnapshotBlocksResponse' :: Maybe Natural
volumeSize = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListSnapshotBlocksResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The size of the blocks in the snapshot, in bytes.
listSnapshotBlocksResponse_blockSize :: Lens.Lens' ListSnapshotBlocksResponse (Prelude.Maybe Prelude.Int)
listSnapshotBlocksResponse_blockSize :: Lens' ListSnapshotBlocksResponse (Maybe Int)
listSnapshotBlocksResponse_blockSize = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSnapshotBlocksResponse' {Maybe Int
blockSize :: Maybe Int
$sel:blockSize:ListSnapshotBlocksResponse' :: ListSnapshotBlocksResponse -> Maybe Int
blockSize} -> Maybe Int
blockSize) (\s :: ListSnapshotBlocksResponse
s@ListSnapshotBlocksResponse' {} Maybe Int
a -> ListSnapshotBlocksResponse
s {$sel:blockSize:ListSnapshotBlocksResponse' :: Maybe Int
blockSize = Maybe Int
a} :: ListSnapshotBlocksResponse)

-- | An array of objects containing information about the blocks.
listSnapshotBlocksResponse_blocks :: Lens.Lens' ListSnapshotBlocksResponse (Prelude.Maybe [Block])
listSnapshotBlocksResponse_blocks :: Lens' ListSnapshotBlocksResponse (Maybe [Block])
listSnapshotBlocksResponse_blocks = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSnapshotBlocksResponse' {Maybe (Sensitive [Block])
blocks :: Maybe (Sensitive [Block])
$sel:blocks:ListSnapshotBlocksResponse' :: ListSnapshotBlocksResponse -> Maybe (Sensitive [Block])
blocks} -> Maybe (Sensitive [Block])
blocks) (\s :: ListSnapshotBlocksResponse
s@ListSnapshotBlocksResponse' {} Maybe (Sensitive [Block])
a -> ListSnapshotBlocksResponse
s {$sel:blocks:ListSnapshotBlocksResponse' :: Maybe (Sensitive [Block])
blocks = Maybe (Sensitive [Block])
a} :: ListSnapshotBlocksResponse) 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. Iso' (Sensitive a) a
Data._Sensitive forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced)

-- | The time when the @BlockToken@ expires.
listSnapshotBlocksResponse_expiryTime :: Lens.Lens' ListSnapshotBlocksResponse (Prelude.Maybe Prelude.UTCTime)
listSnapshotBlocksResponse_expiryTime :: Lens' ListSnapshotBlocksResponse (Maybe UTCTime)
listSnapshotBlocksResponse_expiryTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSnapshotBlocksResponse' {Maybe POSIX
expiryTime :: Maybe POSIX
$sel:expiryTime:ListSnapshotBlocksResponse' :: ListSnapshotBlocksResponse -> Maybe POSIX
expiryTime} -> Maybe POSIX
expiryTime) (\s :: ListSnapshotBlocksResponse
s@ListSnapshotBlocksResponse' {} Maybe POSIX
a -> ListSnapshotBlocksResponse
s {$sel:expiryTime:ListSnapshotBlocksResponse' :: Maybe POSIX
expiryTime = Maybe POSIX
a} :: ListSnapshotBlocksResponse) 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 token to use to retrieve the next page of results. This value is
-- null when there are no more results to return.
listSnapshotBlocksResponse_nextToken :: Lens.Lens' ListSnapshotBlocksResponse (Prelude.Maybe Prelude.Text)
listSnapshotBlocksResponse_nextToken :: Lens' ListSnapshotBlocksResponse (Maybe Text)
listSnapshotBlocksResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSnapshotBlocksResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListSnapshotBlocksResponse' :: ListSnapshotBlocksResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListSnapshotBlocksResponse
s@ListSnapshotBlocksResponse' {} Maybe Text
a -> ListSnapshotBlocksResponse
s {$sel:nextToken:ListSnapshotBlocksResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListSnapshotBlocksResponse)

-- | The size of the volume in GB.
listSnapshotBlocksResponse_volumeSize :: Lens.Lens' ListSnapshotBlocksResponse (Prelude.Maybe Prelude.Natural)
listSnapshotBlocksResponse_volumeSize :: Lens' ListSnapshotBlocksResponse (Maybe Natural)
listSnapshotBlocksResponse_volumeSize = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSnapshotBlocksResponse' {Maybe Natural
volumeSize :: Maybe Natural
$sel:volumeSize:ListSnapshotBlocksResponse' :: ListSnapshotBlocksResponse -> Maybe Natural
volumeSize} -> Maybe Natural
volumeSize) (\s :: ListSnapshotBlocksResponse
s@ListSnapshotBlocksResponse' {} Maybe Natural
a -> ListSnapshotBlocksResponse
s {$sel:volumeSize:ListSnapshotBlocksResponse' :: Maybe Natural
volumeSize = Maybe Natural
a} :: ListSnapshotBlocksResponse)

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

instance Prelude.NFData ListSnapshotBlocksResponse where
  rnf :: ListSnapshotBlocksResponse -> ()
rnf ListSnapshotBlocksResponse' {Int
Maybe Int
Maybe Natural
Maybe Text
Maybe (Sensitive [Block])
Maybe POSIX
httpStatus :: Int
volumeSize :: Maybe Natural
nextToken :: Maybe Text
expiryTime :: Maybe POSIX
blocks :: Maybe (Sensitive [Block])
blockSize :: Maybe Int
$sel:httpStatus:ListSnapshotBlocksResponse' :: ListSnapshotBlocksResponse -> Int
$sel:volumeSize:ListSnapshotBlocksResponse' :: ListSnapshotBlocksResponse -> Maybe Natural
$sel:nextToken:ListSnapshotBlocksResponse' :: ListSnapshotBlocksResponse -> Maybe Text
$sel:expiryTime:ListSnapshotBlocksResponse' :: ListSnapshotBlocksResponse -> Maybe POSIX
$sel:blocks:ListSnapshotBlocksResponse' :: ListSnapshotBlocksResponse -> Maybe (Sensitive [Block])
$sel:blockSize:ListSnapshotBlocksResponse' :: ListSnapshotBlocksResponse -> Maybe Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
blockSize
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive [Block])
blocks
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
expiryTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
volumeSize
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus