{-# 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.AuditManager.GetEvidenceFoldersByAssessmentControl
-- 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 evidence folders associated with a specified control
-- of an assessment in Audit Manager.
module Amazonka.AuditManager.GetEvidenceFoldersByAssessmentControl
  ( -- * Creating a Request
    GetEvidenceFoldersByAssessmentControl (..),
    newGetEvidenceFoldersByAssessmentControl,

    -- * Request Lenses
    getEvidenceFoldersByAssessmentControl_nextToken,
    getEvidenceFoldersByAssessmentControl_maxResults,
    getEvidenceFoldersByAssessmentControl_assessmentId,
    getEvidenceFoldersByAssessmentControl_controlSetId,
    getEvidenceFoldersByAssessmentControl_controlId,

    -- * Destructuring the Response
    GetEvidenceFoldersByAssessmentControlResponse (..),
    newGetEvidenceFoldersByAssessmentControlResponse,

    -- * Response Lenses
    getEvidenceFoldersByAssessmentControlResponse_nextToken,
    getEvidenceFoldersByAssessmentControlResponse_evidenceFolders,
    getEvidenceFoldersByAssessmentControlResponse_httpStatus,
  )
where

import Amazonka.AuditManager.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:/ 'newGetEvidenceFoldersByAssessmentControl' smart constructor.
data GetEvidenceFoldersByAssessmentControl = GetEvidenceFoldersByAssessmentControl'
  { -- | The pagination token used to fetch the next set of results.
    GetEvidenceFoldersByAssessmentControl -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Represents the maximum number of results per page, or per API request
    -- call.
    GetEvidenceFoldersByAssessmentControl -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The identifier for the specified assessment.
    GetEvidenceFoldersByAssessmentControl -> Text
assessmentId :: Prelude.Text,
    -- | The identifier for the specified control set.
    GetEvidenceFoldersByAssessmentControl -> Text
controlSetId :: Prelude.Text,
    -- | The identifier for the specified control.
    GetEvidenceFoldersByAssessmentControl -> Text
controlId :: Prelude.Text
  }
  deriving (GetEvidenceFoldersByAssessmentControl
-> GetEvidenceFoldersByAssessmentControl -> Bool
(GetEvidenceFoldersByAssessmentControl
 -> GetEvidenceFoldersByAssessmentControl -> Bool)
-> (GetEvidenceFoldersByAssessmentControl
    -> GetEvidenceFoldersByAssessmentControl -> Bool)
-> Eq GetEvidenceFoldersByAssessmentControl
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetEvidenceFoldersByAssessmentControl
-> GetEvidenceFoldersByAssessmentControl -> Bool
$c/= :: GetEvidenceFoldersByAssessmentControl
-> GetEvidenceFoldersByAssessmentControl -> Bool
== :: GetEvidenceFoldersByAssessmentControl
-> GetEvidenceFoldersByAssessmentControl -> Bool
$c== :: GetEvidenceFoldersByAssessmentControl
-> GetEvidenceFoldersByAssessmentControl -> Bool
Prelude.Eq, ReadPrec [GetEvidenceFoldersByAssessmentControl]
ReadPrec GetEvidenceFoldersByAssessmentControl
Int -> ReadS GetEvidenceFoldersByAssessmentControl
ReadS [GetEvidenceFoldersByAssessmentControl]
(Int -> ReadS GetEvidenceFoldersByAssessmentControl)
-> ReadS [GetEvidenceFoldersByAssessmentControl]
-> ReadPrec GetEvidenceFoldersByAssessmentControl
-> ReadPrec [GetEvidenceFoldersByAssessmentControl]
-> Read GetEvidenceFoldersByAssessmentControl
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetEvidenceFoldersByAssessmentControl]
$creadListPrec :: ReadPrec [GetEvidenceFoldersByAssessmentControl]
readPrec :: ReadPrec GetEvidenceFoldersByAssessmentControl
$creadPrec :: ReadPrec GetEvidenceFoldersByAssessmentControl
readList :: ReadS [GetEvidenceFoldersByAssessmentControl]
$creadList :: ReadS [GetEvidenceFoldersByAssessmentControl]
readsPrec :: Int -> ReadS GetEvidenceFoldersByAssessmentControl
$creadsPrec :: Int -> ReadS GetEvidenceFoldersByAssessmentControl
Prelude.Read, Int -> GetEvidenceFoldersByAssessmentControl -> ShowS
[GetEvidenceFoldersByAssessmentControl] -> ShowS
GetEvidenceFoldersByAssessmentControl -> String
(Int -> GetEvidenceFoldersByAssessmentControl -> ShowS)
-> (GetEvidenceFoldersByAssessmentControl -> String)
-> ([GetEvidenceFoldersByAssessmentControl] -> ShowS)
-> Show GetEvidenceFoldersByAssessmentControl
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetEvidenceFoldersByAssessmentControl] -> ShowS
$cshowList :: [GetEvidenceFoldersByAssessmentControl] -> ShowS
show :: GetEvidenceFoldersByAssessmentControl -> String
$cshow :: GetEvidenceFoldersByAssessmentControl -> String
showsPrec :: Int -> GetEvidenceFoldersByAssessmentControl -> ShowS
$cshowsPrec :: Int -> GetEvidenceFoldersByAssessmentControl -> ShowS
Prelude.Show, (forall x.
 GetEvidenceFoldersByAssessmentControl
 -> Rep GetEvidenceFoldersByAssessmentControl x)
-> (forall x.
    Rep GetEvidenceFoldersByAssessmentControl x
    -> GetEvidenceFoldersByAssessmentControl)
-> Generic GetEvidenceFoldersByAssessmentControl
forall x.
Rep GetEvidenceFoldersByAssessmentControl x
-> GetEvidenceFoldersByAssessmentControl
forall x.
GetEvidenceFoldersByAssessmentControl
-> Rep GetEvidenceFoldersByAssessmentControl x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetEvidenceFoldersByAssessmentControl x
-> GetEvidenceFoldersByAssessmentControl
$cfrom :: forall x.
GetEvidenceFoldersByAssessmentControl
-> Rep GetEvidenceFoldersByAssessmentControl x
Prelude.Generic)

-- |
-- Create a value of 'GetEvidenceFoldersByAssessmentControl' 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', 'getEvidenceFoldersByAssessmentControl_nextToken' - The pagination token used to fetch the next set of results.
--
-- 'maxResults', 'getEvidenceFoldersByAssessmentControl_maxResults' - Represents the maximum number of results per page, or per API request
-- call.
--
-- 'assessmentId', 'getEvidenceFoldersByAssessmentControl_assessmentId' - The identifier for the specified assessment.
--
-- 'controlSetId', 'getEvidenceFoldersByAssessmentControl_controlSetId' - The identifier for the specified control set.
--
-- 'controlId', 'getEvidenceFoldersByAssessmentControl_controlId' - The identifier for the specified control.
newGetEvidenceFoldersByAssessmentControl ::
  -- | 'assessmentId'
  Prelude.Text ->
  -- | 'controlSetId'
  Prelude.Text ->
  -- | 'controlId'
  Prelude.Text ->
  GetEvidenceFoldersByAssessmentControl
newGetEvidenceFoldersByAssessmentControl :: Text -> Text -> Text -> GetEvidenceFoldersByAssessmentControl
newGetEvidenceFoldersByAssessmentControl
  Text
pAssessmentId_
  Text
pControlSetId_
  Text
pControlId_ =
    GetEvidenceFoldersByAssessmentControl' :: Maybe Text
-> Maybe Natural
-> Text
-> Text
-> Text
-> GetEvidenceFoldersByAssessmentControl
GetEvidenceFoldersByAssessmentControl'
      { $sel:nextToken:GetEvidenceFoldersByAssessmentControl' :: Maybe Text
nextToken =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:maxResults:GetEvidenceFoldersByAssessmentControl' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
        $sel:assessmentId:GetEvidenceFoldersByAssessmentControl' :: Text
assessmentId = Text
pAssessmentId_,
        $sel:controlSetId:GetEvidenceFoldersByAssessmentControl' :: Text
controlSetId = Text
pControlSetId_,
        $sel:controlId:GetEvidenceFoldersByAssessmentControl' :: Text
controlId = Text
pControlId_
      }

-- | The pagination token used to fetch the next set of results.
getEvidenceFoldersByAssessmentControl_nextToken :: Lens.Lens' GetEvidenceFoldersByAssessmentControl (Prelude.Maybe Prelude.Text)
getEvidenceFoldersByAssessmentControl_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetEvidenceFoldersByAssessmentControl
-> f GetEvidenceFoldersByAssessmentControl
getEvidenceFoldersByAssessmentControl_nextToken = (GetEvidenceFoldersByAssessmentControl -> Maybe Text)
-> (GetEvidenceFoldersByAssessmentControl
    -> Maybe Text -> GetEvidenceFoldersByAssessmentControl)
-> Lens
     GetEvidenceFoldersByAssessmentControl
     GetEvidenceFoldersByAssessmentControl
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEvidenceFoldersByAssessmentControl' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetEvidenceFoldersByAssessmentControl' :: GetEvidenceFoldersByAssessmentControl -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetEvidenceFoldersByAssessmentControl
s@GetEvidenceFoldersByAssessmentControl' {} Maybe Text
a -> GetEvidenceFoldersByAssessmentControl
s {$sel:nextToken:GetEvidenceFoldersByAssessmentControl' :: Maybe Text
nextToken = Maybe Text
a} :: GetEvidenceFoldersByAssessmentControl)

-- | Represents the maximum number of results per page, or per API request
-- call.
getEvidenceFoldersByAssessmentControl_maxResults :: Lens.Lens' GetEvidenceFoldersByAssessmentControl (Prelude.Maybe Prelude.Natural)
getEvidenceFoldersByAssessmentControl_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> GetEvidenceFoldersByAssessmentControl
-> f GetEvidenceFoldersByAssessmentControl
getEvidenceFoldersByAssessmentControl_maxResults = (GetEvidenceFoldersByAssessmentControl -> Maybe Natural)
-> (GetEvidenceFoldersByAssessmentControl
    -> Maybe Natural -> GetEvidenceFoldersByAssessmentControl)
-> Lens
     GetEvidenceFoldersByAssessmentControl
     GetEvidenceFoldersByAssessmentControl
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEvidenceFoldersByAssessmentControl' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:GetEvidenceFoldersByAssessmentControl' :: GetEvidenceFoldersByAssessmentControl -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: GetEvidenceFoldersByAssessmentControl
s@GetEvidenceFoldersByAssessmentControl' {} Maybe Natural
a -> GetEvidenceFoldersByAssessmentControl
s {$sel:maxResults:GetEvidenceFoldersByAssessmentControl' :: Maybe Natural
maxResults = Maybe Natural
a} :: GetEvidenceFoldersByAssessmentControl)

-- | The identifier for the specified assessment.
getEvidenceFoldersByAssessmentControl_assessmentId :: Lens.Lens' GetEvidenceFoldersByAssessmentControl Prelude.Text
getEvidenceFoldersByAssessmentControl_assessmentId :: (Text -> f Text)
-> GetEvidenceFoldersByAssessmentControl
-> f GetEvidenceFoldersByAssessmentControl
getEvidenceFoldersByAssessmentControl_assessmentId = (GetEvidenceFoldersByAssessmentControl -> Text)
-> (GetEvidenceFoldersByAssessmentControl
    -> Text -> GetEvidenceFoldersByAssessmentControl)
-> Lens
     GetEvidenceFoldersByAssessmentControl
     GetEvidenceFoldersByAssessmentControl
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEvidenceFoldersByAssessmentControl' {Text
assessmentId :: Text
$sel:assessmentId:GetEvidenceFoldersByAssessmentControl' :: GetEvidenceFoldersByAssessmentControl -> Text
assessmentId} -> Text
assessmentId) (\s :: GetEvidenceFoldersByAssessmentControl
s@GetEvidenceFoldersByAssessmentControl' {} Text
a -> GetEvidenceFoldersByAssessmentControl
s {$sel:assessmentId:GetEvidenceFoldersByAssessmentControl' :: Text
assessmentId = Text
a} :: GetEvidenceFoldersByAssessmentControl)

-- | The identifier for the specified control set.
getEvidenceFoldersByAssessmentControl_controlSetId :: Lens.Lens' GetEvidenceFoldersByAssessmentControl Prelude.Text
getEvidenceFoldersByAssessmentControl_controlSetId :: (Text -> f Text)
-> GetEvidenceFoldersByAssessmentControl
-> f GetEvidenceFoldersByAssessmentControl
getEvidenceFoldersByAssessmentControl_controlSetId = (GetEvidenceFoldersByAssessmentControl -> Text)
-> (GetEvidenceFoldersByAssessmentControl
    -> Text -> GetEvidenceFoldersByAssessmentControl)
-> Lens
     GetEvidenceFoldersByAssessmentControl
     GetEvidenceFoldersByAssessmentControl
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEvidenceFoldersByAssessmentControl' {Text
controlSetId :: Text
$sel:controlSetId:GetEvidenceFoldersByAssessmentControl' :: GetEvidenceFoldersByAssessmentControl -> Text
controlSetId} -> Text
controlSetId) (\s :: GetEvidenceFoldersByAssessmentControl
s@GetEvidenceFoldersByAssessmentControl' {} Text
a -> GetEvidenceFoldersByAssessmentControl
s {$sel:controlSetId:GetEvidenceFoldersByAssessmentControl' :: Text
controlSetId = Text
a} :: GetEvidenceFoldersByAssessmentControl)

-- | The identifier for the specified control.
getEvidenceFoldersByAssessmentControl_controlId :: Lens.Lens' GetEvidenceFoldersByAssessmentControl Prelude.Text
getEvidenceFoldersByAssessmentControl_controlId :: (Text -> f Text)
-> GetEvidenceFoldersByAssessmentControl
-> f GetEvidenceFoldersByAssessmentControl
getEvidenceFoldersByAssessmentControl_controlId = (GetEvidenceFoldersByAssessmentControl -> Text)
-> (GetEvidenceFoldersByAssessmentControl
    -> Text -> GetEvidenceFoldersByAssessmentControl)
-> Lens
     GetEvidenceFoldersByAssessmentControl
     GetEvidenceFoldersByAssessmentControl
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEvidenceFoldersByAssessmentControl' {Text
controlId :: Text
$sel:controlId:GetEvidenceFoldersByAssessmentControl' :: GetEvidenceFoldersByAssessmentControl -> Text
controlId} -> Text
controlId) (\s :: GetEvidenceFoldersByAssessmentControl
s@GetEvidenceFoldersByAssessmentControl' {} Text
a -> GetEvidenceFoldersByAssessmentControl
s {$sel:controlId:GetEvidenceFoldersByAssessmentControl' :: Text
controlId = Text
a} :: GetEvidenceFoldersByAssessmentControl)

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

instance
  Prelude.NFData
    GetEvidenceFoldersByAssessmentControl

instance
  Core.ToHeaders
    GetEvidenceFoldersByAssessmentControl
  where
  toHeaders :: GetEvidenceFoldersByAssessmentControl -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> GetEvidenceFoldersByAssessmentControl -> 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
    GetEvidenceFoldersByAssessmentControl
  where
  toPath :: GetEvidenceFoldersByAssessmentControl -> ByteString
toPath GetEvidenceFoldersByAssessmentControl' {Maybe Natural
Maybe Text
Text
controlId :: Text
controlSetId :: Text
assessmentId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:controlId:GetEvidenceFoldersByAssessmentControl' :: GetEvidenceFoldersByAssessmentControl -> Text
$sel:controlSetId:GetEvidenceFoldersByAssessmentControl' :: GetEvidenceFoldersByAssessmentControl -> Text
$sel:assessmentId:GetEvidenceFoldersByAssessmentControl' :: GetEvidenceFoldersByAssessmentControl -> Text
$sel:maxResults:GetEvidenceFoldersByAssessmentControl' :: GetEvidenceFoldersByAssessmentControl -> Maybe Natural
$sel:nextToken:GetEvidenceFoldersByAssessmentControl' :: GetEvidenceFoldersByAssessmentControl -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/assessments/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
assessmentId,
        ByteString
"/evidenceFolders-by-assessment-control/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
controlSetId,
        ByteString
"/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
controlId
      ]

instance
  Core.ToQuery
    GetEvidenceFoldersByAssessmentControl
  where
  toQuery :: GetEvidenceFoldersByAssessmentControl -> QueryString
toQuery GetEvidenceFoldersByAssessmentControl' {Maybe Natural
Maybe Text
Text
controlId :: Text
controlSetId :: Text
assessmentId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:controlId:GetEvidenceFoldersByAssessmentControl' :: GetEvidenceFoldersByAssessmentControl -> Text
$sel:controlSetId:GetEvidenceFoldersByAssessmentControl' :: GetEvidenceFoldersByAssessmentControl -> Text
$sel:assessmentId:GetEvidenceFoldersByAssessmentControl' :: GetEvidenceFoldersByAssessmentControl -> Text
$sel:maxResults:GetEvidenceFoldersByAssessmentControl' :: GetEvidenceFoldersByAssessmentControl -> Maybe Natural
$sel:nextToken:GetEvidenceFoldersByAssessmentControl' :: GetEvidenceFoldersByAssessmentControl -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"nextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"maxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
      ]

-- | /See:/ 'newGetEvidenceFoldersByAssessmentControlResponse' smart constructor.
data GetEvidenceFoldersByAssessmentControlResponse = GetEvidenceFoldersByAssessmentControlResponse'
  { -- | The pagination token used to fetch the next set of results.
    GetEvidenceFoldersByAssessmentControlResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The list of evidence folders returned by the
    -- @GetEvidenceFoldersByAssessmentControl@ API.
    GetEvidenceFoldersByAssessmentControlResponse
-> Maybe [AssessmentEvidenceFolder]
evidenceFolders :: Prelude.Maybe [AssessmentEvidenceFolder],
    -- | The response's http status code.
    GetEvidenceFoldersByAssessmentControlResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetEvidenceFoldersByAssessmentControlResponse
-> GetEvidenceFoldersByAssessmentControlResponse -> Bool
(GetEvidenceFoldersByAssessmentControlResponse
 -> GetEvidenceFoldersByAssessmentControlResponse -> Bool)
-> (GetEvidenceFoldersByAssessmentControlResponse
    -> GetEvidenceFoldersByAssessmentControlResponse -> Bool)
-> Eq GetEvidenceFoldersByAssessmentControlResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetEvidenceFoldersByAssessmentControlResponse
-> GetEvidenceFoldersByAssessmentControlResponse -> Bool
$c/= :: GetEvidenceFoldersByAssessmentControlResponse
-> GetEvidenceFoldersByAssessmentControlResponse -> Bool
== :: GetEvidenceFoldersByAssessmentControlResponse
-> GetEvidenceFoldersByAssessmentControlResponse -> Bool
$c== :: GetEvidenceFoldersByAssessmentControlResponse
-> GetEvidenceFoldersByAssessmentControlResponse -> Bool
Prelude.Eq, ReadPrec [GetEvidenceFoldersByAssessmentControlResponse]
ReadPrec GetEvidenceFoldersByAssessmentControlResponse
Int -> ReadS GetEvidenceFoldersByAssessmentControlResponse
ReadS [GetEvidenceFoldersByAssessmentControlResponse]
(Int -> ReadS GetEvidenceFoldersByAssessmentControlResponse)
-> ReadS [GetEvidenceFoldersByAssessmentControlResponse]
-> ReadPrec GetEvidenceFoldersByAssessmentControlResponse
-> ReadPrec [GetEvidenceFoldersByAssessmentControlResponse]
-> Read GetEvidenceFoldersByAssessmentControlResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetEvidenceFoldersByAssessmentControlResponse]
$creadListPrec :: ReadPrec [GetEvidenceFoldersByAssessmentControlResponse]
readPrec :: ReadPrec GetEvidenceFoldersByAssessmentControlResponse
$creadPrec :: ReadPrec GetEvidenceFoldersByAssessmentControlResponse
readList :: ReadS [GetEvidenceFoldersByAssessmentControlResponse]
$creadList :: ReadS [GetEvidenceFoldersByAssessmentControlResponse]
readsPrec :: Int -> ReadS GetEvidenceFoldersByAssessmentControlResponse
$creadsPrec :: Int -> ReadS GetEvidenceFoldersByAssessmentControlResponse
Prelude.Read, Int -> GetEvidenceFoldersByAssessmentControlResponse -> ShowS
[GetEvidenceFoldersByAssessmentControlResponse] -> ShowS
GetEvidenceFoldersByAssessmentControlResponse -> String
(Int -> GetEvidenceFoldersByAssessmentControlResponse -> ShowS)
-> (GetEvidenceFoldersByAssessmentControlResponse -> String)
-> ([GetEvidenceFoldersByAssessmentControlResponse] -> ShowS)
-> Show GetEvidenceFoldersByAssessmentControlResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetEvidenceFoldersByAssessmentControlResponse] -> ShowS
$cshowList :: [GetEvidenceFoldersByAssessmentControlResponse] -> ShowS
show :: GetEvidenceFoldersByAssessmentControlResponse -> String
$cshow :: GetEvidenceFoldersByAssessmentControlResponse -> String
showsPrec :: Int -> GetEvidenceFoldersByAssessmentControlResponse -> ShowS
$cshowsPrec :: Int -> GetEvidenceFoldersByAssessmentControlResponse -> ShowS
Prelude.Show, (forall x.
 GetEvidenceFoldersByAssessmentControlResponse
 -> Rep GetEvidenceFoldersByAssessmentControlResponse x)
-> (forall x.
    Rep GetEvidenceFoldersByAssessmentControlResponse x
    -> GetEvidenceFoldersByAssessmentControlResponse)
-> Generic GetEvidenceFoldersByAssessmentControlResponse
forall x.
Rep GetEvidenceFoldersByAssessmentControlResponse x
-> GetEvidenceFoldersByAssessmentControlResponse
forall x.
GetEvidenceFoldersByAssessmentControlResponse
-> Rep GetEvidenceFoldersByAssessmentControlResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetEvidenceFoldersByAssessmentControlResponse x
-> GetEvidenceFoldersByAssessmentControlResponse
$cfrom :: forall x.
GetEvidenceFoldersByAssessmentControlResponse
-> Rep GetEvidenceFoldersByAssessmentControlResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetEvidenceFoldersByAssessmentControlResponse' 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', 'getEvidenceFoldersByAssessmentControlResponse_nextToken' - The pagination token used to fetch the next set of results.
--
-- 'evidenceFolders', 'getEvidenceFoldersByAssessmentControlResponse_evidenceFolders' - The list of evidence folders returned by the
-- @GetEvidenceFoldersByAssessmentControl@ API.
--
-- 'httpStatus', 'getEvidenceFoldersByAssessmentControlResponse_httpStatus' - The response's http status code.
newGetEvidenceFoldersByAssessmentControlResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetEvidenceFoldersByAssessmentControlResponse
newGetEvidenceFoldersByAssessmentControlResponse :: Int -> GetEvidenceFoldersByAssessmentControlResponse
newGetEvidenceFoldersByAssessmentControlResponse
  Int
pHttpStatus_ =
    GetEvidenceFoldersByAssessmentControlResponse' :: Maybe Text
-> Maybe [AssessmentEvidenceFolder]
-> Int
-> GetEvidenceFoldersByAssessmentControlResponse
GetEvidenceFoldersByAssessmentControlResponse'
      { $sel:nextToken:GetEvidenceFoldersByAssessmentControlResponse' :: Maybe Text
nextToken =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:evidenceFolders:GetEvidenceFoldersByAssessmentControlResponse' :: Maybe [AssessmentEvidenceFolder]
evidenceFolders =
          Maybe [AssessmentEvidenceFolder]
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:GetEvidenceFoldersByAssessmentControlResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The pagination token used to fetch the next set of results.
getEvidenceFoldersByAssessmentControlResponse_nextToken :: Lens.Lens' GetEvidenceFoldersByAssessmentControlResponse (Prelude.Maybe Prelude.Text)
getEvidenceFoldersByAssessmentControlResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetEvidenceFoldersByAssessmentControlResponse
-> f GetEvidenceFoldersByAssessmentControlResponse
getEvidenceFoldersByAssessmentControlResponse_nextToken = (GetEvidenceFoldersByAssessmentControlResponse -> Maybe Text)
-> (GetEvidenceFoldersByAssessmentControlResponse
    -> Maybe Text -> GetEvidenceFoldersByAssessmentControlResponse)
-> Lens
     GetEvidenceFoldersByAssessmentControlResponse
     GetEvidenceFoldersByAssessmentControlResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEvidenceFoldersByAssessmentControlResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetEvidenceFoldersByAssessmentControlResponse' :: GetEvidenceFoldersByAssessmentControlResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetEvidenceFoldersByAssessmentControlResponse
s@GetEvidenceFoldersByAssessmentControlResponse' {} Maybe Text
a -> GetEvidenceFoldersByAssessmentControlResponse
s {$sel:nextToken:GetEvidenceFoldersByAssessmentControlResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetEvidenceFoldersByAssessmentControlResponse)

-- | The list of evidence folders returned by the
-- @GetEvidenceFoldersByAssessmentControl@ API.
getEvidenceFoldersByAssessmentControlResponse_evidenceFolders :: Lens.Lens' GetEvidenceFoldersByAssessmentControlResponse (Prelude.Maybe [AssessmentEvidenceFolder])
getEvidenceFoldersByAssessmentControlResponse_evidenceFolders :: (Maybe [AssessmentEvidenceFolder]
 -> f (Maybe [AssessmentEvidenceFolder]))
-> GetEvidenceFoldersByAssessmentControlResponse
-> f GetEvidenceFoldersByAssessmentControlResponse
getEvidenceFoldersByAssessmentControlResponse_evidenceFolders = (GetEvidenceFoldersByAssessmentControlResponse
 -> Maybe [AssessmentEvidenceFolder])
-> (GetEvidenceFoldersByAssessmentControlResponse
    -> Maybe [AssessmentEvidenceFolder]
    -> GetEvidenceFoldersByAssessmentControlResponse)
-> Lens
     GetEvidenceFoldersByAssessmentControlResponse
     GetEvidenceFoldersByAssessmentControlResponse
     (Maybe [AssessmentEvidenceFolder])
     (Maybe [AssessmentEvidenceFolder])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEvidenceFoldersByAssessmentControlResponse' {Maybe [AssessmentEvidenceFolder]
evidenceFolders :: Maybe [AssessmentEvidenceFolder]
$sel:evidenceFolders:GetEvidenceFoldersByAssessmentControlResponse' :: GetEvidenceFoldersByAssessmentControlResponse
-> Maybe [AssessmentEvidenceFolder]
evidenceFolders} -> Maybe [AssessmentEvidenceFolder]
evidenceFolders) (\s :: GetEvidenceFoldersByAssessmentControlResponse
s@GetEvidenceFoldersByAssessmentControlResponse' {} Maybe [AssessmentEvidenceFolder]
a -> GetEvidenceFoldersByAssessmentControlResponse
s {$sel:evidenceFolders:GetEvidenceFoldersByAssessmentControlResponse' :: Maybe [AssessmentEvidenceFolder]
evidenceFolders = Maybe [AssessmentEvidenceFolder]
a} :: GetEvidenceFoldersByAssessmentControlResponse) ((Maybe [AssessmentEvidenceFolder]
  -> f (Maybe [AssessmentEvidenceFolder]))
 -> GetEvidenceFoldersByAssessmentControlResponse
 -> f GetEvidenceFoldersByAssessmentControlResponse)
-> ((Maybe [AssessmentEvidenceFolder]
     -> f (Maybe [AssessmentEvidenceFolder]))
    -> Maybe [AssessmentEvidenceFolder]
    -> f (Maybe [AssessmentEvidenceFolder]))
-> (Maybe [AssessmentEvidenceFolder]
    -> f (Maybe [AssessmentEvidenceFolder]))
-> GetEvidenceFoldersByAssessmentControlResponse
-> f GetEvidenceFoldersByAssessmentControlResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [AssessmentEvidenceFolder]
  [AssessmentEvidenceFolder]
  [AssessmentEvidenceFolder]
  [AssessmentEvidenceFolder]
-> Iso
     (Maybe [AssessmentEvidenceFolder])
     (Maybe [AssessmentEvidenceFolder])
     (Maybe [AssessmentEvidenceFolder])
     (Maybe [AssessmentEvidenceFolder])
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
  [AssessmentEvidenceFolder]
  [AssessmentEvidenceFolder]
  [AssessmentEvidenceFolder]
  [AssessmentEvidenceFolder]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    GetEvidenceFoldersByAssessmentControlResponse