{-# 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.MacieV2.CreateSampleFindings
(
CreateSampleFindings (..),
newCreateSampleFindings,
createSampleFindings_findingTypes,
CreateSampleFindingsResponse (..),
newCreateSampleFindingsResponse,
createSampleFindingsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MacieV2.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data CreateSampleFindings = CreateSampleFindings'
{
CreateSampleFindings -> Maybe [FindingType]
findingTypes :: Prelude.Maybe [FindingType]
}
deriving (CreateSampleFindings -> CreateSampleFindings -> Bool
(CreateSampleFindings -> CreateSampleFindings -> Bool)
-> (CreateSampleFindings -> CreateSampleFindings -> Bool)
-> Eq CreateSampleFindings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateSampleFindings -> CreateSampleFindings -> Bool
$c/= :: CreateSampleFindings -> CreateSampleFindings -> Bool
== :: CreateSampleFindings -> CreateSampleFindings -> Bool
$c== :: CreateSampleFindings -> CreateSampleFindings -> Bool
Prelude.Eq, ReadPrec [CreateSampleFindings]
ReadPrec CreateSampleFindings
Int -> ReadS CreateSampleFindings
ReadS [CreateSampleFindings]
(Int -> ReadS CreateSampleFindings)
-> ReadS [CreateSampleFindings]
-> ReadPrec CreateSampleFindings
-> ReadPrec [CreateSampleFindings]
-> Read CreateSampleFindings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateSampleFindings]
$creadListPrec :: ReadPrec [CreateSampleFindings]
readPrec :: ReadPrec CreateSampleFindings
$creadPrec :: ReadPrec CreateSampleFindings
readList :: ReadS [CreateSampleFindings]
$creadList :: ReadS [CreateSampleFindings]
readsPrec :: Int -> ReadS CreateSampleFindings
$creadsPrec :: Int -> ReadS CreateSampleFindings
Prelude.Read, Int -> CreateSampleFindings -> ShowS
[CreateSampleFindings] -> ShowS
CreateSampleFindings -> String
(Int -> CreateSampleFindings -> ShowS)
-> (CreateSampleFindings -> String)
-> ([CreateSampleFindings] -> ShowS)
-> Show CreateSampleFindings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateSampleFindings] -> ShowS
$cshowList :: [CreateSampleFindings] -> ShowS
show :: CreateSampleFindings -> String
$cshow :: CreateSampleFindings -> String
showsPrec :: Int -> CreateSampleFindings -> ShowS
$cshowsPrec :: Int -> CreateSampleFindings -> ShowS
Prelude.Show, (forall x. CreateSampleFindings -> Rep CreateSampleFindings x)
-> (forall x. Rep CreateSampleFindings x -> CreateSampleFindings)
-> Generic CreateSampleFindings
forall x. Rep CreateSampleFindings x -> CreateSampleFindings
forall x. CreateSampleFindings -> Rep CreateSampleFindings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateSampleFindings x -> CreateSampleFindings
$cfrom :: forall x. CreateSampleFindings -> Rep CreateSampleFindings x
Prelude.Generic)
newCreateSampleFindings ::
CreateSampleFindings
newCreateSampleFindings :: CreateSampleFindings
newCreateSampleFindings =
CreateSampleFindings' :: Maybe [FindingType] -> CreateSampleFindings
CreateSampleFindings'
{ $sel:findingTypes:CreateSampleFindings' :: Maybe [FindingType]
findingTypes =
Maybe [FindingType]
forall a. Maybe a
Prelude.Nothing
}
createSampleFindings_findingTypes :: Lens.Lens' CreateSampleFindings (Prelude.Maybe [FindingType])
createSampleFindings_findingTypes :: (Maybe [FindingType] -> f (Maybe [FindingType]))
-> CreateSampleFindings -> f CreateSampleFindings
createSampleFindings_findingTypes = (CreateSampleFindings -> Maybe [FindingType])
-> (CreateSampleFindings
-> Maybe [FindingType] -> CreateSampleFindings)
-> Lens
CreateSampleFindings
CreateSampleFindings
(Maybe [FindingType])
(Maybe [FindingType])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSampleFindings' {Maybe [FindingType]
findingTypes :: Maybe [FindingType]
$sel:findingTypes:CreateSampleFindings' :: CreateSampleFindings -> Maybe [FindingType]
findingTypes} -> Maybe [FindingType]
findingTypes) (\s :: CreateSampleFindings
s@CreateSampleFindings' {} Maybe [FindingType]
a -> CreateSampleFindings
s {$sel:findingTypes:CreateSampleFindings' :: Maybe [FindingType]
findingTypes = Maybe [FindingType]
a} :: CreateSampleFindings) ((Maybe [FindingType] -> f (Maybe [FindingType]))
-> CreateSampleFindings -> f CreateSampleFindings)
-> ((Maybe [FindingType] -> f (Maybe [FindingType]))
-> Maybe [FindingType] -> f (Maybe [FindingType]))
-> (Maybe [FindingType] -> f (Maybe [FindingType]))
-> CreateSampleFindings
-> f CreateSampleFindings
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [FindingType] [FindingType] [FindingType] [FindingType]
-> Iso
(Maybe [FindingType])
(Maybe [FindingType])
(Maybe [FindingType])
(Maybe [FindingType])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [FindingType] [FindingType] [FindingType] [FindingType]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest CreateSampleFindings where
type
AWSResponse CreateSampleFindings =
CreateSampleFindingsResponse
request :: CreateSampleFindings -> Request CreateSampleFindings
request = Service -> CreateSampleFindings -> Request CreateSampleFindings
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateSampleFindings
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateSampleFindings)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse CreateSampleFindings))
-> Logger
-> Service
-> Proxy CreateSampleFindings
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateSampleFindings)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> CreateSampleFindingsResponse
CreateSampleFindingsResponse'
(Int -> CreateSampleFindingsResponse)
-> Either String Int -> Either String CreateSampleFindingsResponse
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))
)
instance Prelude.Hashable CreateSampleFindings
instance Prelude.NFData CreateSampleFindings
instance Core.ToHeaders CreateSampleFindings where
toHeaders :: CreateSampleFindings -> ResponseHeaders
toHeaders =
ResponseHeaders -> CreateSampleFindings -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ 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 CreateSampleFindings where
toJSON :: CreateSampleFindings -> Value
toJSON CreateSampleFindings' {Maybe [FindingType]
findingTypes :: Maybe [FindingType]
$sel:findingTypes:CreateSampleFindings' :: CreateSampleFindings -> Maybe [FindingType]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Text
"findingTypes" Text -> [FindingType] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([FindingType] -> Pair) -> Maybe [FindingType] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [FindingType]
findingTypes]
)
instance Core.ToPath CreateSampleFindings where
toPath :: CreateSampleFindings -> ByteString
toPath = ByteString -> CreateSampleFindings -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/findings/sample"
instance Core.ToQuery CreateSampleFindings where
toQuery :: CreateSampleFindings -> QueryString
toQuery = QueryString -> CreateSampleFindings -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateSampleFindingsResponse = CreateSampleFindingsResponse'
{
CreateSampleFindingsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateSampleFindingsResponse
-> CreateSampleFindingsResponse -> Bool
(CreateSampleFindingsResponse
-> CreateSampleFindingsResponse -> Bool)
-> (CreateSampleFindingsResponse
-> CreateSampleFindingsResponse -> Bool)
-> Eq CreateSampleFindingsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateSampleFindingsResponse
-> CreateSampleFindingsResponse -> Bool
$c/= :: CreateSampleFindingsResponse
-> CreateSampleFindingsResponse -> Bool
== :: CreateSampleFindingsResponse
-> CreateSampleFindingsResponse -> Bool
$c== :: CreateSampleFindingsResponse
-> CreateSampleFindingsResponse -> Bool
Prelude.Eq, ReadPrec [CreateSampleFindingsResponse]
ReadPrec CreateSampleFindingsResponse
Int -> ReadS CreateSampleFindingsResponse
ReadS [CreateSampleFindingsResponse]
(Int -> ReadS CreateSampleFindingsResponse)
-> ReadS [CreateSampleFindingsResponse]
-> ReadPrec CreateSampleFindingsResponse
-> ReadPrec [CreateSampleFindingsResponse]
-> Read CreateSampleFindingsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateSampleFindingsResponse]
$creadListPrec :: ReadPrec [CreateSampleFindingsResponse]
readPrec :: ReadPrec CreateSampleFindingsResponse
$creadPrec :: ReadPrec CreateSampleFindingsResponse
readList :: ReadS [CreateSampleFindingsResponse]
$creadList :: ReadS [CreateSampleFindingsResponse]
readsPrec :: Int -> ReadS CreateSampleFindingsResponse
$creadsPrec :: Int -> ReadS CreateSampleFindingsResponse
Prelude.Read, Int -> CreateSampleFindingsResponse -> ShowS
[CreateSampleFindingsResponse] -> ShowS
CreateSampleFindingsResponse -> String
(Int -> CreateSampleFindingsResponse -> ShowS)
-> (CreateSampleFindingsResponse -> String)
-> ([CreateSampleFindingsResponse] -> ShowS)
-> Show CreateSampleFindingsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateSampleFindingsResponse] -> ShowS
$cshowList :: [CreateSampleFindingsResponse] -> ShowS
show :: CreateSampleFindingsResponse -> String
$cshow :: CreateSampleFindingsResponse -> String
showsPrec :: Int -> CreateSampleFindingsResponse -> ShowS
$cshowsPrec :: Int -> CreateSampleFindingsResponse -> ShowS
Prelude.Show, (forall x.
CreateSampleFindingsResponse -> Rep CreateSampleFindingsResponse x)
-> (forall x.
Rep CreateSampleFindingsResponse x -> CreateSampleFindingsResponse)
-> Generic CreateSampleFindingsResponse
forall x.
Rep CreateSampleFindingsResponse x -> CreateSampleFindingsResponse
forall x.
CreateSampleFindingsResponse -> Rep CreateSampleFindingsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateSampleFindingsResponse x -> CreateSampleFindingsResponse
$cfrom :: forall x.
CreateSampleFindingsResponse -> Rep CreateSampleFindingsResponse x
Prelude.Generic)
newCreateSampleFindingsResponse ::
Prelude.Int ->
CreateSampleFindingsResponse
newCreateSampleFindingsResponse :: Int -> CreateSampleFindingsResponse
newCreateSampleFindingsResponse Int
pHttpStatus_ =
CreateSampleFindingsResponse' :: Int -> CreateSampleFindingsResponse
CreateSampleFindingsResponse'
{ $sel:httpStatus:CreateSampleFindingsResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
createSampleFindingsResponse_httpStatus :: Lens.Lens' CreateSampleFindingsResponse Prelude.Int
createSampleFindingsResponse_httpStatus :: (Int -> f Int)
-> CreateSampleFindingsResponse -> f CreateSampleFindingsResponse
createSampleFindingsResponse_httpStatus = (CreateSampleFindingsResponse -> Int)
-> (CreateSampleFindingsResponse
-> Int -> CreateSampleFindingsResponse)
-> Lens
CreateSampleFindingsResponse CreateSampleFindingsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSampleFindingsResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateSampleFindingsResponse' :: CreateSampleFindingsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateSampleFindingsResponse
s@CreateSampleFindingsResponse' {} Int
a -> CreateSampleFindingsResponse
s {$sel:httpStatus:CreateSampleFindingsResponse' :: Int
httpStatus = Int
a} :: CreateSampleFindingsResponse)
instance Prelude.NFData CreateSampleFindingsResponse