{-# 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 qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Inspector.Types
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
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]
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
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. 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'
{ $sel:assessmentTemplateArn:CreateExclusionsPreview' :: Text
assessmentTemplateArn =
Text
pAssessmentTemplateArn_
}
createExclusionsPreview_assessmentTemplateArn :: Lens.Lens' CreateExclusionsPreview Prelude.Text
createExclusionsPreview_assessmentTemplateArn :: Lens' CreateExclusionsPreview Text
createExclusionsPreview_assessmentTemplateArn = 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 :: (Service -> Service)
-> CreateExclusionsPreview -> Request CreateExclusionsPreview
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateExclusionsPreview
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateExclusionsPreview)))
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 ->
Int -> Text -> CreateExclusionsPreviewResponse
CreateExclusionsPreviewResponse'
forall (f :: * -> *) a b. Functor 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))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"previewToken")
)
instance Prelude.Hashable CreateExclusionsPreview where
hashWithSalt :: Int -> CreateExclusionsPreview -> Int
hashWithSalt Int
_salt CreateExclusionsPreview' {Text
assessmentTemplateArn :: Text
$sel:assessmentTemplateArn:CreateExclusionsPreview' :: CreateExclusionsPreview -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
assessmentTemplateArn
instance Prelude.NFData CreateExclusionsPreview where
rnf :: CreateExclusionsPreview -> ()
rnf CreateExclusionsPreview' {Text
assessmentTemplateArn :: Text
$sel:assessmentTemplateArn:CreateExclusionsPreview' :: CreateExclusionsPreview -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
assessmentTemplateArn
instance Data.ToHeaders CreateExclusionsPreview where
toHeaders :: CreateExclusionsPreview -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"InspectorService.CreateExclusionsPreview" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON CreateExclusionsPreview where
toJSON :: CreateExclusionsPreview -> Value
toJSON CreateExclusionsPreview' {Text
assessmentTemplateArn :: Text
$sel:assessmentTemplateArn:CreateExclusionsPreview' :: CreateExclusionsPreview -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
( Key
"assessmentTemplateArn"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
assessmentTemplateArn
)
]
)
instance Data.ToPath CreateExclusionsPreview where
toPath :: CreateExclusionsPreview -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery CreateExclusionsPreview where
toQuery :: CreateExclusionsPreview -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data CreateExclusionsPreviewResponse = CreateExclusionsPreviewResponse'
{
CreateExclusionsPreviewResponse -> Int
httpStatus :: Prelude.Int,
CreateExclusionsPreviewResponse -> Text
previewToken :: Prelude.Text
}
deriving (CreateExclusionsPreviewResponse
-> CreateExclusionsPreviewResponse -> Bool
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]
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
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.
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'
{ $sel:httpStatus:CreateExclusionsPreviewResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:previewToken:CreateExclusionsPreviewResponse' :: Text
previewToken = Text
pPreviewToken_
}
createExclusionsPreviewResponse_httpStatus :: Lens.Lens' CreateExclusionsPreviewResponse Prelude.Int
createExclusionsPreviewResponse_httpStatus :: Lens' CreateExclusionsPreviewResponse Int
createExclusionsPreviewResponse_httpStatus = 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 :: Lens' CreateExclusionsPreviewResponse Text
createExclusionsPreviewResponse_previewToken = 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
where
rnf :: CreateExclusionsPreviewResponse -> ()
rnf CreateExclusionsPreviewResponse' {Int
Text
previewToken :: Text
httpStatus :: Int
$sel:previewToken:CreateExclusionsPreviewResponse' :: CreateExclusionsPreviewResponse -> Text
$sel:httpStatus:CreateExclusionsPreviewResponse' :: CreateExclusionsPreviewResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
previewToken