{-# 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.IoT.DescribeAuditFinding
(
DescribeAuditFinding (..),
newDescribeAuditFinding,
describeAuditFinding_findingId,
DescribeAuditFindingResponse (..),
newDescribeAuditFindingResponse,
describeAuditFindingResponse_finding,
describeAuditFindingResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.IoT.Types
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 DescribeAuditFinding = DescribeAuditFinding'
{
DescribeAuditFinding -> Text
findingId :: Prelude.Text
}
deriving (DescribeAuditFinding -> DescribeAuditFinding -> Bool
(DescribeAuditFinding -> DescribeAuditFinding -> Bool)
-> (DescribeAuditFinding -> DescribeAuditFinding -> Bool)
-> Eq DescribeAuditFinding
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeAuditFinding -> DescribeAuditFinding -> Bool
$c/= :: DescribeAuditFinding -> DescribeAuditFinding -> Bool
== :: DescribeAuditFinding -> DescribeAuditFinding -> Bool
$c== :: DescribeAuditFinding -> DescribeAuditFinding -> Bool
Prelude.Eq, ReadPrec [DescribeAuditFinding]
ReadPrec DescribeAuditFinding
Int -> ReadS DescribeAuditFinding
ReadS [DescribeAuditFinding]
(Int -> ReadS DescribeAuditFinding)
-> ReadS [DescribeAuditFinding]
-> ReadPrec DescribeAuditFinding
-> ReadPrec [DescribeAuditFinding]
-> Read DescribeAuditFinding
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeAuditFinding]
$creadListPrec :: ReadPrec [DescribeAuditFinding]
readPrec :: ReadPrec DescribeAuditFinding
$creadPrec :: ReadPrec DescribeAuditFinding
readList :: ReadS [DescribeAuditFinding]
$creadList :: ReadS [DescribeAuditFinding]
readsPrec :: Int -> ReadS DescribeAuditFinding
$creadsPrec :: Int -> ReadS DescribeAuditFinding
Prelude.Read, Int -> DescribeAuditFinding -> ShowS
[DescribeAuditFinding] -> ShowS
DescribeAuditFinding -> String
(Int -> DescribeAuditFinding -> ShowS)
-> (DescribeAuditFinding -> String)
-> ([DescribeAuditFinding] -> ShowS)
-> Show DescribeAuditFinding
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeAuditFinding] -> ShowS
$cshowList :: [DescribeAuditFinding] -> ShowS
show :: DescribeAuditFinding -> String
$cshow :: DescribeAuditFinding -> String
showsPrec :: Int -> DescribeAuditFinding -> ShowS
$cshowsPrec :: Int -> DescribeAuditFinding -> ShowS
Prelude.Show, (forall x. DescribeAuditFinding -> Rep DescribeAuditFinding x)
-> (forall x. Rep DescribeAuditFinding x -> DescribeAuditFinding)
-> Generic DescribeAuditFinding
forall x. Rep DescribeAuditFinding x -> DescribeAuditFinding
forall x. DescribeAuditFinding -> Rep DescribeAuditFinding x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeAuditFinding x -> DescribeAuditFinding
$cfrom :: forall x. DescribeAuditFinding -> Rep DescribeAuditFinding x
Prelude.Generic)
newDescribeAuditFinding ::
Prelude.Text ->
DescribeAuditFinding
newDescribeAuditFinding :: Text -> DescribeAuditFinding
newDescribeAuditFinding Text
pFindingId_ =
DescribeAuditFinding' :: Text -> DescribeAuditFinding
DescribeAuditFinding' {$sel:findingId:DescribeAuditFinding' :: Text
findingId = Text
pFindingId_}
describeAuditFinding_findingId :: Lens.Lens' DescribeAuditFinding Prelude.Text
describeAuditFinding_findingId :: (Text -> f Text) -> DescribeAuditFinding -> f DescribeAuditFinding
describeAuditFinding_findingId = (DescribeAuditFinding -> Text)
-> (DescribeAuditFinding -> Text -> DescribeAuditFinding)
-> Lens DescribeAuditFinding DescribeAuditFinding Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAuditFinding' {Text
findingId :: Text
$sel:findingId:DescribeAuditFinding' :: DescribeAuditFinding -> Text
findingId} -> Text
findingId) (\s :: DescribeAuditFinding
s@DescribeAuditFinding' {} Text
a -> DescribeAuditFinding
s {$sel:findingId:DescribeAuditFinding' :: Text
findingId = Text
a} :: DescribeAuditFinding)
instance Core.AWSRequest DescribeAuditFinding where
type
AWSResponse DescribeAuditFinding =
DescribeAuditFindingResponse
request :: DescribeAuditFinding -> Request DescribeAuditFinding
request = Service -> DescribeAuditFinding -> Request DescribeAuditFinding
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeAuditFinding
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeAuditFinding)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeAuditFinding))
-> Logger
-> Service
-> Proxy DescribeAuditFinding
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeAuditFinding)))
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 AuditFinding -> Int -> DescribeAuditFindingResponse
DescribeAuditFindingResponse'
(Maybe AuditFinding -> Int -> DescribeAuditFindingResponse)
-> Either String (Maybe AuditFinding)
-> Either String (Int -> DescribeAuditFindingResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe AuditFinding)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"finding")
Either String (Int -> DescribeAuditFindingResponse)
-> Either String Int -> Either String DescribeAuditFindingResponse
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 DescribeAuditFinding
instance Prelude.NFData DescribeAuditFinding
instance Core.ToHeaders DescribeAuditFinding where
toHeaders :: DescribeAuditFinding -> ResponseHeaders
toHeaders = ResponseHeaders -> DescribeAuditFinding -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath DescribeAuditFinding where
toPath :: DescribeAuditFinding -> ByteString
toPath DescribeAuditFinding' {Text
findingId :: Text
$sel:findingId:DescribeAuditFinding' :: DescribeAuditFinding -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/audit/findings/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
findingId]
instance Core.ToQuery DescribeAuditFinding where
toQuery :: DescribeAuditFinding -> QueryString
toQuery = QueryString -> DescribeAuditFinding -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeAuditFindingResponse = DescribeAuditFindingResponse'
{ DescribeAuditFindingResponse -> Maybe AuditFinding
finding :: Prelude.Maybe AuditFinding,
DescribeAuditFindingResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeAuditFindingResponse
-> DescribeAuditFindingResponse -> Bool
(DescribeAuditFindingResponse
-> DescribeAuditFindingResponse -> Bool)
-> (DescribeAuditFindingResponse
-> DescribeAuditFindingResponse -> Bool)
-> Eq DescribeAuditFindingResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeAuditFindingResponse
-> DescribeAuditFindingResponse -> Bool
$c/= :: DescribeAuditFindingResponse
-> DescribeAuditFindingResponse -> Bool
== :: DescribeAuditFindingResponse
-> DescribeAuditFindingResponse -> Bool
$c== :: DescribeAuditFindingResponse
-> DescribeAuditFindingResponse -> Bool
Prelude.Eq, ReadPrec [DescribeAuditFindingResponse]
ReadPrec DescribeAuditFindingResponse
Int -> ReadS DescribeAuditFindingResponse
ReadS [DescribeAuditFindingResponse]
(Int -> ReadS DescribeAuditFindingResponse)
-> ReadS [DescribeAuditFindingResponse]
-> ReadPrec DescribeAuditFindingResponse
-> ReadPrec [DescribeAuditFindingResponse]
-> Read DescribeAuditFindingResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeAuditFindingResponse]
$creadListPrec :: ReadPrec [DescribeAuditFindingResponse]
readPrec :: ReadPrec DescribeAuditFindingResponse
$creadPrec :: ReadPrec DescribeAuditFindingResponse
readList :: ReadS [DescribeAuditFindingResponse]
$creadList :: ReadS [DescribeAuditFindingResponse]
readsPrec :: Int -> ReadS DescribeAuditFindingResponse
$creadsPrec :: Int -> ReadS DescribeAuditFindingResponse
Prelude.Read, Int -> DescribeAuditFindingResponse -> ShowS
[DescribeAuditFindingResponse] -> ShowS
DescribeAuditFindingResponse -> String
(Int -> DescribeAuditFindingResponse -> ShowS)
-> (DescribeAuditFindingResponse -> String)
-> ([DescribeAuditFindingResponse] -> ShowS)
-> Show DescribeAuditFindingResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeAuditFindingResponse] -> ShowS
$cshowList :: [DescribeAuditFindingResponse] -> ShowS
show :: DescribeAuditFindingResponse -> String
$cshow :: DescribeAuditFindingResponse -> String
showsPrec :: Int -> DescribeAuditFindingResponse -> ShowS
$cshowsPrec :: Int -> DescribeAuditFindingResponse -> ShowS
Prelude.Show, (forall x.
DescribeAuditFindingResponse -> Rep DescribeAuditFindingResponse x)
-> (forall x.
Rep DescribeAuditFindingResponse x -> DescribeAuditFindingResponse)
-> Generic DescribeAuditFindingResponse
forall x.
Rep DescribeAuditFindingResponse x -> DescribeAuditFindingResponse
forall x.
DescribeAuditFindingResponse -> Rep DescribeAuditFindingResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeAuditFindingResponse x -> DescribeAuditFindingResponse
$cfrom :: forall x.
DescribeAuditFindingResponse -> Rep DescribeAuditFindingResponse x
Prelude.Generic)
newDescribeAuditFindingResponse ::
Prelude.Int ->
DescribeAuditFindingResponse
newDescribeAuditFindingResponse :: Int -> DescribeAuditFindingResponse
newDescribeAuditFindingResponse Int
pHttpStatus_ =
DescribeAuditFindingResponse' :: Maybe AuditFinding -> Int -> DescribeAuditFindingResponse
DescribeAuditFindingResponse'
{ $sel:finding:DescribeAuditFindingResponse' :: Maybe AuditFinding
finding =
Maybe AuditFinding
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeAuditFindingResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeAuditFindingResponse_finding :: Lens.Lens' DescribeAuditFindingResponse (Prelude.Maybe AuditFinding)
describeAuditFindingResponse_finding :: (Maybe AuditFinding -> f (Maybe AuditFinding))
-> DescribeAuditFindingResponse -> f DescribeAuditFindingResponse
describeAuditFindingResponse_finding = (DescribeAuditFindingResponse -> Maybe AuditFinding)
-> (DescribeAuditFindingResponse
-> Maybe AuditFinding -> DescribeAuditFindingResponse)
-> Lens
DescribeAuditFindingResponse
DescribeAuditFindingResponse
(Maybe AuditFinding)
(Maybe AuditFinding)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAuditFindingResponse' {Maybe AuditFinding
finding :: Maybe AuditFinding
$sel:finding:DescribeAuditFindingResponse' :: DescribeAuditFindingResponse -> Maybe AuditFinding
finding} -> Maybe AuditFinding
finding) (\s :: DescribeAuditFindingResponse
s@DescribeAuditFindingResponse' {} Maybe AuditFinding
a -> DescribeAuditFindingResponse
s {$sel:finding:DescribeAuditFindingResponse' :: Maybe AuditFinding
finding = Maybe AuditFinding
a} :: DescribeAuditFindingResponse)
describeAuditFindingResponse_httpStatus :: Lens.Lens' DescribeAuditFindingResponse Prelude.Int
describeAuditFindingResponse_httpStatus :: (Int -> f Int)
-> DescribeAuditFindingResponse -> f DescribeAuditFindingResponse
describeAuditFindingResponse_httpStatus = (DescribeAuditFindingResponse -> Int)
-> (DescribeAuditFindingResponse
-> Int -> DescribeAuditFindingResponse)
-> Lens
DescribeAuditFindingResponse DescribeAuditFindingResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAuditFindingResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeAuditFindingResponse' :: DescribeAuditFindingResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeAuditFindingResponse
s@DescribeAuditFindingResponse' {} Int
a -> DescribeAuditFindingResponse
s {$sel:httpStatus:DescribeAuditFindingResponse' :: Int
httpStatus = Int
a} :: DescribeAuditFindingResponse)
instance Prelude.NFData DescribeAuditFindingResponse