{-# 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.SecurityHub.EnableSecurityHub
(
EnableSecurityHub (..),
newEnableSecurityHub,
enableSecurityHub_enableDefaultStandards,
enableSecurityHub_tags,
EnableSecurityHubResponse (..),
newEnableSecurityHubResponse,
enableSecurityHubResponse_httpStatus,
)
where
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
import Amazonka.SecurityHub.Types
data EnableSecurityHub = EnableSecurityHub'
{
EnableSecurityHub -> Maybe Bool
enableDefaultStandards :: Prelude.Maybe Prelude.Bool,
EnableSecurityHub -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)
}
deriving (EnableSecurityHub -> EnableSecurityHub -> Bool
(EnableSecurityHub -> EnableSecurityHub -> Bool)
-> (EnableSecurityHub -> EnableSecurityHub -> Bool)
-> Eq EnableSecurityHub
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EnableSecurityHub -> EnableSecurityHub -> Bool
$c/= :: EnableSecurityHub -> EnableSecurityHub -> Bool
== :: EnableSecurityHub -> EnableSecurityHub -> Bool
$c== :: EnableSecurityHub -> EnableSecurityHub -> Bool
Prelude.Eq, ReadPrec [EnableSecurityHub]
ReadPrec EnableSecurityHub
Int -> ReadS EnableSecurityHub
ReadS [EnableSecurityHub]
(Int -> ReadS EnableSecurityHub)
-> ReadS [EnableSecurityHub]
-> ReadPrec EnableSecurityHub
-> ReadPrec [EnableSecurityHub]
-> Read EnableSecurityHub
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EnableSecurityHub]
$creadListPrec :: ReadPrec [EnableSecurityHub]
readPrec :: ReadPrec EnableSecurityHub
$creadPrec :: ReadPrec EnableSecurityHub
readList :: ReadS [EnableSecurityHub]
$creadList :: ReadS [EnableSecurityHub]
readsPrec :: Int -> ReadS EnableSecurityHub
$creadsPrec :: Int -> ReadS EnableSecurityHub
Prelude.Read, Int -> EnableSecurityHub -> ShowS
[EnableSecurityHub] -> ShowS
EnableSecurityHub -> String
(Int -> EnableSecurityHub -> ShowS)
-> (EnableSecurityHub -> String)
-> ([EnableSecurityHub] -> ShowS)
-> Show EnableSecurityHub
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EnableSecurityHub] -> ShowS
$cshowList :: [EnableSecurityHub] -> ShowS
show :: EnableSecurityHub -> String
$cshow :: EnableSecurityHub -> String
showsPrec :: Int -> EnableSecurityHub -> ShowS
$cshowsPrec :: Int -> EnableSecurityHub -> ShowS
Prelude.Show, (forall x. EnableSecurityHub -> Rep EnableSecurityHub x)
-> (forall x. Rep EnableSecurityHub x -> EnableSecurityHub)
-> Generic EnableSecurityHub
forall x. Rep EnableSecurityHub x -> EnableSecurityHub
forall x. EnableSecurityHub -> Rep EnableSecurityHub x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EnableSecurityHub x -> EnableSecurityHub
$cfrom :: forall x. EnableSecurityHub -> Rep EnableSecurityHub x
Prelude.Generic)
newEnableSecurityHub ::
EnableSecurityHub
newEnableSecurityHub :: EnableSecurityHub
newEnableSecurityHub =
EnableSecurityHub' :: Maybe Bool -> Maybe (HashMap Text Text) -> EnableSecurityHub
EnableSecurityHub'
{ $sel:enableDefaultStandards:EnableSecurityHub' :: Maybe Bool
enableDefaultStandards =
Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:tags:EnableSecurityHub' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing
}
enableSecurityHub_enableDefaultStandards :: Lens.Lens' EnableSecurityHub (Prelude.Maybe Prelude.Bool)
enableSecurityHub_enableDefaultStandards :: (Maybe Bool -> f (Maybe Bool))
-> EnableSecurityHub -> f EnableSecurityHub
enableSecurityHub_enableDefaultStandards = (EnableSecurityHub -> Maybe Bool)
-> (EnableSecurityHub -> Maybe Bool -> EnableSecurityHub)
-> Lens
EnableSecurityHub EnableSecurityHub (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnableSecurityHub' {Maybe Bool
enableDefaultStandards :: Maybe Bool
$sel:enableDefaultStandards:EnableSecurityHub' :: EnableSecurityHub -> Maybe Bool
enableDefaultStandards} -> Maybe Bool
enableDefaultStandards) (\s :: EnableSecurityHub
s@EnableSecurityHub' {} Maybe Bool
a -> EnableSecurityHub
s {$sel:enableDefaultStandards:EnableSecurityHub' :: Maybe Bool
enableDefaultStandards = Maybe Bool
a} :: EnableSecurityHub)
enableSecurityHub_tags :: Lens.Lens' EnableSecurityHub (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
enableSecurityHub_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> EnableSecurityHub -> f EnableSecurityHub
enableSecurityHub_tags = (EnableSecurityHub -> Maybe (HashMap Text Text))
-> (EnableSecurityHub
-> Maybe (HashMap Text Text) -> EnableSecurityHub)
-> Lens
EnableSecurityHub
EnableSecurityHub
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnableSecurityHub' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:EnableSecurityHub' :: EnableSecurityHub -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: EnableSecurityHub
s@EnableSecurityHub' {} Maybe (HashMap Text Text)
a -> EnableSecurityHub
s {$sel:tags:EnableSecurityHub' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: EnableSecurityHub) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> EnableSecurityHub -> f EnableSecurityHub)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> EnableSecurityHub
-> f EnableSecurityHub
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text 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
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest EnableSecurityHub where
type
AWSResponse EnableSecurityHub =
EnableSecurityHubResponse
request :: EnableSecurityHub -> Request EnableSecurityHub
request = Service -> EnableSecurityHub -> Request EnableSecurityHub
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy EnableSecurityHub
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse EnableSecurityHub)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse EnableSecurityHub))
-> Logger
-> Service
-> Proxy EnableSecurityHub
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse EnableSecurityHub)))
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 -> EnableSecurityHubResponse
EnableSecurityHubResponse'
(Int -> EnableSecurityHubResponse)
-> Either String Int -> Either String EnableSecurityHubResponse
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 EnableSecurityHub
instance Prelude.NFData EnableSecurityHub
instance Core.ToHeaders EnableSecurityHub where
toHeaders :: EnableSecurityHub -> ResponseHeaders
toHeaders =
ResponseHeaders -> EnableSecurityHub -> 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 EnableSecurityHub where
toJSON :: EnableSecurityHub -> Value
toJSON EnableSecurityHub' {Maybe Bool
Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
enableDefaultStandards :: Maybe Bool
$sel:tags:EnableSecurityHub' :: EnableSecurityHub -> Maybe (HashMap Text Text)
$sel:enableDefaultStandards:EnableSecurityHub' :: EnableSecurityHub -> Maybe Bool
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"EnableDefaultStandards" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
enableDefaultStandards,
(Text
"Tags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags
]
)
instance Core.ToPath EnableSecurityHub where
toPath :: EnableSecurityHub -> ByteString
toPath = ByteString -> EnableSecurityHub -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/accounts"
instance Core.ToQuery EnableSecurityHub where
toQuery :: EnableSecurityHub -> QueryString
toQuery = QueryString -> EnableSecurityHub -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data EnableSecurityHubResponse = EnableSecurityHubResponse'
{
EnableSecurityHubResponse -> Int
httpStatus :: Prelude.Int
}
deriving (EnableSecurityHubResponse -> EnableSecurityHubResponse -> Bool
(EnableSecurityHubResponse -> EnableSecurityHubResponse -> Bool)
-> (EnableSecurityHubResponse -> EnableSecurityHubResponse -> Bool)
-> Eq EnableSecurityHubResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EnableSecurityHubResponse -> EnableSecurityHubResponse -> Bool
$c/= :: EnableSecurityHubResponse -> EnableSecurityHubResponse -> Bool
== :: EnableSecurityHubResponse -> EnableSecurityHubResponse -> Bool
$c== :: EnableSecurityHubResponse -> EnableSecurityHubResponse -> Bool
Prelude.Eq, ReadPrec [EnableSecurityHubResponse]
ReadPrec EnableSecurityHubResponse
Int -> ReadS EnableSecurityHubResponse
ReadS [EnableSecurityHubResponse]
(Int -> ReadS EnableSecurityHubResponse)
-> ReadS [EnableSecurityHubResponse]
-> ReadPrec EnableSecurityHubResponse
-> ReadPrec [EnableSecurityHubResponse]
-> Read EnableSecurityHubResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EnableSecurityHubResponse]
$creadListPrec :: ReadPrec [EnableSecurityHubResponse]
readPrec :: ReadPrec EnableSecurityHubResponse
$creadPrec :: ReadPrec EnableSecurityHubResponse
readList :: ReadS [EnableSecurityHubResponse]
$creadList :: ReadS [EnableSecurityHubResponse]
readsPrec :: Int -> ReadS EnableSecurityHubResponse
$creadsPrec :: Int -> ReadS EnableSecurityHubResponse
Prelude.Read, Int -> EnableSecurityHubResponse -> ShowS
[EnableSecurityHubResponse] -> ShowS
EnableSecurityHubResponse -> String
(Int -> EnableSecurityHubResponse -> ShowS)
-> (EnableSecurityHubResponse -> String)
-> ([EnableSecurityHubResponse] -> ShowS)
-> Show EnableSecurityHubResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EnableSecurityHubResponse] -> ShowS
$cshowList :: [EnableSecurityHubResponse] -> ShowS
show :: EnableSecurityHubResponse -> String
$cshow :: EnableSecurityHubResponse -> String
showsPrec :: Int -> EnableSecurityHubResponse -> ShowS
$cshowsPrec :: Int -> EnableSecurityHubResponse -> ShowS
Prelude.Show, (forall x.
EnableSecurityHubResponse -> Rep EnableSecurityHubResponse x)
-> (forall x.
Rep EnableSecurityHubResponse x -> EnableSecurityHubResponse)
-> Generic EnableSecurityHubResponse
forall x.
Rep EnableSecurityHubResponse x -> EnableSecurityHubResponse
forall x.
EnableSecurityHubResponse -> Rep EnableSecurityHubResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep EnableSecurityHubResponse x -> EnableSecurityHubResponse
$cfrom :: forall x.
EnableSecurityHubResponse -> Rep EnableSecurityHubResponse x
Prelude.Generic)
newEnableSecurityHubResponse ::
Prelude.Int ->
EnableSecurityHubResponse
newEnableSecurityHubResponse :: Int -> EnableSecurityHubResponse
newEnableSecurityHubResponse Int
pHttpStatus_ =
EnableSecurityHubResponse' :: Int -> EnableSecurityHubResponse
EnableSecurityHubResponse'
{ $sel:httpStatus:EnableSecurityHubResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
enableSecurityHubResponse_httpStatus :: Lens.Lens' EnableSecurityHubResponse Prelude.Int
enableSecurityHubResponse_httpStatus :: (Int -> f Int)
-> EnableSecurityHubResponse -> f EnableSecurityHubResponse
enableSecurityHubResponse_httpStatus = (EnableSecurityHubResponse -> Int)
-> (EnableSecurityHubResponse -> Int -> EnableSecurityHubResponse)
-> Lens EnableSecurityHubResponse EnableSecurityHubResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnableSecurityHubResponse' {Int
httpStatus :: Int
$sel:httpStatus:EnableSecurityHubResponse' :: EnableSecurityHubResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: EnableSecurityHubResponse
s@EnableSecurityHubResponse' {} Int
a -> EnableSecurityHubResponse
s {$sel:httpStatus:EnableSecurityHubResponse' :: Int
httpStatus = Int
a} :: EnableSecurityHubResponse)
instance Prelude.NFData EnableSecurityHubResponse