{-# 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.Inspector.CreateExclusionsPreview
(
CreateExclusionsPreview (..),
newCreateExclusionsPreview,
createExclusionsPreview_assessmentTemplateArn,
CreateExclusionsPreviewResponse (..),
newCreateExclusionsPreviewResponse,
createExclusionsPreviewResponse_httpStatus,
createExclusionsPreviewResponse_previewToken,
)
where
import qualified Amazonka.Core as Core
import Amazonka.Inspector.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 CreateExclusionsPreview = CreateExclusionsPreview'
{
CreateExclusionsPreview -> Text
assessmentTemplateArn :: Prelude.Text
}
deriving (CreateExclusionsPreview -> CreateExclusionsPreview -> Bool
(CreateExclusionsPreview -> CreateExclusionsPreview -> Bool)
-> (CreateExclusionsPreview -> CreateExclusionsPreview -> Bool)
-> Eq CreateExclusionsPreview
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateExclusionsPreview -> CreateExclusionsPreview -> Bool
$c/= :: CreateExclusionsPreview -> CreateExclusionsPreview -> Bool
== :: CreateExclusionsPreview -> CreateExclusionsPreview -> Bool
$c== :: CreateExclusionsPreview -> CreateExclusionsPreview -> Bool
Prelude.Eq, ReadPrec [CreateExclusionsPreview]
ReadPrec CreateExclusionsPreview
Int -> ReadS CreateExclusionsPreview
ReadS [CreateExclusionsPreview]
(Int -> ReadS CreateExclusionsPreview)
-> ReadS [CreateExclusionsPreview]
-> ReadPrec CreateExclusionsPreview
-> ReadPrec [CreateExclusionsPreview]
-> Read CreateExclusionsPreview
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateExclusionsPreview]
$creadListPrec :: ReadPrec [CreateExclusionsPreview]
readPrec :: ReadPrec CreateExclusionsPreview
$creadPrec :: ReadPrec CreateExclusionsPreview
readList :: ReadS [CreateExclusionsPreview]
$creadList :: ReadS [CreateExclusionsPreview]
readsPrec :: Int -> ReadS CreateExclusionsPreview
$creadsPrec :: Int -> ReadS CreateExclusionsPreview
Prelude.Read, Int -> CreateExclusionsPreview -> ShowS
[CreateExclusionsPreview] -> ShowS
CreateExclusionsPreview -> String
(Int -> CreateExclusionsPreview -> ShowS)
-> (CreateExclusionsPreview -> String)
-> ([CreateExclusionsPreview] -> ShowS)
-> Show CreateExclusionsPreview
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateExclusionsPreview] -> ShowS
$cshowList :: [CreateExclusionsPreview] -> ShowS
show :: CreateExclusionsPreview -> String
$cshow :: CreateExclusionsPreview -> String
showsPrec :: Int -> CreateExclusionsPreview -> ShowS
$cshowsPrec :: Int -> CreateExclusionsPreview -> ShowS
Prelude.Show, (forall x.
CreateExclusionsPreview -> Rep CreateExclusionsPreview x)
-> (forall x.
Rep CreateExclusionsPreview x -> CreateExclusionsPreview)
-> Generic CreateExclusionsPreview
forall x. Rep CreateExclusionsPreview x -> CreateExclusionsPreview
forall x. CreateExclusionsPreview -> Rep CreateExclusionsPreview x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateExclusionsPreview x -> CreateExclusionsPreview
$cfrom :: forall x. CreateExclusionsPreview -> Rep CreateExclusionsPreview x
Prelude.Generic)
newCreateExclusionsPreview ::
Prelude.Text ->
CreateExclusionsPreview
newCreateExclusionsPreview :: Text -> CreateExclusionsPreview
newCreateExclusionsPreview Text
pAssessmentTemplateArn_ =
CreateExclusionsPreview' :: Text -> CreateExclusionsPreview
CreateExclusionsPreview'
{ $sel:assessmentTemplateArn:CreateExclusionsPreview' :: Text
assessmentTemplateArn =
Text
pAssessmentTemplateArn_
}
createExclusionsPreview_assessmentTemplateArn :: Lens.Lens' CreateExclusionsPreview Prelude.Text
createExclusionsPreview_assessmentTemplateArn :: (Text -> f Text)
-> CreateExclusionsPreview -> f CreateExclusionsPreview
createExclusionsPreview_assessmentTemplateArn = (CreateExclusionsPreview -> Text)
-> (CreateExclusionsPreview -> Text -> CreateExclusionsPreview)
-> Lens CreateExclusionsPreview CreateExclusionsPreview Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateExclusionsPreview' {Text
assessmentTemplateArn :: Text
$sel:assessmentTemplateArn:CreateExclusionsPreview' :: CreateExclusionsPreview -> Text
assessmentTemplateArn} -> Text
assessmentTemplateArn) (\s :: CreateExclusionsPreview
s@CreateExclusionsPreview' {} Text
a -> CreateExclusionsPreview
s {$sel:assessmentTemplateArn:CreateExclusionsPreview' :: Text
assessmentTemplateArn = Text
a} :: CreateExclusionsPreview)
instance Core.AWSRequest CreateExclusionsPreview where
type
AWSResponse CreateExclusionsPreview =
CreateExclusionsPreviewResponse
request :: CreateExclusionsPreview -> Request CreateExclusionsPreview
request = Service
-> CreateExclusionsPreview -> Request CreateExclusionsPreview
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateExclusionsPreview
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateExclusionsPreview)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateExclusionsPreview))
-> Logger
-> Service
-> Proxy CreateExclusionsPreview
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateExclusionsPreview)))
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 ->
Int -> Text -> CreateExclusionsPreviewResponse
CreateExclusionsPreviewResponse'
(Int -> Text -> CreateExclusionsPreviewResponse)
-> Either String Int
-> Either String (Text -> CreateExclusionsPreviewResponse)
forall (f :: * -> *) a b. Functor 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))
Either String (Text -> CreateExclusionsPreviewResponse)
-> Either String Text
-> Either String CreateExclusionsPreviewResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"previewToken")
)
instance Prelude.Hashable CreateExclusionsPreview
instance Prelude.NFData CreateExclusionsPreview
instance Core.ToHeaders CreateExclusionsPreview where
toHeaders :: CreateExclusionsPreview -> ResponseHeaders
toHeaders =
ResponseHeaders -> CreateExclusionsPreview -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"InspectorService.CreateExclusionsPreview" ::
Prelude.ByteString
),
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.ToJSON CreateExclusionsPreview where
toJSON :: CreateExclusionsPreview -> Value
toJSON CreateExclusionsPreview' {Text
assessmentTemplateArn :: Text
$sel:assessmentTemplateArn:CreateExclusionsPreview' :: CreateExclusionsPreview -> 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
"assessmentTemplateArn"
Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
assessmentTemplateArn
)
]
)
instance Core.ToPath CreateExclusionsPreview where
toPath :: CreateExclusionsPreview -> ByteString
toPath = ByteString -> CreateExclusionsPreview -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CreateExclusionsPreview where
toQuery :: CreateExclusionsPreview -> QueryString
toQuery = QueryString -> CreateExclusionsPreview -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateExclusionsPreviewResponse = CreateExclusionsPreviewResponse'
{
CreateExclusionsPreviewResponse -> Int
httpStatus :: Prelude.Int,
CreateExclusionsPreviewResponse -> Text
previewToken :: Prelude.Text
}
deriving (CreateExclusionsPreviewResponse
-> CreateExclusionsPreviewResponse -> Bool
(CreateExclusionsPreviewResponse
-> CreateExclusionsPreviewResponse -> Bool)
-> (CreateExclusionsPreviewResponse
-> CreateExclusionsPreviewResponse -> Bool)
-> Eq CreateExclusionsPreviewResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateExclusionsPreviewResponse
-> CreateExclusionsPreviewResponse -> Bool
$c/= :: CreateExclusionsPreviewResponse
-> CreateExclusionsPreviewResponse -> Bool
== :: CreateExclusionsPreviewResponse
-> CreateExclusionsPreviewResponse -> Bool
$c== :: CreateExclusionsPreviewResponse
-> CreateExclusionsPreviewResponse -> Bool
Prelude.Eq, ReadPrec [CreateExclusionsPreviewResponse]
ReadPrec CreateExclusionsPreviewResponse
Int -> ReadS CreateExclusionsPreviewResponse
ReadS [CreateExclusionsPreviewResponse]
(Int -> ReadS CreateExclusionsPreviewResponse)
-> ReadS [CreateExclusionsPreviewResponse]
-> ReadPrec CreateExclusionsPreviewResponse
-> ReadPrec [CreateExclusionsPreviewResponse]
-> Read CreateExclusionsPreviewResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateExclusionsPreviewResponse]
$creadListPrec :: ReadPrec [CreateExclusionsPreviewResponse]
readPrec :: ReadPrec CreateExclusionsPreviewResponse
$creadPrec :: ReadPrec CreateExclusionsPreviewResponse
readList :: ReadS [CreateExclusionsPreviewResponse]
$creadList :: ReadS [CreateExclusionsPreviewResponse]
readsPrec :: Int -> ReadS CreateExclusionsPreviewResponse
$creadsPrec :: Int -> ReadS CreateExclusionsPreviewResponse
Prelude.Read, Int -> CreateExclusionsPreviewResponse -> ShowS
[CreateExclusionsPreviewResponse] -> ShowS
CreateExclusionsPreviewResponse -> String
(Int -> CreateExclusionsPreviewResponse -> ShowS)
-> (CreateExclusionsPreviewResponse -> String)
-> ([CreateExclusionsPreviewResponse] -> ShowS)
-> Show CreateExclusionsPreviewResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateExclusionsPreviewResponse] -> ShowS
$cshowList :: [CreateExclusionsPreviewResponse] -> ShowS
show :: CreateExclusionsPreviewResponse -> String
$cshow :: CreateExclusionsPreviewResponse -> String
showsPrec :: Int -> CreateExclusionsPreviewResponse -> ShowS
$cshowsPrec :: Int -> CreateExclusionsPreviewResponse -> ShowS
Prelude.Show, (forall x.
CreateExclusionsPreviewResponse
-> Rep CreateExclusionsPreviewResponse x)
-> (forall x.
Rep CreateExclusionsPreviewResponse x
-> CreateExclusionsPreviewResponse)
-> Generic CreateExclusionsPreviewResponse
forall x.
Rep CreateExclusionsPreviewResponse x
-> CreateExclusionsPreviewResponse
forall x.
CreateExclusionsPreviewResponse
-> Rep CreateExclusionsPreviewResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateExclusionsPreviewResponse x
-> CreateExclusionsPreviewResponse
$cfrom :: forall x.
CreateExclusionsPreviewResponse
-> Rep CreateExclusionsPreviewResponse x
Prelude.Generic)
newCreateExclusionsPreviewResponse ::
Prelude.Int ->
Prelude.Text ->
CreateExclusionsPreviewResponse
newCreateExclusionsPreviewResponse :: Int -> Text -> CreateExclusionsPreviewResponse
newCreateExclusionsPreviewResponse
Int
pHttpStatus_
Text
pPreviewToken_ =
CreateExclusionsPreviewResponse' :: Int -> Text -> CreateExclusionsPreviewResponse
CreateExclusionsPreviewResponse'
{ $sel:httpStatus:CreateExclusionsPreviewResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:previewToken:CreateExclusionsPreviewResponse' :: Text
previewToken = Text
pPreviewToken_
}
createExclusionsPreviewResponse_httpStatus :: Lens.Lens' CreateExclusionsPreviewResponse Prelude.Int
createExclusionsPreviewResponse_httpStatus :: (Int -> f Int)
-> CreateExclusionsPreviewResponse
-> f CreateExclusionsPreviewResponse
createExclusionsPreviewResponse_httpStatus = (CreateExclusionsPreviewResponse -> Int)
-> (CreateExclusionsPreviewResponse
-> Int -> CreateExclusionsPreviewResponse)
-> Lens
CreateExclusionsPreviewResponse
CreateExclusionsPreviewResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateExclusionsPreviewResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateExclusionsPreviewResponse' :: CreateExclusionsPreviewResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateExclusionsPreviewResponse
s@CreateExclusionsPreviewResponse' {} Int
a -> CreateExclusionsPreviewResponse
s {$sel:httpStatus:CreateExclusionsPreviewResponse' :: Int
httpStatus = Int
a} :: CreateExclusionsPreviewResponse)
createExclusionsPreviewResponse_previewToken :: Lens.Lens' CreateExclusionsPreviewResponse Prelude.Text
createExclusionsPreviewResponse_previewToken :: (Text -> f Text)
-> CreateExclusionsPreviewResponse
-> f CreateExclusionsPreviewResponse
createExclusionsPreviewResponse_previewToken = (CreateExclusionsPreviewResponse -> Text)
-> (CreateExclusionsPreviewResponse
-> Text -> CreateExclusionsPreviewResponse)
-> Lens
CreateExclusionsPreviewResponse
CreateExclusionsPreviewResponse
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateExclusionsPreviewResponse' {Text
previewToken :: Text
$sel:previewToken:CreateExclusionsPreviewResponse' :: CreateExclusionsPreviewResponse -> Text
previewToken} -> Text
previewToken) (\s :: CreateExclusionsPreviewResponse
s@CreateExclusionsPreviewResponse' {} Text
a -> CreateExclusionsPreviewResponse
s {$sel:previewToken:CreateExclusionsPreviewResponse' :: Text
previewToken = Text
a} :: CreateExclusionsPreviewResponse)
instance
Prelude.NFData
CreateExclusionsPreviewResponse