{-# 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.StartResourceScan
(
StartResourceScan (..),
newStartResourceScan,
startResourceScan_analyzerArn,
startResourceScan_resourceArn,
StartResourceScanResponse (..),
newStartResourceScanResponse,
)
where
import Amazonka.AccessAnalyzer.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 StartResourceScan = StartResourceScan'
{
StartResourceScan -> Text
analyzerArn :: Prelude.Text,
StartResourceScan -> Text
resourceArn :: Prelude.Text
}
deriving (StartResourceScan -> StartResourceScan -> Bool
(StartResourceScan -> StartResourceScan -> Bool)
-> (StartResourceScan -> StartResourceScan -> Bool)
-> Eq StartResourceScan
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartResourceScan -> StartResourceScan -> Bool
$c/= :: StartResourceScan -> StartResourceScan -> Bool
== :: StartResourceScan -> StartResourceScan -> Bool
$c== :: StartResourceScan -> StartResourceScan -> Bool
Prelude.Eq, ReadPrec [StartResourceScan]
ReadPrec StartResourceScan
Int -> ReadS StartResourceScan
ReadS [StartResourceScan]
(Int -> ReadS StartResourceScan)
-> ReadS [StartResourceScan]
-> ReadPrec StartResourceScan
-> ReadPrec [StartResourceScan]
-> Read StartResourceScan
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartResourceScan]
$creadListPrec :: ReadPrec [StartResourceScan]
readPrec :: ReadPrec StartResourceScan
$creadPrec :: ReadPrec StartResourceScan
readList :: ReadS [StartResourceScan]
$creadList :: ReadS [StartResourceScan]
readsPrec :: Int -> ReadS StartResourceScan
$creadsPrec :: Int -> ReadS StartResourceScan
Prelude.Read, Int -> StartResourceScan -> ShowS
[StartResourceScan] -> ShowS
StartResourceScan -> String
(Int -> StartResourceScan -> ShowS)
-> (StartResourceScan -> String)
-> ([StartResourceScan] -> ShowS)
-> Show StartResourceScan
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartResourceScan] -> ShowS
$cshowList :: [StartResourceScan] -> ShowS
show :: StartResourceScan -> String
$cshow :: StartResourceScan -> String
showsPrec :: Int -> StartResourceScan -> ShowS
$cshowsPrec :: Int -> StartResourceScan -> ShowS
Prelude.Show, (forall x. StartResourceScan -> Rep StartResourceScan x)
-> (forall x. Rep StartResourceScan x -> StartResourceScan)
-> Generic StartResourceScan
forall x. Rep StartResourceScan x -> StartResourceScan
forall x. StartResourceScan -> Rep StartResourceScan x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartResourceScan x -> StartResourceScan
$cfrom :: forall x. StartResourceScan -> Rep StartResourceScan x
Prelude.Generic)
newStartResourceScan ::
Prelude.Text ->
Prelude.Text ->
StartResourceScan
newStartResourceScan :: Text -> Text -> StartResourceScan
newStartResourceScan Text
pAnalyzerArn_ Text
pResourceArn_ =
StartResourceScan' :: Text -> Text -> StartResourceScan
StartResourceScan'
{ $sel:analyzerArn:StartResourceScan' :: Text
analyzerArn = Text
pAnalyzerArn_,
$sel:resourceArn:StartResourceScan' :: Text
resourceArn = Text
pResourceArn_
}
startResourceScan_analyzerArn :: Lens.Lens' StartResourceScan Prelude.Text
startResourceScan_analyzerArn :: (Text -> f Text) -> StartResourceScan -> f StartResourceScan
startResourceScan_analyzerArn = (StartResourceScan -> Text)
-> (StartResourceScan -> Text -> StartResourceScan)
-> Lens StartResourceScan StartResourceScan Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartResourceScan' {Text
analyzerArn :: Text
$sel:analyzerArn:StartResourceScan' :: StartResourceScan -> Text
analyzerArn} -> Text
analyzerArn) (\s :: StartResourceScan
s@StartResourceScan' {} Text
a -> StartResourceScan
s {$sel:analyzerArn:StartResourceScan' :: Text
analyzerArn = Text
a} :: StartResourceScan)
startResourceScan_resourceArn :: Lens.Lens' StartResourceScan Prelude.Text
startResourceScan_resourceArn :: (Text -> f Text) -> StartResourceScan -> f StartResourceScan
startResourceScan_resourceArn = (StartResourceScan -> Text)
-> (StartResourceScan -> Text -> StartResourceScan)
-> Lens StartResourceScan StartResourceScan Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartResourceScan' {Text
resourceArn :: Text
$sel:resourceArn:StartResourceScan' :: StartResourceScan -> Text
resourceArn} -> Text
resourceArn) (\s :: StartResourceScan
s@StartResourceScan' {} Text
a -> StartResourceScan
s {$sel:resourceArn:StartResourceScan' :: Text
resourceArn = Text
a} :: StartResourceScan)
instance Core.AWSRequest StartResourceScan where
type
AWSResponse StartResourceScan =
StartResourceScanResponse
request :: StartResourceScan -> Request StartResourceScan
request = Service -> StartResourceScan -> Request StartResourceScan
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy StartResourceScan
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StartResourceScan)))
response =
AWSResponse StartResourceScan
-> Logger
-> Service
-> Proxy StartResourceScan
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StartResourceScan)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse StartResourceScan
StartResourceScanResponse
StartResourceScanResponse'
instance Prelude.Hashable StartResourceScan
instance Prelude.NFData StartResourceScan
instance Core.ToHeaders StartResourceScan where
toHeaders :: StartResourceScan -> [Header]
toHeaders =
[Header] -> StartResourceScan -> [Header]
forall a b. a -> b -> a
Prelude.const
( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON StartResourceScan where
toJSON :: StartResourceScan -> Value
toJSON StartResourceScan' {Text
resourceArn :: Text
analyzerArn :: Text
$sel:resourceArn:StartResourceScan' :: StartResourceScan -> Text
$sel:analyzerArn:StartResourceScan' :: StartResourceScan -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"analyzerArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
analyzerArn),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"resourceArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
resourceArn)
]
)
instance Core.ToPath StartResourceScan where
toPath :: StartResourceScan -> ByteString
toPath = ByteString -> StartResourceScan -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/resource/scan"
instance Core.ToQuery StartResourceScan where
toQuery :: StartResourceScan -> QueryString
toQuery = QueryString -> StartResourceScan -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data StartResourceScanResponse = StartResourceScanResponse'
{
}
deriving (StartResourceScanResponse -> StartResourceScanResponse -> Bool
(StartResourceScanResponse -> StartResourceScanResponse -> Bool)
-> (StartResourceScanResponse -> StartResourceScanResponse -> Bool)
-> Eq StartResourceScanResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartResourceScanResponse -> StartResourceScanResponse -> Bool
$c/= :: StartResourceScanResponse -> StartResourceScanResponse -> Bool
== :: StartResourceScanResponse -> StartResourceScanResponse -> Bool
$c== :: StartResourceScanResponse -> StartResourceScanResponse -> Bool
Prelude.Eq, ReadPrec [StartResourceScanResponse]
ReadPrec StartResourceScanResponse
Int -> ReadS StartResourceScanResponse
ReadS [StartResourceScanResponse]
(Int -> ReadS StartResourceScanResponse)
-> ReadS [StartResourceScanResponse]
-> ReadPrec StartResourceScanResponse
-> ReadPrec [StartResourceScanResponse]
-> Read StartResourceScanResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartResourceScanResponse]
$creadListPrec :: ReadPrec [StartResourceScanResponse]
readPrec :: ReadPrec StartResourceScanResponse
$creadPrec :: ReadPrec StartResourceScanResponse
readList :: ReadS [StartResourceScanResponse]
$creadList :: ReadS [StartResourceScanResponse]
readsPrec :: Int -> ReadS StartResourceScanResponse
$creadsPrec :: Int -> ReadS StartResourceScanResponse
Prelude.Read, Int -> StartResourceScanResponse -> ShowS
[StartResourceScanResponse] -> ShowS
StartResourceScanResponse -> String
(Int -> StartResourceScanResponse -> ShowS)
-> (StartResourceScanResponse -> String)
-> ([StartResourceScanResponse] -> ShowS)
-> Show StartResourceScanResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartResourceScanResponse] -> ShowS
$cshowList :: [StartResourceScanResponse] -> ShowS
show :: StartResourceScanResponse -> String
$cshow :: StartResourceScanResponse -> String
showsPrec :: Int -> StartResourceScanResponse -> ShowS
$cshowsPrec :: Int -> StartResourceScanResponse -> ShowS
Prelude.Show, (forall x.
StartResourceScanResponse -> Rep StartResourceScanResponse x)
-> (forall x.
Rep StartResourceScanResponse x -> StartResourceScanResponse)
-> Generic StartResourceScanResponse
forall x.
Rep StartResourceScanResponse x -> StartResourceScanResponse
forall x.
StartResourceScanResponse -> Rep StartResourceScanResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StartResourceScanResponse x -> StartResourceScanResponse
$cfrom :: forall x.
StartResourceScanResponse -> Rep StartResourceScanResponse x
Prelude.Generic)
newStartResourceScanResponse ::
StartResourceScanResponse
newStartResourceScanResponse :: StartResourceScanResponse
newStartResourceScanResponse =
StartResourceScanResponse
StartResourceScanResponse'
instance Prelude.NFData StartResourceScanResponse