{-# 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.AccessAnalyzer.GetAnalyzedResource
(
GetAnalyzedResource (..),
newGetAnalyzedResource,
getAnalyzedResource_analyzerArn,
getAnalyzedResource_resourceArn,
GetAnalyzedResourceResponse (..),
newGetAnalyzedResourceResponse,
getAnalyzedResourceResponse_resource,
getAnalyzedResourceResponse_httpStatus,
)
where
import Amazonka.AccessAnalyzer.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data GetAnalyzedResource = GetAnalyzedResource'
{
GetAnalyzedResource -> Text
analyzerArn :: Prelude.Text,
GetAnalyzedResource -> Text
resourceArn :: Prelude.Text
}
deriving (GetAnalyzedResource -> GetAnalyzedResource -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetAnalyzedResource -> GetAnalyzedResource -> Bool
$c/= :: GetAnalyzedResource -> GetAnalyzedResource -> Bool
== :: GetAnalyzedResource -> GetAnalyzedResource -> Bool
$c== :: GetAnalyzedResource -> GetAnalyzedResource -> Bool
Prelude.Eq, ReadPrec [GetAnalyzedResource]
ReadPrec GetAnalyzedResource
Int -> ReadS GetAnalyzedResource
ReadS [GetAnalyzedResource]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetAnalyzedResource]
$creadListPrec :: ReadPrec [GetAnalyzedResource]
readPrec :: ReadPrec GetAnalyzedResource
$creadPrec :: ReadPrec GetAnalyzedResource
readList :: ReadS [GetAnalyzedResource]
$creadList :: ReadS [GetAnalyzedResource]
readsPrec :: Int -> ReadS GetAnalyzedResource
$creadsPrec :: Int -> ReadS GetAnalyzedResource
Prelude.Read, Int -> GetAnalyzedResource -> ShowS
[GetAnalyzedResource] -> ShowS
GetAnalyzedResource -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetAnalyzedResource] -> ShowS
$cshowList :: [GetAnalyzedResource] -> ShowS
show :: GetAnalyzedResource -> String
$cshow :: GetAnalyzedResource -> String
showsPrec :: Int -> GetAnalyzedResource -> ShowS
$cshowsPrec :: Int -> GetAnalyzedResource -> ShowS
Prelude.Show, forall x. Rep GetAnalyzedResource x -> GetAnalyzedResource
forall x. GetAnalyzedResource -> Rep GetAnalyzedResource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetAnalyzedResource x -> GetAnalyzedResource
$cfrom :: forall x. GetAnalyzedResource -> Rep GetAnalyzedResource x
Prelude.Generic)
newGetAnalyzedResource ::
Prelude.Text ->
Prelude.Text ->
GetAnalyzedResource
newGetAnalyzedResource :: Text -> Text -> GetAnalyzedResource
newGetAnalyzedResource Text
pAnalyzerArn_ Text
pResourceArn_ =
GetAnalyzedResource'
{ $sel:analyzerArn:GetAnalyzedResource' :: Text
analyzerArn = Text
pAnalyzerArn_,
$sel:resourceArn:GetAnalyzedResource' :: Text
resourceArn = Text
pResourceArn_
}
getAnalyzedResource_analyzerArn :: Lens.Lens' GetAnalyzedResource Prelude.Text
getAnalyzedResource_analyzerArn :: Lens' GetAnalyzedResource Text
getAnalyzedResource_analyzerArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAnalyzedResource' {Text
analyzerArn :: Text
$sel:analyzerArn:GetAnalyzedResource' :: GetAnalyzedResource -> Text
analyzerArn} -> Text
analyzerArn) (\s :: GetAnalyzedResource
s@GetAnalyzedResource' {} Text
a -> GetAnalyzedResource
s {$sel:analyzerArn:GetAnalyzedResource' :: Text
analyzerArn = Text
a} :: GetAnalyzedResource)
getAnalyzedResource_resourceArn :: Lens.Lens' GetAnalyzedResource Prelude.Text
getAnalyzedResource_resourceArn :: Lens' GetAnalyzedResource Text
getAnalyzedResource_resourceArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAnalyzedResource' {Text
resourceArn :: Text
$sel:resourceArn:GetAnalyzedResource' :: GetAnalyzedResource -> Text
resourceArn} -> Text
resourceArn) (\s :: GetAnalyzedResource
s@GetAnalyzedResource' {} Text
a -> GetAnalyzedResource
s {$sel:resourceArn:GetAnalyzedResource' :: Text
resourceArn = Text
a} :: GetAnalyzedResource)
instance Core.AWSRequest GetAnalyzedResource where
type
AWSResponse GetAnalyzedResource =
GetAnalyzedResourceResponse
request :: (Service -> Service)
-> GetAnalyzedResource -> Request GetAnalyzedResource
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetAnalyzedResource
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetAnalyzedResource)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe AnalyzedResource -> Int -> GetAnalyzedResourceResponse
GetAnalyzedResourceResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"resource")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable GetAnalyzedResource where
hashWithSalt :: Int -> GetAnalyzedResource -> Int
hashWithSalt Int
_salt GetAnalyzedResource' {Text
resourceArn :: Text
analyzerArn :: Text
$sel:resourceArn:GetAnalyzedResource' :: GetAnalyzedResource -> Text
$sel:analyzerArn:GetAnalyzedResource' :: GetAnalyzedResource -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
analyzerArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
resourceArn
instance Prelude.NFData GetAnalyzedResource where
rnf :: GetAnalyzedResource -> ()
rnf GetAnalyzedResource' {Text
resourceArn :: Text
analyzerArn :: Text
$sel:resourceArn:GetAnalyzedResource' :: GetAnalyzedResource -> Text
$sel:analyzerArn:GetAnalyzedResource' :: GetAnalyzedResource -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
analyzerArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
resourceArn
instance Data.ToHeaders GetAnalyzedResource where
toHeaders :: GetAnalyzedResource -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToPath GetAnalyzedResource where
toPath :: GetAnalyzedResource -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/analyzed-resource"
instance Data.ToQuery GetAnalyzedResource where
toQuery :: GetAnalyzedResource -> QueryString
toQuery GetAnalyzedResource' {Text
resourceArn :: Text
analyzerArn :: Text
$sel:resourceArn:GetAnalyzedResource' :: GetAnalyzedResource -> Text
$sel:analyzerArn:GetAnalyzedResource' :: GetAnalyzedResource -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"analyzerArn" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
analyzerArn,
ByteString
"resourceArn" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
resourceArn
]
data GetAnalyzedResourceResponse = GetAnalyzedResourceResponse'
{
GetAnalyzedResourceResponse -> Maybe AnalyzedResource
resource :: Prelude.Maybe AnalyzedResource,
GetAnalyzedResourceResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetAnalyzedResourceResponse -> GetAnalyzedResourceResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetAnalyzedResourceResponse -> GetAnalyzedResourceResponse -> Bool
$c/= :: GetAnalyzedResourceResponse -> GetAnalyzedResourceResponse -> Bool
== :: GetAnalyzedResourceResponse -> GetAnalyzedResourceResponse -> Bool
$c== :: GetAnalyzedResourceResponse -> GetAnalyzedResourceResponse -> Bool
Prelude.Eq, ReadPrec [GetAnalyzedResourceResponse]
ReadPrec GetAnalyzedResourceResponse
Int -> ReadS GetAnalyzedResourceResponse
ReadS [GetAnalyzedResourceResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetAnalyzedResourceResponse]
$creadListPrec :: ReadPrec [GetAnalyzedResourceResponse]
readPrec :: ReadPrec GetAnalyzedResourceResponse
$creadPrec :: ReadPrec GetAnalyzedResourceResponse
readList :: ReadS [GetAnalyzedResourceResponse]
$creadList :: ReadS [GetAnalyzedResourceResponse]
readsPrec :: Int -> ReadS GetAnalyzedResourceResponse
$creadsPrec :: Int -> ReadS GetAnalyzedResourceResponse
Prelude.Read, Int -> GetAnalyzedResourceResponse -> ShowS
[GetAnalyzedResourceResponse] -> ShowS
GetAnalyzedResourceResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetAnalyzedResourceResponse] -> ShowS
$cshowList :: [GetAnalyzedResourceResponse] -> ShowS
show :: GetAnalyzedResourceResponse -> String
$cshow :: GetAnalyzedResourceResponse -> String
showsPrec :: Int -> GetAnalyzedResourceResponse -> ShowS
$cshowsPrec :: Int -> GetAnalyzedResourceResponse -> ShowS
Prelude.Show, forall x.
Rep GetAnalyzedResourceResponse x -> GetAnalyzedResourceResponse
forall x.
GetAnalyzedResourceResponse -> Rep GetAnalyzedResourceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetAnalyzedResourceResponse x -> GetAnalyzedResourceResponse
$cfrom :: forall x.
GetAnalyzedResourceResponse -> Rep GetAnalyzedResourceResponse x
Prelude.Generic)
newGetAnalyzedResourceResponse ::
Prelude.Int ->
GetAnalyzedResourceResponse
newGetAnalyzedResourceResponse :: Int -> GetAnalyzedResourceResponse
newGetAnalyzedResourceResponse Int
pHttpStatus_ =
GetAnalyzedResourceResponse'
{ $sel:resource:GetAnalyzedResourceResponse' :: Maybe AnalyzedResource
resource =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetAnalyzedResourceResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getAnalyzedResourceResponse_resource :: Lens.Lens' GetAnalyzedResourceResponse (Prelude.Maybe AnalyzedResource)
getAnalyzedResourceResponse_resource :: Lens' GetAnalyzedResourceResponse (Maybe AnalyzedResource)
getAnalyzedResourceResponse_resource = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAnalyzedResourceResponse' {Maybe AnalyzedResource
resource :: Maybe AnalyzedResource
$sel:resource:GetAnalyzedResourceResponse' :: GetAnalyzedResourceResponse -> Maybe AnalyzedResource
resource} -> Maybe AnalyzedResource
resource) (\s :: GetAnalyzedResourceResponse
s@GetAnalyzedResourceResponse' {} Maybe AnalyzedResource
a -> GetAnalyzedResourceResponse
s {$sel:resource:GetAnalyzedResourceResponse' :: Maybe AnalyzedResource
resource = Maybe AnalyzedResource
a} :: GetAnalyzedResourceResponse)
getAnalyzedResourceResponse_httpStatus :: Lens.Lens' GetAnalyzedResourceResponse Prelude.Int
getAnalyzedResourceResponse_httpStatus :: Lens' GetAnalyzedResourceResponse Int
getAnalyzedResourceResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAnalyzedResourceResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetAnalyzedResourceResponse' :: GetAnalyzedResourceResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetAnalyzedResourceResponse
s@GetAnalyzedResourceResponse' {} Int
a -> GetAnalyzedResourceResponse
s {$sel:httpStatus:GetAnalyzedResourceResponse' :: Int
httpStatus = Int
a} :: GetAnalyzedResourceResponse)
instance Prelude.NFData GetAnalyzedResourceResponse where
rnf :: GetAnalyzedResourceResponse -> ()
rnf GetAnalyzedResourceResponse' {Int
Maybe AnalyzedResource
httpStatus :: Int
resource :: Maybe AnalyzedResource
$sel:httpStatus:GetAnalyzedResourceResponse' :: GetAnalyzedResourceResponse -> Int
$sel:resource:GetAnalyzedResourceResponse' :: GetAnalyzedResourceResponse -> Maybe AnalyzedResource
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe AnalyzedResource
resource
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus