{-# 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.GuardDuty.UpdateThreatIntelSet
(
UpdateThreatIntelSet (..),
newUpdateThreatIntelSet,
updateThreatIntelSet_location,
updateThreatIntelSet_activate,
updateThreatIntelSet_name,
updateThreatIntelSet_detectorId,
updateThreatIntelSet_threatIntelSetId,
UpdateThreatIntelSetResponse (..),
newUpdateThreatIntelSetResponse,
updateThreatIntelSetResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.GuardDuty.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 UpdateThreatIntelSet = UpdateThreatIntelSet'
{
UpdateThreatIntelSet -> Maybe Text
location :: Prelude.Maybe Prelude.Text,
UpdateThreatIntelSet -> Maybe Bool
activate :: Prelude.Maybe Prelude.Bool,
UpdateThreatIntelSet -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
UpdateThreatIntelSet -> Text
detectorId :: Prelude.Text,
UpdateThreatIntelSet -> Text
threatIntelSetId :: Prelude.Text
}
deriving (UpdateThreatIntelSet -> UpdateThreatIntelSet -> Bool
(UpdateThreatIntelSet -> UpdateThreatIntelSet -> Bool)
-> (UpdateThreatIntelSet -> UpdateThreatIntelSet -> Bool)
-> Eq UpdateThreatIntelSet
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateThreatIntelSet -> UpdateThreatIntelSet -> Bool
$c/= :: UpdateThreatIntelSet -> UpdateThreatIntelSet -> Bool
== :: UpdateThreatIntelSet -> UpdateThreatIntelSet -> Bool
$c== :: UpdateThreatIntelSet -> UpdateThreatIntelSet -> Bool
Prelude.Eq, ReadPrec [UpdateThreatIntelSet]
ReadPrec UpdateThreatIntelSet
Int -> ReadS UpdateThreatIntelSet
ReadS [UpdateThreatIntelSet]
(Int -> ReadS UpdateThreatIntelSet)
-> ReadS [UpdateThreatIntelSet]
-> ReadPrec UpdateThreatIntelSet
-> ReadPrec [UpdateThreatIntelSet]
-> Read UpdateThreatIntelSet
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateThreatIntelSet]
$creadListPrec :: ReadPrec [UpdateThreatIntelSet]
readPrec :: ReadPrec UpdateThreatIntelSet
$creadPrec :: ReadPrec UpdateThreatIntelSet
readList :: ReadS [UpdateThreatIntelSet]
$creadList :: ReadS [UpdateThreatIntelSet]
readsPrec :: Int -> ReadS UpdateThreatIntelSet
$creadsPrec :: Int -> ReadS UpdateThreatIntelSet
Prelude.Read, Int -> UpdateThreatIntelSet -> ShowS
[UpdateThreatIntelSet] -> ShowS
UpdateThreatIntelSet -> String
(Int -> UpdateThreatIntelSet -> ShowS)
-> (UpdateThreatIntelSet -> String)
-> ([UpdateThreatIntelSet] -> ShowS)
-> Show UpdateThreatIntelSet
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateThreatIntelSet] -> ShowS
$cshowList :: [UpdateThreatIntelSet] -> ShowS
show :: UpdateThreatIntelSet -> String
$cshow :: UpdateThreatIntelSet -> String
showsPrec :: Int -> UpdateThreatIntelSet -> ShowS
$cshowsPrec :: Int -> UpdateThreatIntelSet -> ShowS
Prelude.Show, (forall x. UpdateThreatIntelSet -> Rep UpdateThreatIntelSet x)
-> (forall x. Rep UpdateThreatIntelSet x -> UpdateThreatIntelSet)
-> Generic UpdateThreatIntelSet
forall x. Rep UpdateThreatIntelSet x -> UpdateThreatIntelSet
forall x. UpdateThreatIntelSet -> Rep UpdateThreatIntelSet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateThreatIntelSet x -> UpdateThreatIntelSet
$cfrom :: forall x. UpdateThreatIntelSet -> Rep UpdateThreatIntelSet x
Prelude.Generic)
newUpdateThreatIntelSet ::
Prelude.Text ->
Prelude.Text ->
UpdateThreatIntelSet
newUpdateThreatIntelSet :: Text -> Text -> UpdateThreatIntelSet
newUpdateThreatIntelSet
Text
pDetectorId_
Text
pThreatIntelSetId_ =
UpdateThreatIntelSet' :: Maybe Text
-> Maybe Bool -> Maybe Text -> Text -> Text -> UpdateThreatIntelSet
UpdateThreatIntelSet'
{ $sel:location:UpdateThreatIntelSet' :: Maybe Text
location = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:activate:UpdateThreatIntelSet' :: Maybe Bool
activate = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:name:UpdateThreatIntelSet' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:detectorId:UpdateThreatIntelSet' :: Text
detectorId = Text
pDetectorId_,
$sel:threatIntelSetId:UpdateThreatIntelSet' :: Text
threatIntelSetId = Text
pThreatIntelSetId_
}
updateThreatIntelSet_location :: Lens.Lens' UpdateThreatIntelSet (Prelude.Maybe Prelude.Text)
updateThreatIntelSet_location :: (Maybe Text -> f (Maybe Text))
-> UpdateThreatIntelSet -> f UpdateThreatIntelSet
updateThreatIntelSet_location = (UpdateThreatIntelSet -> Maybe Text)
-> (UpdateThreatIntelSet -> Maybe Text -> UpdateThreatIntelSet)
-> Lens
UpdateThreatIntelSet UpdateThreatIntelSet (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateThreatIntelSet' {Maybe Text
location :: Maybe Text
$sel:location:UpdateThreatIntelSet' :: UpdateThreatIntelSet -> Maybe Text
location} -> Maybe Text
location) (\s :: UpdateThreatIntelSet
s@UpdateThreatIntelSet' {} Maybe Text
a -> UpdateThreatIntelSet
s {$sel:location:UpdateThreatIntelSet' :: Maybe Text
location = Maybe Text
a} :: UpdateThreatIntelSet)
updateThreatIntelSet_activate :: Lens.Lens' UpdateThreatIntelSet (Prelude.Maybe Prelude.Bool)
updateThreatIntelSet_activate :: (Maybe Bool -> f (Maybe Bool))
-> UpdateThreatIntelSet -> f UpdateThreatIntelSet
updateThreatIntelSet_activate = (UpdateThreatIntelSet -> Maybe Bool)
-> (UpdateThreatIntelSet -> Maybe Bool -> UpdateThreatIntelSet)
-> Lens
UpdateThreatIntelSet UpdateThreatIntelSet (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateThreatIntelSet' {Maybe Bool
activate :: Maybe Bool
$sel:activate:UpdateThreatIntelSet' :: UpdateThreatIntelSet -> Maybe Bool
activate} -> Maybe Bool
activate) (\s :: UpdateThreatIntelSet
s@UpdateThreatIntelSet' {} Maybe Bool
a -> UpdateThreatIntelSet
s {$sel:activate:UpdateThreatIntelSet' :: Maybe Bool
activate = Maybe Bool
a} :: UpdateThreatIntelSet)
updateThreatIntelSet_name :: Lens.Lens' UpdateThreatIntelSet (Prelude.Maybe Prelude.Text)
updateThreatIntelSet_name :: (Maybe Text -> f (Maybe Text))
-> UpdateThreatIntelSet -> f UpdateThreatIntelSet
updateThreatIntelSet_name = (UpdateThreatIntelSet -> Maybe Text)
-> (UpdateThreatIntelSet -> Maybe Text -> UpdateThreatIntelSet)
-> Lens
UpdateThreatIntelSet UpdateThreatIntelSet (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateThreatIntelSet' {Maybe Text
name :: Maybe Text
$sel:name:UpdateThreatIntelSet' :: UpdateThreatIntelSet -> Maybe Text
name} -> Maybe Text
name) (\s :: UpdateThreatIntelSet
s@UpdateThreatIntelSet' {} Maybe Text
a -> UpdateThreatIntelSet
s {$sel:name:UpdateThreatIntelSet' :: Maybe Text
name = Maybe Text
a} :: UpdateThreatIntelSet)
updateThreatIntelSet_detectorId :: Lens.Lens' UpdateThreatIntelSet Prelude.Text
updateThreatIntelSet_detectorId :: (Text -> f Text) -> UpdateThreatIntelSet -> f UpdateThreatIntelSet
updateThreatIntelSet_detectorId = (UpdateThreatIntelSet -> Text)
-> (UpdateThreatIntelSet -> Text -> UpdateThreatIntelSet)
-> Lens UpdateThreatIntelSet UpdateThreatIntelSet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateThreatIntelSet' {Text
detectorId :: Text
$sel:detectorId:UpdateThreatIntelSet' :: UpdateThreatIntelSet -> Text
detectorId} -> Text
detectorId) (\s :: UpdateThreatIntelSet
s@UpdateThreatIntelSet' {} Text
a -> UpdateThreatIntelSet
s {$sel:detectorId:UpdateThreatIntelSet' :: Text
detectorId = Text
a} :: UpdateThreatIntelSet)
updateThreatIntelSet_threatIntelSetId :: Lens.Lens' UpdateThreatIntelSet Prelude.Text
updateThreatIntelSet_threatIntelSetId :: (Text -> f Text) -> UpdateThreatIntelSet -> f UpdateThreatIntelSet
updateThreatIntelSet_threatIntelSetId = (UpdateThreatIntelSet -> Text)
-> (UpdateThreatIntelSet -> Text -> UpdateThreatIntelSet)
-> Lens UpdateThreatIntelSet UpdateThreatIntelSet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateThreatIntelSet' {Text
threatIntelSetId :: Text
$sel:threatIntelSetId:UpdateThreatIntelSet' :: UpdateThreatIntelSet -> Text
threatIntelSetId} -> Text
threatIntelSetId) (\s :: UpdateThreatIntelSet
s@UpdateThreatIntelSet' {} Text
a -> UpdateThreatIntelSet
s {$sel:threatIntelSetId:UpdateThreatIntelSet' :: Text
threatIntelSetId = Text
a} :: UpdateThreatIntelSet)
instance Core.AWSRequest UpdateThreatIntelSet where
type
AWSResponse UpdateThreatIntelSet =
UpdateThreatIntelSetResponse
request :: UpdateThreatIntelSet -> Request UpdateThreatIntelSet
request = Service -> UpdateThreatIntelSet -> Request UpdateThreatIntelSet
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateThreatIntelSet
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateThreatIntelSet)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse UpdateThreatIntelSet))
-> Logger
-> Service
-> Proxy UpdateThreatIntelSet
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateThreatIntelSet)))
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 -> UpdateThreatIntelSetResponse
UpdateThreatIntelSetResponse'
(Int -> UpdateThreatIntelSetResponse)
-> Either String Int -> Either String UpdateThreatIntelSetResponse
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 UpdateThreatIntelSet
instance Prelude.NFData UpdateThreatIntelSet
instance Core.ToHeaders UpdateThreatIntelSet where
toHeaders :: UpdateThreatIntelSet -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateThreatIntelSet -> 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 UpdateThreatIntelSet where
toJSON :: UpdateThreatIntelSet -> Value
toJSON UpdateThreatIntelSet' {Maybe Bool
Maybe Text
Text
threatIntelSetId :: Text
detectorId :: Text
name :: Maybe Text
activate :: Maybe Bool
location :: Maybe Text
$sel:threatIntelSetId:UpdateThreatIntelSet' :: UpdateThreatIntelSet -> Text
$sel:detectorId:UpdateThreatIntelSet' :: UpdateThreatIntelSet -> Text
$sel:name:UpdateThreatIntelSet' :: UpdateThreatIntelSet -> Maybe Text
$sel:activate:UpdateThreatIntelSet' :: UpdateThreatIntelSet -> Maybe Bool
$sel:location:UpdateThreatIntelSet' :: UpdateThreatIntelSet -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"location" 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
location,
(Text
"activate" 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
activate,
(Text
"name" 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
name
]
)
instance Core.ToPath UpdateThreatIntelSet where
toPath :: UpdateThreatIntelSet -> ByteString
toPath UpdateThreatIntelSet' {Maybe Bool
Maybe Text
Text
threatIntelSetId :: Text
detectorId :: Text
name :: Maybe Text
activate :: Maybe Bool
location :: Maybe Text
$sel:threatIntelSetId:UpdateThreatIntelSet' :: UpdateThreatIntelSet -> Text
$sel:detectorId:UpdateThreatIntelSet' :: UpdateThreatIntelSet -> Text
$sel:name:UpdateThreatIntelSet' :: UpdateThreatIntelSet -> Maybe Text
$sel:activate:UpdateThreatIntelSet' :: UpdateThreatIntelSet -> Maybe Bool
$sel:location:UpdateThreatIntelSet' :: UpdateThreatIntelSet -> Maybe Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/detector/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
detectorId,
ByteString
"/threatintelset/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
threatIntelSetId
]
instance Core.ToQuery UpdateThreatIntelSet where
toQuery :: UpdateThreatIntelSet -> QueryString
toQuery = QueryString -> UpdateThreatIntelSet -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateThreatIntelSetResponse = UpdateThreatIntelSetResponse'
{
UpdateThreatIntelSetResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateThreatIntelSetResponse
-> UpdateThreatIntelSetResponse -> Bool
(UpdateThreatIntelSetResponse
-> UpdateThreatIntelSetResponse -> Bool)
-> (UpdateThreatIntelSetResponse
-> UpdateThreatIntelSetResponse -> Bool)
-> Eq UpdateThreatIntelSetResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateThreatIntelSetResponse
-> UpdateThreatIntelSetResponse -> Bool
$c/= :: UpdateThreatIntelSetResponse
-> UpdateThreatIntelSetResponse -> Bool
== :: UpdateThreatIntelSetResponse
-> UpdateThreatIntelSetResponse -> Bool
$c== :: UpdateThreatIntelSetResponse
-> UpdateThreatIntelSetResponse -> Bool
Prelude.Eq, ReadPrec [UpdateThreatIntelSetResponse]
ReadPrec UpdateThreatIntelSetResponse
Int -> ReadS UpdateThreatIntelSetResponse
ReadS [UpdateThreatIntelSetResponse]
(Int -> ReadS UpdateThreatIntelSetResponse)
-> ReadS [UpdateThreatIntelSetResponse]
-> ReadPrec UpdateThreatIntelSetResponse
-> ReadPrec [UpdateThreatIntelSetResponse]
-> Read UpdateThreatIntelSetResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateThreatIntelSetResponse]
$creadListPrec :: ReadPrec [UpdateThreatIntelSetResponse]
readPrec :: ReadPrec UpdateThreatIntelSetResponse
$creadPrec :: ReadPrec UpdateThreatIntelSetResponse
readList :: ReadS [UpdateThreatIntelSetResponse]
$creadList :: ReadS [UpdateThreatIntelSetResponse]
readsPrec :: Int -> ReadS UpdateThreatIntelSetResponse
$creadsPrec :: Int -> ReadS UpdateThreatIntelSetResponse
Prelude.Read, Int -> UpdateThreatIntelSetResponse -> ShowS
[UpdateThreatIntelSetResponse] -> ShowS
UpdateThreatIntelSetResponse -> String
(Int -> UpdateThreatIntelSetResponse -> ShowS)
-> (UpdateThreatIntelSetResponse -> String)
-> ([UpdateThreatIntelSetResponse] -> ShowS)
-> Show UpdateThreatIntelSetResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateThreatIntelSetResponse] -> ShowS
$cshowList :: [UpdateThreatIntelSetResponse] -> ShowS
show :: UpdateThreatIntelSetResponse -> String
$cshow :: UpdateThreatIntelSetResponse -> String
showsPrec :: Int -> UpdateThreatIntelSetResponse -> ShowS
$cshowsPrec :: Int -> UpdateThreatIntelSetResponse -> ShowS
Prelude.Show, (forall x.
UpdateThreatIntelSetResponse -> Rep UpdateThreatIntelSetResponse x)
-> (forall x.
Rep UpdateThreatIntelSetResponse x -> UpdateThreatIntelSetResponse)
-> Generic UpdateThreatIntelSetResponse
forall x.
Rep UpdateThreatIntelSetResponse x -> UpdateThreatIntelSetResponse
forall x.
UpdateThreatIntelSetResponse -> Rep UpdateThreatIntelSetResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateThreatIntelSetResponse x -> UpdateThreatIntelSetResponse
$cfrom :: forall x.
UpdateThreatIntelSetResponse -> Rep UpdateThreatIntelSetResponse x
Prelude.Generic)
newUpdateThreatIntelSetResponse ::
Prelude.Int ->
UpdateThreatIntelSetResponse
newUpdateThreatIntelSetResponse :: Int -> UpdateThreatIntelSetResponse
newUpdateThreatIntelSetResponse Int
pHttpStatus_ =
UpdateThreatIntelSetResponse' :: Int -> UpdateThreatIntelSetResponse
UpdateThreatIntelSetResponse'
{ $sel:httpStatus:UpdateThreatIntelSetResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
updateThreatIntelSetResponse_httpStatus :: Lens.Lens' UpdateThreatIntelSetResponse Prelude.Int
updateThreatIntelSetResponse_httpStatus :: (Int -> f Int)
-> UpdateThreatIntelSetResponse -> f UpdateThreatIntelSetResponse
updateThreatIntelSetResponse_httpStatus = (UpdateThreatIntelSetResponse -> Int)
-> (UpdateThreatIntelSetResponse
-> Int -> UpdateThreatIntelSetResponse)
-> Lens
UpdateThreatIntelSetResponse UpdateThreatIntelSetResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateThreatIntelSetResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateThreatIntelSetResponse' :: UpdateThreatIntelSetResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateThreatIntelSetResponse
s@UpdateThreatIntelSetResponse' {} Int
a -> UpdateThreatIntelSetResponse
s {$sel:httpStatus:UpdateThreatIntelSetResponse' :: Int
httpStatus = Int
a} :: UpdateThreatIntelSetResponse)
instance Prelude.NFData UpdateThreatIntelSetResponse