{-# 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.UpdateMacieSession
(
UpdateMacieSession (..),
newUpdateMacieSession,
updateMacieSession_status,
updateMacieSession_findingPublishingFrequency,
UpdateMacieSessionResponse (..),
newUpdateMacieSessionResponse,
updateMacieSessionResponse_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 UpdateMacieSession = UpdateMacieSession'
{
UpdateMacieSession -> Maybe MacieStatus
status :: Prelude.Maybe MacieStatus,
UpdateMacieSession -> Maybe FindingPublishingFrequency
findingPublishingFrequency :: Prelude.Maybe FindingPublishingFrequency
}
deriving (UpdateMacieSession -> UpdateMacieSession -> Bool
(UpdateMacieSession -> UpdateMacieSession -> Bool)
-> (UpdateMacieSession -> UpdateMacieSession -> Bool)
-> Eq UpdateMacieSession
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateMacieSession -> UpdateMacieSession -> Bool
$c/= :: UpdateMacieSession -> UpdateMacieSession -> Bool
== :: UpdateMacieSession -> UpdateMacieSession -> Bool
$c== :: UpdateMacieSession -> UpdateMacieSession -> Bool
Prelude.Eq, ReadPrec [UpdateMacieSession]
ReadPrec UpdateMacieSession
Int -> ReadS UpdateMacieSession
ReadS [UpdateMacieSession]
(Int -> ReadS UpdateMacieSession)
-> ReadS [UpdateMacieSession]
-> ReadPrec UpdateMacieSession
-> ReadPrec [UpdateMacieSession]
-> Read UpdateMacieSession
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateMacieSession]
$creadListPrec :: ReadPrec [UpdateMacieSession]
readPrec :: ReadPrec UpdateMacieSession
$creadPrec :: ReadPrec UpdateMacieSession
readList :: ReadS [UpdateMacieSession]
$creadList :: ReadS [UpdateMacieSession]
readsPrec :: Int -> ReadS UpdateMacieSession
$creadsPrec :: Int -> ReadS UpdateMacieSession
Prelude.Read, Int -> UpdateMacieSession -> ShowS
[UpdateMacieSession] -> ShowS
UpdateMacieSession -> String
(Int -> UpdateMacieSession -> ShowS)
-> (UpdateMacieSession -> String)
-> ([UpdateMacieSession] -> ShowS)
-> Show UpdateMacieSession
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateMacieSession] -> ShowS
$cshowList :: [UpdateMacieSession] -> ShowS
show :: UpdateMacieSession -> String
$cshow :: UpdateMacieSession -> String
showsPrec :: Int -> UpdateMacieSession -> ShowS
$cshowsPrec :: Int -> UpdateMacieSession -> ShowS
Prelude.Show, (forall x. UpdateMacieSession -> Rep UpdateMacieSession x)
-> (forall x. Rep UpdateMacieSession x -> UpdateMacieSession)
-> Generic UpdateMacieSession
forall x. Rep UpdateMacieSession x -> UpdateMacieSession
forall x. UpdateMacieSession -> Rep UpdateMacieSession x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateMacieSession x -> UpdateMacieSession
$cfrom :: forall x. UpdateMacieSession -> Rep UpdateMacieSession x
Prelude.Generic)
newUpdateMacieSession ::
UpdateMacieSession
newUpdateMacieSession :: UpdateMacieSession
newUpdateMacieSession =
UpdateMacieSession' :: Maybe MacieStatus
-> Maybe FindingPublishingFrequency -> UpdateMacieSession
UpdateMacieSession'
{ $sel:status:UpdateMacieSession' :: Maybe MacieStatus
status = Maybe MacieStatus
forall a. Maybe a
Prelude.Nothing,
$sel:findingPublishingFrequency:UpdateMacieSession' :: Maybe FindingPublishingFrequency
findingPublishingFrequency = Maybe FindingPublishingFrequency
forall a. Maybe a
Prelude.Nothing
}
updateMacieSession_status :: Lens.Lens' UpdateMacieSession (Prelude.Maybe MacieStatus)
updateMacieSession_status :: (Maybe MacieStatus -> f (Maybe MacieStatus))
-> UpdateMacieSession -> f UpdateMacieSession
updateMacieSession_status = (UpdateMacieSession -> Maybe MacieStatus)
-> (UpdateMacieSession -> Maybe MacieStatus -> UpdateMacieSession)
-> Lens
UpdateMacieSession
UpdateMacieSession
(Maybe MacieStatus)
(Maybe MacieStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMacieSession' {Maybe MacieStatus
status :: Maybe MacieStatus
$sel:status:UpdateMacieSession' :: UpdateMacieSession -> Maybe MacieStatus
status} -> Maybe MacieStatus
status) (\s :: UpdateMacieSession
s@UpdateMacieSession' {} Maybe MacieStatus
a -> UpdateMacieSession
s {$sel:status:UpdateMacieSession' :: Maybe MacieStatus
status = Maybe MacieStatus
a} :: UpdateMacieSession)
updateMacieSession_findingPublishingFrequency :: Lens.Lens' UpdateMacieSession (Prelude.Maybe FindingPublishingFrequency)
updateMacieSession_findingPublishingFrequency :: (Maybe FindingPublishingFrequency
-> f (Maybe FindingPublishingFrequency))
-> UpdateMacieSession -> f UpdateMacieSession
updateMacieSession_findingPublishingFrequency = (UpdateMacieSession -> Maybe FindingPublishingFrequency)
-> (UpdateMacieSession
-> Maybe FindingPublishingFrequency -> UpdateMacieSession)
-> Lens
UpdateMacieSession
UpdateMacieSession
(Maybe FindingPublishingFrequency)
(Maybe FindingPublishingFrequency)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMacieSession' {Maybe FindingPublishingFrequency
findingPublishingFrequency :: Maybe FindingPublishingFrequency
$sel:findingPublishingFrequency:UpdateMacieSession' :: UpdateMacieSession -> Maybe FindingPublishingFrequency
findingPublishingFrequency} -> Maybe FindingPublishingFrequency
findingPublishingFrequency) (\s :: UpdateMacieSession
s@UpdateMacieSession' {} Maybe FindingPublishingFrequency
a -> UpdateMacieSession
s {$sel:findingPublishingFrequency:UpdateMacieSession' :: Maybe FindingPublishingFrequency
findingPublishingFrequency = Maybe FindingPublishingFrequency
a} :: UpdateMacieSession)
instance Core.AWSRequest UpdateMacieSession where
type
AWSResponse UpdateMacieSession =
UpdateMacieSessionResponse
request :: UpdateMacieSession -> Request UpdateMacieSession
request = Service -> UpdateMacieSession -> Request UpdateMacieSession
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.patchJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateMacieSession
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateMacieSession)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse UpdateMacieSession))
-> Logger
-> Service
-> Proxy UpdateMacieSession
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateMacieSession)))
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 -> UpdateMacieSessionResponse
UpdateMacieSessionResponse'
(Int -> UpdateMacieSessionResponse)
-> Either String Int -> Either String UpdateMacieSessionResponse
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 UpdateMacieSession
instance Prelude.NFData UpdateMacieSession
instance Core.ToHeaders UpdateMacieSession where
toHeaders :: UpdateMacieSession -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateMacieSession -> 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 UpdateMacieSession where
toJSON :: UpdateMacieSession -> Value
toJSON UpdateMacieSession' {Maybe FindingPublishingFrequency
Maybe MacieStatus
findingPublishingFrequency :: Maybe FindingPublishingFrequency
status :: Maybe MacieStatus
$sel:findingPublishingFrequency:UpdateMacieSession' :: UpdateMacieSession -> Maybe FindingPublishingFrequency
$sel:status:UpdateMacieSession' :: UpdateMacieSession -> Maybe MacieStatus
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"status" Text -> MacieStatus -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (MacieStatus -> Pair) -> Maybe MacieStatus -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MacieStatus
status,
(Text
"findingPublishingFrequency" Text -> FindingPublishingFrequency -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(FindingPublishingFrequency -> Pair)
-> Maybe FindingPublishingFrequency -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe FindingPublishingFrequency
findingPublishingFrequency
]
)
instance Core.ToPath UpdateMacieSession where
toPath :: UpdateMacieSession -> ByteString
toPath = ByteString -> UpdateMacieSession -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/macie"
instance Core.ToQuery UpdateMacieSession where
toQuery :: UpdateMacieSession -> QueryString
toQuery = QueryString -> UpdateMacieSession -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateMacieSessionResponse = UpdateMacieSessionResponse'
{
UpdateMacieSessionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateMacieSessionResponse -> UpdateMacieSessionResponse -> Bool
(UpdateMacieSessionResponse -> UpdateMacieSessionResponse -> Bool)
-> (UpdateMacieSessionResponse
-> UpdateMacieSessionResponse -> Bool)
-> Eq UpdateMacieSessionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateMacieSessionResponse -> UpdateMacieSessionResponse -> Bool
$c/= :: UpdateMacieSessionResponse -> UpdateMacieSessionResponse -> Bool
== :: UpdateMacieSessionResponse -> UpdateMacieSessionResponse -> Bool
$c== :: UpdateMacieSessionResponse -> UpdateMacieSessionResponse -> Bool
Prelude.Eq, ReadPrec [UpdateMacieSessionResponse]
ReadPrec UpdateMacieSessionResponse
Int -> ReadS UpdateMacieSessionResponse
ReadS [UpdateMacieSessionResponse]
(Int -> ReadS UpdateMacieSessionResponse)
-> ReadS [UpdateMacieSessionResponse]
-> ReadPrec UpdateMacieSessionResponse
-> ReadPrec [UpdateMacieSessionResponse]
-> Read UpdateMacieSessionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateMacieSessionResponse]
$creadListPrec :: ReadPrec [UpdateMacieSessionResponse]
readPrec :: ReadPrec UpdateMacieSessionResponse
$creadPrec :: ReadPrec UpdateMacieSessionResponse
readList :: ReadS [UpdateMacieSessionResponse]
$creadList :: ReadS [UpdateMacieSessionResponse]
readsPrec :: Int -> ReadS UpdateMacieSessionResponse
$creadsPrec :: Int -> ReadS UpdateMacieSessionResponse
Prelude.Read, Int -> UpdateMacieSessionResponse -> ShowS
[UpdateMacieSessionResponse] -> ShowS
UpdateMacieSessionResponse -> String
(Int -> UpdateMacieSessionResponse -> ShowS)
-> (UpdateMacieSessionResponse -> String)
-> ([UpdateMacieSessionResponse] -> ShowS)
-> Show UpdateMacieSessionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateMacieSessionResponse] -> ShowS
$cshowList :: [UpdateMacieSessionResponse] -> ShowS
show :: UpdateMacieSessionResponse -> String
$cshow :: UpdateMacieSessionResponse -> String
showsPrec :: Int -> UpdateMacieSessionResponse -> ShowS
$cshowsPrec :: Int -> UpdateMacieSessionResponse -> ShowS
Prelude.Show, (forall x.
UpdateMacieSessionResponse -> Rep UpdateMacieSessionResponse x)
-> (forall x.
Rep UpdateMacieSessionResponse x -> UpdateMacieSessionResponse)
-> Generic UpdateMacieSessionResponse
forall x.
Rep UpdateMacieSessionResponse x -> UpdateMacieSessionResponse
forall x.
UpdateMacieSessionResponse -> Rep UpdateMacieSessionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateMacieSessionResponse x -> UpdateMacieSessionResponse
$cfrom :: forall x.
UpdateMacieSessionResponse -> Rep UpdateMacieSessionResponse x
Prelude.Generic)
newUpdateMacieSessionResponse ::
Prelude.Int ->
UpdateMacieSessionResponse
newUpdateMacieSessionResponse :: Int -> UpdateMacieSessionResponse
newUpdateMacieSessionResponse Int
pHttpStatus_ =
UpdateMacieSessionResponse' :: Int -> UpdateMacieSessionResponse
UpdateMacieSessionResponse'
{ $sel:httpStatus:UpdateMacieSessionResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
updateMacieSessionResponse_httpStatus :: Lens.Lens' UpdateMacieSessionResponse Prelude.Int
updateMacieSessionResponse_httpStatus :: (Int -> f Int)
-> UpdateMacieSessionResponse -> f UpdateMacieSessionResponse
updateMacieSessionResponse_httpStatus = (UpdateMacieSessionResponse -> Int)
-> (UpdateMacieSessionResponse
-> Int -> UpdateMacieSessionResponse)
-> Lens
UpdateMacieSessionResponse UpdateMacieSessionResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMacieSessionResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateMacieSessionResponse' :: UpdateMacieSessionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateMacieSessionResponse
s@UpdateMacieSessionResponse' {} Int
a -> UpdateMacieSessionResponse
s {$sel:httpStatus:UpdateMacieSessionResponse' :: Int
httpStatus = Int
a} :: UpdateMacieSessionResponse)
instance Prelude.NFData UpdateMacieSessionResponse