{-# 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.SSMContacts.DescribeEngagement
-- 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)
--
-- Incident Manager uses engagements to engage contacts and escalation
-- plans during an incident. Use this command to describe the engagement
-- that occurred during an incident.
module Amazonka.SSMContacts.DescribeEngagement
  ( -- * Creating a Request
    DescribeEngagement (..),
    newDescribeEngagement,

    -- * Request Lenses
    describeEngagement_engagementId,

    -- * Destructuring the Response
    DescribeEngagementResponse (..),
    newDescribeEngagementResponse,

    -- * Response Lenses
    describeEngagementResponse_publicSubject,
    describeEngagementResponse_startTime,
    describeEngagementResponse_publicContent,
    describeEngagementResponse_stopTime,
    describeEngagementResponse_incidentId,
    describeEngagementResponse_httpStatus,
    describeEngagementResponse_contactArn,
    describeEngagementResponse_engagementArn,
    describeEngagementResponse_sender,
    describeEngagementResponse_subject,
    describeEngagementResponse_content,
  )
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.SSMContacts.Types

-- | /See:/ 'newDescribeEngagement' smart constructor.
data DescribeEngagement = DescribeEngagement'
  { -- | The Amazon Resource Name (ARN) of the engagement you want the details
    -- of.
    DescribeEngagement -> Text
engagementId :: Prelude.Text
  }
  deriving (DescribeEngagement -> DescribeEngagement -> Bool
(DescribeEngagement -> DescribeEngagement -> Bool)
-> (DescribeEngagement -> DescribeEngagement -> Bool)
-> Eq DescribeEngagement
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeEngagement -> DescribeEngagement -> Bool
$c/= :: DescribeEngagement -> DescribeEngagement -> Bool
== :: DescribeEngagement -> DescribeEngagement -> Bool
$c== :: DescribeEngagement -> DescribeEngagement -> Bool
Prelude.Eq, ReadPrec [DescribeEngagement]
ReadPrec DescribeEngagement
Int -> ReadS DescribeEngagement
ReadS [DescribeEngagement]
(Int -> ReadS DescribeEngagement)
-> ReadS [DescribeEngagement]
-> ReadPrec DescribeEngagement
-> ReadPrec [DescribeEngagement]
-> Read DescribeEngagement
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeEngagement]
$creadListPrec :: ReadPrec [DescribeEngagement]
readPrec :: ReadPrec DescribeEngagement
$creadPrec :: ReadPrec DescribeEngagement
readList :: ReadS [DescribeEngagement]
$creadList :: ReadS [DescribeEngagement]
readsPrec :: Int -> ReadS DescribeEngagement
$creadsPrec :: Int -> ReadS DescribeEngagement
Prelude.Read, Int -> DescribeEngagement -> ShowS
[DescribeEngagement] -> ShowS
DescribeEngagement -> String
(Int -> DescribeEngagement -> ShowS)
-> (DescribeEngagement -> String)
-> ([DescribeEngagement] -> ShowS)
-> Show DescribeEngagement
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeEngagement] -> ShowS
$cshowList :: [DescribeEngagement] -> ShowS
show :: DescribeEngagement -> String
$cshow :: DescribeEngagement -> String
showsPrec :: Int -> DescribeEngagement -> ShowS
$cshowsPrec :: Int -> DescribeEngagement -> ShowS
Prelude.Show, (forall x. DescribeEngagement -> Rep DescribeEngagement x)
-> (forall x. Rep DescribeEngagement x -> DescribeEngagement)
-> Generic DescribeEngagement
forall x. Rep DescribeEngagement x -> DescribeEngagement
forall x. DescribeEngagement -> Rep DescribeEngagement x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeEngagement x -> DescribeEngagement
$cfrom :: forall x. DescribeEngagement -> Rep DescribeEngagement x
Prelude.Generic)

-- |
-- Create a value of 'DescribeEngagement' 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:
--
-- 'engagementId', 'describeEngagement_engagementId' - The Amazon Resource Name (ARN) of the engagement you want the details
-- of.
newDescribeEngagement ::
  -- | 'engagementId'
  Prelude.Text ->
  DescribeEngagement
newDescribeEngagement :: Text -> DescribeEngagement
newDescribeEngagement Text
pEngagementId_ =
  DescribeEngagement' :: Text -> DescribeEngagement
DescribeEngagement' {$sel:engagementId:DescribeEngagement' :: Text
engagementId = Text
pEngagementId_}

-- | The Amazon Resource Name (ARN) of the engagement you want the details
-- of.
describeEngagement_engagementId :: Lens.Lens' DescribeEngagement Prelude.Text
describeEngagement_engagementId :: (Text -> f Text) -> DescribeEngagement -> f DescribeEngagement
describeEngagement_engagementId = (DescribeEngagement -> Text)
-> (DescribeEngagement -> Text -> DescribeEngagement)
-> Lens DescribeEngagement DescribeEngagement Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEngagement' {Text
engagementId :: Text
$sel:engagementId:DescribeEngagement' :: DescribeEngagement -> Text
engagementId} -> Text
engagementId) (\s :: DescribeEngagement
s@DescribeEngagement' {} Text
a -> DescribeEngagement
s {$sel:engagementId:DescribeEngagement' :: Text
engagementId = Text
a} :: DescribeEngagement)

instance Core.AWSRequest DescribeEngagement where
  type
    AWSResponse DescribeEngagement =
      DescribeEngagementResponse
  request :: DescribeEngagement -> Request DescribeEngagement
request = Service -> DescribeEngagement -> Request DescribeEngagement
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeEngagement
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeEngagement)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeEngagement))
-> Logger
-> Service
-> Proxy DescribeEngagement
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeEngagement)))
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 ->
          Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Int
-> Text
-> Text
-> Text
-> Text
-> Text
-> DescribeEngagementResponse
DescribeEngagementResponse'
            (Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Int
 -> Text
 -> Text
 -> Text
 -> Text
 -> Text
 -> DescribeEngagementResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Int
      -> Text
      -> Text
      -> Text
      -> Text
      -> Text
      -> DescribeEngagementResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"PublicSubject")
            Either
  String
  (Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Int
   -> Text
   -> Text
   -> Text
   -> Text
   -> Text
   -> DescribeEngagementResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Int
      -> Text
      -> Text
      -> Text
      -> Text
      -> Text
      -> DescribeEngagementResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"StartTime")
            Either
  String
  (Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Int
   -> Text
   -> Text
   -> Text
   -> Text
   -> Text
   -> DescribeEngagementResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe POSIX
      -> Maybe Text
      -> Int
      -> Text
      -> Text
      -> Text
      -> Text
      -> Text
      -> DescribeEngagementResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"PublicContent")
            Either
  String
  (Maybe POSIX
   -> Maybe Text
   -> Int
   -> Text
   -> Text
   -> Text
   -> Text
   -> Text
   -> DescribeEngagementResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe Text
      -> Int
      -> Text
      -> Text
      -> Text
      -> Text
      -> Text
      -> DescribeEngagementResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"StopTime")
            Either
  String
  (Maybe Text
   -> Int
   -> Text
   -> Text
   -> Text
   -> Text
   -> Text
   -> DescribeEngagementResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Int
      -> Text
      -> Text
      -> Text
      -> Text
      -> Text
      -> DescribeEngagementResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"IncidentId")
            Either
  String
  (Int
   -> Text
   -> Text
   -> Text
   -> Text
   -> Text
   -> DescribeEngagementResponse)
-> Either String Int
-> Either
     String
     (Text
      -> Text -> Text -> Text -> Text -> DescribeEngagementResponse)
forall (f :: * -> *) a b. Applicative f => 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 -> Text -> Text -> Text -> DescribeEngagementResponse)
-> Either String Text
-> Either
     String (Text -> Text -> Text -> Text -> DescribeEngagementResponse)
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
"ContactArn")
            Either
  String (Text -> Text -> Text -> Text -> DescribeEngagementResponse)
-> Either String Text
-> Either
     String (Text -> Text -> Text -> DescribeEngagementResponse)
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
"EngagementArn")
            Either String (Text -> Text -> Text -> DescribeEngagementResponse)
-> Either String Text
-> Either String (Text -> Text -> DescribeEngagementResponse)
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
"Sender")
            Either String (Text -> Text -> DescribeEngagementResponse)
-> Either String Text
-> Either String (Text -> DescribeEngagementResponse)
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
"Subject")
            Either String (Text -> DescribeEngagementResponse)
-> Either String Text -> Either String DescribeEngagementResponse
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
"Content")
      )

instance Prelude.Hashable DescribeEngagement

instance Prelude.NFData DescribeEngagement

instance Core.ToHeaders DescribeEngagement where
  toHeaders :: DescribeEngagement -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeEngagement -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"SSMContacts.DescribeEngagement" ::
                          Prelude.ByteString
                      ),
            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 DescribeEngagement where
  toJSON :: DescribeEngagement -> Value
toJSON DescribeEngagement' {Text
engagementId :: Text
$sel:engagementId:DescribeEngagement' :: DescribeEngagement -> 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
"EngagementId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
engagementId)]
      )

instance Core.ToPath DescribeEngagement where
  toPath :: DescribeEngagement -> ByteString
toPath = ByteString -> DescribeEngagement -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newDescribeEngagementResponse' smart constructor.
data DescribeEngagementResponse = DescribeEngagementResponse'
  { -- | The insecure subject of the message that was sent to the contact. Use
    -- this field for engagements to @SMS@.
    DescribeEngagementResponse -> Maybe Text
publicSubject :: Prelude.Maybe Prelude.Text,
    -- | The time that the engagement started.
    DescribeEngagementResponse -> Maybe POSIX
startTime :: Prelude.Maybe Core.POSIX,
    -- | The insecure content of the message that was sent to the contact. Use
    -- this field for engagements to @SMS@.
    DescribeEngagementResponse -> Maybe Text
publicContent :: Prelude.Maybe Prelude.Text,
    -- | The time that the engagement ended.
    DescribeEngagementResponse -> Maybe POSIX
stopTime :: Prelude.Maybe Core.POSIX,
    -- | The ARN of the incident in which the engagement occurred.
    DescribeEngagementResponse -> Maybe Text
incidentId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeEngagementResponse -> Int
httpStatus :: Prelude.Int,
    -- | The ARN of the escalation plan or contacts involved in the engagement.
    DescribeEngagementResponse -> Text
contactArn :: Prelude.Text,
    -- | The ARN of the engagement.
    DescribeEngagementResponse -> Text
engagementArn :: Prelude.Text,
    -- | The user that started the engagement.
    DescribeEngagementResponse -> Text
sender :: Prelude.Text,
    -- | The secure subject of the message that was sent to the contact. Use this
    -- field for engagements to @VOICE@ and @EMAIL@.
    DescribeEngagementResponse -> Text
subject :: Prelude.Text,
    -- | The secure content of the message that was sent to the contact. Use this
    -- field for engagements to @VOICE@ and @EMAIL@.
    DescribeEngagementResponse -> Text
content :: Prelude.Text
  }
  deriving (DescribeEngagementResponse -> DescribeEngagementResponse -> Bool
(DescribeEngagementResponse -> DescribeEngagementResponse -> Bool)
-> (DescribeEngagementResponse
    -> DescribeEngagementResponse -> Bool)
-> Eq DescribeEngagementResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeEngagementResponse -> DescribeEngagementResponse -> Bool
$c/= :: DescribeEngagementResponse -> DescribeEngagementResponse -> Bool
== :: DescribeEngagementResponse -> DescribeEngagementResponse -> Bool
$c== :: DescribeEngagementResponse -> DescribeEngagementResponse -> Bool
Prelude.Eq, ReadPrec [DescribeEngagementResponse]
ReadPrec DescribeEngagementResponse
Int -> ReadS DescribeEngagementResponse
ReadS [DescribeEngagementResponse]
(Int -> ReadS DescribeEngagementResponse)
-> ReadS [DescribeEngagementResponse]
-> ReadPrec DescribeEngagementResponse
-> ReadPrec [DescribeEngagementResponse]
-> Read DescribeEngagementResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeEngagementResponse]
$creadListPrec :: ReadPrec [DescribeEngagementResponse]
readPrec :: ReadPrec DescribeEngagementResponse
$creadPrec :: ReadPrec DescribeEngagementResponse
readList :: ReadS [DescribeEngagementResponse]
$creadList :: ReadS [DescribeEngagementResponse]
readsPrec :: Int -> ReadS DescribeEngagementResponse
$creadsPrec :: Int -> ReadS DescribeEngagementResponse
Prelude.Read, Int -> DescribeEngagementResponse -> ShowS
[DescribeEngagementResponse] -> ShowS
DescribeEngagementResponse -> String
(Int -> DescribeEngagementResponse -> ShowS)
-> (DescribeEngagementResponse -> String)
-> ([DescribeEngagementResponse] -> ShowS)
-> Show DescribeEngagementResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeEngagementResponse] -> ShowS
$cshowList :: [DescribeEngagementResponse] -> ShowS
show :: DescribeEngagementResponse -> String
$cshow :: DescribeEngagementResponse -> String
showsPrec :: Int -> DescribeEngagementResponse -> ShowS
$cshowsPrec :: Int -> DescribeEngagementResponse -> ShowS
Prelude.Show, (forall x.
 DescribeEngagementResponse -> Rep DescribeEngagementResponse x)
-> (forall x.
    Rep DescribeEngagementResponse x -> DescribeEngagementResponse)
-> Generic DescribeEngagementResponse
forall x.
Rep DescribeEngagementResponse x -> DescribeEngagementResponse
forall x.
DescribeEngagementResponse -> Rep DescribeEngagementResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeEngagementResponse x -> DescribeEngagementResponse
$cfrom :: forall x.
DescribeEngagementResponse -> Rep DescribeEngagementResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeEngagementResponse' 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:
--
-- 'publicSubject', 'describeEngagementResponse_publicSubject' - The insecure subject of the message that was sent to the contact. Use
-- this field for engagements to @SMS@.
--
-- 'startTime', 'describeEngagementResponse_startTime' - The time that the engagement started.
--
-- 'publicContent', 'describeEngagementResponse_publicContent' - The insecure content of the message that was sent to the contact. Use
-- this field for engagements to @SMS@.
--
-- 'stopTime', 'describeEngagementResponse_stopTime' - The time that the engagement ended.
--
-- 'incidentId', 'describeEngagementResponse_incidentId' - The ARN of the incident in which the engagement occurred.
--
-- 'httpStatus', 'describeEngagementResponse_httpStatus' - The response's http status code.
--
-- 'contactArn', 'describeEngagementResponse_contactArn' - The ARN of the escalation plan or contacts involved in the engagement.
--
-- 'engagementArn', 'describeEngagementResponse_engagementArn' - The ARN of the engagement.
--
-- 'sender', 'describeEngagementResponse_sender' - The user that started the engagement.
--
-- 'subject', 'describeEngagementResponse_subject' - The secure subject of the message that was sent to the contact. Use this
-- field for engagements to @VOICE@ and @EMAIL@.
--
-- 'content', 'describeEngagementResponse_content' - The secure content of the message that was sent to the contact. Use this
-- field for engagements to @VOICE@ and @EMAIL@.
newDescribeEngagementResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'contactArn'
  Prelude.Text ->
  -- | 'engagementArn'
  Prelude.Text ->
  -- | 'sender'
  Prelude.Text ->
  -- | 'subject'
  Prelude.Text ->
  -- | 'content'
  Prelude.Text ->
  DescribeEngagementResponse
newDescribeEngagementResponse :: Int
-> Text
-> Text
-> Text
-> Text
-> Text
-> DescribeEngagementResponse
newDescribeEngagementResponse
  Int
pHttpStatus_
  Text
pContactArn_
  Text
pEngagementArn_
  Text
pSender_
  Text
pSubject_
  Text
pContent_ =
    DescribeEngagementResponse' :: Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Int
-> Text
-> Text
-> Text
-> Text
-> Text
-> DescribeEngagementResponse
DescribeEngagementResponse'
      { $sel:publicSubject:DescribeEngagementResponse' :: Maybe Text
publicSubject =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:startTime:DescribeEngagementResponse' :: Maybe POSIX
startTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
        $sel:publicContent:DescribeEngagementResponse' :: Maybe Text
publicContent = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:stopTime:DescribeEngagementResponse' :: Maybe POSIX
stopTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
        $sel:incidentId:DescribeEngagementResponse' :: Maybe Text
incidentId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:DescribeEngagementResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:contactArn:DescribeEngagementResponse' :: Text
contactArn = Text
pContactArn_,
        $sel:engagementArn:DescribeEngagementResponse' :: Text
engagementArn = Text
pEngagementArn_,
        $sel:sender:DescribeEngagementResponse' :: Text
sender = Text
pSender_,
        $sel:subject:DescribeEngagementResponse' :: Text
subject = Text
pSubject_,
        $sel:content:DescribeEngagementResponse' :: Text
content = Text
pContent_
      }

-- | The insecure subject of the message that was sent to the contact. Use
-- this field for engagements to @SMS@.
describeEngagementResponse_publicSubject :: Lens.Lens' DescribeEngagementResponse (Prelude.Maybe Prelude.Text)
describeEngagementResponse_publicSubject :: (Maybe Text -> f (Maybe Text))
-> DescribeEngagementResponse -> f DescribeEngagementResponse
describeEngagementResponse_publicSubject = (DescribeEngagementResponse -> Maybe Text)
-> (DescribeEngagementResponse
    -> Maybe Text -> DescribeEngagementResponse)
-> Lens
     DescribeEngagementResponse
     DescribeEngagementResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEngagementResponse' {Maybe Text
publicSubject :: Maybe Text
$sel:publicSubject:DescribeEngagementResponse' :: DescribeEngagementResponse -> Maybe Text
publicSubject} -> Maybe Text
publicSubject) (\s :: DescribeEngagementResponse
s@DescribeEngagementResponse' {} Maybe Text
a -> DescribeEngagementResponse
s {$sel:publicSubject:DescribeEngagementResponse' :: Maybe Text
publicSubject = Maybe Text
a} :: DescribeEngagementResponse)

-- | The time that the engagement started.
describeEngagementResponse_startTime :: Lens.Lens' DescribeEngagementResponse (Prelude.Maybe Prelude.UTCTime)
describeEngagementResponse_startTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeEngagementResponse -> f DescribeEngagementResponse
describeEngagementResponse_startTime = (DescribeEngagementResponse -> Maybe POSIX)
-> (DescribeEngagementResponse
    -> Maybe POSIX -> DescribeEngagementResponse)
-> Lens
     DescribeEngagementResponse
     DescribeEngagementResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEngagementResponse' {Maybe POSIX
startTime :: Maybe POSIX
$sel:startTime:DescribeEngagementResponse' :: DescribeEngagementResponse -> Maybe POSIX
startTime} -> Maybe POSIX
startTime) (\s :: DescribeEngagementResponse
s@DescribeEngagementResponse' {} Maybe POSIX
a -> DescribeEngagementResponse
s {$sel:startTime:DescribeEngagementResponse' :: Maybe POSIX
startTime = Maybe POSIX
a} :: DescribeEngagementResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> DescribeEngagementResponse -> f DescribeEngagementResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeEngagementResponse
-> f DescribeEngagementResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The insecure content of the message that was sent to the contact. Use
-- this field for engagements to @SMS@.
describeEngagementResponse_publicContent :: Lens.Lens' DescribeEngagementResponse (Prelude.Maybe Prelude.Text)
describeEngagementResponse_publicContent :: (Maybe Text -> f (Maybe Text))
-> DescribeEngagementResponse -> f DescribeEngagementResponse
describeEngagementResponse_publicContent = (DescribeEngagementResponse -> Maybe Text)
-> (DescribeEngagementResponse
    -> Maybe Text -> DescribeEngagementResponse)
-> Lens
     DescribeEngagementResponse
     DescribeEngagementResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEngagementResponse' {Maybe Text
publicContent :: Maybe Text
$sel:publicContent:DescribeEngagementResponse' :: DescribeEngagementResponse -> Maybe Text
publicContent} -> Maybe Text
publicContent) (\s :: DescribeEngagementResponse
s@DescribeEngagementResponse' {} Maybe Text
a -> DescribeEngagementResponse
s {$sel:publicContent:DescribeEngagementResponse' :: Maybe Text
publicContent = Maybe Text
a} :: DescribeEngagementResponse)

-- | The time that the engagement ended.
describeEngagementResponse_stopTime :: Lens.Lens' DescribeEngagementResponse (Prelude.Maybe Prelude.UTCTime)
describeEngagementResponse_stopTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeEngagementResponse -> f DescribeEngagementResponse
describeEngagementResponse_stopTime = (DescribeEngagementResponse -> Maybe POSIX)
-> (DescribeEngagementResponse
    -> Maybe POSIX -> DescribeEngagementResponse)
-> Lens
     DescribeEngagementResponse
     DescribeEngagementResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEngagementResponse' {Maybe POSIX
stopTime :: Maybe POSIX
$sel:stopTime:DescribeEngagementResponse' :: DescribeEngagementResponse -> Maybe POSIX
stopTime} -> Maybe POSIX
stopTime) (\s :: DescribeEngagementResponse
s@DescribeEngagementResponse' {} Maybe POSIX
a -> DescribeEngagementResponse
s {$sel:stopTime:DescribeEngagementResponse' :: Maybe POSIX
stopTime = Maybe POSIX
a} :: DescribeEngagementResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> DescribeEngagementResponse -> f DescribeEngagementResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeEngagementResponse
-> f DescribeEngagementResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The ARN of the incident in which the engagement occurred.
describeEngagementResponse_incidentId :: Lens.Lens' DescribeEngagementResponse (Prelude.Maybe Prelude.Text)
describeEngagementResponse_incidentId :: (Maybe Text -> f (Maybe Text))
-> DescribeEngagementResponse -> f DescribeEngagementResponse
describeEngagementResponse_incidentId = (DescribeEngagementResponse -> Maybe Text)
-> (DescribeEngagementResponse
    -> Maybe Text -> DescribeEngagementResponse)
-> Lens
     DescribeEngagementResponse
     DescribeEngagementResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEngagementResponse' {Maybe Text
incidentId :: Maybe Text
$sel:incidentId:DescribeEngagementResponse' :: DescribeEngagementResponse -> Maybe Text
incidentId} -> Maybe Text
incidentId) (\s :: DescribeEngagementResponse
s@DescribeEngagementResponse' {} Maybe Text
a -> DescribeEngagementResponse
s {$sel:incidentId:DescribeEngagementResponse' :: Maybe Text
incidentId = Maybe Text
a} :: DescribeEngagementResponse)

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

-- | The ARN of the escalation plan or contacts involved in the engagement.
describeEngagementResponse_contactArn :: Lens.Lens' DescribeEngagementResponse Prelude.Text
describeEngagementResponse_contactArn :: (Text -> f Text)
-> DescribeEngagementResponse -> f DescribeEngagementResponse
describeEngagementResponse_contactArn = (DescribeEngagementResponse -> Text)
-> (DescribeEngagementResponse
    -> Text -> DescribeEngagementResponse)
-> Lens
     DescribeEngagementResponse DescribeEngagementResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEngagementResponse' {Text
contactArn :: Text
$sel:contactArn:DescribeEngagementResponse' :: DescribeEngagementResponse -> Text
contactArn} -> Text
contactArn) (\s :: DescribeEngagementResponse
s@DescribeEngagementResponse' {} Text
a -> DescribeEngagementResponse
s {$sel:contactArn:DescribeEngagementResponse' :: Text
contactArn = Text
a} :: DescribeEngagementResponse)

-- | The ARN of the engagement.
describeEngagementResponse_engagementArn :: Lens.Lens' DescribeEngagementResponse Prelude.Text
describeEngagementResponse_engagementArn :: (Text -> f Text)
-> DescribeEngagementResponse -> f DescribeEngagementResponse
describeEngagementResponse_engagementArn = (DescribeEngagementResponse -> Text)
-> (DescribeEngagementResponse
    -> Text -> DescribeEngagementResponse)
-> Lens
     DescribeEngagementResponse DescribeEngagementResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEngagementResponse' {Text
engagementArn :: Text
$sel:engagementArn:DescribeEngagementResponse' :: DescribeEngagementResponse -> Text
engagementArn} -> Text
engagementArn) (\s :: DescribeEngagementResponse
s@DescribeEngagementResponse' {} Text
a -> DescribeEngagementResponse
s {$sel:engagementArn:DescribeEngagementResponse' :: Text
engagementArn = Text
a} :: DescribeEngagementResponse)

-- | The user that started the engagement.
describeEngagementResponse_sender :: Lens.Lens' DescribeEngagementResponse Prelude.Text
describeEngagementResponse_sender :: (Text -> f Text)
-> DescribeEngagementResponse -> f DescribeEngagementResponse
describeEngagementResponse_sender = (DescribeEngagementResponse -> Text)
-> (DescribeEngagementResponse
    -> Text -> DescribeEngagementResponse)
-> Lens
     DescribeEngagementResponse DescribeEngagementResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEngagementResponse' {Text
sender :: Text
$sel:sender:DescribeEngagementResponse' :: DescribeEngagementResponse -> Text
sender} -> Text
sender) (\s :: DescribeEngagementResponse
s@DescribeEngagementResponse' {} Text
a -> DescribeEngagementResponse
s {$sel:sender:DescribeEngagementResponse' :: Text
sender = Text
a} :: DescribeEngagementResponse)

-- | The secure subject of the message that was sent to the contact. Use this
-- field for engagements to @VOICE@ and @EMAIL@.
describeEngagementResponse_subject :: Lens.Lens' DescribeEngagementResponse Prelude.Text
describeEngagementResponse_subject :: (Text -> f Text)
-> DescribeEngagementResponse -> f DescribeEngagementResponse
describeEngagementResponse_subject = (DescribeEngagementResponse -> Text)
-> (DescribeEngagementResponse
    -> Text -> DescribeEngagementResponse)
-> Lens
     DescribeEngagementResponse DescribeEngagementResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEngagementResponse' {Text
subject :: Text
$sel:subject:DescribeEngagementResponse' :: DescribeEngagementResponse -> Text
subject} -> Text
subject) (\s :: DescribeEngagementResponse
s@DescribeEngagementResponse' {} Text
a -> DescribeEngagementResponse
s {$sel:subject:DescribeEngagementResponse' :: Text
subject = Text
a} :: DescribeEngagementResponse)

-- | The secure content of the message that was sent to the contact. Use this
-- field for engagements to @VOICE@ and @EMAIL@.
describeEngagementResponse_content :: Lens.Lens' DescribeEngagementResponse Prelude.Text
describeEngagementResponse_content :: (Text -> f Text)
-> DescribeEngagementResponse -> f DescribeEngagementResponse
describeEngagementResponse_content = (DescribeEngagementResponse -> Text)
-> (DescribeEngagementResponse
    -> Text -> DescribeEngagementResponse)
-> Lens
     DescribeEngagementResponse DescribeEngagementResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEngagementResponse' {Text
content :: Text
$sel:content:DescribeEngagementResponse' :: DescribeEngagementResponse -> Text
content} -> Text
content) (\s :: DescribeEngagementResponse
s@DescribeEngagementResponse' {} Text
a -> DescribeEngagementResponse
s {$sel:content:DescribeEngagementResponse' :: Text
content = Text
a} :: DescribeEngagementResponse)

instance Prelude.NFData DescribeEngagementResponse