{-# 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.CodeGuruReviewer.ListRecommendationFeedback
-- 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 list of
-- <https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RecommendationFeedbackSummary.html RecommendationFeedbackSummary>
-- objects that contain customer recommendation feedback for all CodeGuru
-- Reviewer users.
module Amazonka.CodeGuruReviewer.ListRecommendationFeedback
  ( -- * Creating a Request
    ListRecommendationFeedback (..),
    newListRecommendationFeedback,

    -- * Request Lenses
    listRecommendationFeedback_userIds,
    listRecommendationFeedback_nextToken,
    listRecommendationFeedback_recommendationIds,
    listRecommendationFeedback_maxResults,
    listRecommendationFeedback_codeReviewArn,

    -- * Destructuring the Response
    ListRecommendationFeedbackResponse (..),
    newListRecommendationFeedbackResponse,

    -- * Response Lenses
    listRecommendationFeedbackResponse_nextToken,
    listRecommendationFeedbackResponse_recommendationFeedbackSummaries,
    listRecommendationFeedbackResponse_httpStatus,
  )
where

import Amazonka.CodeGuruReviewer.Types
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

-- | /See:/ 'newListRecommendationFeedback' smart constructor.
data ListRecommendationFeedback = ListRecommendationFeedback'
  { -- | An Amazon Web Services user\'s account ID or Amazon Resource Name (ARN).
    -- Use this ID to query the recommendation feedback for a code review from
    -- that user.
    --
    -- The @UserId@ is an IAM principal that can be specified as an Amazon Web
    -- Services account ID or an Amazon Resource Name (ARN). For more
    -- information, see
    -- <https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#Principal_specifying Specifying a Principal>
    -- in the /Amazon Web Services Identity and Access Management User Guide/.
    ListRecommendationFeedback -> Maybe (NonEmpty Text)
userIds :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | If @nextToken@ is returned, there are more results available. The value
    -- of nextToken is a unique pagination token for each page. Make the call
    -- again using the returned token to retrieve the next page. Keep all other
    -- arguments unchanged.
    ListRecommendationFeedback -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Used to query the recommendation feedback for a given recommendation.
    ListRecommendationFeedback -> Maybe (NonEmpty Text)
recommendationIds :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | The maximum number of results that are returned per call. The default is
    -- 100.
    ListRecommendationFeedback -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The Amazon Resource Name (ARN) of the
    -- <https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_CodeReview.html CodeReview>
    -- object.
    ListRecommendationFeedback -> Text
codeReviewArn :: Prelude.Text
  }
  deriving (ListRecommendationFeedback -> ListRecommendationFeedback -> Bool
(ListRecommendationFeedback -> ListRecommendationFeedback -> Bool)
-> (ListRecommendationFeedback
    -> ListRecommendationFeedback -> Bool)
-> Eq ListRecommendationFeedback
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListRecommendationFeedback -> ListRecommendationFeedback -> Bool
$c/= :: ListRecommendationFeedback -> ListRecommendationFeedback -> Bool
== :: ListRecommendationFeedback -> ListRecommendationFeedback -> Bool
$c== :: ListRecommendationFeedback -> ListRecommendationFeedback -> Bool
Prelude.Eq, ReadPrec [ListRecommendationFeedback]
ReadPrec ListRecommendationFeedback
Int -> ReadS ListRecommendationFeedback
ReadS [ListRecommendationFeedback]
(Int -> ReadS ListRecommendationFeedback)
-> ReadS [ListRecommendationFeedback]
-> ReadPrec ListRecommendationFeedback
-> ReadPrec [ListRecommendationFeedback]
-> Read ListRecommendationFeedback
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListRecommendationFeedback]
$creadListPrec :: ReadPrec [ListRecommendationFeedback]
readPrec :: ReadPrec ListRecommendationFeedback
$creadPrec :: ReadPrec ListRecommendationFeedback
readList :: ReadS [ListRecommendationFeedback]
$creadList :: ReadS [ListRecommendationFeedback]
readsPrec :: Int -> ReadS ListRecommendationFeedback
$creadsPrec :: Int -> ReadS ListRecommendationFeedback
Prelude.Read, Int -> ListRecommendationFeedback -> ShowS
[ListRecommendationFeedback] -> ShowS
ListRecommendationFeedback -> String
(Int -> ListRecommendationFeedback -> ShowS)
-> (ListRecommendationFeedback -> String)
-> ([ListRecommendationFeedback] -> ShowS)
-> Show ListRecommendationFeedback
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListRecommendationFeedback] -> ShowS
$cshowList :: [ListRecommendationFeedback] -> ShowS
show :: ListRecommendationFeedback -> String
$cshow :: ListRecommendationFeedback -> String
showsPrec :: Int -> ListRecommendationFeedback -> ShowS
$cshowsPrec :: Int -> ListRecommendationFeedback -> ShowS
Prelude.Show, (forall x.
 ListRecommendationFeedback -> Rep ListRecommendationFeedback x)
-> (forall x.
    Rep ListRecommendationFeedback x -> ListRecommendationFeedback)
-> Generic ListRecommendationFeedback
forall x.
Rep ListRecommendationFeedback x -> ListRecommendationFeedback
forall x.
ListRecommendationFeedback -> Rep ListRecommendationFeedback x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListRecommendationFeedback x -> ListRecommendationFeedback
$cfrom :: forall x.
ListRecommendationFeedback -> Rep ListRecommendationFeedback x
Prelude.Generic)

-- |
-- Create a value of 'ListRecommendationFeedback' 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:
--
-- 'userIds', 'listRecommendationFeedback_userIds' - An Amazon Web Services user\'s account ID or Amazon Resource Name (ARN).
-- Use this ID to query the recommendation feedback for a code review from
-- that user.
--
-- The @UserId@ is an IAM principal that can be specified as an Amazon Web
-- Services account ID or an Amazon Resource Name (ARN). For more
-- information, see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#Principal_specifying Specifying a Principal>
-- in the /Amazon Web Services Identity and Access Management User Guide/.
--
-- 'nextToken', 'listRecommendationFeedback_nextToken' - If @nextToken@ is returned, there are more results available. The value
-- of nextToken is a unique pagination token for each page. Make the call
-- again using the returned token to retrieve the next page. Keep all other
-- arguments unchanged.
--
-- 'recommendationIds', 'listRecommendationFeedback_recommendationIds' - Used to query the recommendation feedback for a given recommendation.
--
-- 'maxResults', 'listRecommendationFeedback_maxResults' - The maximum number of results that are returned per call. The default is
-- 100.
--
-- 'codeReviewArn', 'listRecommendationFeedback_codeReviewArn' - The Amazon Resource Name (ARN) of the
-- <https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_CodeReview.html CodeReview>
-- object.
newListRecommendationFeedback ::
  -- | 'codeReviewArn'
  Prelude.Text ->
  ListRecommendationFeedback
newListRecommendationFeedback :: Text -> ListRecommendationFeedback
newListRecommendationFeedback Text
pCodeReviewArn_ =
  ListRecommendationFeedback' :: Maybe (NonEmpty Text)
-> Maybe Text
-> Maybe (NonEmpty Text)
-> Maybe Natural
-> Text
-> ListRecommendationFeedback
ListRecommendationFeedback'
    { $sel:userIds:ListRecommendationFeedback' :: Maybe (NonEmpty Text)
userIds =
        Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListRecommendationFeedback' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:recommendationIds:ListRecommendationFeedback' :: Maybe (NonEmpty Text)
recommendationIds = Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListRecommendationFeedback' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:codeReviewArn:ListRecommendationFeedback' :: Text
codeReviewArn = Text
pCodeReviewArn_
    }

-- | An Amazon Web Services user\'s account ID or Amazon Resource Name (ARN).
-- Use this ID to query the recommendation feedback for a code review from
-- that user.
--
-- The @UserId@ is an IAM principal that can be specified as an Amazon Web
-- Services account ID or an Amazon Resource Name (ARN). For more
-- information, see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#Principal_specifying Specifying a Principal>
-- in the /Amazon Web Services Identity and Access Management User Guide/.
listRecommendationFeedback_userIds :: Lens.Lens' ListRecommendationFeedback (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
listRecommendationFeedback_userIds :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> ListRecommendationFeedback -> f ListRecommendationFeedback
listRecommendationFeedback_userIds = (ListRecommendationFeedback -> Maybe (NonEmpty Text))
-> (ListRecommendationFeedback
    -> Maybe (NonEmpty Text) -> ListRecommendationFeedback)
-> Lens
     ListRecommendationFeedback
     ListRecommendationFeedback
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRecommendationFeedback' {Maybe (NonEmpty Text)
userIds :: Maybe (NonEmpty Text)
$sel:userIds:ListRecommendationFeedback' :: ListRecommendationFeedback -> Maybe (NonEmpty Text)
userIds} -> Maybe (NonEmpty Text)
userIds) (\s :: ListRecommendationFeedback
s@ListRecommendationFeedback' {} Maybe (NonEmpty Text)
a -> ListRecommendationFeedback
s {$sel:userIds:ListRecommendationFeedback' :: Maybe (NonEmpty Text)
userIds = Maybe (NonEmpty Text)
a} :: ListRecommendationFeedback) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
 -> ListRecommendationFeedback -> f ListRecommendationFeedback)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
    -> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> ListRecommendationFeedback
-> f ListRecommendationFeedback
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
-> Iso
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty 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
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | If @nextToken@ is returned, there are more results available. The value
-- of nextToken is a unique pagination token for each page. Make the call
-- again using the returned token to retrieve the next page. Keep all other
-- arguments unchanged.
listRecommendationFeedback_nextToken :: Lens.Lens' ListRecommendationFeedback (Prelude.Maybe Prelude.Text)
listRecommendationFeedback_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListRecommendationFeedback -> f ListRecommendationFeedback
listRecommendationFeedback_nextToken = (ListRecommendationFeedback -> Maybe Text)
-> (ListRecommendationFeedback
    -> Maybe Text -> ListRecommendationFeedback)
-> Lens
     ListRecommendationFeedback
     ListRecommendationFeedback
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRecommendationFeedback' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListRecommendationFeedback' :: ListRecommendationFeedback -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListRecommendationFeedback
s@ListRecommendationFeedback' {} Maybe Text
a -> ListRecommendationFeedback
s {$sel:nextToken:ListRecommendationFeedback' :: Maybe Text
nextToken = Maybe Text
a} :: ListRecommendationFeedback)

-- | Used to query the recommendation feedback for a given recommendation.
listRecommendationFeedback_recommendationIds :: Lens.Lens' ListRecommendationFeedback (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
listRecommendationFeedback_recommendationIds :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> ListRecommendationFeedback -> f ListRecommendationFeedback
listRecommendationFeedback_recommendationIds = (ListRecommendationFeedback -> Maybe (NonEmpty Text))
-> (ListRecommendationFeedback
    -> Maybe (NonEmpty Text) -> ListRecommendationFeedback)
-> Lens
     ListRecommendationFeedback
     ListRecommendationFeedback
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRecommendationFeedback' {Maybe (NonEmpty Text)
recommendationIds :: Maybe (NonEmpty Text)
$sel:recommendationIds:ListRecommendationFeedback' :: ListRecommendationFeedback -> Maybe (NonEmpty Text)
recommendationIds} -> Maybe (NonEmpty Text)
recommendationIds) (\s :: ListRecommendationFeedback
s@ListRecommendationFeedback' {} Maybe (NonEmpty Text)
a -> ListRecommendationFeedback
s {$sel:recommendationIds:ListRecommendationFeedback' :: Maybe (NonEmpty Text)
recommendationIds = Maybe (NonEmpty Text)
a} :: ListRecommendationFeedback) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
 -> ListRecommendationFeedback -> f ListRecommendationFeedback)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
    -> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> ListRecommendationFeedback
-> f ListRecommendationFeedback
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
-> Iso
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty 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
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The maximum number of results that are returned per call. The default is
-- 100.
listRecommendationFeedback_maxResults :: Lens.Lens' ListRecommendationFeedback (Prelude.Maybe Prelude.Natural)
listRecommendationFeedback_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListRecommendationFeedback -> f ListRecommendationFeedback
listRecommendationFeedback_maxResults = (ListRecommendationFeedback -> Maybe Natural)
-> (ListRecommendationFeedback
    -> Maybe Natural -> ListRecommendationFeedback)
-> Lens
     ListRecommendationFeedback
     ListRecommendationFeedback
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRecommendationFeedback' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListRecommendationFeedback' :: ListRecommendationFeedback -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListRecommendationFeedback
s@ListRecommendationFeedback' {} Maybe Natural
a -> ListRecommendationFeedback
s {$sel:maxResults:ListRecommendationFeedback' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListRecommendationFeedback)

-- | The Amazon Resource Name (ARN) of the
-- <https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_CodeReview.html CodeReview>
-- object.
listRecommendationFeedback_codeReviewArn :: Lens.Lens' ListRecommendationFeedback Prelude.Text
listRecommendationFeedback_codeReviewArn :: (Text -> f Text)
-> ListRecommendationFeedback -> f ListRecommendationFeedback
listRecommendationFeedback_codeReviewArn = (ListRecommendationFeedback -> Text)
-> (ListRecommendationFeedback
    -> Text -> ListRecommendationFeedback)
-> Lens
     ListRecommendationFeedback ListRecommendationFeedback Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRecommendationFeedback' {Text
codeReviewArn :: Text
$sel:codeReviewArn:ListRecommendationFeedback' :: ListRecommendationFeedback -> Text
codeReviewArn} -> Text
codeReviewArn) (\s :: ListRecommendationFeedback
s@ListRecommendationFeedback' {} Text
a -> ListRecommendationFeedback
s {$sel:codeReviewArn:ListRecommendationFeedback' :: Text
codeReviewArn = Text
a} :: ListRecommendationFeedback)

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

instance Prelude.NFData ListRecommendationFeedback

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

instance Core.ToPath ListRecommendationFeedback where
  toPath :: ListRecommendationFeedback -> ByteString
toPath ListRecommendationFeedback' {Maybe Natural
Maybe (NonEmpty Text)
Maybe Text
Text
codeReviewArn :: Text
maxResults :: Maybe Natural
recommendationIds :: Maybe (NonEmpty Text)
nextToken :: Maybe Text
userIds :: Maybe (NonEmpty Text)
$sel:codeReviewArn:ListRecommendationFeedback' :: ListRecommendationFeedback -> Text
$sel:maxResults:ListRecommendationFeedback' :: ListRecommendationFeedback -> Maybe Natural
$sel:recommendationIds:ListRecommendationFeedback' :: ListRecommendationFeedback -> Maybe (NonEmpty Text)
$sel:nextToken:ListRecommendationFeedback' :: ListRecommendationFeedback -> Maybe Text
$sel:userIds:ListRecommendationFeedback' :: ListRecommendationFeedback -> Maybe (NonEmpty Text)
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/feedback/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
codeReviewArn,
        ByteString
"/RecommendationFeedback"
      ]

instance Core.ToQuery ListRecommendationFeedback where
  toQuery :: ListRecommendationFeedback -> QueryString
toQuery ListRecommendationFeedback' {Maybe Natural
Maybe (NonEmpty Text)
Maybe Text
Text
codeReviewArn :: Text
maxResults :: Maybe Natural
recommendationIds :: Maybe (NonEmpty Text)
nextToken :: Maybe Text
userIds :: Maybe (NonEmpty Text)
$sel:codeReviewArn:ListRecommendationFeedback' :: ListRecommendationFeedback -> Text
$sel:maxResults:ListRecommendationFeedback' :: ListRecommendationFeedback -> Maybe Natural
$sel:recommendationIds:ListRecommendationFeedback' :: ListRecommendationFeedback -> Maybe (NonEmpty Text)
$sel:nextToken:ListRecommendationFeedback' :: ListRecommendationFeedback -> Maybe Text
$sel:userIds:ListRecommendationFeedback' :: ListRecommendationFeedback -> Maybe (NonEmpty Text)
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"UserIds"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            (ByteString -> NonEmpty Text -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" (NonEmpty Text -> QueryString)
-> Maybe (NonEmpty Text) -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Text)
userIds),
        ByteString
"NextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"RecommendationIds"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            ( ByteString -> NonEmpty Text -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member"
                (NonEmpty Text -> QueryString)
-> Maybe (NonEmpty Text) -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Text)
recommendationIds
            ),
        ByteString
"MaxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
      ]

-- | /See:/ 'newListRecommendationFeedbackResponse' smart constructor.
data ListRecommendationFeedbackResponse = ListRecommendationFeedbackResponse'
  { -- | If nextToken is returned, there are more results available. The value of
    -- nextToken is a unique pagination token for each page. Make the call
    -- again using the returned token to retrieve the next page. Keep all other
    -- arguments unchanged.
    ListRecommendationFeedbackResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Recommendation feedback summaries corresponding to the code review ARN.
    ListRecommendationFeedbackResponse
-> Maybe [RecommendationFeedbackSummary]
recommendationFeedbackSummaries :: Prelude.Maybe [RecommendationFeedbackSummary],
    -- | The response's http status code.
    ListRecommendationFeedbackResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListRecommendationFeedbackResponse
-> ListRecommendationFeedbackResponse -> Bool
(ListRecommendationFeedbackResponse
 -> ListRecommendationFeedbackResponse -> Bool)
-> (ListRecommendationFeedbackResponse
    -> ListRecommendationFeedbackResponse -> Bool)
-> Eq ListRecommendationFeedbackResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListRecommendationFeedbackResponse
-> ListRecommendationFeedbackResponse -> Bool
$c/= :: ListRecommendationFeedbackResponse
-> ListRecommendationFeedbackResponse -> Bool
== :: ListRecommendationFeedbackResponse
-> ListRecommendationFeedbackResponse -> Bool
$c== :: ListRecommendationFeedbackResponse
-> ListRecommendationFeedbackResponse -> Bool
Prelude.Eq, ReadPrec [ListRecommendationFeedbackResponse]
ReadPrec ListRecommendationFeedbackResponse
Int -> ReadS ListRecommendationFeedbackResponse
ReadS [ListRecommendationFeedbackResponse]
(Int -> ReadS ListRecommendationFeedbackResponse)
-> ReadS [ListRecommendationFeedbackResponse]
-> ReadPrec ListRecommendationFeedbackResponse
-> ReadPrec [ListRecommendationFeedbackResponse]
-> Read ListRecommendationFeedbackResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListRecommendationFeedbackResponse]
$creadListPrec :: ReadPrec [ListRecommendationFeedbackResponse]
readPrec :: ReadPrec ListRecommendationFeedbackResponse
$creadPrec :: ReadPrec ListRecommendationFeedbackResponse
readList :: ReadS [ListRecommendationFeedbackResponse]
$creadList :: ReadS [ListRecommendationFeedbackResponse]
readsPrec :: Int -> ReadS ListRecommendationFeedbackResponse
$creadsPrec :: Int -> ReadS ListRecommendationFeedbackResponse
Prelude.Read, Int -> ListRecommendationFeedbackResponse -> ShowS
[ListRecommendationFeedbackResponse] -> ShowS
ListRecommendationFeedbackResponse -> String
(Int -> ListRecommendationFeedbackResponse -> ShowS)
-> (ListRecommendationFeedbackResponse -> String)
-> ([ListRecommendationFeedbackResponse] -> ShowS)
-> Show ListRecommendationFeedbackResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListRecommendationFeedbackResponse] -> ShowS
$cshowList :: [ListRecommendationFeedbackResponse] -> ShowS
show :: ListRecommendationFeedbackResponse -> String
$cshow :: ListRecommendationFeedbackResponse -> String
showsPrec :: Int -> ListRecommendationFeedbackResponse -> ShowS
$cshowsPrec :: Int -> ListRecommendationFeedbackResponse -> ShowS
Prelude.Show, (forall x.
 ListRecommendationFeedbackResponse
 -> Rep ListRecommendationFeedbackResponse x)
-> (forall x.
    Rep ListRecommendationFeedbackResponse x
    -> ListRecommendationFeedbackResponse)
-> Generic ListRecommendationFeedbackResponse
forall x.
Rep ListRecommendationFeedbackResponse x
-> ListRecommendationFeedbackResponse
forall x.
ListRecommendationFeedbackResponse
-> Rep ListRecommendationFeedbackResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListRecommendationFeedbackResponse x
-> ListRecommendationFeedbackResponse
$cfrom :: forall x.
ListRecommendationFeedbackResponse
-> Rep ListRecommendationFeedbackResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListRecommendationFeedbackResponse' 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:
--
-- 'nextToken', 'listRecommendationFeedbackResponse_nextToken' - If nextToken is returned, there are more results available. The value of
-- nextToken is a unique pagination token for each page. Make the call
-- again using the returned token to retrieve the next page. Keep all other
-- arguments unchanged.
--
-- 'recommendationFeedbackSummaries', 'listRecommendationFeedbackResponse_recommendationFeedbackSummaries' - Recommendation feedback summaries corresponding to the code review ARN.
--
-- 'httpStatus', 'listRecommendationFeedbackResponse_httpStatus' - The response's http status code.
newListRecommendationFeedbackResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListRecommendationFeedbackResponse
newListRecommendationFeedbackResponse :: Int -> ListRecommendationFeedbackResponse
newListRecommendationFeedbackResponse Int
pHttpStatus_ =
  ListRecommendationFeedbackResponse' :: Maybe Text
-> Maybe [RecommendationFeedbackSummary]
-> Int
-> ListRecommendationFeedbackResponse
ListRecommendationFeedbackResponse'
    { $sel:nextToken:ListRecommendationFeedbackResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:recommendationFeedbackSummaries:ListRecommendationFeedbackResponse' :: Maybe [RecommendationFeedbackSummary]
recommendationFeedbackSummaries =
        Maybe [RecommendationFeedbackSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListRecommendationFeedbackResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | If nextToken is returned, there are more results available. The value of
-- nextToken is a unique pagination token for each page. Make the call
-- again using the returned token to retrieve the next page. Keep all other
-- arguments unchanged.
listRecommendationFeedbackResponse_nextToken :: Lens.Lens' ListRecommendationFeedbackResponse (Prelude.Maybe Prelude.Text)
listRecommendationFeedbackResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListRecommendationFeedbackResponse
-> f ListRecommendationFeedbackResponse
listRecommendationFeedbackResponse_nextToken = (ListRecommendationFeedbackResponse -> Maybe Text)
-> (ListRecommendationFeedbackResponse
    -> Maybe Text -> ListRecommendationFeedbackResponse)
-> Lens
     ListRecommendationFeedbackResponse
     ListRecommendationFeedbackResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRecommendationFeedbackResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListRecommendationFeedbackResponse' :: ListRecommendationFeedbackResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListRecommendationFeedbackResponse
s@ListRecommendationFeedbackResponse' {} Maybe Text
a -> ListRecommendationFeedbackResponse
s {$sel:nextToken:ListRecommendationFeedbackResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListRecommendationFeedbackResponse)

-- | Recommendation feedback summaries corresponding to the code review ARN.
listRecommendationFeedbackResponse_recommendationFeedbackSummaries :: Lens.Lens' ListRecommendationFeedbackResponse (Prelude.Maybe [RecommendationFeedbackSummary])
listRecommendationFeedbackResponse_recommendationFeedbackSummaries :: (Maybe [RecommendationFeedbackSummary]
 -> f (Maybe [RecommendationFeedbackSummary]))
-> ListRecommendationFeedbackResponse
-> f ListRecommendationFeedbackResponse
listRecommendationFeedbackResponse_recommendationFeedbackSummaries = (ListRecommendationFeedbackResponse
 -> Maybe [RecommendationFeedbackSummary])
-> (ListRecommendationFeedbackResponse
    -> Maybe [RecommendationFeedbackSummary]
    -> ListRecommendationFeedbackResponse)
-> Lens
     ListRecommendationFeedbackResponse
     ListRecommendationFeedbackResponse
     (Maybe [RecommendationFeedbackSummary])
     (Maybe [RecommendationFeedbackSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRecommendationFeedbackResponse' {Maybe [RecommendationFeedbackSummary]
recommendationFeedbackSummaries :: Maybe [RecommendationFeedbackSummary]
$sel:recommendationFeedbackSummaries:ListRecommendationFeedbackResponse' :: ListRecommendationFeedbackResponse
-> Maybe [RecommendationFeedbackSummary]
recommendationFeedbackSummaries} -> Maybe [RecommendationFeedbackSummary]
recommendationFeedbackSummaries) (\s :: ListRecommendationFeedbackResponse
s@ListRecommendationFeedbackResponse' {} Maybe [RecommendationFeedbackSummary]
a -> ListRecommendationFeedbackResponse
s {$sel:recommendationFeedbackSummaries:ListRecommendationFeedbackResponse' :: Maybe [RecommendationFeedbackSummary]
recommendationFeedbackSummaries = Maybe [RecommendationFeedbackSummary]
a} :: ListRecommendationFeedbackResponse) ((Maybe [RecommendationFeedbackSummary]
  -> f (Maybe [RecommendationFeedbackSummary]))
 -> ListRecommendationFeedbackResponse
 -> f ListRecommendationFeedbackResponse)
-> ((Maybe [RecommendationFeedbackSummary]
     -> f (Maybe [RecommendationFeedbackSummary]))
    -> Maybe [RecommendationFeedbackSummary]
    -> f (Maybe [RecommendationFeedbackSummary]))
-> (Maybe [RecommendationFeedbackSummary]
    -> f (Maybe [RecommendationFeedbackSummary]))
-> ListRecommendationFeedbackResponse
-> f ListRecommendationFeedbackResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [RecommendationFeedbackSummary]
  [RecommendationFeedbackSummary]
  [RecommendationFeedbackSummary]
  [RecommendationFeedbackSummary]
-> Iso
     (Maybe [RecommendationFeedbackSummary])
     (Maybe [RecommendationFeedbackSummary])
     (Maybe [RecommendationFeedbackSummary])
     (Maybe [RecommendationFeedbackSummary])
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
  [RecommendationFeedbackSummary]
  [RecommendationFeedbackSummary]
  [RecommendationFeedbackSummary]
  [RecommendationFeedbackSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    ListRecommendationFeedbackResponse