{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.SSMIncidents.CreateTimelineEvent
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates a custom timeline event on the incident details page of an
-- incident record. Timeline events are automatically created by Incident
-- Manager, marking key moment during an incident. You can create custom
-- timeline events to mark important events that are automatically detected
-- by Incident Manager.
module Amazonka.SSMIncidents.CreateTimelineEvent
  ( -- * Creating a Request
    CreateTimelineEvent (..),
    newCreateTimelineEvent,

    -- * Request Lenses
    createTimelineEvent_clientToken,
    createTimelineEvent_eventData,
    createTimelineEvent_eventTime,
    createTimelineEvent_eventType,
    createTimelineEvent_incidentRecordArn,

    -- * Destructuring the Response
    CreateTimelineEventResponse (..),
    newCreateTimelineEventResponse,

    -- * Response Lenses
    createTimelineEventResponse_httpStatus,
    createTimelineEventResponse_eventId,
    createTimelineEventResponse_incidentRecordArn,
  )
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

-- | /See:/ 'newCreateTimelineEvent' smart constructor.
data CreateTimelineEvent = CreateTimelineEvent'
  { -- | A token ensuring that the action is called only once with the specified
    -- details.
    CreateTimelineEvent -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | A valid JSON string. There is no other schema imposed. A short
    -- description of the event.
    CreateTimelineEvent -> Text
eventData :: Prelude.Text,
    -- | The time that the event occurred.
    CreateTimelineEvent -> POSIX
eventTime :: Core.POSIX,
    -- | The type of the event. You can create timeline events of type
    -- @Custom Event@.
    CreateTimelineEvent -> Text
eventType :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the incident record you are adding the
    -- event to.
    CreateTimelineEvent -> Text
incidentRecordArn :: Prelude.Text
  }
  deriving (CreateTimelineEvent -> CreateTimelineEvent -> Bool
(CreateTimelineEvent -> CreateTimelineEvent -> Bool)
-> (CreateTimelineEvent -> CreateTimelineEvent -> Bool)
-> Eq CreateTimelineEvent
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateTimelineEvent -> CreateTimelineEvent -> Bool
$c/= :: CreateTimelineEvent -> CreateTimelineEvent -> Bool
== :: CreateTimelineEvent -> CreateTimelineEvent -> Bool
$c== :: CreateTimelineEvent -> CreateTimelineEvent -> Bool
Prelude.Eq, ReadPrec [CreateTimelineEvent]
ReadPrec CreateTimelineEvent
Int -> ReadS CreateTimelineEvent
ReadS [CreateTimelineEvent]
(Int -> ReadS CreateTimelineEvent)
-> ReadS [CreateTimelineEvent]
-> ReadPrec CreateTimelineEvent
-> ReadPrec [CreateTimelineEvent]
-> Read CreateTimelineEvent
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateTimelineEvent]
$creadListPrec :: ReadPrec [CreateTimelineEvent]
readPrec :: ReadPrec CreateTimelineEvent
$creadPrec :: ReadPrec CreateTimelineEvent
readList :: ReadS [CreateTimelineEvent]
$creadList :: ReadS [CreateTimelineEvent]
readsPrec :: Int -> ReadS CreateTimelineEvent
$creadsPrec :: Int -> ReadS CreateTimelineEvent
Prelude.Read, Int -> CreateTimelineEvent -> ShowS
[CreateTimelineEvent] -> ShowS
CreateTimelineEvent -> String
(Int -> CreateTimelineEvent -> ShowS)
-> (CreateTimelineEvent -> String)
-> ([CreateTimelineEvent] -> ShowS)
-> Show CreateTimelineEvent
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateTimelineEvent] -> ShowS
$cshowList :: [CreateTimelineEvent] -> ShowS
show :: CreateTimelineEvent -> String
$cshow :: CreateTimelineEvent -> String
showsPrec :: Int -> CreateTimelineEvent -> ShowS
$cshowsPrec :: Int -> CreateTimelineEvent -> ShowS
Prelude.Show, (forall x. CreateTimelineEvent -> Rep CreateTimelineEvent x)
-> (forall x. Rep CreateTimelineEvent x -> CreateTimelineEvent)
-> Generic CreateTimelineEvent
forall x. Rep CreateTimelineEvent x -> CreateTimelineEvent
forall x. CreateTimelineEvent -> Rep CreateTimelineEvent x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateTimelineEvent x -> CreateTimelineEvent
$cfrom :: forall x. CreateTimelineEvent -> Rep CreateTimelineEvent x
Prelude.Generic)

-- |
-- Create a value of 'CreateTimelineEvent' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'clientToken', 'createTimelineEvent_clientToken' - A token ensuring that the action is called only once with the specified
-- details.
--
-- 'eventData', 'createTimelineEvent_eventData' - A valid JSON string. There is no other schema imposed. A short
-- description of the event.
--
-- 'eventTime', 'createTimelineEvent_eventTime' - The time that the event occurred.
--
-- 'eventType', 'createTimelineEvent_eventType' - The type of the event. You can create timeline events of type
-- @Custom Event@.
--
-- 'incidentRecordArn', 'createTimelineEvent_incidentRecordArn' - The Amazon Resource Name (ARN) of the incident record you are adding the
-- event to.
newCreateTimelineEvent ::
  -- | 'eventData'
  Prelude.Text ->
  -- | 'eventTime'
  Prelude.UTCTime ->
  -- | 'eventType'
  Prelude.Text ->
  -- | 'incidentRecordArn'
  Prelude.Text ->
  CreateTimelineEvent
newCreateTimelineEvent :: Text -> UTCTime -> Text -> Text -> CreateTimelineEvent
newCreateTimelineEvent
  Text
pEventData_
  UTCTime
pEventTime_
  Text
pEventType_
  Text
pIncidentRecordArn_ =
    CreateTimelineEvent' :: Maybe Text -> Text -> POSIX -> Text -> Text -> CreateTimelineEvent
CreateTimelineEvent'
      { $sel:clientToken:CreateTimelineEvent' :: Maybe Text
clientToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:eventData:CreateTimelineEvent' :: Text
eventData = Text
pEventData_,
        $sel:eventTime:CreateTimelineEvent' :: POSIX
eventTime = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
 -> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pEventTime_,
        $sel:eventType:CreateTimelineEvent' :: Text
eventType = Text
pEventType_,
        $sel:incidentRecordArn:CreateTimelineEvent' :: Text
incidentRecordArn = Text
pIncidentRecordArn_
      }

-- | A token ensuring that the action is called only once with the specified
-- details.
createTimelineEvent_clientToken :: Lens.Lens' CreateTimelineEvent (Prelude.Maybe Prelude.Text)
createTimelineEvent_clientToken :: (Maybe Text -> f (Maybe Text))
-> CreateTimelineEvent -> f CreateTimelineEvent
createTimelineEvent_clientToken = (CreateTimelineEvent -> Maybe Text)
-> (CreateTimelineEvent -> Maybe Text -> CreateTimelineEvent)
-> Lens
     CreateTimelineEvent CreateTimelineEvent (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTimelineEvent' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:CreateTimelineEvent' :: CreateTimelineEvent -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: CreateTimelineEvent
s@CreateTimelineEvent' {} Maybe Text
a -> CreateTimelineEvent
s {$sel:clientToken:CreateTimelineEvent' :: Maybe Text
clientToken = Maybe Text
a} :: CreateTimelineEvent)

-- | A valid JSON string. There is no other schema imposed. A short
-- description of the event.
createTimelineEvent_eventData :: Lens.Lens' CreateTimelineEvent Prelude.Text
createTimelineEvent_eventData :: (Text -> f Text) -> CreateTimelineEvent -> f CreateTimelineEvent
createTimelineEvent_eventData = (CreateTimelineEvent -> Text)
-> (CreateTimelineEvent -> Text -> CreateTimelineEvent)
-> Lens CreateTimelineEvent CreateTimelineEvent Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTimelineEvent' {Text
eventData :: Text
$sel:eventData:CreateTimelineEvent' :: CreateTimelineEvent -> Text
eventData} -> Text
eventData) (\s :: CreateTimelineEvent
s@CreateTimelineEvent' {} Text
a -> CreateTimelineEvent
s {$sel:eventData:CreateTimelineEvent' :: Text
eventData = Text
a} :: CreateTimelineEvent)

-- | The time that the event occurred.
createTimelineEvent_eventTime :: Lens.Lens' CreateTimelineEvent Prelude.UTCTime
createTimelineEvent_eventTime :: (UTCTime -> f UTCTime)
-> CreateTimelineEvent -> f CreateTimelineEvent
createTimelineEvent_eventTime = (CreateTimelineEvent -> POSIX)
-> (CreateTimelineEvent -> POSIX -> CreateTimelineEvent)
-> Lens CreateTimelineEvent CreateTimelineEvent POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTimelineEvent' {POSIX
eventTime :: POSIX
$sel:eventTime:CreateTimelineEvent' :: CreateTimelineEvent -> POSIX
eventTime} -> POSIX
eventTime) (\s :: CreateTimelineEvent
s@CreateTimelineEvent' {} POSIX
a -> CreateTimelineEvent
s {$sel:eventTime:CreateTimelineEvent' :: POSIX
eventTime = POSIX
a} :: CreateTimelineEvent) ((POSIX -> f POSIX)
 -> CreateTimelineEvent -> f CreateTimelineEvent)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> CreateTimelineEvent
-> f CreateTimelineEvent
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The type of the event. You can create timeline events of type
-- @Custom Event@.
createTimelineEvent_eventType :: Lens.Lens' CreateTimelineEvent Prelude.Text
createTimelineEvent_eventType :: (Text -> f Text) -> CreateTimelineEvent -> f CreateTimelineEvent
createTimelineEvent_eventType = (CreateTimelineEvent -> Text)
-> (CreateTimelineEvent -> Text -> CreateTimelineEvent)
-> Lens CreateTimelineEvent CreateTimelineEvent Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTimelineEvent' {Text
eventType :: Text
$sel:eventType:CreateTimelineEvent' :: CreateTimelineEvent -> Text
eventType} -> Text
eventType) (\s :: CreateTimelineEvent
s@CreateTimelineEvent' {} Text
a -> CreateTimelineEvent
s {$sel:eventType:CreateTimelineEvent' :: Text
eventType = Text
a} :: CreateTimelineEvent)

-- | The Amazon Resource Name (ARN) of the incident record you are adding the
-- event to.
createTimelineEvent_incidentRecordArn :: Lens.Lens' CreateTimelineEvent Prelude.Text
createTimelineEvent_incidentRecordArn :: (Text -> f Text) -> CreateTimelineEvent -> f CreateTimelineEvent
createTimelineEvent_incidentRecordArn = (CreateTimelineEvent -> Text)
-> (CreateTimelineEvent -> Text -> CreateTimelineEvent)
-> Lens CreateTimelineEvent CreateTimelineEvent Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTimelineEvent' {Text
incidentRecordArn :: Text
$sel:incidentRecordArn:CreateTimelineEvent' :: CreateTimelineEvent -> Text
incidentRecordArn} -> Text
incidentRecordArn) (\s :: CreateTimelineEvent
s@CreateTimelineEvent' {} Text
a -> CreateTimelineEvent
s {$sel:incidentRecordArn:CreateTimelineEvent' :: Text
incidentRecordArn = Text
a} :: CreateTimelineEvent)

instance Core.AWSRequest CreateTimelineEvent where
  type
    AWSResponse CreateTimelineEvent =
      CreateTimelineEventResponse
  request :: CreateTimelineEvent -> Request CreateTimelineEvent
request = Service -> CreateTimelineEvent -> Request CreateTimelineEvent
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateTimelineEvent
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateTimelineEvent)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateTimelineEvent))
-> Logger
-> Service
-> Proxy CreateTimelineEvent
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateTimelineEvent)))
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 ->
          Int -> Text -> Text -> CreateTimelineEventResponse
CreateTimelineEventResponse'
            (Int -> Text -> Text -> CreateTimelineEventResponse)
-> Either String Int
-> Either String (Text -> Text -> CreateTimelineEventResponse)
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))
            Either String (Text -> Text -> CreateTimelineEventResponse)
-> Either String Text
-> Either String (Text -> CreateTimelineEventResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"eventId")
            Either String (Text -> CreateTimelineEventResponse)
-> Either String Text -> Either String CreateTimelineEventResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"incidentRecordArn")
      )

instance Prelude.Hashable CreateTimelineEvent

instance Prelude.NFData CreateTimelineEvent

instance Core.ToHeaders CreateTimelineEvent where
  toHeaders :: CreateTimelineEvent -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateTimelineEvent -> 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 CreateTimelineEvent where
  toJSON :: CreateTimelineEvent -> Value
toJSON CreateTimelineEvent' {Maybe Text
Text
POSIX
incidentRecordArn :: Text
eventType :: Text
eventTime :: POSIX
eventData :: Text
clientToken :: Maybe Text
$sel:incidentRecordArn:CreateTimelineEvent' :: CreateTimelineEvent -> Text
$sel:eventType:CreateTimelineEvent' :: CreateTimelineEvent -> Text
$sel:eventTime:CreateTimelineEvent' :: CreateTimelineEvent -> POSIX
$sel:eventData:CreateTimelineEvent' :: CreateTimelineEvent -> Text
$sel:clientToken:CreateTimelineEvent' :: CreateTimelineEvent -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"clientToken" 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
clientToken,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"eventData" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
eventData),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"eventTime" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= POSIX
eventTime),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"eventType" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
eventType),
            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 CreateTimelineEvent where
  toPath :: CreateTimelineEvent -> ByteString
toPath = ByteString -> CreateTimelineEvent -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/createTimelineEvent"

instance Core.ToQuery CreateTimelineEvent where
  toQuery :: CreateTimelineEvent -> QueryString
toQuery = QueryString -> CreateTimelineEvent -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newCreateTimelineEventResponse' smart constructor.
data CreateTimelineEventResponse = CreateTimelineEventResponse'
  { -- | The response's http status code.
    CreateTimelineEventResponse -> Int
httpStatus :: Prelude.Int,
    -- | The ID of the event for easy reference later.
    CreateTimelineEventResponse -> Text
eventId :: Prelude.Text,
    -- | The ARN of the incident record that you added the event to.
    CreateTimelineEventResponse -> Text
incidentRecordArn :: Prelude.Text
  }
  deriving (CreateTimelineEventResponse -> CreateTimelineEventResponse -> Bool
(CreateTimelineEventResponse
 -> CreateTimelineEventResponse -> Bool)
-> (CreateTimelineEventResponse
    -> CreateTimelineEventResponse -> Bool)
-> Eq CreateTimelineEventResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateTimelineEventResponse -> CreateTimelineEventResponse -> Bool
$c/= :: CreateTimelineEventResponse -> CreateTimelineEventResponse -> Bool
== :: CreateTimelineEventResponse -> CreateTimelineEventResponse -> Bool
$c== :: CreateTimelineEventResponse -> CreateTimelineEventResponse -> Bool
Prelude.Eq, ReadPrec [CreateTimelineEventResponse]
ReadPrec CreateTimelineEventResponse
Int -> ReadS CreateTimelineEventResponse
ReadS [CreateTimelineEventResponse]
(Int -> ReadS CreateTimelineEventResponse)
-> ReadS [CreateTimelineEventResponse]
-> ReadPrec CreateTimelineEventResponse
-> ReadPrec [CreateTimelineEventResponse]
-> Read CreateTimelineEventResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateTimelineEventResponse]
$creadListPrec :: ReadPrec [CreateTimelineEventResponse]
readPrec :: ReadPrec CreateTimelineEventResponse
$creadPrec :: ReadPrec CreateTimelineEventResponse
readList :: ReadS [CreateTimelineEventResponse]
$creadList :: ReadS [CreateTimelineEventResponse]
readsPrec :: Int -> ReadS CreateTimelineEventResponse
$creadsPrec :: Int -> ReadS CreateTimelineEventResponse
Prelude.Read, Int -> CreateTimelineEventResponse -> ShowS
[CreateTimelineEventResponse] -> ShowS
CreateTimelineEventResponse -> String
(Int -> CreateTimelineEventResponse -> ShowS)
-> (CreateTimelineEventResponse -> String)
-> ([CreateTimelineEventResponse] -> ShowS)
-> Show CreateTimelineEventResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateTimelineEventResponse] -> ShowS
$cshowList :: [CreateTimelineEventResponse] -> ShowS
show :: CreateTimelineEventResponse -> String
$cshow :: CreateTimelineEventResponse -> String
showsPrec :: Int -> CreateTimelineEventResponse -> ShowS
$cshowsPrec :: Int -> CreateTimelineEventResponse -> ShowS
Prelude.Show, (forall x.
 CreateTimelineEventResponse -> Rep CreateTimelineEventResponse x)
-> (forall x.
    Rep CreateTimelineEventResponse x -> CreateTimelineEventResponse)
-> Generic CreateTimelineEventResponse
forall x.
Rep CreateTimelineEventResponse x -> CreateTimelineEventResponse
forall x.
CreateTimelineEventResponse -> Rep CreateTimelineEventResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateTimelineEventResponse x -> CreateTimelineEventResponse
$cfrom :: forall x.
CreateTimelineEventResponse -> Rep CreateTimelineEventResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateTimelineEventResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'httpStatus', 'createTimelineEventResponse_httpStatus' - The response's http status code.
--
-- 'eventId', 'createTimelineEventResponse_eventId' - The ID of the event for easy reference later.
--
-- 'incidentRecordArn', 'createTimelineEventResponse_incidentRecordArn' - The ARN of the incident record that you added the event to.
newCreateTimelineEventResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'eventId'
  Prelude.Text ->
  -- | 'incidentRecordArn'
  Prelude.Text ->
  CreateTimelineEventResponse
newCreateTimelineEventResponse :: Int -> Text -> Text -> CreateTimelineEventResponse
newCreateTimelineEventResponse
  Int
pHttpStatus_
  Text
pEventId_
  Text
pIncidentRecordArn_ =
    CreateTimelineEventResponse' :: Int -> Text -> Text -> CreateTimelineEventResponse
CreateTimelineEventResponse'
      { $sel:httpStatus:CreateTimelineEventResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:eventId:CreateTimelineEventResponse' :: Text
eventId = Text
pEventId_,
        $sel:incidentRecordArn:CreateTimelineEventResponse' :: Text
incidentRecordArn = Text
pIncidentRecordArn_
      }

-- | The response's http status code.
createTimelineEventResponse_httpStatus :: Lens.Lens' CreateTimelineEventResponse Prelude.Int
createTimelineEventResponse_httpStatus :: (Int -> f Int)
-> CreateTimelineEventResponse -> f CreateTimelineEventResponse
createTimelineEventResponse_httpStatus = (CreateTimelineEventResponse -> Int)
-> (CreateTimelineEventResponse
    -> Int -> CreateTimelineEventResponse)
-> Lens
     CreateTimelineEventResponse CreateTimelineEventResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTimelineEventResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateTimelineEventResponse' :: CreateTimelineEventResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateTimelineEventResponse
s@CreateTimelineEventResponse' {} Int
a -> CreateTimelineEventResponse
s {$sel:httpStatus:CreateTimelineEventResponse' :: Int
httpStatus = Int
a} :: CreateTimelineEventResponse)

-- | The ID of the event for easy reference later.
createTimelineEventResponse_eventId :: Lens.Lens' CreateTimelineEventResponse Prelude.Text
createTimelineEventResponse_eventId :: (Text -> f Text)
-> CreateTimelineEventResponse -> f CreateTimelineEventResponse
createTimelineEventResponse_eventId = (CreateTimelineEventResponse -> Text)
-> (CreateTimelineEventResponse
    -> Text -> CreateTimelineEventResponse)
-> Lens
     CreateTimelineEventResponse CreateTimelineEventResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTimelineEventResponse' {Text
eventId :: Text
$sel:eventId:CreateTimelineEventResponse' :: CreateTimelineEventResponse -> Text
eventId} -> Text
eventId) (\s :: CreateTimelineEventResponse
s@CreateTimelineEventResponse' {} Text
a -> CreateTimelineEventResponse
s {$sel:eventId:CreateTimelineEventResponse' :: Text
eventId = Text
a} :: CreateTimelineEventResponse)

-- | The ARN of the incident record that you added the event to.
createTimelineEventResponse_incidentRecordArn :: Lens.Lens' CreateTimelineEventResponse Prelude.Text
createTimelineEventResponse_incidentRecordArn :: (Text -> f Text)
-> CreateTimelineEventResponse -> f CreateTimelineEventResponse
createTimelineEventResponse_incidentRecordArn = (CreateTimelineEventResponse -> Text)
-> (CreateTimelineEventResponse
    -> Text -> CreateTimelineEventResponse)
-> Lens
     CreateTimelineEventResponse CreateTimelineEventResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTimelineEventResponse' {Text
incidentRecordArn :: Text
$sel:incidentRecordArn:CreateTimelineEventResponse' :: CreateTimelineEventResponse -> Text
incidentRecordArn} -> Text
incidentRecordArn) (\s :: CreateTimelineEventResponse
s@CreateTimelineEventResponse' {} Text
a -> CreateTimelineEventResponse
s {$sel:incidentRecordArn:CreateTimelineEventResponse' :: Text
incidentRecordArn = Text
a} :: CreateTimelineEventResponse)

instance Prelude.NFData CreateTimelineEventResponse