{-# 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.DescribeComments
-- 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)
--
-- List all the comments for the specified document version.
--
-- This operation returns paginated results.
module Amazonka.WorkDocs.DescribeComments
  ( -- * Creating a Request
    DescribeComments (..),
    newDescribeComments,

    -- * Request Lenses
    describeComments_authenticationToken,
    describeComments_marker,
    describeComments_limit,
    describeComments_documentId,
    describeComments_versionId,

    -- * Destructuring the Response
    DescribeCommentsResponse (..),
    newDescribeCommentsResponse,

    -- * Response Lenses
    describeCommentsResponse_marker,
    describeCommentsResponse_comments,
    describeCommentsResponse_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:/ 'newDescribeComments' smart constructor.
data DescribeComments = DescribeComments'
  { -- | Amazon WorkDocs authentication token. Not required when using AWS
    -- administrator credentials to access the API.
    DescribeComments -> Maybe (Sensitive Text)
authenticationToken :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The marker for the next set of results. This marker was received from a
    -- previous call.
    DescribeComments -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of items to return.
    DescribeComments -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural,
    -- | The ID of the document.
    DescribeComments -> Text
documentId :: Prelude.Text,
    -- | The ID of the document version.
    DescribeComments -> Text
versionId :: Prelude.Text
  }
  deriving (DescribeComments -> DescribeComments -> Bool
(DescribeComments -> DescribeComments -> Bool)
-> (DescribeComments -> DescribeComments -> Bool)
-> Eq DescribeComments
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeComments -> DescribeComments -> Bool
$c/= :: DescribeComments -> DescribeComments -> Bool
== :: DescribeComments -> DescribeComments -> Bool
$c== :: DescribeComments -> DescribeComments -> Bool
Prelude.Eq, Int -> DescribeComments -> ShowS
[DescribeComments] -> ShowS
DescribeComments -> String
(Int -> DescribeComments -> ShowS)
-> (DescribeComments -> String)
-> ([DescribeComments] -> ShowS)
-> Show DescribeComments
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeComments] -> ShowS
$cshowList :: [DescribeComments] -> ShowS
show :: DescribeComments -> String
$cshow :: DescribeComments -> String
showsPrec :: Int -> DescribeComments -> ShowS
$cshowsPrec :: Int -> DescribeComments -> ShowS
Prelude.Show, (forall x. DescribeComments -> Rep DescribeComments x)
-> (forall x. Rep DescribeComments x -> DescribeComments)
-> Generic DescribeComments
forall x. Rep DescribeComments x -> DescribeComments
forall x. DescribeComments -> Rep DescribeComments x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeComments x -> DescribeComments
$cfrom :: forall x. DescribeComments -> Rep DescribeComments x
Prelude.Generic)

-- |
-- Create a value of 'DescribeComments' 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', 'describeComments_authenticationToken' - Amazon WorkDocs authentication token. Not required when using AWS
-- administrator credentials to access the API.
--
-- 'marker', 'describeComments_marker' - The marker for the next set of results. This marker was received from a
-- previous call.
--
-- 'limit', 'describeComments_limit' - The maximum number of items to return.
--
-- 'documentId', 'describeComments_documentId' - The ID of the document.
--
-- 'versionId', 'describeComments_versionId' - The ID of the document version.
newDescribeComments ::
  -- | 'documentId'
  Prelude.Text ->
  -- | 'versionId'
  Prelude.Text ->
  DescribeComments
newDescribeComments :: Text -> Text -> DescribeComments
newDescribeComments Text
pDocumentId_ Text
pVersionId_ =
  DescribeComments' :: Maybe (Sensitive Text)
-> Maybe Text -> Maybe Natural -> Text -> Text -> DescribeComments
DescribeComments'
    { $sel:authenticationToken:DescribeComments' :: Maybe (Sensitive Text)
authenticationToken =
        Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeComments' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:limit:DescribeComments' :: Maybe Natural
limit = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:documentId:DescribeComments' :: Text
documentId = Text
pDocumentId_,
      $sel:versionId:DescribeComments' :: Text
versionId = Text
pVersionId_
    }

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

-- | The marker for the next set of results. This marker was received from a
-- previous call.
describeComments_marker :: Lens.Lens' DescribeComments (Prelude.Maybe Prelude.Text)
describeComments_marker :: (Maybe Text -> f (Maybe Text))
-> DescribeComments -> f DescribeComments
describeComments_marker = (DescribeComments -> Maybe Text)
-> (DescribeComments -> Maybe Text -> DescribeComments)
-> Lens DescribeComments DescribeComments (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeComments' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeComments' :: DescribeComments -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeComments
s@DescribeComments' {} Maybe Text
a -> DescribeComments
s {$sel:marker:DescribeComments' :: Maybe Text
marker = Maybe Text
a} :: DescribeComments)

-- | The maximum number of items to return.
describeComments_limit :: Lens.Lens' DescribeComments (Prelude.Maybe Prelude.Natural)
describeComments_limit :: (Maybe Natural -> f (Maybe Natural))
-> DescribeComments -> f DescribeComments
describeComments_limit = (DescribeComments -> Maybe Natural)
-> (DescribeComments -> Maybe Natural -> DescribeComments)
-> Lens
     DescribeComments DescribeComments (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeComments' {Maybe Natural
limit :: Maybe Natural
$sel:limit:DescribeComments' :: DescribeComments -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: DescribeComments
s@DescribeComments' {} Maybe Natural
a -> DescribeComments
s {$sel:limit:DescribeComments' :: Maybe Natural
limit = Maybe Natural
a} :: DescribeComments)

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

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

instance Core.AWSPager DescribeComments where
  page :: DescribeComments
-> AWSResponse DescribeComments -> Maybe DescribeComments
page DescribeComments
rq AWSResponse DescribeComments
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeComments
DescribeCommentsResponse
rs
            DescribeCommentsResponse
-> Getting (First Text) DescribeCommentsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeCommentsResponse
-> Const (First Text) DescribeCommentsResponse
Lens' DescribeCommentsResponse (Maybe Text)
describeCommentsResponse_marker ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeCommentsResponse
 -> Const (First Text) DescribeCommentsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeCommentsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe DescribeComments
forall a. Maybe a
Prelude.Nothing
    | Maybe [Comment] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeComments
DescribeCommentsResponse
rs
            DescribeCommentsResponse
-> Getting (First [Comment]) DescribeCommentsResponse [Comment]
-> Maybe [Comment]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [Comment] -> Const (First [Comment]) (Maybe [Comment]))
-> DescribeCommentsResponse
-> Const (First [Comment]) DescribeCommentsResponse
Lens' DescribeCommentsResponse (Maybe [Comment])
describeCommentsResponse_comments
              ((Maybe [Comment] -> Const (First [Comment]) (Maybe [Comment]))
 -> DescribeCommentsResponse
 -> Const (First [Comment]) DescribeCommentsResponse)
-> (([Comment] -> Const (First [Comment]) [Comment])
    -> Maybe [Comment] -> Const (First [Comment]) (Maybe [Comment]))
-> Getting (First [Comment]) DescribeCommentsResponse [Comment]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Comment] -> Const (First [Comment]) [Comment])
-> Maybe [Comment] -> Const (First [Comment]) (Maybe [Comment])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe DescribeComments
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      DescribeComments -> Maybe DescribeComments
forall a. a -> Maybe a
Prelude.Just (DescribeComments -> Maybe DescribeComments)
-> DescribeComments -> Maybe DescribeComments
forall a b. (a -> b) -> a -> b
Prelude.$
        DescribeComments
rq
          DescribeComments
-> (DescribeComments -> DescribeComments) -> DescribeComments
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> DescribeComments -> Identity DescribeComments
Lens DescribeComments DescribeComments (Maybe Text) (Maybe Text)
describeComments_marker
          ((Maybe Text -> Identity (Maybe Text))
 -> DescribeComments -> Identity DescribeComments)
-> Maybe Text -> DescribeComments -> DescribeComments
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeComments
DescribeCommentsResponse
rs
          DescribeCommentsResponse
-> Getting (First Text) DescribeCommentsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeCommentsResponse
-> Const (First Text) DescribeCommentsResponse
Lens' DescribeCommentsResponse (Maybe Text)
describeCommentsResponse_marker ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeCommentsResponse
 -> Const (First Text) DescribeCommentsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeCommentsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

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

instance Prelude.NFData DescribeComments

instance Core.ToHeaders DescribeComments where
  toHeaders :: DescribeComments -> ResponseHeaders
toHeaders DescribeComments' {Maybe Natural
Maybe Text
Maybe (Sensitive Text)
Text
versionId :: Text
documentId :: Text
limit :: Maybe Natural
marker :: Maybe Text
authenticationToken :: Maybe (Sensitive Text)
$sel:versionId:DescribeComments' :: DescribeComments -> Text
$sel:documentId:DescribeComments' :: DescribeComments -> Text
$sel:limit:DescribeComments' :: DescribeComments -> Maybe Natural
$sel:marker:DescribeComments' :: DescribeComments -> Maybe Text
$sel:authenticationToken:DescribeComments' :: DescribeComments -> 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 DescribeComments where
  toPath :: DescribeComments -> ByteString
toPath DescribeComments' {Maybe Natural
Maybe Text
Maybe (Sensitive Text)
Text
versionId :: Text
documentId :: Text
limit :: Maybe Natural
marker :: Maybe Text
authenticationToken :: Maybe (Sensitive Text)
$sel:versionId:DescribeComments' :: DescribeComments -> Text
$sel:documentId:DescribeComments' :: DescribeComments -> Text
$sel:limit:DescribeComments' :: DescribeComments -> Maybe Natural
$sel:marker:DescribeComments' :: DescribeComments -> Maybe Text
$sel:authenticationToken:DescribeComments' :: DescribeComments -> 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,
        ByteString
"/comments"
      ]

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

-- | /See:/ 'newDescribeCommentsResponse' smart constructor.
data DescribeCommentsResponse = DescribeCommentsResponse'
  { -- | The marker for the next set of results. This marker was received from a
    -- previous call.
    DescribeCommentsResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The list of comments for the specified document version.
    DescribeCommentsResponse -> Maybe [Comment]
comments :: Prelude.Maybe [Comment],
    -- | The response's http status code.
    DescribeCommentsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeCommentsResponse -> DescribeCommentsResponse -> Bool
(DescribeCommentsResponse -> DescribeCommentsResponse -> Bool)
-> (DescribeCommentsResponse -> DescribeCommentsResponse -> Bool)
-> Eq DescribeCommentsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeCommentsResponse -> DescribeCommentsResponse -> Bool
$c/= :: DescribeCommentsResponse -> DescribeCommentsResponse -> Bool
== :: DescribeCommentsResponse -> DescribeCommentsResponse -> Bool
$c== :: DescribeCommentsResponse -> DescribeCommentsResponse -> Bool
Prelude.Eq, Int -> DescribeCommentsResponse -> ShowS
[DescribeCommentsResponse] -> ShowS
DescribeCommentsResponse -> String
(Int -> DescribeCommentsResponse -> ShowS)
-> (DescribeCommentsResponse -> String)
-> ([DescribeCommentsResponse] -> ShowS)
-> Show DescribeCommentsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeCommentsResponse] -> ShowS
$cshowList :: [DescribeCommentsResponse] -> ShowS
show :: DescribeCommentsResponse -> String
$cshow :: DescribeCommentsResponse -> String
showsPrec :: Int -> DescribeCommentsResponse -> ShowS
$cshowsPrec :: Int -> DescribeCommentsResponse -> ShowS
Prelude.Show, (forall x.
 DescribeCommentsResponse -> Rep DescribeCommentsResponse x)
-> (forall x.
    Rep DescribeCommentsResponse x -> DescribeCommentsResponse)
-> Generic DescribeCommentsResponse
forall x.
Rep DescribeCommentsResponse x -> DescribeCommentsResponse
forall x.
DescribeCommentsResponse -> Rep DescribeCommentsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeCommentsResponse x -> DescribeCommentsResponse
$cfrom :: forall x.
DescribeCommentsResponse -> Rep DescribeCommentsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeCommentsResponse' 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:
--
-- 'marker', 'describeCommentsResponse_marker' - The marker for the next set of results. This marker was received from a
-- previous call.
--
-- 'comments', 'describeCommentsResponse_comments' - The list of comments for the specified document version.
--
-- 'httpStatus', 'describeCommentsResponse_httpStatus' - The response's http status code.
newDescribeCommentsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeCommentsResponse
newDescribeCommentsResponse :: Int -> DescribeCommentsResponse
newDescribeCommentsResponse Int
pHttpStatus_ =
  DescribeCommentsResponse' :: Maybe Text -> Maybe [Comment] -> Int -> DescribeCommentsResponse
DescribeCommentsResponse'
    { $sel:marker:DescribeCommentsResponse' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:comments:DescribeCommentsResponse' :: Maybe [Comment]
comments = Maybe [Comment]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeCommentsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The marker for the next set of results. This marker was received from a
-- previous call.
describeCommentsResponse_marker :: Lens.Lens' DescribeCommentsResponse (Prelude.Maybe Prelude.Text)
describeCommentsResponse_marker :: (Maybe Text -> f (Maybe Text))
-> DescribeCommentsResponse -> f DescribeCommentsResponse
describeCommentsResponse_marker = (DescribeCommentsResponse -> Maybe Text)
-> (DescribeCommentsResponse
    -> Maybe Text -> DescribeCommentsResponse)
-> Lens' DescribeCommentsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCommentsResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeCommentsResponse' :: DescribeCommentsResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeCommentsResponse
s@DescribeCommentsResponse' {} Maybe Text
a -> DescribeCommentsResponse
s {$sel:marker:DescribeCommentsResponse' :: Maybe Text
marker = Maybe Text
a} :: DescribeCommentsResponse)

-- | The list of comments for the specified document version.
describeCommentsResponse_comments :: Lens.Lens' DescribeCommentsResponse (Prelude.Maybe [Comment])
describeCommentsResponse_comments :: (Maybe [Comment] -> f (Maybe [Comment]))
-> DescribeCommentsResponse -> f DescribeCommentsResponse
describeCommentsResponse_comments = (DescribeCommentsResponse -> Maybe [Comment])
-> (DescribeCommentsResponse
    -> Maybe [Comment] -> DescribeCommentsResponse)
-> Lens' DescribeCommentsResponse (Maybe [Comment])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCommentsResponse' {Maybe [Comment]
comments :: Maybe [Comment]
$sel:comments:DescribeCommentsResponse' :: DescribeCommentsResponse -> Maybe [Comment]
comments} -> Maybe [Comment]
comments) (\s :: DescribeCommentsResponse
s@DescribeCommentsResponse' {} Maybe [Comment]
a -> DescribeCommentsResponse
s {$sel:comments:DescribeCommentsResponse' :: Maybe [Comment]
comments = Maybe [Comment]
a} :: DescribeCommentsResponse) ((Maybe [Comment] -> f (Maybe [Comment]))
 -> DescribeCommentsResponse -> f DescribeCommentsResponse)
-> ((Maybe [Comment] -> f (Maybe [Comment]))
    -> Maybe [Comment] -> f (Maybe [Comment]))
-> (Maybe [Comment] -> f (Maybe [Comment]))
-> DescribeCommentsResponse
-> f DescribeCommentsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Comment] [Comment] [Comment] [Comment]
-> Iso
     (Maybe [Comment])
     (Maybe [Comment])
     (Maybe [Comment])
     (Maybe [Comment])
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 [Comment] [Comment] [Comment] [Comment]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData DescribeCommentsResponse