{-# 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.SSMIncidents.DeleteTimelineEvent
(
DeleteTimelineEvent (..),
newDeleteTimelineEvent,
deleteTimelineEvent_eventId,
deleteTimelineEvent_incidentRecordArn,
DeleteTimelineEventResponse (..),
newDeleteTimelineEventResponse,
deleteTimelineEventResponse_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.SSMIncidents.Types
data DeleteTimelineEvent = DeleteTimelineEvent'
{
DeleteTimelineEvent -> Text
eventId :: Prelude.Text,
DeleteTimelineEvent -> Text
incidentRecordArn :: Prelude.Text
}
deriving (DeleteTimelineEvent -> DeleteTimelineEvent -> Bool
(DeleteTimelineEvent -> DeleteTimelineEvent -> Bool)
-> (DeleteTimelineEvent -> DeleteTimelineEvent -> Bool)
-> Eq DeleteTimelineEvent
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteTimelineEvent -> DeleteTimelineEvent -> Bool
$c/= :: DeleteTimelineEvent -> DeleteTimelineEvent -> Bool
== :: DeleteTimelineEvent -> DeleteTimelineEvent -> Bool
$c== :: DeleteTimelineEvent -> DeleteTimelineEvent -> Bool
Prelude.Eq, ReadPrec [DeleteTimelineEvent]
ReadPrec DeleteTimelineEvent
Int -> ReadS DeleteTimelineEvent
ReadS [DeleteTimelineEvent]
(Int -> ReadS DeleteTimelineEvent)
-> ReadS [DeleteTimelineEvent]
-> ReadPrec DeleteTimelineEvent
-> ReadPrec [DeleteTimelineEvent]
-> Read DeleteTimelineEvent
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteTimelineEvent]
$creadListPrec :: ReadPrec [DeleteTimelineEvent]
readPrec :: ReadPrec DeleteTimelineEvent
$creadPrec :: ReadPrec DeleteTimelineEvent
readList :: ReadS [DeleteTimelineEvent]
$creadList :: ReadS [DeleteTimelineEvent]
readsPrec :: Int -> ReadS DeleteTimelineEvent
$creadsPrec :: Int -> ReadS DeleteTimelineEvent
Prelude.Read, Int -> DeleteTimelineEvent -> ShowS
[DeleteTimelineEvent] -> ShowS
DeleteTimelineEvent -> String
(Int -> DeleteTimelineEvent -> ShowS)
-> (DeleteTimelineEvent -> String)
-> ([DeleteTimelineEvent] -> ShowS)
-> Show DeleteTimelineEvent
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteTimelineEvent] -> ShowS
$cshowList :: [DeleteTimelineEvent] -> ShowS
show :: DeleteTimelineEvent -> String
$cshow :: DeleteTimelineEvent -> String
showsPrec :: Int -> DeleteTimelineEvent -> ShowS
$cshowsPrec :: Int -> DeleteTimelineEvent -> ShowS
Prelude.Show, (forall x. DeleteTimelineEvent -> Rep DeleteTimelineEvent x)
-> (forall x. Rep DeleteTimelineEvent x -> DeleteTimelineEvent)
-> Generic DeleteTimelineEvent
forall x. Rep DeleteTimelineEvent x -> DeleteTimelineEvent
forall x. DeleteTimelineEvent -> Rep DeleteTimelineEvent x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteTimelineEvent x -> DeleteTimelineEvent
$cfrom :: forall x. DeleteTimelineEvent -> Rep DeleteTimelineEvent x
Prelude.Generic)
newDeleteTimelineEvent ::
Prelude.Text ->
Prelude.Text ->
DeleteTimelineEvent
newDeleteTimelineEvent :: Text -> Text -> DeleteTimelineEvent
newDeleteTimelineEvent Text
pEventId_ Text
pIncidentRecordArn_ =
DeleteTimelineEvent' :: Text -> Text -> DeleteTimelineEvent
DeleteTimelineEvent'
{ $sel:eventId:DeleteTimelineEvent' :: Text
eventId = Text
pEventId_,
$sel:incidentRecordArn:DeleteTimelineEvent' :: Text
incidentRecordArn = Text
pIncidentRecordArn_
}
deleteTimelineEvent_eventId :: Lens.Lens' DeleteTimelineEvent Prelude.Text
deleteTimelineEvent_eventId :: (Text -> f Text) -> DeleteTimelineEvent -> f DeleteTimelineEvent
deleteTimelineEvent_eventId = (DeleteTimelineEvent -> Text)
-> (DeleteTimelineEvent -> Text -> DeleteTimelineEvent)
-> Lens DeleteTimelineEvent DeleteTimelineEvent Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteTimelineEvent' {Text
eventId :: Text
$sel:eventId:DeleteTimelineEvent' :: DeleteTimelineEvent -> Text
eventId} -> Text
eventId) (\s :: DeleteTimelineEvent
s@DeleteTimelineEvent' {} Text
a -> DeleteTimelineEvent
s {$sel:eventId:DeleteTimelineEvent' :: Text
eventId = Text
a} :: DeleteTimelineEvent)
deleteTimelineEvent_incidentRecordArn :: Lens.Lens' DeleteTimelineEvent Prelude.Text
deleteTimelineEvent_incidentRecordArn :: (Text -> f Text) -> DeleteTimelineEvent -> f DeleteTimelineEvent
deleteTimelineEvent_incidentRecordArn = (DeleteTimelineEvent -> Text)
-> (DeleteTimelineEvent -> Text -> DeleteTimelineEvent)
-> Lens DeleteTimelineEvent DeleteTimelineEvent Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteTimelineEvent' {Text
incidentRecordArn :: Text
$sel:incidentRecordArn:DeleteTimelineEvent' :: DeleteTimelineEvent -> Text
incidentRecordArn} -> Text
incidentRecordArn) (\s :: DeleteTimelineEvent
s@DeleteTimelineEvent' {} Text
a -> DeleteTimelineEvent
s {$sel:incidentRecordArn:DeleteTimelineEvent' :: Text
incidentRecordArn = Text
a} :: DeleteTimelineEvent)
instance Core.AWSRequest DeleteTimelineEvent where
type
AWSResponse DeleteTimelineEvent =
DeleteTimelineEventResponse
request :: DeleteTimelineEvent -> Request DeleteTimelineEvent
request = Service -> DeleteTimelineEvent -> Request DeleteTimelineEvent
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteTimelineEvent
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteTimelineEvent)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeleteTimelineEvent))
-> Logger
-> Service
-> Proxy DeleteTimelineEvent
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteTimelineEvent)))
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 -> DeleteTimelineEventResponse
DeleteTimelineEventResponse'
(Int -> DeleteTimelineEventResponse)
-> Either String Int -> Either String DeleteTimelineEventResponse
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 DeleteTimelineEvent
instance Prelude.NFData DeleteTimelineEvent
instance Core.ToHeaders DeleteTimelineEvent where
toHeaders :: DeleteTimelineEvent -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteTimelineEvent -> 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 DeleteTimelineEvent where
toJSON :: DeleteTimelineEvent -> Value
toJSON DeleteTimelineEvent' {Text
incidentRecordArn :: Text
eventId :: Text
$sel:incidentRecordArn:DeleteTimelineEvent' :: DeleteTimelineEvent -> Text
$sel:eventId:DeleteTimelineEvent' :: DeleteTimelineEvent -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"eventId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
eventId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"incidentRecordArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
incidentRecordArn)
]
)
instance Core.ToPath DeleteTimelineEvent where
toPath :: DeleteTimelineEvent -> ByteString
toPath = ByteString -> DeleteTimelineEvent -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/deleteTimelineEvent"
instance Core.ToQuery DeleteTimelineEvent where
toQuery :: DeleteTimelineEvent -> QueryString
toQuery = QueryString -> DeleteTimelineEvent -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteTimelineEventResponse = DeleteTimelineEventResponse'
{
DeleteTimelineEventResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteTimelineEventResponse -> DeleteTimelineEventResponse -> Bool
(DeleteTimelineEventResponse
-> DeleteTimelineEventResponse -> Bool)
-> (DeleteTimelineEventResponse
-> DeleteTimelineEventResponse -> Bool)
-> Eq DeleteTimelineEventResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteTimelineEventResponse -> DeleteTimelineEventResponse -> Bool
$c/= :: DeleteTimelineEventResponse -> DeleteTimelineEventResponse -> Bool
== :: DeleteTimelineEventResponse -> DeleteTimelineEventResponse -> Bool
$c== :: DeleteTimelineEventResponse -> DeleteTimelineEventResponse -> Bool
Prelude.Eq, ReadPrec [DeleteTimelineEventResponse]
ReadPrec DeleteTimelineEventResponse
Int -> ReadS DeleteTimelineEventResponse
ReadS [DeleteTimelineEventResponse]
(Int -> ReadS DeleteTimelineEventResponse)
-> ReadS [DeleteTimelineEventResponse]
-> ReadPrec DeleteTimelineEventResponse
-> ReadPrec [DeleteTimelineEventResponse]
-> Read DeleteTimelineEventResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteTimelineEventResponse]
$creadListPrec :: ReadPrec [DeleteTimelineEventResponse]
readPrec :: ReadPrec DeleteTimelineEventResponse
$creadPrec :: ReadPrec DeleteTimelineEventResponse
readList :: ReadS [DeleteTimelineEventResponse]
$creadList :: ReadS [DeleteTimelineEventResponse]
readsPrec :: Int -> ReadS DeleteTimelineEventResponse
$creadsPrec :: Int -> ReadS DeleteTimelineEventResponse
Prelude.Read, Int -> DeleteTimelineEventResponse -> ShowS
[DeleteTimelineEventResponse] -> ShowS
DeleteTimelineEventResponse -> String
(Int -> DeleteTimelineEventResponse -> ShowS)
-> (DeleteTimelineEventResponse -> String)
-> ([DeleteTimelineEventResponse] -> ShowS)
-> Show DeleteTimelineEventResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteTimelineEventResponse] -> ShowS
$cshowList :: [DeleteTimelineEventResponse] -> ShowS
show :: DeleteTimelineEventResponse -> String
$cshow :: DeleteTimelineEventResponse -> String
showsPrec :: Int -> DeleteTimelineEventResponse -> ShowS
$cshowsPrec :: Int -> DeleteTimelineEventResponse -> ShowS
Prelude.Show, (forall x.
DeleteTimelineEventResponse -> Rep DeleteTimelineEventResponse x)
-> (forall x.
Rep DeleteTimelineEventResponse x -> DeleteTimelineEventResponse)
-> Generic DeleteTimelineEventResponse
forall x.
Rep DeleteTimelineEventResponse x -> DeleteTimelineEventResponse
forall x.
DeleteTimelineEventResponse -> Rep DeleteTimelineEventResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteTimelineEventResponse x -> DeleteTimelineEventResponse
$cfrom :: forall x.
DeleteTimelineEventResponse -> Rep DeleteTimelineEventResponse x
Prelude.Generic)
newDeleteTimelineEventResponse ::
Prelude.Int ->
DeleteTimelineEventResponse
newDeleteTimelineEventResponse :: Int -> DeleteTimelineEventResponse
newDeleteTimelineEventResponse Int
pHttpStatus_ =
DeleteTimelineEventResponse' :: Int -> DeleteTimelineEventResponse
DeleteTimelineEventResponse'
{ $sel:httpStatus:DeleteTimelineEventResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
deleteTimelineEventResponse_httpStatus :: Lens.Lens' DeleteTimelineEventResponse Prelude.Int
deleteTimelineEventResponse_httpStatus :: (Int -> f Int)
-> DeleteTimelineEventResponse -> f DeleteTimelineEventResponse
deleteTimelineEventResponse_httpStatus = (DeleteTimelineEventResponse -> Int)
-> (DeleteTimelineEventResponse
-> Int -> DeleteTimelineEventResponse)
-> Lens
DeleteTimelineEventResponse DeleteTimelineEventResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteTimelineEventResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteTimelineEventResponse' :: DeleteTimelineEventResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteTimelineEventResponse
s@DeleteTimelineEventResponse' {} Int
a -> DeleteTimelineEventResponse
s {$sel:httpStatus:DeleteTimelineEventResponse' :: Int
httpStatus = Int
a} :: DeleteTimelineEventResponse)
instance Prelude.NFData DeleteTimelineEventResponse