{-# 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.GetDocument
-- 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 details of a document.
module Amazonka.WorkDocs.GetDocument
  ( -- * Creating a Request
    GetDocument (..),
    newGetDocument,

    -- * Request Lenses
    getDocument_authenticationToken,
    getDocument_includeCustomMetadata,
    getDocument_documentId,

    -- * Destructuring the Response
    GetDocumentResponse (..),
    newGetDocumentResponse,

    -- * Response Lenses
    getDocumentResponse_customMetadata,
    getDocumentResponse_metadata,
    getDocumentResponse_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:/ 'newGetDocument' smart constructor.
data GetDocument = GetDocument'
  { -- | Amazon WorkDocs authentication token. Not required when using AWS
    -- administrator credentials to access the API.
    GetDocument -> Maybe (Sensitive Text)
authenticationToken :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | Set this to @TRUE@ to include custom metadata in the response.
    GetDocument -> Maybe Bool
includeCustomMetadata :: Prelude.Maybe Prelude.Bool,
    -- | The ID of the document.
    GetDocument -> Text
documentId :: Prelude.Text
  }
  deriving (GetDocument -> GetDocument -> Bool
(GetDocument -> GetDocument -> Bool)
-> (GetDocument -> GetDocument -> Bool) -> Eq GetDocument
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetDocument -> GetDocument -> Bool
$c/= :: GetDocument -> GetDocument -> Bool
== :: GetDocument -> GetDocument -> Bool
$c== :: GetDocument -> GetDocument -> Bool
Prelude.Eq, Int -> GetDocument -> ShowS
[GetDocument] -> ShowS
GetDocument -> String
(Int -> GetDocument -> ShowS)
-> (GetDocument -> String)
-> ([GetDocument] -> ShowS)
-> Show GetDocument
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetDocument] -> ShowS
$cshowList :: [GetDocument] -> ShowS
show :: GetDocument -> String
$cshow :: GetDocument -> String
showsPrec :: Int -> GetDocument -> ShowS
$cshowsPrec :: Int -> GetDocument -> ShowS
Prelude.Show, (forall x. GetDocument -> Rep GetDocument x)
-> (forall x. Rep GetDocument x -> GetDocument)
-> Generic GetDocument
forall x. Rep GetDocument x -> GetDocument
forall x. GetDocument -> Rep GetDocument x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetDocument x -> GetDocument
$cfrom :: forall x. GetDocument -> Rep GetDocument x
Prelude.Generic)

-- |
-- Create a value of 'GetDocument' 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', 'getDocument_authenticationToken' - Amazon WorkDocs authentication token. Not required when using AWS
-- administrator credentials to access the API.
--
-- 'includeCustomMetadata', 'getDocument_includeCustomMetadata' - Set this to @TRUE@ to include custom metadata in the response.
--
-- 'documentId', 'getDocument_documentId' - The ID of the document.
newGetDocument ::
  -- | 'documentId'
  Prelude.Text ->
  GetDocument
newGetDocument :: Text -> GetDocument
newGetDocument Text
pDocumentId_ =
  GetDocument' :: Maybe (Sensitive Text) -> Maybe Bool -> Text -> GetDocument
GetDocument'
    { $sel:authenticationToken:GetDocument' :: Maybe (Sensitive Text)
authenticationToken = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:includeCustomMetadata:GetDocument' :: Maybe Bool
includeCustomMetadata = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:documentId:GetDocument' :: Text
documentId = Text
pDocumentId_
    }

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

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

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

instance Prelude.NFData GetDocument

instance Core.ToHeaders GetDocument where
  toHeaders :: GetDocument -> ResponseHeaders
toHeaders GetDocument' {Maybe Bool
Maybe (Sensitive Text)
Text
documentId :: Text
includeCustomMetadata :: Maybe Bool
authenticationToken :: Maybe (Sensitive Text)
$sel:documentId:GetDocument' :: GetDocument -> Text
$sel:includeCustomMetadata:GetDocument' :: GetDocument -> Maybe Bool
$sel:authenticationToken:GetDocument' :: GetDocument -> 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 GetDocument where
  toPath :: GetDocument -> ByteString
toPath GetDocument' {Maybe Bool
Maybe (Sensitive Text)
Text
documentId :: Text
includeCustomMetadata :: Maybe Bool
authenticationToken :: Maybe (Sensitive Text)
$sel:documentId:GetDocument' :: GetDocument -> Text
$sel:includeCustomMetadata:GetDocument' :: GetDocument -> Maybe Bool
$sel:authenticationToken:GetDocument' :: GetDocument -> 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]

instance Core.ToQuery GetDocument where
  toQuery :: GetDocument -> QueryString
toQuery GetDocument' {Maybe Bool
Maybe (Sensitive Text)
Text
documentId :: Text
includeCustomMetadata :: Maybe Bool
authenticationToken :: Maybe (Sensitive Text)
$sel:documentId:GetDocument' :: GetDocument -> Text
$sel:includeCustomMetadata:GetDocument' :: GetDocument -> Maybe Bool
$sel:authenticationToken:GetDocument' :: GetDocument -> 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
      ]

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

-- |
-- Create a value of 'GetDocumentResponse' 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', 'getDocumentResponse_customMetadata' - The custom metadata on the document.
--
-- 'metadata', 'getDocumentResponse_metadata' - The metadata details of the document.
--
-- 'httpStatus', 'getDocumentResponse_httpStatus' - The response's http status code.
newGetDocumentResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetDocumentResponse
newGetDocumentResponse :: Int -> GetDocumentResponse
newGetDocumentResponse Int
pHttpStatus_ =
  GetDocumentResponse' :: Maybe (HashMap Text Text)
-> Maybe DocumentMetadata -> Int -> GetDocumentResponse
GetDocumentResponse'
    { $sel:customMetadata:GetDocumentResponse' :: Maybe (HashMap Text Text)
customMetadata =
        Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:metadata:GetDocumentResponse' :: Maybe DocumentMetadata
metadata = Maybe DocumentMetadata
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetDocumentResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The custom metadata on the document.
getDocumentResponse_customMetadata :: Lens.Lens' GetDocumentResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
getDocumentResponse_customMetadata :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> GetDocumentResponse -> f GetDocumentResponse
getDocumentResponse_customMetadata = (GetDocumentResponse -> Maybe (HashMap Text Text))
-> (GetDocumentResponse
    -> Maybe (HashMap Text Text) -> GetDocumentResponse)
-> Lens
     GetDocumentResponse
     GetDocumentResponse
     (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 (\GetDocumentResponse' {Maybe (HashMap Text Text)
customMetadata :: Maybe (HashMap Text Text)
$sel:customMetadata:GetDocumentResponse' :: GetDocumentResponse -> Maybe (HashMap Text Text)
customMetadata} -> Maybe (HashMap Text Text)
customMetadata) (\s :: GetDocumentResponse
s@GetDocumentResponse' {} Maybe (HashMap Text Text)
a -> GetDocumentResponse
s {$sel:customMetadata:GetDocumentResponse' :: Maybe (HashMap Text Text)
customMetadata = Maybe (HashMap Text Text)
a} :: GetDocumentResponse) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> GetDocumentResponse -> f GetDocumentResponse)
-> ((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)))
-> GetDocumentResponse
-> f GetDocumentResponse
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 metadata details of the document.
getDocumentResponse_metadata :: Lens.Lens' GetDocumentResponse (Prelude.Maybe DocumentMetadata)
getDocumentResponse_metadata :: (Maybe DocumentMetadata -> f (Maybe DocumentMetadata))
-> GetDocumentResponse -> f GetDocumentResponse
getDocumentResponse_metadata = (GetDocumentResponse -> Maybe DocumentMetadata)
-> (GetDocumentResponse
    -> Maybe DocumentMetadata -> GetDocumentResponse)
-> Lens
     GetDocumentResponse
     GetDocumentResponse
     (Maybe DocumentMetadata)
     (Maybe DocumentMetadata)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDocumentResponse' {Maybe DocumentMetadata
metadata :: Maybe DocumentMetadata
$sel:metadata:GetDocumentResponse' :: GetDocumentResponse -> Maybe DocumentMetadata
metadata} -> Maybe DocumentMetadata
metadata) (\s :: GetDocumentResponse
s@GetDocumentResponse' {} Maybe DocumentMetadata
a -> GetDocumentResponse
s {$sel:metadata:GetDocumentResponse' :: Maybe DocumentMetadata
metadata = Maybe DocumentMetadata
a} :: GetDocumentResponse)

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

instance Prelude.NFData GetDocumentResponse