{-# 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.IoT.CreateSecurityProfile
(
CreateSecurityProfile (..),
newCreateSecurityProfile,
createSecurityProfile_alertTargets,
createSecurityProfile_additionalMetricsToRetainV2,
createSecurityProfile_behaviors,
createSecurityProfile_additionalMetricsToRetain,
createSecurityProfile_securityProfileDescription,
createSecurityProfile_tags,
createSecurityProfile_securityProfileName,
CreateSecurityProfileResponse (..),
newCreateSecurityProfileResponse,
createSecurityProfileResponse_securityProfileName,
createSecurityProfileResponse_securityProfileArn,
createSecurityProfileResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.IoT.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 CreateSecurityProfile = CreateSecurityProfile'
{
CreateSecurityProfile
-> Maybe (HashMap AlertTargetType AlertTarget)
alertTargets :: Prelude.Maybe (Prelude.HashMap AlertTargetType AlertTarget),
CreateSecurityProfile -> Maybe [MetricToRetain]
additionalMetricsToRetainV2 :: Prelude.Maybe [MetricToRetain],
CreateSecurityProfile -> Maybe [Behavior]
behaviors :: Prelude.Maybe [Behavior],
CreateSecurityProfile -> Maybe [Text]
additionalMetricsToRetain :: Prelude.Maybe [Prelude.Text],
CreateSecurityProfile -> Maybe Text
securityProfileDescription :: Prelude.Maybe Prelude.Text,
CreateSecurityProfile -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
CreateSecurityProfile -> Text
securityProfileName :: Prelude.Text
}
deriving (CreateSecurityProfile -> CreateSecurityProfile -> Bool
(CreateSecurityProfile -> CreateSecurityProfile -> Bool)
-> (CreateSecurityProfile -> CreateSecurityProfile -> Bool)
-> Eq CreateSecurityProfile
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateSecurityProfile -> CreateSecurityProfile -> Bool
$c/= :: CreateSecurityProfile -> CreateSecurityProfile -> Bool
== :: CreateSecurityProfile -> CreateSecurityProfile -> Bool
$c== :: CreateSecurityProfile -> CreateSecurityProfile -> Bool
Prelude.Eq, ReadPrec [CreateSecurityProfile]
ReadPrec CreateSecurityProfile
Int -> ReadS CreateSecurityProfile
ReadS [CreateSecurityProfile]
(Int -> ReadS CreateSecurityProfile)
-> ReadS [CreateSecurityProfile]
-> ReadPrec CreateSecurityProfile
-> ReadPrec [CreateSecurityProfile]
-> Read CreateSecurityProfile
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateSecurityProfile]
$creadListPrec :: ReadPrec [CreateSecurityProfile]
readPrec :: ReadPrec CreateSecurityProfile
$creadPrec :: ReadPrec CreateSecurityProfile
readList :: ReadS [CreateSecurityProfile]
$creadList :: ReadS [CreateSecurityProfile]
readsPrec :: Int -> ReadS CreateSecurityProfile
$creadsPrec :: Int -> ReadS CreateSecurityProfile
Prelude.Read, Int -> CreateSecurityProfile -> ShowS
[CreateSecurityProfile] -> ShowS
CreateSecurityProfile -> String
(Int -> CreateSecurityProfile -> ShowS)
-> (CreateSecurityProfile -> String)
-> ([CreateSecurityProfile] -> ShowS)
-> Show CreateSecurityProfile
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateSecurityProfile] -> ShowS
$cshowList :: [CreateSecurityProfile] -> ShowS
show :: CreateSecurityProfile -> String
$cshow :: CreateSecurityProfile -> String
showsPrec :: Int -> CreateSecurityProfile -> ShowS
$cshowsPrec :: Int -> CreateSecurityProfile -> ShowS
Prelude.Show, (forall x. CreateSecurityProfile -> Rep CreateSecurityProfile x)
-> (forall x. Rep CreateSecurityProfile x -> CreateSecurityProfile)
-> Generic CreateSecurityProfile
forall x. Rep CreateSecurityProfile x -> CreateSecurityProfile
forall x. CreateSecurityProfile -> Rep CreateSecurityProfile x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateSecurityProfile x -> CreateSecurityProfile
$cfrom :: forall x. CreateSecurityProfile -> Rep CreateSecurityProfile x
Prelude.Generic)
newCreateSecurityProfile ::
Prelude.Text ->
CreateSecurityProfile
newCreateSecurityProfile :: Text -> CreateSecurityProfile
newCreateSecurityProfile Text
pSecurityProfileName_ =
CreateSecurityProfile' :: Maybe (HashMap AlertTargetType AlertTarget)
-> Maybe [MetricToRetain]
-> Maybe [Behavior]
-> Maybe [Text]
-> Maybe Text
-> Maybe [Tag]
-> Text
-> CreateSecurityProfile
CreateSecurityProfile'
{ $sel:alertTargets:CreateSecurityProfile' :: Maybe (HashMap AlertTargetType AlertTarget)
alertTargets =
Maybe (HashMap AlertTargetType AlertTarget)
forall a. Maybe a
Prelude.Nothing,
$sel:additionalMetricsToRetainV2:CreateSecurityProfile' :: Maybe [MetricToRetain]
additionalMetricsToRetainV2 = Maybe [MetricToRetain]
forall a. Maybe a
Prelude.Nothing,
$sel:behaviors:CreateSecurityProfile' :: Maybe [Behavior]
behaviors = Maybe [Behavior]
forall a. Maybe a
Prelude.Nothing,
$sel:additionalMetricsToRetain:CreateSecurityProfile' :: Maybe [Text]
additionalMetricsToRetain = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:securityProfileDescription:CreateSecurityProfile' :: Maybe Text
securityProfileDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tags:CreateSecurityProfile' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
$sel:securityProfileName:CreateSecurityProfile' :: Text
securityProfileName = Text
pSecurityProfileName_
}
createSecurityProfile_alertTargets :: Lens.Lens' CreateSecurityProfile (Prelude.Maybe (Prelude.HashMap AlertTargetType AlertTarget))
createSecurityProfile_alertTargets :: (Maybe (HashMap AlertTargetType AlertTarget)
-> f (Maybe (HashMap AlertTargetType AlertTarget)))
-> CreateSecurityProfile -> f CreateSecurityProfile
createSecurityProfile_alertTargets = (CreateSecurityProfile
-> Maybe (HashMap AlertTargetType AlertTarget))
-> (CreateSecurityProfile
-> Maybe (HashMap AlertTargetType AlertTarget)
-> CreateSecurityProfile)
-> Lens
CreateSecurityProfile
CreateSecurityProfile
(Maybe (HashMap AlertTargetType AlertTarget))
(Maybe (HashMap AlertTargetType AlertTarget))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSecurityProfile' {Maybe (HashMap AlertTargetType AlertTarget)
alertTargets :: Maybe (HashMap AlertTargetType AlertTarget)
$sel:alertTargets:CreateSecurityProfile' :: CreateSecurityProfile
-> Maybe (HashMap AlertTargetType AlertTarget)
alertTargets} -> Maybe (HashMap AlertTargetType AlertTarget)
alertTargets) (\s :: CreateSecurityProfile
s@CreateSecurityProfile' {} Maybe (HashMap AlertTargetType AlertTarget)
a -> CreateSecurityProfile
s {$sel:alertTargets:CreateSecurityProfile' :: Maybe (HashMap AlertTargetType AlertTarget)
alertTargets = Maybe (HashMap AlertTargetType AlertTarget)
a} :: CreateSecurityProfile) ((Maybe (HashMap AlertTargetType AlertTarget)
-> f (Maybe (HashMap AlertTargetType AlertTarget)))
-> CreateSecurityProfile -> f CreateSecurityProfile)
-> ((Maybe (HashMap AlertTargetType AlertTarget)
-> f (Maybe (HashMap AlertTargetType AlertTarget)))
-> Maybe (HashMap AlertTargetType AlertTarget)
-> f (Maybe (HashMap AlertTargetType AlertTarget)))
-> (Maybe (HashMap AlertTargetType AlertTarget)
-> f (Maybe (HashMap AlertTargetType AlertTarget)))
-> CreateSecurityProfile
-> f CreateSecurityProfile
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap AlertTargetType AlertTarget)
(HashMap AlertTargetType AlertTarget)
(HashMap AlertTargetType AlertTarget)
(HashMap AlertTargetType AlertTarget)
-> Iso
(Maybe (HashMap AlertTargetType AlertTarget))
(Maybe (HashMap AlertTargetType AlertTarget))
(Maybe (HashMap AlertTargetType AlertTarget))
(Maybe (HashMap AlertTargetType AlertTarget))
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
(HashMap AlertTargetType AlertTarget)
(HashMap AlertTargetType AlertTarget)
(HashMap AlertTargetType AlertTarget)
(HashMap AlertTargetType AlertTarget)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createSecurityProfile_additionalMetricsToRetainV2 :: Lens.Lens' CreateSecurityProfile (Prelude.Maybe [MetricToRetain])
createSecurityProfile_additionalMetricsToRetainV2 :: (Maybe [MetricToRetain] -> f (Maybe [MetricToRetain]))
-> CreateSecurityProfile -> f CreateSecurityProfile
createSecurityProfile_additionalMetricsToRetainV2 = (CreateSecurityProfile -> Maybe [MetricToRetain])
-> (CreateSecurityProfile
-> Maybe [MetricToRetain] -> CreateSecurityProfile)
-> Lens
CreateSecurityProfile
CreateSecurityProfile
(Maybe [MetricToRetain])
(Maybe [MetricToRetain])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSecurityProfile' {Maybe [MetricToRetain]
additionalMetricsToRetainV2 :: Maybe [MetricToRetain]
$sel:additionalMetricsToRetainV2:CreateSecurityProfile' :: CreateSecurityProfile -> Maybe [MetricToRetain]
additionalMetricsToRetainV2} -> Maybe [MetricToRetain]
additionalMetricsToRetainV2) (\s :: CreateSecurityProfile
s@CreateSecurityProfile' {} Maybe [MetricToRetain]
a -> CreateSecurityProfile
s {$sel:additionalMetricsToRetainV2:CreateSecurityProfile' :: Maybe [MetricToRetain]
additionalMetricsToRetainV2 = Maybe [MetricToRetain]
a} :: CreateSecurityProfile) ((Maybe [MetricToRetain] -> f (Maybe [MetricToRetain]))
-> CreateSecurityProfile -> f CreateSecurityProfile)
-> ((Maybe [MetricToRetain] -> f (Maybe [MetricToRetain]))
-> Maybe [MetricToRetain] -> f (Maybe [MetricToRetain]))
-> (Maybe [MetricToRetain] -> f (Maybe [MetricToRetain]))
-> CreateSecurityProfile
-> f CreateSecurityProfile
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[MetricToRetain] [MetricToRetain] [MetricToRetain] [MetricToRetain]
-> Iso
(Maybe [MetricToRetain])
(Maybe [MetricToRetain])
(Maybe [MetricToRetain])
(Maybe [MetricToRetain])
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
[MetricToRetain] [MetricToRetain] [MetricToRetain] [MetricToRetain]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createSecurityProfile_behaviors :: Lens.Lens' CreateSecurityProfile (Prelude.Maybe [Behavior])
createSecurityProfile_behaviors :: (Maybe [Behavior] -> f (Maybe [Behavior]))
-> CreateSecurityProfile -> f CreateSecurityProfile
createSecurityProfile_behaviors = (CreateSecurityProfile -> Maybe [Behavior])
-> (CreateSecurityProfile
-> Maybe [Behavior] -> CreateSecurityProfile)
-> Lens
CreateSecurityProfile
CreateSecurityProfile
(Maybe [Behavior])
(Maybe [Behavior])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSecurityProfile' {Maybe [Behavior]
behaviors :: Maybe [Behavior]
$sel:behaviors:CreateSecurityProfile' :: CreateSecurityProfile -> Maybe [Behavior]
behaviors} -> Maybe [Behavior]
behaviors) (\s :: CreateSecurityProfile
s@CreateSecurityProfile' {} Maybe [Behavior]
a -> CreateSecurityProfile
s {$sel:behaviors:CreateSecurityProfile' :: Maybe [Behavior]
behaviors = Maybe [Behavior]
a} :: CreateSecurityProfile) ((Maybe [Behavior] -> f (Maybe [Behavior]))
-> CreateSecurityProfile -> f CreateSecurityProfile)
-> ((Maybe [Behavior] -> f (Maybe [Behavior]))
-> Maybe [Behavior] -> f (Maybe [Behavior]))
-> (Maybe [Behavior] -> f (Maybe [Behavior]))
-> CreateSecurityProfile
-> f CreateSecurityProfile
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Behavior] [Behavior] [Behavior] [Behavior]
-> Iso
(Maybe [Behavior])
(Maybe [Behavior])
(Maybe [Behavior])
(Maybe [Behavior])
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 [Behavior] [Behavior] [Behavior] [Behavior]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createSecurityProfile_additionalMetricsToRetain :: Lens.Lens' CreateSecurityProfile (Prelude.Maybe [Prelude.Text])
createSecurityProfile_additionalMetricsToRetain :: (Maybe [Text] -> f (Maybe [Text]))
-> CreateSecurityProfile -> f CreateSecurityProfile
createSecurityProfile_additionalMetricsToRetain = (CreateSecurityProfile -> Maybe [Text])
-> (CreateSecurityProfile -> Maybe [Text] -> CreateSecurityProfile)
-> Lens
CreateSecurityProfile
CreateSecurityProfile
(Maybe [Text])
(Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSecurityProfile' {Maybe [Text]
additionalMetricsToRetain :: Maybe [Text]
$sel:additionalMetricsToRetain:CreateSecurityProfile' :: CreateSecurityProfile -> Maybe [Text]
additionalMetricsToRetain} -> Maybe [Text]
additionalMetricsToRetain) (\s :: CreateSecurityProfile
s@CreateSecurityProfile' {} Maybe [Text]
a -> CreateSecurityProfile
s {$sel:additionalMetricsToRetain:CreateSecurityProfile' :: Maybe [Text]
additionalMetricsToRetain = Maybe [Text]
a} :: CreateSecurityProfile) ((Maybe [Text] -> f (Maybe [Text]))
-> CreateSecurityProfile -> f CreateSecurityProfile)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> CreateSecurityProfile
-> f CreateSecurityProfile
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createSecurityProfile_securityProfileDescription :: Lens.Lens' CreateSecurityProfile (Prelude.Maybe Prelude.Text)
createSecurityProfile_securityProfileDescription :: (Maybe Text -> f (Maybe Text))
-> CreateSecurityProfile -> f CreateSecurityProfile
createSecurityProfile_securityProfileDescription = (CreateSecurityProfile -> Maybe Text)
-> (CreateSecurityProfile -> Maybe Text -> CreateSecurityProfile)
-> Lens
CreateSecurityProfile
CreateSecurityProfile
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSecurityProfile' {Maybe Text
securityProfileDescription :: Maybe Text
$sel:securityProfileDescription:CreateSecurityProfile' :: CreateSecurityProfile -> Maybe Text
securityProfileDescription} -> Maybe Text
securityProfileDescription) (\s :: CreateSecurityProfile
s@CreateSecurityProfile' {} Maybe Text
a -> CreateSecurityProfile
s {$sel:securityProfileDescription:CreateSecurityProfile' :: Maybe Text
securityProfileDescription = Maybe Text
a} :: CreateSecurityProfile)
createSecurityProfile_tags :: Lens.Lens' CreateSecurityProfile (Prelude.Maybe [Tag])
createSecurityProfile_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateSecurityProfile -> f CreateSecurityProfile
createSecurityProfile_tags = (CreateSecurityProfile -> Maybe [Tag])
-> (CreateSecurityProfile -> Maybe [Tag] -> CreateSecurityProfile)
-> Lens
CreateSecurityProfile
CreateSecurityProfile
(Maybe [Tag])
(Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSecurityProfile' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateSecurityProfile' :: CreateSecurityProfile -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateSecurityProfile
s@CreateSecurityProfile' {} Maybe [Tag]
a -> CreateSecurityProfile
s {$sel:tags:CreateSecurityProfile' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateSecurityProfile) ((Maybe [Tag] -> f (Maybe [Tag]))
-> CreateSecurityProfile -> f CreateSecurityProfile)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
-> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateSecurityProfile
-> f CreateSecurityProfile
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createSecurityProfile_securityProfileName :: Lens.Lens' CreateSecurityProfile Prelude.Text
createSecurityProfile_securityProfileName :: (Text -> f Text)
-> CreateSecurityProfile -> f CreateSecurityProfile
createSecurityProfile_securityProfileName = (CreateSecurityProfile -> Text)
-> (CreateSecurityProfile -> Text -> CreateSecurityProfile)
-> Lens CreateSecurityProfile CreateSecurityProfile Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSecurityProfile' {Text
securityProfileName :: Text
$sel:securityProfileName:CreateSecurityProfile' :: CreateSecurityProfile -> Text
securityProfileName} -> Text
securityProfileName) (\s :: CreateSecurityProfile
s@CreateSecurityProfile' {} Text
a -> CreateSecurityProfile
s {$sel:securityProfileName:CreateSecurityProfile' :: Text
securityProfileName = Text
a} :: CreateSecurityProfile)
instance Core.AWSRequest CreateSecurityProfile where
type
AWSResponse CreateSecurityProfile =
CreateSecurityProfileResponse
request :: CreateSecurityProfile -> Request CreateSecurityProfile
request = Service -> CreateSecurityProfile -> Request CreateSecurityProfile
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateSecurityProfile
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateSecurityProfile)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateSecurityProfile))
-> Logger
-> Service
-> Proxy CreateSecurityProfile
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateSecurityProfile)))
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 ->
Maybe Text -> Maybe Text -> Int -> CreateSecurityProfileResponse
CreateSecurityProfileResponse'
(Maybe Text -> Maybe Text -> Int -> CreateSecurityProfileResponse)
-> Either String (Maybe Text)
-> Either
String (Maybe Text -> Int -> CreateSecurityProfileResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"securityProfileName")
Either String (Maybe Text -> Int -> CreateSecurityProfileResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateSecurityProfileResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"securityProfileArn")
Either String (Int -> CreateSecurityProfileResponse)
-> Either String Int -> Either String CreateSecurityProfileResponse
forall (f :: * -> *) a b. Applicative f => 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 CreateSecurityProfile
instance Prelude.NFData CreateSecurityProfile
instance Core.ToHeaders CreateSecurityProfile where
toHeaders :: CreateSecurityProfile -> ResponseHeaders
toHeaders = ResponseHeaders -> CreateSecurityProfile -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToJSON CreateSecurityProfile where
toJSON :: CreateSecurityProfile -> Value
toJSON CreateSecurityProfile' {Maybe [Text]
Maybe [MetricToRetain]
Maybe [Behavior]
Maybe [Tag]
Maybe Text
Maybe (HashMap AlertTargetType AlertTarget)
Text
securityProfileName :: Text
tags :: Maybe [Tag]
securityProfileDescription :: Maybe Text
additionalMetricsToRetain :: Maybe [Text]
behaviors :: Maybe [Behavior]
additionalMetricsToRetainV2 :: Maybe [MetricToRetain]
alertTargets :: Maybe (HashMap AlertTargetType AlertTarget)
$sel:securityProfileName:CreateSecurityProfile' :: CreateSecurityProfile -> Text
$sel:tags:CreateSecurityProfile' :: CreateSecurityProfile -> Maybe [Tag]
$sel:securityProfileDescription:CreateSecurityProfile' :: CreateSecurityProfile -> Maybe Text
$sel:additionalMetricsToRetain:CreateSecurityProfile' :: CreateSecurityProfile -> Maybe [Text]
$sel:behaviors:CreateSecurityProfile' :: CreateSecurityProfile -> Maybe [Behavior]
$sel:additionalMetricsToRetainV2:CreateSecurityProfile' :: CreateSecurityProfile -> Maybe [MetricToRetain]
$sel:alertTargets:CreateSecurityProfile' :: CreateSecurityProfile
-> Maybe (HashMap AlertTargetType AlertTarget)
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"alertTargets" Text -> HashMap AlertTargetType AlertTarget -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap AlertTargetType AlertTarget -> Pair)
-> Maybe (HashMap AlertTargetType AlertTarget) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap AlertTargetType AlertTarget)
alertTargets,
(Text
"additionalMetricsToRetainV2" Text -> [MetricToRetain] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([MetricToRetain] -> Pair) -> Maybe [MetricToRetain] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [MetricToRetain]
additionalMetricsToRetainV2,
(Text
"behaviors" Text -> [Behavior] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Behavior] -> Pair) -> Maybe [Behavior] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Behavior]
behaviors,
(Text
"additionalMetricsToRetain" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
additionalMetricsToRetain,
(Text
"securityProfileDescription" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
securityProfileDescription,
(Text
"tags" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags
]
)
instance Core.ToPath CreateSecurityProfile where
toPath :: CreateSecurityProfile -> ByteString
toPath CreateSecurityProfile' {Maybe [Text]
Maybe [MetricToRetain]
Maybe [Behavior]
Maybe [Tag]
Maybe Text
Maybe (HashMap AlertTargetType AlertTarget)
Text
securityProfileName :: Text
tags :: Maybe [Tag]
securityProfileDescription :: Maybe Text
additionalMetricsToRetain :: Maybe [Text]
behaviors :: Maybe [Behavior]
additionalMetricsToRetainV2 :: Maybe [MetricToRetain]
alertTargets :: Maybe (HashMap AlertTargetType AlertTarget)
$sel:securityProfileName:CreateSecurityProfile' :: CreateSecurityProfile -> Text
$sel:tags:CreateSecurityProfile' :: CreateSecurityProfile -> Maybe [Tag]
$sel:securityProfileDescription:CreateSecurityProfile' :: CreateSecurityProfile -> Maybe Text
$sel:additionalMetricsToRetain:CreateSecurityProfile' :: CreateSecurityProfile -> Maybe [Text]
$sel:behaviors:CreateSecurityProfile' :: CreateSecurityProfile -> Maybe [Behavior]
$sel:additionalMetricsToRetainV2:CreateSecurityProfile' :: CreateSecurityProfile -> Maybe [MetricToRetain]
$sel:alertTargets:CreateSecurityProfile' :: CreateSecurityProfile
-> Maybe (HashMap AlertTargetType AlertTarget)
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/security-profiles/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
securityProfileName
]
instance Core.ToQuery CreateSecurityProfile where
toQuery :: CreateSecurityProfile -> QueryString
toQuery = QueryString -> CreateSecurityProfile -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateSecurityProfileResponse = CreateSecurityProfileResponse'
{
CreateSecurityProfileResponse -> Maybe Text
securityProfileName :: Prelude.Maybe Prelude.Text,
CreateSecurityProfileResponse -> Maybe Text
securityProfileArn :: Prelude.Maybe Prelude.Text,
CreateSecurityProfileResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateSecurityProfileResponse
-> CreateSecurityProfileResponse -> Bool
(CreateSecurityProfileResponse
-> CreateSecurityProfileResponse -> Bool)
-> (CreateSecurityProfileResponse
-> CreateSecurityProfileResponse -> Bool)
-> Eq CreateSecurityProfileResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateSecurityProfileResponse
-> CreateSecurityProfileResponse -> Bool
$c/= :: CreateSecurityProfileResponse
-> CreateSecurityProfileResponse -> Bool
== :: CreateSecurityProfileResponse
-> CreateSecurityProfileResponse -> Bool
$c== :: CreateSecurityProfileResponse
-> CreateSecurityProfileResponse -> Bool
Prelude.Eq, ReadPrec [CreateSecurityProfileResponse]
ReadPrec CreateSecurityProfileResponse
Int -> ReadS CreateSecurityProfileResponse
ReadS [CreateSecurityProfileResponse]
(Int -> ReadS CreateSecurityProfileResponse)
-> ReadS [CreateSecurityProfileResponse]
-> ReadPrec CreateSecurityProfileResponse
-> ReadPrec [CreateSecurityProfileResponse]
-> Read CreateSecurityProfileResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateSecurityProfileResponse]
$creadListPrec :: ReadPrec [CreateSecurityProfileResponse]
readPrec :: ReadPrec CreateSecurityProfileResponse
$creadPrec :: ReadPrec CreateSecurityProfileResponse
readList :: ReadS [CreateSecurityProfileResponse]
$creadList :: ReadS [CreateSecurityProfileResponse]
readsPrec :: Int -> ReadS CreateSecurityProfileResponse
$creadsPrec :: Int -> ReadS CreateSecurityProfileResponse
Prelude.Read, Int -> CreateSecurityProfileResponse -> ShowS
[CreateSecurityProfileResponse] -> ShowS
CreateSecurityProfileResponse -> String
(Int -> CreateSecurityProfileResponse -> ShowS)
-> (CreateSecurityProfileResponse -> String)
-> ([CreateSecurityProfileResponse] -> ShowS)
-> Show CreateSecurityProfileResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateSecurityProfileResponse] -> ShowS
$cshowList :: [CreateSecurityProfileResponse] -> ShowS
show :: CreateSecurityProfileResponse -> String
$cshow :: CreateSecurityProfileResponse -> String
showsPrec :: Int -> CreateSecurityProfileResponse -> ShowS
$cshowsPrec :: Int -> CreateSecurityProfileResponse -> ShowS
Prelude.Show, (forall x.
CreateSecurityProfileResponse
-> Rep CreateSecurityProfileResponse x)
-> (forall x.
Rep CreateSecurityProfileResponse x
-> CreateSecurityProfileResponse)
-> Generic CreateSecurityProfileResponse
forall x.
Rep CreateSecurityProfileResponse x
-> CreateSecurityProfileResponse
forall x.
CreateSecurityProfileResponse
-> Rep CreateSecurityProfileResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateSecurityProfileResponse x
-> CreateSecurityProfileResponse
$cfrom :: forall x.
CreateSecurityProfileResponse
-> Rep CreateSecurityProfileResponse x
Prelude.Generic)
newCreateSecurityProfileResponse ::
Prelude.Int ->
CreateSecurityProfileResponse
newCreateSecurityProfileResponse :: Int -> CreateSecurityProfileResponse
newCreateSecurityProfileResponse Int
pHttpStatus_ =
CreateSecurityProfileResponse' :: Maybe Text -> Maybe Text -> Int -> CreateSecurityProfileResponse
CreateSecurityProfileResponse'
{ $sel:securityProfileName:CreateSecurityProfileResponse' :: Maybe Text
securityProfileName =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:securityProfileArn:CreateSecurityProfileResponse' :: Maybe Text
securityProfileArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateSecurityProfileResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createSecurityProfileResponse_securityProfileName :: Lens.Lens' CreateSecurityProfileResponse (Prelude.Maybe Prelude.Text)
createSecurityProfileResponse_securityProfileName :: (Maybe Text -> f (Maybe Text))
-> CreateSecurityProfileResponse -> f CreateSecurityProfileResponse
createSecurityProfileResponse_securityProfileName = (CreateSecurityProfileResponse -> Maybe Text)
-> (CreateSecurityProfileResponse
-> Maybe Text -> CreateSecurityProfileResponse)
-> Lens
CreateSecurityProfileResponse
CreateSecurityProfileResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSecurityProfileResponse' {Maybe Text
securityProfileName :: Maybe Text
$sel:securityProfileName:CreateSecurityProfileResponse' :: CreateSecurityProfileResponse -> Maybe Text
securityProfileName} -> Maybe Text
securityProfileName) (\s :: CreateSecurityProfileResponse
s@CreateSecurityProfileResponse' {} Maybe Text
a -> CreateSecurityProfileResponse
s {$sel:securityProfileName:CreateSecurityProfileResponse' :: Maybe Text
securityProfileName = Maybe Text
a} :: CreateSecurityProfileResponse)
createSecurityProfileResponse_securityProfileArn :: Lens.Lens' CreateSecurityProfileResponse (Prelude.Maybe Prelude.Text)
createSecurityProfileResponse_securityProfileArn :: (Maybe Text -> f (Maybe Text))
-> CreateSecurityProfileResponse -> f CreateSecurityProfileResponse
createSecurityProfileResponse_securityProfileArn = (CreateSecurityProfileResponse -> Maybe Text)
-> (CreateSecurityProfileResponse
-> Maybe Text -> CreateSecurityProfileResponse)
-> Lens
CreateSecurityProfileResponse
CreateSecurityProfileResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSecurityProfileResponse' {Maybe Text
securityProfileArn :: Maybe Text
$sel:securityProfileArn:CreateSecurityProfileResponse' :: CreateSecurityProfileResponse -> Maybe Text
securityProfileArn} -> Maybe Text
securityProfileArn) (\s :: CreateSecurityProfileResponse
s@CreateSecurityProfileResponse' {} Maybe Text
a -> CreateSecurityProfileResponse
s {$sel:securityProfileArn:CreateSecurityProfileResponse' :: Maybe Text
securityProfileArn = Maybe Text
a} :: CreateSecurityProfileResponse)
createSecurityProfileResponse_httpStatus :: Lens.Lens' CreateSecurityProfileResponse Prelude.Int
createSecurityProfileResponse_httpStatus :: (Int -> f Int)
-> CreateSecurityProfileResponse -> f CreateSecurityProfileResponse
createSecurityProfileResponse_httpStatus = (CreateSecurityProfileResponse -> Int)
-> (CreateSecurityProfileResponse
-> Int -> CreateSecurityProfileResponse)
-> Lens
CreateSecurityProfileResponse CreateSecurityProfileResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSecurityProfileResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateSecurityProfileResponse' :: CreateSecurityProfileResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateSecurityProfileResponse
s@CreateSecurityProfileResponse' {} Int
a -> CreateSecurityProfileResponse
s {$sel:httpStatus:CreateSecurityProfileResponse' :: Int
httpStatus = Int
a} :: CreateSecurityProfileResponse)
instance Prelude.NFData CreateSecurityProfileResponse