{-# 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 #-}
module Amazonka.AuditManager.GetEvidenceFolder
(
GetEvidenceFolder (..),
newGetEvidenceFolder,
getEvidenceFolder_assessmentId,
getEvidenceFolder_controlSetId,
getEvidenceFolder_evidenceFolderId,
GetEvidenceFolderResponse (..),
newGetEvidenceFolderResponse,
getEvidenceFolderResponse_evidenceFolder,
getEvidenceFolderResponse_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
data GetEvidenceFolder = GetEvidenceFolder'
{
GetEvidenceFolder -> Text
assessmentId :: Prelude.Text,
GetEvidenceFolder -> Text
controlSetId :: Prelude.Text,
GetEvidenceFolder -> Text
evidenceFolderId :: Prelude.Text
}
deriving (GetEvidenceFolder -> GetEvidenceFolder -> Bool
(GetEvidenceFolder -> GetEvidenceFolder -> Bool)
-> (GetEvidenceFolder -> GetEvidenceFolder -> Bool)
-> Eq GetEvidenceFolder
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetEvidenceFolder -> GetEvidenceFolder -> Bool
$c/= :: GetEvidenceFolder -> GetEvidenceFolder -> Bool
== :: GetEvidenceFolder -> GetEvidenceFolder -> Bool
$c== :: GetEvidenceFolder -> GetEvidenceFolder -> Bool
Prelude.Eq, ReadPrec [GetEvidenceFolder]
ReadPrec GetEvidenceFolder
Int -> ReadS GetEvidenceFolder
ReadS [GetEvidenceFolder]
(Int -> ReadS GetEvidenceFolder)
-> ReadS [GetEvidenceFolder]
-> ReadPrec GetEvidenceFolder
-> ReadPrec [GetEvidenceFolder]
-> Read GetEvidenceFolder
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetEvidenceFolder]
$creadListPrec :: ReadPrec [GetEvidenceFolder]
readPrec :: ReadPrec GetEvidenceFolder
$creadPrec :: ReadPrec GetEvidenceFolder
readList :: ReadS [GetEvidenceFolder]
$creadList :: ReadS [GetEvidenceFolder]
readsPrec :: Int -> ReadS GetEvidenceFolder
$creadsPrec :: Int -> ReadS GetEvidenceFolder
Prelude.Read, Int -> GetEvidenceFolder -> ShowS
[GetEvidenceFolder] -> ShowS
GetEvidenceFolder -> String
(Int -> GetEvidenceFolder -> ShowS)
-> (GetEvidenceFolder -> String)
-> ([GetEvidenceFolder] -> ShowS)
-> Show GetEvidenceFolder
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetEvidenceFolder] -> ShowS
$cshowList :: [GetEvidenceFolder] -> ShowS
show :: GetEvidenceFolder -> String
$cshow :: GetEvidenceFolder -> String
showsPrec :: Int -> GetEvidenceFolder -> ShowS
$cshowsPrec :: Int -> GetEvidenceFolder -> ShowS
Prelude.Show, (forall x. GetEvidenceFolder -> Rep GetEvidenceFolder x)
-> (forall x. Rep GetEvidenceFolder x -> GetEvidenceFolder)
-> Generic GetEvidenceFolder
forall x. Rep GetEvidenceFolder x -> GetEvidenceFolder
forall x. GetEvidenceFolder -> Rep GetEvidenceFolder x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetEvidenceFolder x -> GetEvidenceFolder
$cfrom :: forall x. GetEvidenceFolder -> Rep GetEvidenceFolder x
Prelude.Generic)
newGetEvidenceFolder ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
GetEvidenceFolder
newGetEvidenceFolder :: Text -> Text -> Text -> GetEvidenceFolder
newGetEvidenceFolder
Text
pAssessmentId_
Text
pControlSetId_
Text
pEvidenceFolderId_ =
GetEvidenceFolder' :: Text -> Text -> Text -> GetEvidenceFolder
GetEvidenceFolder'
{ $sel:assessmentId:GetEvidenceFolder' :: Text
assessmentId = Text
pAssessmentId_,
$sel:controlSetId:GetEvidenceFolder' :: Text
controlSetId = Text
pControlSetId_,
$sel:evidenceFolderId:GetEvidenceFolder' :: Text
evidenceFolderId = Text
pEvidenceFolderId_
}
getEvidenceFolder_assessmentId :: Lens.Lens' GetEvidenceFolder Prelude.Text
getEvidenceFolder_assessmentId :: (Text -> f Text) -> GetEvidenceFolder -> f GetEvidenceFolder
getEvidenceFolder_assessmentId = (GetEvidenceFolder -> Text)
-> (GetEvidenceFolder -> Text -> GetEvidenceFolder)
-> Lens GetEvidenceFolder GetEvidenceFolder Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEvidenceFolder' {Text
assessmentId :: Text
$sel:assessmentId:GetEvidenceFolder' :: GetEvidenceFolder -> Text
assessmentId} -> Text
assessmentId) (\s :: GetEvidenceFolder
s@GetEvidenceFolder' {} Text
a -> GetEvidenceFolder
s {$sel:assessmentId:GetEvidenceFolder' :: Text
assessmentId = Text
a} :: GetEvidenceFolder)
getEvidenceFolder_controlSetId :: Lens.Lens' GetEvidenceFolder Prelude.Text
getEvidenceFolder_controlSetId :: (Text -> f Text) -> GetEvidenceFolder -> f GetEvidenceFolder
getEvidenceFolder_controlSetId = (GetEvidenceFolder -> Text)
-> (GetEvidenceFolder -> Text -> GetEvidenceFolder)
-> Lens GetEvidenceFolder GetEvidenceFolder Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEvidenceFolder' {Text
controlSetId :: Text
$sel:controlSetId:GetEvidenceFolder' :: GetEvidenceFolder -> Text
controlSetId} -> Text
controlSetId) (\s :: GetEvidenceFolder
s@GetEvidenceFolder' {} Text
a -> GetEvidenceFolder
s {$sel:controlSetId:GetEvidenceFolder' :: Text
controlSetId = Text
a} :: GetEvidenceFolder)
getEvidenceFolder_evidenceFolderId :: Lens.Lens' GetEvidenceFolder Prelude.Text
getEvidenceFolder_evidenceFolderId :: (Text -> f Text) -> GetEvidenceFolder -> f GetEvidenceFolder
getEvidenceFolder_evidenceFolderId = (GetEvidenceFolder -> Text)
-> (GetEvidenceFolder -> Text -> GetEvidenceFolder)
-> Lens GetEvidenceFolder GetEvidenceFolder Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEvidenceFolder' {Text
evidenceFolderId :: Text
$sel:evidenceFolderId:GetEvidenceFolder' :: GetEvidenceFolder -> Text
evidenceFolderId} -> Text
evidenceFolderId) (\s :: GetEvidenceFolder
s@GetEvidenceFolder' {} Text
a -> GetEvidenceFolder
s {$sel:evidenceFolderId:GetEvidenceFolder' :: Text
evidenceFolderId = Text
a} :: GetEvidenceFolder)
instance Core.AWSRequest GetEvidenceFolder where
type
AWSResponse GetEvidenceFolder =
GetEvidenceFolderResponse
request :: GetEvidenceFolder -> Request GetEvidenceFolder
request = Service -> GetEvidenceFolder -> Request GetEvidenceFolder
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy GetEvidenceFolder
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetEvidenceFolder)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetEvidenceFolder))
-> Logger
-> Service
-> Proxy GetEvidenceFolder
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetEvidenceFolder)))
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 AssessmentEvidenceFolder -> Int -> GetEvidenceFolderResponse
GetEvidenceFolderResponse'
(Maybe AssessmentEvidenceFolder
-> Int -> GetEvidenceFolderResponse)
-> Either String (Maybe AssessmentEvidenceFolder)
-> Either String (Int -> GetEvidenceFolderResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe AssessmentEvidenceFolder)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"evidenceFolder")
Either String (Int -> GetEvidenceFolderResponse)
-> Either String Int -> Either String GetEvidenceFolderResponse
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 GetEvidenceFolder
instance Prelude.NFData GetEvidenceFolder
instance Core.ToHeaders GetEvidenceFolder where
toHeaders :: GetEvidenceFolder -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetEvidenceFolder -> 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 GetEvidenceFolder where
toPath :: GetEvidenceFolder -> ByteString
toPath GetEvidenceFolder' {Text
evidenceFolderId :: Text
controlSetId :: Text
assessmentId :: Text
$sel:evidenceFolderId:GetEvidenceFolder' :: GetEvidenceFolder -> Text
$sel:controlSetId:GetEvidenceFolder' :: GetEvidenceFolder -> Text
$sel:assessmentId:GetEvidenceFolder' :: GetEvidenceFolder -> 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
"/controlSets/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
controlSetId,
ByteString
"/evidenceFolders/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
evidenceFolderId
]
instance Core.ToQuery GetEvidenceFolder where
toQuery :: GetEvidenceFolder -> QueryString
toQuery = QueryString -> GetEvidenceFolder -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetEvidenceFolderResponse = GetEvidenceFolderResponse'
{
GetEvidenceFolderResponse -> Maybe AssessmentEvidenceFolder
evidenceFolder :: Prelude.Maybe AssessmentEvidenceFolder,
GetEvidenceFolderResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetEvidenceFolderResponse -> GetEvidenceFolderResponse -> Bool
(GetEvidenceFolderResponse -> GetEvidenceFolderResponse -> Bool)
-> (GetEvidenceFolderResponse -> GetEvidenceFolderResponse -> Bool)
-> Eq GetEvidenceFolderResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetEvidenceFolderResponse -> GetEvidenceFolderResponse -> Bool
$c/= :: GetEvidenceFolderResponse -> GetEvidenceFolderResponse -> Bool
== :: GetEvidenceFolderResponse -> GetEvidenceFolderResponse -> Bool
$c== :: GetEvidenceFolderResponse -> GetEvidenceFolderResponse -> Bool
Prelude.Eq, ReadPrec [GetEvidenceFolderResponse]
ReadPrec GetEvidenceFolderResponse
Int -> ReadS GetEvidenceFolderResponse
ReadS [GetEvidenceFolderResponse]
(Int -> ReadS GetEvidenceFolderResponse)
-> ReadS [GetEvidenceFolderResponse]
-> ReadPrec GetEvidenceFolderResponse
-> ReadPrec [GetEvidenceFolderResponse]
-> Read GetEvidenceFolderResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetEvidenceFolderResponse]
$creadListPrec :: ReadPrec [GetEvidenceFolderResponse]
readPrec :: ReadPrec GetEvidenceFolderResponse
$creadPrec :: ReadPrec GetEvidenceFolderResponse
readList :: ReadS [GetEvidenceFolderResponse]
$creadList :: ReadS [GetEvidenceFolderResponse]
readsPrec :: Int -> ReadS GetEvidenceFolderResponse
$creadsPrec :: Int -> ReadS GetEvidenceFolderResponse
Prelude.Read, Int -> GetEvidenceFolderResponse -> ShowS
[GetEvidenceFolderResponse] -> ShowS
GetEvidenceFolderResponse -> String
(Int -> GetEvidenceFolderResponse -> ShowS)
-> (GetEvidenceFolderResponse -> String)
-> ([GetEvidenceFolderResponse] -> ShowS)
-> Show GetEvidenceFolderResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetEvidenceFolderResponse] -> ShowS
$cshowList :: [GetEvidenceFolderResponse] -> ShowS
show :: GetEvidenceFolderResponse -> String
$cshow :: GetEvidenceFolderResponse -> String
showsPrec :: Int -> GetEvidenceFolderResponse -> ShowS
$cshowsPrec :: Int -> GetEvidenceFolderResponse -> ShowS
Prelude.Show, (forall x.
GetEvidenceFolderResponse -> Rep GetEvidenceFolderResponse x)
-> (forall x.
Rep GetEvidenceFolderResponse x -> GetEvidenceFolderResponse)
-> Generic GetEvidenceFolderResponse
forall x.
Rep GetEvidenceFolderResponse x -> GetEvidenceFolderResponse
forall x.
GetEvidenceFolderResponse -> Rep GetEvidenceFolderResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetEvidenceFolderResponse x -> GetEvidenceFolderResponse
$cfrom :: forall x.
GetEvidenceFolderResponse -> Rep GetEvidenceFolderResponse x
Prelude.Generic)
newGetEvidenceFolderResponse ::
Prelude.Int ->
GetEvidenceFolderResponse
newGetEvidenceFolderResponse :: Int -> GetEvidenceFolderResponse
newGetEvidenceFolderResponse Int
pHttpStatus_ =
GetEvidenceFolderResponse' :: Maybe AssessmentEvidenceFolder -> Int -> GetEvidenceFolderResponse
GetEvidenceFolderResponse'
{ $sel:evidenceFolder:GetEvidenceFolderResponse' :: Maybe AssessmentEvidenceFolder
evidenceFolder =
Maybe AssessmentEvidenceFolder
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetEvidenceFolderResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getEvidenceFolderResponse_evidenceFolder :: Lens.Lens' GetEvidenceFolderResponse (Prelude.Maybe AssessmentEvidenceFolder)
getEvidenceFolderResponse_evidenceFolder :: (Maybe AssessmentEvidenceFolder
-> f (Maybe AssessmentEvidenceFolder))
-> GetEvidenceFolderResponse -> f GetEvidenceFolderResponse
getEvidenceFolderResponse_evidenceFolder = (GetEvidenceFolderResponse -> Maybe AssessmentEvidenceFolder)
-> (GetEvidenceFolderResponse
-> Maybe AssessmentEvidenceFolder -> GetEvidenceFolderResponse)
-> Lens
GetEvidenceFolderResponse
GetEvidenceFolderResponse
(Maybe AssessmentEvidenceFolder)
(Maybe AssessmentEvidenceFolder)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEvidenceFolderResponse' {Maybe AssessmentEvidenceFolder
evidenceFolder :: Maybe AssessmentEvidenceFolder
$sel:evidenceFolder:GetEvidenceFolderResponse' :: GetEvidenceFolderResponse -> Maybe AssessmentEvidenceFolder
evidenceFolder} -> Maybe AssessmentEvidenceFolder
evidenceFolder) (\s :: GetEvidenceFolderResponse
s@GetEvidenceFolderResponse' {} Maybe AssessmentEvidenceFolder
a -> GetEvidenceFolderResponse
s {$sel:evidenceFolder:GetEvidenceFolderResponse' :: Maybe AssessmentEvidenceFolder
evidenceFolder = Maybe AssessmentEvidenceFolder
a} :: GetEvidenceFolderResponse)
getEvidenceFolderResponse_httpStatus :: Lens.Lens' GetEvidenceFolderResponse Prelude.Int
getEvidenceFolderResponse_httpStatus :: (Int -> f Int)
-> GetEvidenceFolderResponse -> f GetEvidenceFolderResponse
getEvidenceFolderResponse_httpStatus = (GetEvidenceFolderResponse -> Int)
-> (GetEvidenceFolderResponse -> Int -> GetEvidenceFolderResponse)
-> Lens GetEvidenceFolderResponse GetEvidenceFolderResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEvidenceFolderResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetEvidenceFolderResponse' :: GetEvidenceFolderResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetEvidenceFolderResponse
s@GetEvidenceFolderResponse' {} Int
a -> GetEvidenceFolderResponse
s {$sel:httpStatus:GetEvidenceFolderResponse' :: Int
httpStatus = Int
a} :: GetEvidenceFolderResponse)
instance Prelude.NFData GetEvidenceFolderResponse