{-# 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.QLDB.GetRevision
-- 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 a revision data object for a specified document ID and block
-- address. Also returns a proof of the specified revision for verification
-- if @DigestTipAddress@ is provided.
module Amazonka.QLDB.GetRevision
  ( -- * Creating a Request
    GetRevision (..),
    newGetRevision,

    -- * Request Lenses
    getRevision_digestTipAddress,
    getRevision_name,
    getRevision_blockAddress,
    getRevision_documentId,

    -- * Destructuring the Response
    GetRevisionResponse (..),
    newGetRevisionResponse,

    -- * Response Lenses
    getRevisionResponse_proof,
    getRevisionResponse_httpStatus,
    getRevisionResponse_revision,
  )
where

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

-- | /See:/ 'newGetRevision' smart constructor.
data GetRevision = GetRevision'
  { -- | The latest block location covered by the digest for which to request a
    -- proof. An address is an Amazon Ion structure that has two fields:
    -- @strandId@ and @sequenceNo@.
    --
    -- For example: @{strandId:\"BlFTjlSXze9BIh1KOszcE3\",sequenceNo:49}@.
    GetRevision -> Maybe (Sensitive ValueHolder)
digestTipAddress :: Prelude.Maybe (Core.Sensitive ValueHolder),
    -- | The name of the ledger.
    GetRevision -> Text
name :: Prelude.Text,
    -- | The block location of the document revision to be verified. An address
    -- is an Amazon Ion structure that has two fields: @strandId@ and
    -- @sequenceNo@.
    --
    -- For example: @{strandId:\"BlFTjlSXze9BIh1KOszcE3\",sequenceNo:14}@.
    GetRevision -> Sensitive ValueHolder
blockAddress :: Core.Sensitive ValueHolder,
    -- | The UUID (represented in Base62-encoded text) of the document to be
    -- verified.
    GetRevision -> Text
documentId :: Prelude.Text
  }
  deriving (GetRevision -> GetRevision -> Bool
(GetRevision -> GetRevision -> Bool)
-> (GetRevision -> GetRevision -> Bool) -> Eq GetRevision
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetRevision -> GetRevision -> Bool
$c/= :: GetRevision -> GetRevision -> Bool
== :: GetRevision -> GetRevision -> Bool
$c== :: GetRevision -> GetRevision -> Bool
Prelude.Eq, Int -> GetRevision -> ShowS
[GetRevision] -> ShowS
GetRevision -> String
(Int -> GetRevision -> ShowS)
-> (GetRevision -> String)
-> ([GetRevision] -> ShowS)
-> Show GetRevision
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetRevision] -> ShowS
$cshowList :: [GetRevision] -> ShowS
show :: GetRevision -> String
$cshow :: GetRevision -> String
showsPrec :: Int -> GetRevision -> ShowS
$cshowsPrec :: Int -> GetRevision -> ShowS
Prelude.Show, (forall x. GetRevision -> Rep GetRevision x)
-> (forall x. Rep GetRevision x -> GetRevision)
-> Generic GetRevision
forall x. Rep GetRevision x -> GetRevision
forall x. GetRevision -> Rep GetRevision x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetRevision x -> GetRevision
$cfrom :: forall x. GetRevision -> Rep GetRevision x
Prelude.Generic)

-- |
-- Create a value of 'GetRevision' 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:
--
-- 'digestTipAddress', 'getRevision_digestTipAddress' - The latest block location covered by the digest for which to request a
-- proof. An address is an Amazon Ion structure that has two fields:
-- @strandId@ and @sequenceNo@.
--
-- For example: @{strandId:\"BlFTjlSXze9BIh1KOszcE3\",sequenceNo:49}@.
--
-- 'name', 'getRevision_name' - The name of the ledger.
--
-- 'blockAddress', 'getRevision_blockAddress' - The block location of the document revision to be verified. An address
-- is an Amazon Ion structure that has two fields: @strandId@ and
-- @sequenceNo@.
--
-- For example: @{strandId:\"BlFTjlSXze9BIh1KOszcE3\",sequenceNo:14}@.
--
-- 'documentId', 'getRevision_documentId' - The UUID (represented in Base62-encoded text) of the document to be
-- verified.
newGetRevision ::
  -- | 'name'
  Prelude.Text ->
  -- | 'blockAddress'
  ValueHolder ->
  -- | 'documentId'
  Prelude.Text ->
  GetRevision
newGetRevision :: Text -> ValueHolder -> Text -> GetRevision
newGetRevision Text
pName_ ValueHolder
pBlockAddress_ Text
pDocumentId_ =
  GetRevision' :: Maybe (Sensitive ValueHolder)
-> Text -> Sensitive ValueHolder -> Text -> GetRevision
GetRevision'
    { $sel:digestTipAddress:GetRevision' :: Maybe (Sensitive ValueHolder)
digestTipAddress = Maybe (Sensitive ValueHolder)
forall a. Maybe a
Prelude.Nothing,
      $sel:name:GetRevision' :: Text
name = Text
pName_,
      $sel:blockAddress:GetRevision' :: Sensitive ValueHolder
blockAddress = Tagged ValueHolder (Identity ValueHolder)
-> Tagged
     (Sensitive ValueHolder) (Identity (Sensitive ValueHolder))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Tagged ValueHolder (Identity ValueHolder)
 -> Tagged
      (Sensitive ValueHolder) (Identity (Sensitive ValueHolder)))
-> ValueHolder -> Sensitive ValueHolder
forall t b. AReview t b -> b -> t
Lens.# ValueHolder
pBlockAddress_,
      $sel:documentId:GetRevision' :: Text
documentId = Text
pDocumentId_
    }

-- | The latest block location covered by the digest for which to request a
-- proof. An address is an Amazon Ion structure that has two fields:
-- @strandId@ and @sequenceNo@.
--
-- For example: @{strandId:\"BlFTjlSXze9BIh1KOszcE3\",sequenceNo:49}@.
getRevision_digestTipAddress :: Lens.Lens' GetRevision (Prelude.Maybe ValueHolder)
getRevision_digestTipAddress :: (Maybe ValueHolder -> f (Maybe ValueHolder))
-> GetRevision -> f GetRevision
getRevision_digestTipAddress = (GetRevision -> Maybe (Sensitive ValueHolder))
-> (GetRevision -> Maybe (Sensitive ValueHolder) -> GetRevision)
-> Lens
     GetRevision
     GetRevision
     (Maybe (Sensitive ValueHolder))
     (Maybe (Sensitive ValueHolder))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRevision' {Maybe (Sensitive ValueHolder)
digestTipAddress :: Maybe (Sensitive ValueHolder)
$sel:digestTipAddress:GetRevision' :: GetRevision -> Maybe (Sensitive ValueHolder)
digestTipAddress} -> Maybe (Sensitive ValueHolder)
digestTipAddress) (\s :: GetRevision
s@GetRevision' {} Maybe (Sensitive ValueHolder)
a -> GetRevision
s {$sel:digestTipAddress:GetRevision' :: Maybe (Sensitive ValueHolder)
digestTipAddress = Maybe (Sensitive ValueHolder)
a} :: GetRevision) ((Maybe (Sensitive ValueHolder)
  -> f (Maybe (Sensitive ValueHolder)))
 -> GetRevision -> f GetRevision)
-> ((Maybe ValueHolder -> f (Maybe ValueHolder))
    -> Maybe (Sensitive ValueHolder)
    -> f (Maybe (Sensitive ValueHolder)))
-> (Maybe ValueHolder -> f (Maybe ValueHolder))
-> GetRevision
-> f GetRevision
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (Sensitive ValueHolder)
  (Sensitive ValueHolder)
  ValueHolder
  ValueHolder
-> Iso
     (Maybe (Sensitive ValueHolder))
     (Maybe (Sensitive ValueHolder))
     (Maybe ValueHolder)
     (Maybe ValueHolder)
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 AnIso
  (Sensitive ValueHolder)
  (Sensitive ValueHolder)
  ValueHolder
  ValueHolder
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | The name of the ledger.
getRevision_name :: Lens.Lens' GetRevision Prelude.Text
getRevision_name :: (Text -> f Text) -> GetRevision -> f GetRevision
getRevision_name = (GetRevision -> Text)
-> (GetRevision -> Text -> GetRevision)
-> Lens GetRevision GetRevision Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRevision' {Text
name :: Text
$sel:name:GetRevision' :: GetRevision -> Text
name} -> Text
name) (\s :: GetRevision
s@GetRevision' {} Text
a -> GetRevision
s {$sel:name:GetRevision' :: Text
name = Text
a} :: GetRevision)

-- | The block location of the document revision to be verified. An address
-- is an Amazon Ion structure that has two fields: @strandId@ and
-- @sequenceNo@.
--
-- For example: @{strandId:\"BlFTjlSXze9BIh1KOszcE3\",sequenceNo:14}@.
getRevision_blockAddress :: Lens.Lens' GetRevision ValueHolder
getRevision_blockAddress :: (ValueHolder -> f ValueHolder) -> GetRevision -> f GetRevision
getRevision_blockAddress = (GetRevision -> Sensitive ValueHolder)
-> (GetRevision -> Sensitive ValueHolder -> GetRevision)
-> Lens
     GetRevision
     GetRevision
     (Sensitive ValueHolder)
     (Sensitive ValueHolder)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRevision' {Sensitive ValueHolder
blockAddress :: Sensitive ValueHolder
$sel:blockAddress:GetRevision' :: GetRevision -> Sensitive ValueHolder
blockAddress} -> Sensitive ValueHolder
blockAddress) (\s :: GetRevision
s@GetRevision' {} Sensitive ValueHolder
a -> GetRevision
s {$sel:blockAddress:GetRevision' :: Sensitive ValueHolder
blockAddress = Sensitive ValueHolder
a} :: GetRevision) ((Sensitive ValueHolder -> f (Sensitive ValueHolder))
 -> GetRevision -> f GetRevision)
-> ((ValueHolder -> f ValueHolder)
    -> Sensitive ValueHolder -> f (Sensitive ValueHolder))
-> (ValueHolder -> f ValueHolder)
-> GetRevision
-> f GetRevision
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (ValueHolder -> f ValueHolder)
-> Sensitive ValueHolder -> f (Sensitive ValueHolder)
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | The UUID (represented in Base62-encoded text) of the document to be
-- verified.
getRevision_documentId :: Lens.Lens' GetRevision Prelude.Text
getRevision_documentId :: (Text -> f Text) -> GetRevision -> f GetRevision
getRevision_documentId = (GetRevision -> Text)
-> (GetRevision -> Text -> GetRevision)
-> Lens GetRevision GetRevision Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRevision' {Text
documentId :: Text
$sel:documentId:GetRevision' :: GetRevision -> Text
documentId} -> Text
documentId) (\s :: GetRevision
s@GetRevision' {} Text
a -> GetRevision
s {$sel:documentId:GetRevision' :: Text
documentId = Text
a} :: GetRevision)

instance Core.AWSRequest GetRevision where
  type AWSResponse GetRevision = GetRevisionResponse
  request :: GetRevision -> Request GetRevision
request = Service -> GetRevision -> Request GetRevision
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy GetRevision
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetRevision)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetRevision))
-> Logger
-> Service
-> Proxy GetRevision
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetRevision)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe (Sensitive ValueHolder)
-> Int -> Sensitive ValueHolder -> GetRevisionResponse
GetRevisionResponse'
            (Maybe (Sensitive ValueHolder)
 -> Int -> Sensitive ValueHolder -> GetRevisionResponse)
-> Either String (Maybe (Sensitive ValueHolder))
-> Either
     String (Int -> Sensitive ValueHolder -> GetRevisionResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Sensitive ValueHolder))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Proof")
            Either String (Int -> Sensitive ValueHolder -> GetRevisionResponse)
-> Either String Int
-> Either String (Sensitive ValueHolder -> GetRevisionResponse)
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 (Sensitive ValueHolder -> GetRevisionResponse)
-> Either String (Sensitive ValueHolder)
-> Either String GetRevisionResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Sensitive ValueHolder)
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"Revision")
      )

instance Prelude.Hashable GetRevision

instance Prelude.NFData GetRevision

instance Core.ToHeaders GetRevision where
  toHeaders :: GetRevision -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetRevision -> 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.0" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON GetRevision where
  toJSON :: GetRevision -> Value
toJSON GetRevision' {Maybe (Sensitive ValueHolder)
Text
Sensitive ValueHolder
documentId :: Text
blockAddress :: Sensitive ValueHolder
name :: Text
digestTipAddress :: Maybe (Sensitive ValueHolder)
$sel:documentId:GetRevision' :: GetRevision -> Text
$sel:blockAddress:GetRevision' :: GetRevision -> Sensitive ValueHolder
$sel:name:GetRevision' :: GetRevision -> Text
$sel:digestTipAddress:GetRevision' :: GetRevision -> Maybe (Sensitive ValueHolder)
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"DigestTipAddress" Text -> Sensitive ValueHolder -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Sensitive ValueHolder -> Pair)
-> Maybe (Sensitive ValueHolder) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive ValueHolder)
digestTipAddress,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"BlockAddress" Text -> Sensitive ValueHolder -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive ValueHolder
blockAddress),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"DocumentId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
documentId)
          ]
      )

instance Core.ToPath GetRevision where
  toPath :: GetRevision -> ByteString
toPath GetRevision' {Maybe (Sensitive ValueHolder)
Text
Sensitive ValueHolder
documentId :: Text
blockAddress :: Sensitive ValueHolder
name :: Text
digestTipAddress :: Maybe (Sensitive ValueHolder)
$sel:documentId:GetRevision' :: GetRevision -> Text
$sel:blockAddress:GetRevision' :: GetRevision -> Sensitive ValueHolder
$sel:name:GetRevision' :: GetRevision -> Text
$sel:digestTipAddress:GetRevision' :: GetRevision -> Maybe (Sensitive ValueHolder)
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/ledgers/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
name, ByteString
"/revision"]

instance Core.ToQuery GetRevision where
  toQuery :: GetRevision -> QueryString
toQuery = QueryString -> GetRevision -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newGetRevisionResponse' smart constructor.
data GetRevisionResponse = GetRevisionResponse'
  { -- | The proof object in Amazon Ion format returned by a @GetRevision@
    -- request. A proof contains the list of hash values that are required to
    -- recalculate the specified digest using a Merkle tree, starting with the
    -- specified document revision.
    GetRevisionResponse -> Maybe (Sensitive ValueHolder)
proof :: Prelude.Maybe (Core.Sensitive ValueHolder),
    -- | The response's http status code.
    GetRevisionResponse -> Int
httpStatus :: Prelude.Int,
    -- | The document revision data object in Amazon Ion format.
    GetRevisionResponse -> Sensitive ValueHolder
revision :: Core.Sensitive ValueHolder
  }
  deriving (GetRevisionResponse -> GetRevisionResponse -> Bool
(GetRevisionResponse -> GetRevisionResponse -> Bool)
-> (GetRevisionResponse -> GetRevisionResponse -> Bool)
-> Eq GetRevisionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetRevisionResponse -> GetRevisionResponse -> Bool
$c/= :: GetRevisionResponse -> GetRevisionResponse -> Bool
== :: GetRevisionResponse -> GetRevisionResponse -> Bool
$c== :: GetRevisionResponse -> GetRevisionResponse -> Bool
Prelude.Eq, Int -> GetRevisionResponse -> ShowS
[GetRevisionResponse] -> ShowS
GetRevisionResponse -> String
(Int -> GetRevisionResponse -> ShowS)
-> (GetRevisionResponse -> String)
-> ([GetRevisionResponse] -> ShowS)
-> Show GetRevisionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetRevisionResponse] -> ShowS
$cshowList :: [GetRevisionResponse] -> ShowS
show :: GetRevisionResponse -> String
$cshow :: GetRevisionResponse -> String
showsPrec :: Int -> GetRevisionResponse -> ShowS
$cshowsPrec :: Int -> GetRevisionResponse -> ShowS
Prelude.Show, (forall x. GetRevisionResponse -> Rep GetRevisionResponse x)
-> (forall x. Rep GetRevisionResponse x -> GetRevisionResponse)
-> Generic GetRevisionResponse
forall x. Rep GetRevisionResponse x -> GetRevisionResponse
forall x. GetRevisionResponse -> Rep GetRevisionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetRevisionResponse x -> GetRevisionResponse
$cfrom :: forall x. GetRevisionResponse -> Rep GetRevisionResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetRevisionResponse' 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:
--
-- 'proof', 'getRevisionResponse_proof' - The proof object in Amazon Ion format returned by a @GetRevision@
-- request. A proof contains the list of hash values that are required to
-- recalculate the specified digest using a Merkle tree, starting with the
-- specified document revision.
--
-- 'httpStatus', 'getRevisionResponse_httpStatus' - The response's http status code.
--
-- 'revision', 'getRevisionResponse_revision' - The document revision data object in Amazon Ion format.
newGetRevisionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'revision'
  ValueHolder ->
  GetRevisionResponse
newGetRevisionResponse :: Int -> ValueHolder -> GetRevisionResponse
newGetRevisionResponse Int
pHttpStatus_ ValueHolder
pRevision_ =
  GetRevisionResponse' :: Maybe (Sensitive ValueHolder)
-> Int -> Sensitive ValueHolder -> GetRevisionResponse
GetRevisionResponse'
    { $sel:proof:GetRevisionResponse' :: Maybe (Sensitive ValueHolder)
proof = Maybe (Sensitive ValueHolder)
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetRevisionResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:revision:GetRevisionResponse' :: Sensitive ValueHolder
revision = Tagged ValueHolder (Identity ValueHolder)
-> Tagged
     (Sensitive ValueHolder) (Identity (Sensitive ValueHolder))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Tagged ValueHolder (Identity ValueHolder)
 -> Tagged
      (Sensitive ValueHolder) (Identity (Sensitive ValueHolder)))
-> ValueHolder -> Sensitive ValueHolder
forall t b. AReview t b -> b -> t
Lens.# ValueHolder
pRevision_
    }

-- | The proof object in Amazon Ion format returned by a @GetRevision@
-- request. A proof contains the list of hash values that are required to
-- recalculate the specified digest using a Merkle tree, starting with the
-- specified document revision.
getRevisionResponse_proof :: Lens.Lens' GetRevisionResponse (Prelude.Maybe ValueHolder)
getRevisionResponse_proof :: (Maybe ValueHolder -> f (Maybe ValueHolder))
-> GetRevisionResponse -> f GetRevisionResponse
getRevisionResponse_proof = (GetRevisionResponse -> Maybe (Sensitive ValueHolder))
-> (GetRevisionResponse
    -> Maybe (Sensitive ValueHolder) -> GetRevisionResponse)
-> Lens
     GetRevisionResponse
     GetRevisionResponse
     (Maybe (Sensitive ValueHolder))
     (Maybe (Sensitive ValueHolder))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRevisionResponse' {Maybe (Sensitive ValueHolder)
proof :: Maybe (Sensitive ValueHolder)
$sel:proof:GetRevisionResponse' :: GetRevisionResponse -> Maybe (Sensitive ValueHolder)
proof} -> Maybe (Sensitive ValueHolder)
proof) (\s :: GetRevisionResponse
s@GetRevisionResponse' {} Maybe (Sensitive ValueHolder)
a -> GetRevisionResponse
s {$sel:proof:GetRevisionResponse' :: Maybe (Sensitive ValueHolder)
proof = Maybe (Sensitive ValueHolder)
a} :: GetRevisionResponse) ((Maybe (Sensitive ValueHolder)
  -> f (Maybe (Sensitive ValueHolder)))
 -> GetRevisionResponse -> f GetRevisionResponse)
-> ((Maybe ValueHolder -> f (Maybe ValueHolder))
    -> Maybe (Sensitive ValueHolder)
    -> f (Maybe (Sensitive ValueHolder)))
-> (Maybe ValueHolder -> f (Maybe ValueHolder))
-> GetRevisionResponse
-> f GetRevisionResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (Sensitive ValueHolder)
  (Sensitive ValueHolder)
  ValueHolder
  ValueHolder
-> Iso
     (Maybe (Sensitive ValueHolder))
     (Maybe (Sensitive ValueHolder))
     (Maybe ValueHolder)
     (Maybe ValueHolder)
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 AnIso
  (Sensitive ValueHolder)
  (Sensitive ValueHolder)
  ValueHolder
  ValueHolder
forall a. Iso' (Sensitive a) a
Core._Sensitive

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

-- | The document revision data object in Amazon Ion format.
getRevisionResponse_revision :: Lens.Lens' GetRevisionResponse ValueHolder
getRevisionResponse_revision :: (ValueHolder -> f ValueHolder)
-> GetRevisionResponse -> f GetRevisionResponse
getRevisionResponse_revision = (GetRevisionResponse -> Sensitive ValueHolder)
-> (GetRevisionResponse
    -> Sensitive ValueHolder -> GetRevisionResponse)
-> Lens
     GetRevisionResponse
     GetRevisionResponse
     (Sensitive ValueHolder)
     (Sensitive ValueHolder)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRevisionResponse' {Sensitive ValueHolder
revision :: Sensitive ValueHolder
$sel:revision:GetRevisionResponse' :: GetRevisionResponse -> Sensitive ValueHolder
revision} -> Sensitive ValueHolder
revision) (\s :: GetRevisionResponse
s@GetRevisionResponse' {} Sensitive ValueHolder
a -> GetRevisionResponse
s {$sel:revision:GetRevisionResponse' :: Sensitive ValueHolder
revision = Sensitive ValueHolder
a} :: GetRevisionResponse) ((Sensitive ValueHolder -> f (Sensitive ValueHolder))
 -> GetRevisionResponse -> f GetRevisionResponse)
-> ((ValueHolder -> f ValueHolder)
    -> Sensitive ValueHolder -> f (Sensitive ValueHolder))
-> (ValueHolder -> f ValueHolder)
-> GetRevisionResponse
-> f GetRevisionResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (ValueHolder -> f ValueHolder)
-> Sensitive ValueHolder -> f (Sensitive ValueHolder)
forall a. Iso' (Sensitive a) a
Core._Sensitive

instance Prelude.NFData GetRevisionResponse