{-# 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.GetSnapshotBlock
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns the data in a block in an Amazon Elastic Block Store snapshot.
module Amazonka.EBS.GetSnapshotBlock
  ( -- * Creating a Request
    GetSnapshotBlock (..),
    newGetSnapshotBlock,

    -- * Request Lenses
    getSnapshotBlock_snapshotId,
    getSnapshotBlock_blockIndex,
    getSnapshotBlock_blockToken,

    -- * Destructuring the Response
    GetSnapshotBlockResponse (..),
    newGetSnapshotBlockResponse,

    -- * Response Lenses
    getSnapshotBlockResponse_dataLength,
    getSnapshotBlockResponse_checksumAlgorithm,
    getSnapshotBlockResponse_checksum,
    getSnapshotBlockResponse_httpStatus,
    getSnapshotBlockResponse_blockData,
  )
where

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

-- | /See:/ 'newGetSnapshotBlock' smart constructor.
data GetSnapshotBlock = GetSnapshotBlock'
  { -- | The ID of the snapshot containing the block from which to get data.
    GetSnapshotBlock -> Text
snapshotId :: Prelude.Text,
    -- | The block index of the block from which to get data.
    --
    -- Obtain the @BlockIndex@ by running the @ListChangedBlocks@ or
    -- @ListSnapshotBlocks@ operations.
    GetSnapshotBlock -> Natural
blockIndex :: Prelude.Natural,
    -- | The block token of the block from which to get data.
    --
    -- Obtain the @BlockToken@ by running the @ListChangedBlocks@ or
    -- @ListSnapshotBlocks@ operations.
    GetSnapshotBlock -> Text
blockToken :: Prelude.Text
  }
  deriving (GetSnapshotBlock -> GetSnapshotBlock -> Bool
(GetSnapshotBlock -> GetSnapshotBlock -> Bool)
-> (GetSnapshotBlock -> GetSnapshotBlock -> Bool)
-> Eq GetSnapshotBlock
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetSnapshotBlock -> GetSnapshotBlock -> Bool
$c/= :: GetSnapshotBlock -> GetSnapshotBlock -> Bool
== :: GetSnapshotBlock -> GetSnapshotBlock -> Bool
$c== :: GetSnapshotBlock -> GetSnapshotBlock -> Bool
Prelude.Eq, ReadPrec [GetSnapshotBlock]
ReadPrec GetSnapshotBlock
Int -> ReadS GetSnapshotBlock
ReadS [GetSnapshotBlock]
(Int -> ReadS GetSnapshotBlock)
-> ReadS [GetSnapshotBlock]
-> ReadPrec GetSnapshotBlock
-> ReadPrec [GetSnapshotBlock]
-> Read GetSnapshotBlock
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetSnapshotBlock]
$creadListPrec :: ReadPrec [GetSnapshotBlock]
readPrec :: ReadPrec GetSnapshotBlock
$creadPrec :: ReadPrec GetSnapshotBlock
readList :: ReadS [GetSnapshotBlock]
$creadList :: ReadS [GetSnapshotBlock]
readsPrec :: Int -> ReadS GetSnapshotBlock
$creadsPrec :: Int -> ReadS GetSnapshotBlock
Prelude.Read, Int -> GetSnapshotBlock -> ShowS
[GetSnapshotBlock] -> ShowS
GetSnapshotBlock -> String
(Int -> GetSnapshotBlock -> ShowS)
-> (GetSnapshotBlock -> String)
-> ([GetSnapshotBlock] -> ShowS)
-> Show GetSnapshotBlock
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetSnapshotBlock] -> ShowS
$cshowList :: [GetSnapshotBlock] -> ShowS
show :: GetSnapshotBlock -> String
$cshow :: GetSnapshotBlock -> String
showsPrec :: Int -> GetSnapshotBlock -> ShowS
$cshowsPrec :: Int -> GetSnapshotBlock -> ShowS
Prelude.Show, (forall x. GetSnapshotBlock -> Rep GetSnapshotBlock x)
-> (forall x. Rep GetSnapshotBlock x -> GetSnapshotBlock)
-> Generic GetSnapshotBlock
forall x. Rep GetSnapshotBlock x -> GetSnapshotBlock
forall x. GetSnapshotBlock -> Rep GetSnapshotBlock x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetSnapshotBlock x -> GetSnapshotBlock
$cfrom :: forall x. GetSnapshotBlock -> Rep GetSnapshotBlock x
Prelude.Generic)

-- |
-- Create a value of 'GetSnapshotBlock' 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:
--
-- 'snapshotId', 'getSnapshotBlock_snapshotId' - The ID of the snapshot containing the block from which to get data.
--
-- 'blockIndex', 'getSnapshotBlock_blockIndex' - The block index of the block from which to get data.
--
-- Obtain the @BlockIndex@ by running the @ListChangedBlocks@ or
-- @ListSnapshotBlocks@ operations.
--
-- 'blockToken', 'getSnapshotBlock_blockToken' - The block token of the block from which to get data.
--
-- Obtain the @BlockToken@ by running the @ListChangedBlocks@ or
-- @ListSnapshotBlocks@ operations.
newGetSnapshotBlock ::
  -- | 'snapshotId'
  Prelude.Text ->
  -- | 'blockIndex'
  Prelude.Natural ->
  -- | 'blockToken'
  Prelude.Text ->
  GetSnapshotBlock
newGetSnapshotBlock :: Text -> Natural -> Text -> GetSnapshotBlock
newGetSnapshotBlock
  Text
pSnapshotId_
  Natural
pBlockIndex_
  Text
pBlockToken_ =
    GetSnapshotBlock' :: Text -> Natural -> Text -> GetSnapshotBlock
GetSnapshotBlock'
      { $sel:snapshotId:GetSnapshotBlock' :: Text
snapshotId = Text
pSnapshotId_,
        $sel:blockIndex:GetSnapshotBlock' :: Natural
blockIndex = Natural
pBlockIndex_,
        $sel:blockToken:GetSnapshotBlock' :: Text
blockToken = Text
pBlockToken_
      }

-- | The ID of the snapshot containing the block from which to get data.
getSnapshotBlock_snapshotId :: Lens.Lens' GetSnapshotBlock Prelude.Text
getSnapshotBlock_snapshotId :: (Text -> f Text) -> GetSnapshotBlock -> f GetSnapshotBlock
getSnapshotBlock_snapshotId = (GetSnapshotBlock -> Text)
-> (GetSnapshotBlock -> Text -> GetSnapshotBlock)
-> Lens GetSnapshotBlock GetSnapshotBlock Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSnapshotBlock' {Text
snapshotId :: Text
$sel:snapshotId:GetSnapshotBlock' :: GetSnapshotBlock -> Text
snapshotId} -> Text
snapshotId) (\s :: GetSnapshotBlock
s@GetSnapshotBlock' {} Text
a -> GetSnapshotBlock
s {$sel:snapshotId:GetSnapshotBlock' :: Text
snapshotId = Text
a} :: GetSnapshotBlock)

-- | The block index of the block from which to get data.
--
-- Obtain the @BlockIndex@ by running the @ListChangedBlocks@ or
-- @ListSnapshotBlocks@ operations.
getSnapshotBlock_blockIndex :: Lens.Lens' GetSnapshotBlock Prelude.Natural
getSnapshotBlock_blockIndex :: (Natural -> f Natural) -> GetSnapshotBlock -> f GetSnapshotBlock
getSnapshotBlock_blockIndex = (GetSnapshotBlock -> Natural)
-> (GetSnapshotBlock -> Natural -> GetSnapshotBlock)
-> Lens GetSnapshotBlock GetSnapshotBlock Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSnapshotBlock' {Natural
blockIndex :: Natural
$sel:blockIndex:GetSnapshotBlock' :: GetSnapshotBlock -> Natural
blockIndex} -> Natural
blockIndex) (\s :: GetSnapshotBlock
s@GetSnapshotBlock' {} Natural
a -> GetSnapshotBlock
s {$sel:blockIndex:GetSnapshotBlock' :: Natural
blockIndex = Natural
a} :: GetSnapshotBlock)

-- | The block token of the block from which to get data.
--
-- Obtain the @BlockToken@ by running the @ListChangedBlocks@ or
-- @ListSnapshotBlocks@ operations.
getSnapshotBlock_blockToken :: Lens.Lens' GetSnapshotBlock Prelude.Text
getSnapshotBlock_blockToken :: (Text -> f Text) -> GetSnapshotBlock -> f GetSnapshotBlock
getSnapshotBlock_blockToken = (GetSnapshotBlock -> Text)
-> (GetSnapshotBlock -> Text -> GetSnapshotBlock)
-> Lens GetSnapshotBlock GetSnapshotBlock Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSnapshotBlock' {Text
blockToken :: Text
$sel:blockToken:GetSnapshotBlock' :: GetSnapshotBlock -> Text
blockToken} -> Text
blockToken) (\s :: GetSnapshotBlock
s@GetSnapshotBlock' {} Text
a -> GetSnapshotBlock
s {$sel:blockToken:GetSnapshotBlock' :: Text
blockToken = Text
a} :: GetSnapshotBlock)

instance Core.AWSRequest GetSnapshotBlock where
  type
    AWSResponse GetSnapshotBlock =
      GetSnapshotBlockResponse
  request :: GetSnapshotBlock -> Request GetSnapshotBlock
request = Service -> GetSnapshotBlock -> Request GetSnapshotBlock
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy GetSnapshotBlock
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetSnapshotBlock)))
response =
    (Int
 -> ResponseHeaders
 -> ResponseBody
 -> Either String (AWSResponse GetSnapshotBlock))
-> Logger
-> Service
-> Proxy GetSnapshotBlock
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetSnapshotBlock)))
forall (m :: * -> *) a.
MonadResource m =>
(Int
 -> ResponseHeaders
 -> ResponseBody
 -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveBody
      ( \Int
s ResponseHeaders
h ResponseBody
x ->
          Maybe Int
-> Maybe ChecksumAlgorithm
-> Maybe Text
-> Int
-> ResponseBody
-> GetSnapshotBlockResponse
GetSnapshotBlockResponse'
            (Maybe Int
 -> Maybe ChecksumAlgorithm
 -> Maybe Text
 -> Int
 -> ResponseBody
 -> GetSnapshotBlockResponse)
-> Either String (Maybe Int)
-> Either
     String
     (Maybe ChecksumAlgorithm
      -> Maybe Text -> Int -> ResponseBody -> GetSnapshotBlockResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (ResponseHeaders
h ResponseHeaders -> HeaderName -> Either String (Maybe Int)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"x-amz-Data-Length")
            Either
  String
  (Maybe ChecksumAlgorithm
   -> Maybe Text -> Int -> ResponseBody -> GetSnapshotBlockResponse)
-> Either String (Maybe ChecksumAlgorithm)
-> Either
     String
     (Maybe Text -> Int -> ResponseBody -> GetSnapshotBlockResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseHeaders
h ResponseHeaders
-> HeaderName -> Either String (Maybe ChecksumAlgorithm)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"x-amz-Checksum-Algorithm")
            Either
  String
  (Maybe Text -> Int -> ResponseBody -> GetSnapshotBlockResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ResponseBody -> GetSnapshotBlockResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseHeaders
h ResponseHeaders -> HeaderName -> Either String (Maybe Text)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"x-amz-Checksum")
            Either String (Int -> ResponseBody -> GetSnapshotBlockResponse)
-> Either String Int
-> Either String (ResponseBody -> GetSnapshotBlockResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            Either String (ResponseBody -> GetSnapshotBlockResponse)
-> Either String ResponseBody
-> Either String GetSnapshotBlockResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseBody -> Either String ResponseBody
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure ResponseBody
x)
      )

instance Prelude.Hashable GetSnapshotBlock

instance Prelude.NFData GetSnapshotBlock

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

instance Core.ToPath GetSnapshotBlock where
  toPath :: GetSnapshotBlock -> ByteString
toPath GetSnapshotBlock' {Natural
Text
blockToken :: Text
blockIndex :: Natural
snapshotId :: Text
$sel:blockToken:GetSnapshotBlock' :: GetSnapshotBlock -> Text
$sel:blockIndex:GetSnapshotBlock' :: GetSnapshotBlock -> Natural
$sel:snapshotId:GetSnapshotBlock' :: GetSnapshotBlock -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/snapshots/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
snapshotId,
        ByteString
"/blocks/",
        Natural -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Natural
blockIndex
      ]

instance Core.ToQuery GetSnapshotBlock where
  toQuery :: GetSnapshotBlock -> QueryString
toQuery GetSnapshotBlock' {Natural
Text
blockToken :: Text
blockIndex :: Natural
snapshotId :: Text
$sel:blockToken:GetSnapshotBlock' :: GetSnapshotBlock -> Text
$sel:blockIndex:GetSnapshotBlock' :: GetSnapshotBlock -> Natural
$sel:snapshotId:GetSnapshotBlock' :: GetSnapshotBlock -> Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"blockToken" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
blockToken]

-- | /See:/ 'newGetSnapshotBlockResponse' smart constructor.
data GetSnapshotBlockResponse = GetSnapshotBlockResponse'
  { -- | The size of the data in the block.
    GetSnapshotBlockResponse -> Maybe Int
dataLength :: Prelude.Maybe Prelude.Int,
    -- | The algorithm used to generate the checksum for the block, such as
    -- SHA256.
    GetSnapshotBlockResponse -> Maybe ChecksumAlgorithm
checksumAlgorithm :: Prelude.Maybe ChecksumAlgorithm,
    -- | The checksum generated for the block, which is Base64 encoded.
    GetSnapshotBlockResponse -> Maybe Text
checksum :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetSnapshotBlockResponse -> Int
httpStatus :: Prelude.Int,
    -- | The data content of the block.
    GetSnapshotBlockResponse -> ResponseBody
blockData :: Core.ResponseBody
  }
  deriving (Int -> GetSnapshotBlockResponse -> ShowS
[GetSnapshotBlockResponse] -> ShowS
GetSnapshotBlockResponse -> String
(Int -> GetSnapshotBlockResponse -> ShowS)
-> (GetSnapshotBlockResponse -> String)
-> ([GetSnapshotBlockResponse] -> ShowS)
-> Show GetSnapshotBlockResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetSnapshotBlockResponse] -> ShowS
$cshowList :: [GetSnapshotBlockResponse] -> ShowS
show :: GetSnapshotBlockResponse -> String
$cshow :: GetSnapshotBlockResponse -> String
showsPrec :: Int -> GetSnapshotBlockResponse -> ShowS
$cshowsPrec :: Int -> GetSnapshotBlockResponse -> ShowS
Prelude.Show, (forall x.
 GetSnapshotBlockResponse -> Rep GetSnapshotBlockResponse x)
-> (forall x.
    Rep GetSnapshotBlockResponse x -> GetSnapshotBlockResponse)
-> Generic GetSnapshotBlockResponse
forall x.
Rep GetSnapshotBlockResponse x -> GetSnapshotBlockResponse
forall x.
GetSnapshotBlockResponse -> Rep GetSnapshotBlockResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetSnapshotBlockResponse x -> GetSnapshotBlockResponse
$cfrom :: forall x.
GetSnapshotBlockResponse -> Rep GetSnapshotBlockResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetSnapshotBlockResponse' 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:
--
-- 'dataLength', 'getSnapshotBlockResponse_dataLength' - The size of the data in the block.
--
-- 'checksumAlgorithm', 'getSnapshotBlockResponse_checksumAlgorithm' - The algorithm used to generate the checksum for the block, such as
-- SHA256.
--
-- 'checksum', 'getSnapshotBlockResponse_checksum' - The checksum generated for the block, which is Base64 encoded.
--
-- 'httpStatus', 'getSnapshotBlockResponse_httpStatus' - The response's http status code.
--
-- 'blockData', 'getSnapshotBlockResponse_blockData' - The data content of the block.
newGetSnapshotBlockResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'blockData'
  Core.ResponseBody ->
  GetSnapshotBlockResponse
newGetSnapshotBlockResponse :: Int -> ResponseBody -> GetSnapshotBlockResponse
newGetSnapshotBlockResponse Int
pHttpStatus_ ResponseBody
pBlockData_ =
  GetSnapshotBlockResponse' :: Maybe Int
-> Maybe ChecksumAlgorithm
-> Maybe Text
-> Int
-> ResponseBody
-> GetSnapshotBlockResponse
GetSnapshotBlockResponse'
    { $sel:dataLength:GetSnapshotBlockResponse' :: Maybe Int
dataLength =
        Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:checksumAlgorithm:GetSnapshotBlockResponse' :: Maybe ChecksumAlgorithm
checksumAlgorithm = Maybe ChecksumAlgorithm
forall a. Maybe a
Prelude.Nothing,
      $sel:checksum:GetSnapshotBlockResponse' :: Maybe Text
checksum = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetSnapshotBlockResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:blockData:GetSnapshotBlockResponse' :: ResponseBody
blockData = ResponseBody
pBlockData_
    }

-- | The size of the data in the block.
getSnapshotBlockResponse_dataLength :: Lens.Lens' GetSnapshotBlockResponse (Prelude.Maybe Prelude.Int)
getSnapshotBlockResponse_dataLength :: (Maybe Int -> f (Maybe Int))
-> GetSnapshotBlockResponse -> f GetSnapshotBlockResponse
getSnapshotBlockResponse_dataLength = (GetSnapshotBlockResponse -> Maybe Int)
-> (GetSnapshotBlockResponse
    -> Maybe Int -> GetSnapshotBlockResponse)
-> Lens
     GetSnapshotBlockResponse
     GetSnapshotBlockResponse
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSnapshotBlockResponse' {Maybe Int
dataLength :: Maybe Int
$sel:dataLength:GetSnapshotBlockResponse' :: GetSnapshotBlockResponse -> Maybe Int
dataLength} -> Maybe Int
dataLength) (\s :: GetSnapshotBlockResponse
s@GetSnapshotBlockResponse' {} Maybe Int
a -> GetSnapshotBlockResponse
s {$sel:dataLength:GetSnapshotBlockResponse' :: Maybe Int
dataLength = Maybe Int
a} :: GetSnapshotBlockResponse)

-- | The algorithm used to generate the checksum for the block, such as
-- SHA256.
getSnapshotBlockResponse_checksumAlgorithm :: Lens.Lens' GetSnapshotBlockResponse (Prelude.Maybe ChecksumAlgorithm)
getSnapshotBlockResponse_checksumAlgorithm :: (Maybe ChecksumAlgorithm -> f (Maybe ChecksumAlgorithm))
-> GetSnapshotBlockResponse -> f GetSnapshotBlockResponse
getSnapshotBlockResponse_checksumAlgorithm = (GetSnapshotBlockResponse -> Maybe ChecksumAlgorithm)
-> (GetSnapshotBlockResponse
    -> Maybe ChecksumAlgorithm -> GetSnapshotBlockResponse)
-> Lens
     GetSnapshotBlockResponse
     GetSnapshotBlockResponse
     (Maybe ChecksumAlgorithm)
     (Maybe ChecksumAlgorithm)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSnapshotBlockResponse' {Maybe ChecksumAlgorithm
checksumAlgorithm :: Maybe ChecksumAlgorithm
$sel:checksumAlgorithm:GetSnapshotBlockResponse' :: GetSnapshotBlockResponse -> Maybe ChecksumAlgorithm
checksumAlgorithm} -> Maybe ChecksumAlgorithm
checksumAlgorithm) (\s :: GetSnapshotBlockResponse
s@GetSnapshotBlockResponse' {} Maybe ChecksumAlgorithm
a -> GetSnapshotBlockResponse
s {$sel:checksumAlgorithm:GetSnapshotBlockResponse' :: Maybe ChecksumAlgorithm
checksumAlgorithm = Maybe ChecksumAlgorithm
a} :: GetSnapshotBlockResponse)

-- | The checksum generated for the block, which is Base64 encoded.
getSnapshotBlockResponse_checksum :: Lens.Lens' GetSnapshotBlockResponse (Prelude.Maybe Prelude.Text)
getSnapshotBlockResponse_checksum :: (Maybe Text -> f (Maybe Text))
-> GetSnapshotBlockResponse -> f GetSnapshotBlockResponse
getSnapshotBlockResponse_checksum = (GetSnapshotBlockResponse -> Maybe Text)
-> (GetSnapshotBlockResponse
    -> Maybe Text -> GetSnapshotBlockResponse)
-> Lens
     GetSnapshotBlockResponse
     GetSnapshotBlockResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSnapshotBlockResponse' {Maybe Text
checksum :: Maybe Text
$sel:checksum:GetSnapshotBlockResponse' :: GetSnapshotBlockResponse -> Maybe Text
checksum} -> Maybe Text
checksum) (\s :: GetSnapshotBlockResponse
s@GetSnapshotBlockResponse' {} Maybe Text
a -> GetSnapshotBlockResponse
s {$sel:checksum:GetSnapshotBlockResponse' :: Maybe Text
checksum = Maybe Text
a} :: GetSnapshotBlockResponse)

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

-- | The data content of the block.
getSnapshotBlockResponse_blockData :: Lens.Lens' GetSnapshotBlockResponse Core.ResponseBody
getSnapshotBlockResponse_blockData :: (ResponseBody -> f ResponseBody)
-> GetSnapshotBlockResponse -> f GetSnapshotBlockResponse
getSnapshotBlockResponse_blockData = (GetSnapshotBlockResponse -> ResponseBody)
-> (GetSnapshotBlockResponse
    -> ResponseBody -> GetSnapshotBlockResponse)
-> Lens
     GetSnapshotBlockResponse
     GetSnapshotBlockResponse
     ResponseBody
     ResponseBody
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSnapshotBlockResponse' {ResponseBody
blockData :: ResponseBody
$sel:blockData:GetSnapshotBlockResponse' :: GetSnapshotBlockResponse -> ResponseBody
blockData} -> ResponseBody
blockData) (\s :: GetSnapshotBlockResponse
s@GetSnapshotBlockResponse' {} ResponseBody
a -> GetSnapshotBlockResponse
s {$sel:blockData:GetSnapshotBlockResponse' :: ResponseBody
blockData = ResponseBody
a} :: GetSnapshotBlockResponse)