{-# 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.WorkDocs.GetDocumentVersion
-- 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)
--
-- Retrieves version metadata for the specified document.
module Amazonka.WorkDocs.GetDocumentVersion
  ( -- * Creating a Request
    GetDocumentVersion (..),
    newGetDocumentVersion,

    -- * Request Lenses
    getDocumentVersion_authenticationToken,
    getDocumentVersion_includeCustomMetadata,
    getDocumentVersion_fields,
    getDocumentVersion_documentId,
    getDocumentVersion_versionId,

    -- * Destructuring the Response
    GetDocumentVersionResponse (..),
    newGetDocumentVersionResponse,

    -- * Response Lenses
    getDocumentVersionResponse_customMetadata,
    getDocumentVersionResponse_metadata,
    getDocumentVersionResponse_httpStatus,
  )
where

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

-- | /See:/ 'newGetDocumentVersion' smart constructor.
data GetDocumentVersion = GetDocumentVersion'
  { -- | Amazon WorkDocs authentication token. Not required when using AWS
    -- administrator credentials to access the API.
    GetDocumentVersion -> Maybe (Sensitive Text)
authenticationToken :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | Set this to TRUE to include custom metadata in the response.
    GetDocumentVersion -> Maybe Bool
includeCustomMetadata :: Prelude.Maybe Prelude.Bool,
    -- | A comma-separated list of values. Specify \"SOURCE\" to include a URL
    -- for the source document.
    GetDocumentVersion -> Maybe Text
fields :: Prelude.Maybe Prelude.Text,
    -- | The ID of the document.
    GetDocumentVersion -> Text
documentId :: Prelude.Text,
    -- | The version ID of the document.
    GetDocumentVersion -> Text
versionId :: Prelude.Text
  }
  deriving (GetDocumentVersion -> GetDocumentVersion -> Bool
(GetDocumentVersion -> GetDocumentVersion -> Bool)
-> (GetDocumentVersion -> GetDocumentVersion -> Bool)
-> Eq GetDocumentVersion
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetDocumentVersion -> GetDocumentVersion -> Bool
$c/= :: GetDocumentVersion -> GetDocumentVersion -> Bool
== :: GetDocumentVersion -> GetDocumentVersion -> Bool
$c== :: GetDocumentVersion -> GetDocumentVersion -> Bool
Prelude.Eq, Int -> GetDocumentVersion -> ShowS
[GetDocumentVersion] -> ShowS
GetDocumentVersion -> String
(Int -> GetDocumentVersion -> ShowS)
-> (GetDocumentVersion -> String)
-> ([GetDocumentVersion] -> ShowS)
-> Show GetDocumentVersion
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetDocumentVersion] -> ShowS
$cshowList :: [GetDocumentVersion] -> ShowS
show :: GetDocumentVersion -> String
$cshow :: GetDocumentVersion -> String
showsPrec :: Int -> GetDocumentVersion -> ShowS
$cshowsPrec :: Int -> GetDocumentVersion -> ShowS
Prelude.Show, (forall x. GetDocumentVersion -> Rep GetDocumentVersion x)
-> (forall x. Rep GetDocumentVersion x -> GetDocumentVersion)
-> Generic GetDocumentVersion
forall x. Rep GetDocumentVersion x -> GetDocumentVersion
forall x. GetDocumentVersion -> Rep GetDocumentVersion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetDocumentVersion x -> GetDocumentVersion
$cfrom :: forall x. GetDocumentVersion -> Rep GetDocumentVersion x
Prelude.Generic)

-- |
-- Create a value of 'GetDocumentVersion' 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:
--
-- 'authenticationToken', 'getDocumentVersion_authenticationToken' - Amazon WorkDocs authentication token. Not required when using AWS
-- administrator credentials to access the API.
--
-- 'includeCustomMetadata', 'getDocumentVersion_includeCustomMetadata' - Set this to TRUE to include custom metadata in the response.
--
-- 'fields', 'getDocumentVersion_fields' - A comma-separated list of values. Specify \"SOURCE\" to include a URL
-- for the source document.
--
-- 'documentId', 'getDocumentVersion_documentId' - The ID of the document.
--
-- 'versionId', 'getDocumentVersion_versionId' - The version ID of the document.
newGetDocumentVersion ::
  -- | 'documentId'
  Prelude.Text ->
  -- | 'versionId'
  Prelude.Text ->
  GetDocumentVersion
newGetDocumentVersion :: Text -> Text -> GetDocumentVersion
newGetDocumentVersion Text
pDocumentId_ Text
pVersionId_ =
  GetDocumentVersion' :: Maybe (Sensitive Text)
-> Maybe Bool -> Maybe Text -> Text -> Text -> GetDocumentVersion
GetDocumentVersion'
    { $sel:authenticationToken:GetDocumentVersion' :: Maybe (Sensitive Text)
authenticationToken =
        Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:includeCustomMetadata:GetDocumentVersion' :: Maybe Bool
includeCustomMetadata = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:fields:GetDocumentVersion' :: Maybe Text
fields = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:documentId:GetDocumentVersion' :: Text
documentId = Text
pDocumentId_,
      $sel:versionId:GetDocumentVersion' :: Text
versionId = Text
pVersionId_
    }

-- | Amazon WorkDocs authentication token. Not required when using AWS
-- administrator credentials to access the API.
getDocumentVersion_authenticationToken :: Lens.Lens' GetDocumentVersion (Prelude.Maybe Prelude.Text)
getDocumentVersion_authenticationToken :: (Maybe Text -> f (Maybe Text))
-> GetDocumentVersion -> f GetDocumentVersion
getDocumentVersion_authenticationToken = (GetDocumentVersion -> Maybe (Sensitive Text))
-> (GetDocumentVersion
    -> Maybe (Sensitive Text) -> GetDocumentVersion)
-> Lens
     GetDocumentVersion
     GetDocumentVersion
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDocumentVersion' {Maybe (Sensitive Text)
authenticationToken :: Maybe (Sensitive Text)
$sel:authenticationToken:GetDocumentVersion' :: GetDocumentVersion -> Maybe (Sensitive Text)
authenticationToken} -> Maybe (Sensitive Text)
authenticationToken) (\s :: GetDocumentVersion
s@GetDocumentVersion' {} Maybe (Sensitive Text)
a -> GetDocumentVersion
s {$sel:authenticationToken:GetDocumentVersion' :: Maybe (Sensitive Text)
authenticationToken = Maybe (Sensitive Text)
a} :: GetDocumentVersion) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> GetDocumentVersion -> f GetDocumentVersion)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> GetDocumentVersion
-> f GetDocumentVersion
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
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 Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | Set this to TRUE to include custom metadata in the response.
getDocumentVersion_includeCustomMetadata :: Lens.Lens' GetDocumentVersion (Prelude.Maybe Prelude.Bool)
getDocumentVersion_includeCustomMetadata :: (Maybe Bool -> f (Maybe Bool))
-> GetDocumentVersion -> f GetDocumentVersion
getDocumentVersion_includeCustomMetadata = (GetDocumentVersion -> Maybe Bool)
-> (GetDocumentVersion -> Maybe Bool -> GetDocumentVersion)
-> Lens
     GetDocumentVersion GetDocumentVersion (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDocumentVersion' {Maybe Bool
includeCustomMetadata :: Maybe Bool
$sel:includeCustomMetadata:GetDocumentVersion' :: GetDocumentVersion -> Maybe Bool
includeCustomMetadata} -> Maybe Bool
includeCustomMetadata) (\s :: GetDocumentVersion
s@GetDocumentVersion' {} Maybe Bool
a -> GetDocumentVersion
s {$sel:includeCustomMetadata:GetDocumentVersion' :: Maybe Bool
includeCustomMetadata = Maybe Bool
a} :: GetDocumentVersion)

-- | A comma-separated list of values. Specify \"SOURCE\" to include a URL
-- for the source document.
getDocumentVersion_fields :: Lens.Lens' GetDocumentVersion (Prelude.Maybe Prelude.Text)
getDocumentVersion_fields :: (Maybe Text -> f (Maybe Text))
-> GetDocumentVersion -> f GetDocumentVersion
getDocumentVersion_fields = (GetDocumentVersion -> Maybe Text)
-> (GetDocumentVersion -> Maybe Text -> GetDocumentVersion)
-> Lens
     GetDocumentVersion GetDocumentVersion (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDocumentVersion' {Maybe Text
fields :: Maybe Text
$sel:fields:GetDocumentVersion' :: GetDocumentVersion -> Maybe Text
fields} -> Maybe Text
fields) (\s :: GetDocumentVersion
s@GetDocumentVersion' {} Maybe Text
a -> GetDocumentVersion
s {$sel:fields:GetDocumentVersion' :: Maybe Text
fields = Maybe Text
a} :: GetDocumentVersion)

-- | The ID of the document.
getDocumentVersion_documentId :: Lens.Lens' GetDocumentVersion Prelude.Text
getDocumentVersion_documentId :: (Text -> f Text) -> GetDocumentVersion -> f GetDocumentVersion
getDocumentVersion_documentId = (GetDocumentVersion -> Text)
-> (GetDocumentVersion -> Text -> GetDocumentVersion)
-> Lens GetDocumentVersion GetDocumentVersion Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDocumentVersion' {Text
documentId :: Text
$sel:documentId:GetDocumentVersion' :: GetDocumentVersion -> Text
documentId} -> Text
documentId) (\s :: GetDocumentVersion
s@GetDocumentVersion' {} Text
a -> GetDocumentVersion
s {$sel:documentId:GetDocumentVersion' :: Text
documentId = Text
a} :: GetDocumentVersion)

-- | The version ID of the document.
getDocumentVersion_versionId :: Lens.Lens' GetDocumentVersion Prelude.Text
getDocumentVersion_versionId :: (Text -> f Text) -> GetDocumentVersion -> f GetDocumentVersion
getDocumentVersion_versionId = (GetDocumentVersion -> Text)
-> (GetDocumentVersion -> Text -> GetDocumentVersion)
-> Lens GetDocumentVersion GetDocumentVersion Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDocumentVersion' {Text
versionId :: Text
$sel:versionId:GetDocumentVersion' :: GetDocumentVersion -> Text
versionId} -> Text
versionId) (\s :: GetDocumentVersion
s@GetDocumentVersion' {} Text
a -> GetDocumentVersion
s {$sel:versionId:GetDocumentVersion' :: Text
versionId = Text
a} :: GetDocumentVersion)

instance Core.AWSRequest GetDocumentVersion where
  type
    AWSResponse GetDocumentVersion =
      GetDocumentVersionResponse
  request :: GetDocumentVersion -> Request GetDocumentVersion
request = Service -> GetDocumentVersion -> Request GetDocumentVersion
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy GetDocumentVersion
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetDocumentVersion)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetDocumentVersion))
-> Logger
-> Service
-> Proxy GetDocumentVersion
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetDocumentVersion)))
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 (HashMap Text Text)
-> Maybe DocumentVersionMetadata
-> Int
-> GetDocumentVersionResponse
GetDocumentVersionResponse'
            (Maybe (HashMap Text Text)
 -> Maybe DocumentVersionMetadata
 -> Int
 -> GetDocumentVersionResponse)
-> Either String (Maybe (HashMap Text Text))
-> Either
     String
     (Maybe DocumentVersionMetadata
      -> Int -> GetDocumentVersionResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CustomMetadata" Either String (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text)
-> Either String (Maybe (HashMap Text Text))
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (Maybe DocumentVersionMetadata
   -> Int -> GetDocumentVersionResponse)
-> Either String (Maybe DocumentVersionMetadata)
-> Either String (Int -> GetDocumentVersionResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe DocumentVersionMetadata)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Metadata")
            Either String (Int -> GetDocumentVersionResponse)
-> Either String Int -> Either String GetDocumentVersionResponse
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))
      )

instance Prelude.Hashable GetDocumentVersion

instance Prelude.NFData GetDocumentVersion

instance Core.ToHeaders GetDocumentVersion where
  toHeaders :: GetDocumentVersion -> ResponseHeaders
toHeaders GetDocumentVersion' {Maybe Bool
Maybe Text
Maybe (Sensitive Text)
Text
versionId :: Text
documentId :: Text
fields :: Maybe Text
includeCustomMetadata :: Maybe Bool
authenticationToken :: Maybe (Sensitive Text)
$sel:versionId:GetDocumentVersion' :: GetDocumentVersion -> Text
$sel:documentId:GetDocumentVersion' :: GetDocumentVersion -> Text
$sel:fields:GetDocumentVersion' :: GetDocumentVersion -> Maybe Text
$sel:includeCustomMetadata:GetDocumentVersion' :: GetDocumentVersion -> Maybe Bool
$sel:authenticationToken:GetDocumentVersion' :: GetDocumentVersion -> Maybe (Sensitive Text)
..} =
    [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ HeaderName
"Authentication" HeaderName -> Maybe (Sensitive Text) -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe (Sensitive Text)
authenticationToken,
        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 GetDocumentVersion where
  toPath :: GetDocumentVersion -> ByteString
toPath GetDocumentVersion' {Maybe Bool
Maybe Text
Maybe (Sensitive Text)
Text
versionId :: Text
documentId :: Text
fields :: Maybe Text
includeCustomMetadata :: Maybe Bool
authenticationToken :: Maybe (Sensitive Text)
$sel:versionId:GetDocumentVersion' :: GetDocumentVersion -> Text
$sel:documentId:GetDocumentVersion' :: GetDocumentVersion -> Text
$sel:fields:GetDocumentVersion' :: GetDocumentVersion -> Maybe Text
$sel:includeCustomMetadata:GetDocumentVersion' :: GetDocumentVersion -> Maybe Bool
$sel:authenticationToken:GetDocumentVersion' :: GetDocumentVersion -> Maybe (Sensitive Text)
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/api/v1/documents/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
documentId,
        ByteString
"/versions/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
versionId
      ]

instance Core.ToQuery GetDocumentVersion where
  toQuery :: GetDocumentVersion -> QueryString
toQuery GetDocumentVersion' {Maybe Bool
Maybe Text
Maybe (Sensitive Text)
Text
versionId :: Text
documentId :: Text
fields :: Maybe Text
includeCustomMetadata :: Maybe Bool
authenticationToken :: Maybe (Sensitive Text)
$sel:versionId:GetDocumentVersion' :: GetDocumentVersion -> Text
$sel:documentId:GetDocumentVersion' :: GetDocumentVersion -> Text
$sel:fields:GetDocumentVersion' :: GetDocumentVersion -> Maybe Text
$sel:includeCustomMetadata:GetDocumentVersion' :: GetDocumentVersion -> Maybe Bool
$sel:authenticationToken:GetDocumentVersion' :: GetDocumentVersion -> Maybe (Sensitive Text)
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"includeCustomMetadata"
          ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
includeCustomMetadata,
        ByteString
"fields" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
fields
      ]

-- | /See:/ 'newGetDocumentVersionResponse' smart constructor.
data GetDocumentVersionResponse = GetDocumentVersionResponse'
  { -- | The custom metadata on the document version.
    GetDocumentVersionResponse -> Maybe (HashMap Text Text)
customMetadata :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The version metadata.
    GetDocumentVersionResponse -> Maybe DocumentVersionMetadata
metadata :: Prelude.Maybe DocumentVersionMetadata,
    -- | The response's http status code.
    GetDocumentVersionResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetDocumentVersionResponse -> GetDocumentVersionResponse -> Bool
(GetDocumentVersionResponse -> GetDocumentVersionResponse -> Bool)
-> (GetDocumentVersionResponse
    -> GetDocumentVersionResponse -> Bool)
-> Eq GetDocumentVersionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetDocumentVersionResponse -> GetDocumentVersionResponse -> Bool
$c/= :: GetDocumentVersionResponse -> GetDocumentVersionResponse -> Bool
== :: GetDocumentVersionResponse -> GetDocumentVersionResponse -> Bool
$c== :: GetDocumentVersionResponse -> GetDocumentVersionResponse -> Bool
Prelude.Eq, Int -> GetDocumentVersionResponse -> ShowS
[GetDocumentVersionResponse] -> ShowS
GetDocumentVersionResponse -> String
(Int -> GetDocumentVersionResponse -> ShowS)
-> (GetDocumentVersionResponse -> String)
-> ([GetDocumentVersionResponse] -> ShowS)
-> Show GetDocumentVersionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetDocumentVersionResponse] -> ShowS
$cshowList :: [GetDocumentVersionResponse] -> ShowS
show :: GetDocumentVersionResponse -> String
$cshow :: GetDocumentVersionResponse -> String
showsPrec :: Int -> GetDocumentVersionResponse -> ShowS
$cshowsPrec :: Int -> GetDocumentVersionResponse -> ShowS
Prelude.Show, (forall x.
 GetDocumentVersionResponse -> Rep GetDocumentVersionResponse x)
-> (forall x.
    Rep GetDocumentVersionResponse x -> GetDocumentVersionResponse)
-> Generic GetDocumentVersionResponse
forall x.
Rep GetDocumentVersionResponse x -> GetDocumentVersionResponse
forall x.
GetDocumentVersionResponse -> Rep GetDocumentVersionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetDocumentVersionResponse x -> GetDocumentVersionResponse
$cfrom :: forall x.
GetDocumentVersionResponse -> Rep GetDocumentVersionResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetDocumentVersionResponse' 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:
--
-- 'customMetadata', 'getDocumentVersionResponse_customMetadata' - The custom metadata on the document version.
--
-- 'metadata', 'getDocumentVersionResponse_metadata' - The version metadata.
--
-- 'httpStatus', 'getDocumentVersionResponse_httpStatus' - The response's http status code.
newGetDocumentVersionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetDocumentVersionResponse
newGetDocumentVersionResponse :: Int -> GetDocumentVersionResponse
newGetDocumentVersionResponse Int
pHttpStatus_ =
  GetDocumentVersionResponse' :: Maybe (HashMap Text Text)
-> Maybe DocumentVersionMetadata
-> Int
-> GetDocumentVersionResponse
GetDocumentVersionResponse'
    { $sel:customMetadata:GetDocumentVersionResponse' :: Maybe (HashMap Text Text)
customMetadata =
        Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:metadata:GetDocumentVersionResponse' :: Maybe DocumentVersionMetadata
metadata = Maybe DocumentVersionMetadata
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetDocumentVersionResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The custom metadata on the document version.
getDocumentVersionResponse_customMetadata :: Lens.Lens' GetDocumentVersionResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
getDocumentVersionResponse_customMetadata :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> GetDocumentVersionResponse -> f GetDocumentVersionResponse
getDocumentVersionResponse_customMetadata = (GetDocumentVersionResponse -> Maybe (HashMap Text Text))
-> (GetDocumentVersionResponse
    -> Maybe (HashMap Text Text) -> GetDocumentVersionResponse)
-> Lens
     GetDocumentVersionResponse
     GetDocumentVersionResponse
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDocumentVersionResponse' {Maybe (HashMap Text Text)
customMetadata :: Maybe (HashMap Text Text)
$sel:customMetadata:GetDocumentVersionResponse' :: GetDocumentVersionResponse -> Maybe (HashMap Text Text)
customMetadata} -> Maybe (HashMap Text Text)
customMetadata) (\s :: GetDocumentVersionResponse
s@GetDocumentVersionResponse' {} Maybe (HashMap Text Text)
a -> GetDocumentVersionResponse
s {$sel:customMetadata:GetDocumentVersionResponse' :: Maybe (HashMap Text Text)
customMetadata = Maybe (HashMap Text Text)
a} :: GetDocumentVersionResponse) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> GetDocumentVersionResponse -> f GetDocumentVersionResponse)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> GetDocumentVersionResponse
-> f GetDocumentVersionResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The version metadata.
getDocumentVersionResponse_metadata :: Lens.Lens' GetDocumentVersionResponse (Prelude.Maybe DocumentVersionMetadata)
getDocumentVersionResponse_metadata :: (Maybe DocumentVersionMetadata
 -> f (Maybe DocumentVersionMetadata))
-> GetDocumentVersionResponse -> f GetDocumentVersionResponse
getDocumentVersionResponse_metadata = (GetDocumentVersionResponse -> Maybe DocumentVersionMetadata)
-> (GetDocumentVersionResponse
    -> Maybe DocumentVersionMetadata -> GetDocumentVersionResponse)
-> Lens
     GetDocumentVersionResponse
     GetDocumentVersionResponse
     (Maybe DocumentVersionMetadata)
     (Maybe DocumentVersionMetadata)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDocumentVersionResponse' {Maybe DocumentVersionMetadata
metadata :: Maybe DocumentVersionMetadata
$sel:metadata:GetDocumentVersionResponse' :: GetDocumentVersionResponse -> Maybe DocumentVersionMetadata
metadata} -> Maybe DocumentVersionMetadata
metadata) (\s :: GetDocumentVersionResponse
s@GetDocumentVersionResponse' {} Maybe DocumentVersionMetadata
a -> GetDocumentVersionResponse
s {$sel:metadata:GetDocumentVersionResponse' :: Maybe DocumentVersionMetadata
metadata = Maybe DocumentVersionMetadata
a} :: GetDocumentVersionResponse)

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

instance Prelude.NFData GetDocumentVersionResponse