{-# 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.DescribePage
-- 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)
--
-- Lists details of the engagement to a contact channel.
module Amazonka.SSMContacts.DescribePage
  ( -- * Creating a Request
    DescribePage (..),
    newDescribePage,

    -- * Request Lenses
    describePage_pageId,

    -- * Destructuring the Response
    DescribePageResponse (..),
    newDescribePageResponse,

    -- * Response Lenses
    describePageResponse_readTime,
    describePageResponse_publicSubject,
    describePageResponse_publicContent,
    describePageResponse_deliveryTime,
    describePageResponse_incidentId,
    describePageResponse_sentTime,
    describePageResponse_httpStatus,
    describePageResponse_pageArn,
    describePageResponse_engagementArn,
    describePageResponse_contactArn,
    describePageResponse_sender,
    describePageResponse_subject,
    describePageResponse_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:/ 'newDescribePage' smart constructor.
data DescribePage = DescribePage'
  { -- | The ID of the engagement to a contact channel.
    DescribePage -> Text
pageId :: Prelude.Text
  }
  deriving (DescribePage -> DescribePage -> Bool
(DescribePage -> DescribePage -> Bool)
-> (DescribePage -> DescribePage -> Bool) -> Eq DescribePage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribePage -> DescribePage -> Bool
$c/= :: DescribePage -> DescribePage -> Bool
== :: DescribePage -> DescribePage -> Bool
$c== :: DescribePage -> DescribePage -> Bool
Prelude.Eq, ReadPrec [DescribePage]
ReadPrec DescribePage
Int -> ReadS DescribePage
ReadS [DescribePage]
(Int -> ReadS DescribePage)
-> ReadS [DescribePage]
-> ReadPrec DescribePage
-> ReadPrec [DescribePage]
-> Read DescribePage
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribePage]
$creadListPrec :: ReadPrec [DescribePage]
readPrec :: ReadPrec DescribePage
$creadPrec :: ReadPrec DescribePage
readList :: ReadS [DescribePage]
$creadList :: ReadS [DescribePage]
readsPrec :: Int -> ReadS DescribePage
$creadsPrec :: Int -> ReadS DescribePage
Prelude.Read, Int -> DescribePage -> ShowS
[DescribePage] -> ShowS
DescribePage -> String
(Int -> DescribePage -> ShowS)
-> (DescribePage -> String)
-> ([DescribePage] -> ShowS)
-> Show DescribePage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribePage] -> ShowS
$cshowList :: [DescribePage] -> ShowS
show :: DescribePage -> String
$cshow :: DescribePage -> String
showsPrec :: Int -> DescribePage -> ShowS
$cshowsPrec :: Int -> DescribePage -> ShowS
Prelude.Show, (forall x. DescribePage -> Rep DescribePage x)
-> (forall x. Rep DescribePage x -> DescribePage)
-> Generic DescribePage
forall x. Rep DescribePage x -> DescribePage
forall x. DescribePage -> Rep DescribePage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribePage x -> DescribePage
$cfrom :: forall x. DescribePage -> Rep DescribePage x
Prelude.Generic)

-- |
-- Create a value of 'DescribePage' 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:
--
-- 'pageId', 'describePage_pageId' - The ID of the engagement to a contact channel.
newDescribePage ::
  -- | 'pageId'
  Prelude.Text ->
  DescribePage
newDescribePage :: Text -> DescribePage
newDescribePage Text
pPageId_ =
  DescribePage' :: Text -> DescribePage
DescribePage' {$sel:pageId:DescribePage' :: Text
pageId = Text
pPageId_}

-- | The ID of the engagement to a contact channel.
describePage_pageId :: Lens.Lens' DescribePage Prelude.Text
describePage_pageId :: (Text -> f Text) -> DescribePage -> f DescribePage
describePage_pageId = (DescribePage -> Text)
-> (DescribePage -> Text -> DescribePage)
-> Lens DescribePage DescribePage Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePage' {Text
pageId :: Text
$sel:pageId:DescribePage' :: DescribePage -> Text
pageId} -> Text
pageId) (\s :: DescribePage
s@DescribePage' {} Text
a -> DescribePage
s {$sel:pageId:DescribePage' :: Text
pageId = Text
a} :: DescribePage)

instance Core.AWSRequest DescribePage where
  type AWSResponse DescribePage = DescribePageResponse
  request :: DescribePage -> Request DescribePage
request = Service -> DescribePage -> Request DescribePage
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribePage
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribePage)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribePage))
-> Logger
-> Service
-> Proxy DescribePage
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribePage)))
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 POSIX
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Int
-> Text
-> Text
-> Text
-> Text
-> Text
-> Text
-> DescribePageResponse
DescribePageResponse'
            (Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe POSIX
 -> Int
 -> Text
 -> Text
 -> Text
 -> Text
 -> Text
 -> Text
 -> DescribePageResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Int
      -> Text
      -> Text
      -> Text
      -> Text
      -> Text
      -> Text
      -> DescribePageResponse)
forall (f :: * -> *) a b. Functor 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
"ReadTime")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Int
   -> Text
   -> Text
   -> Text
   -> Text
   -> Text
   -> Text
   -> DescribePageResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Int
      -> Text
      -> Text
      -> Text
      -> Text
      -> Text
      -> Text
      -> DescribePageResponse)
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
"PublicSubject")
            Either
  String
  (Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Int
   -> Text
   -> Text
   -> Text
   -> Text
   -> Text
   -> Text
   -> DescribePageResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Int
      -> Text
      -> Text
      -> Text
      -> Text
      -> Text
      -> Text
      -> DescribePageResponse)
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
   -> Maybe POSIX
   -> Int
   -> Text
   -> Text
   -> Text
   -> Text
   -> Text
   -> Text
   -> DescribePageResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe Text
      -> Maybe POSIX
      -> Int
      -> Text
      -> Text
      -> Text
      -> Text
      -> Text
      -> Text
      -> DescribePageResponse)
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
"DeliveryTime")
            Either
  String
  (Maybe Text
   -> Maybe POSIX
   -> Int
   -> Text
   -> Text
   -> Text
   -> Text
   -> Text
   -> Text
   -> DescribePageResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe POSIX
      -> Int
      -> Text
      -> Text
      -> Text
      -> Text
      -> Text
      -> Text
      -> DescribePageResponse)
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
  (Maybe POSIX
   -> Int
   -> Text
   -> Text
   -> Text
   -> Text
   -> Text
   -> Text
   -> DescribePageResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Int
      -> Text
      -> Text
      -> Text
      -> Text
      -> Text
      -> Text
      -> DescribePageResponse)
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
"SentTime")
            Either
  String
  (Int
   -> Text
   -> Text
   -> Text
   -> Text
   -> Text
   -> Text
   -> DescribePageResponse)
-> Either String Int
-> Either
     String
     (Text
      -> Text -> Text -> Text -> Text -> Text -> DescribePageResponse)
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 -> Text -> DescribePageResponse)
-> Either String Text
-> Either
     String
     (Text -> Text -> Text -> Text -> Text -> DescribePageResponse)
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
"PageArn")
            Either
  String
  (Text -> Text -> Text -> Text -> Text -> DescribePageResponse)
-> Either String Text
-> Either
     String (Text -> Text -> Text -> Text -> DescribePageResponse)
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 -> Text -> DescribePageResponse)
-> Either String Text
-> Either String (Text -> Text -> Text -> DescribePageResponse)
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 -> DescribePageResponse)
-> Either String Text
-> Either String (Text -> Text -> DescribePageResponse)
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 -> DescribePageResponse)
-> Either String Text
-> Either String (Text -> DescribePageResponse)
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 -> DescribePageResponse)
-> Either String Text -> Either String DescribePageResponse
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 DescribePage

instance Prelude.NFData DescribePage

instance Core.ToHeaders DescribePage where
  toHeaders :: DescribePage -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribePage -> 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.DescribePage" :: 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 DescribePage where
  toJSON :: DescribePage -> Value
toJSON DescribePage' {Text
pageId :: Text
$sel:pageId:DescribePage' :: DescribePage -> 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
"PageId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
pageId)]
      )

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

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

-- | /See:/ 'newDescribePageResponse' smart constructor.
data DescribePageResponse = DescribePageResponse'
  { -- | The time that the contact channel acknowledged the engagement.
    DescribePageResponse -> Maybe POSIX
readTime :: Prelude.Maybe Core.POSIX,
    -- | The insecure subject of the message that was sent to the contact. Use
    -- this field for engagements to @SMS@.
    DescribePageResponse -> Maybe Text
publicSubject :: Prelude.Maybe Prelude.Text,
    -- | The insecure content of the message that was sent to the contact. Use
    -- this field for engagements to @SMS@.
    DescribePageResponse -> Maybe Text
publicContent :: Prelude.Maybe Prelude.Text,
    -- | The time that the contact channel received the engagement.
    DescribePageResponse -> Maybe POSIX
deliveryTime :: Prelude.Maybe Core.POSIX,
    -- | The ARN of the incident that engaged the contact channel.
    DescribePageResponse -> Maybe Text
incidentId :: Prelude.Maybe Prelude.Text,
    -- | The time the engagement was sent to the contact channel.
    DescribePageResponse -> Maybe POSIX
sentTime :: Prelude.Maybe Core.POSIX,
    -- | The response's http status code.
    DescribePageResponse -> Int
httpStatus :: Prelude.Int,
    -- | The Amazon Resource Name (ARN) of the engagement to a contact channel.
    DescribePageResponse -> Text
pageArn :: Prelude.Text,
    -- | The ARN of the engagement that engaged the contact channel.
    DescribePageResponse -> Text
engagementArn :: Prelude.Text,
    -- | The ARN of the contact that was engaged.
    DescribePageResponse -> Text
contactArn :: Prelude.Text,
    -- | The user that started the engagement.
    DescribePageResponse -> 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@.
    DescribePageResponse -> 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@.
    DescribePageResponse -> Text
content :: Prelude.Text
  }
  deriving (DescribePageResponse -> DescribePageResponse -> Bool
(DescribePageResponse -> DescribePageResponse -> Bool)
-> (DescribePageResponse -> DescribePageResponse -> Bool)
-> Eq DescribePageResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribePageResponse -> DescribePageResponse -> Bool
$c/= :: DescribePageResponse -> DescribePageResponse -> Bool
== :: DescribePageResponse -> DescribePageResponse -> Bool
$c== :: DescribePageResponse -> DescribePageResponse -> Bool
Prelude.Eq, ReadPrec [DescribePageResponse]
ReadPrec DescribePageResponse
Int -> ReadS DescribePageResponse
ReadS [DescribePageResponse]
(Int -> ReadS DescribePageResponse)
-> ReadS [DescribePageResponse]
-> ReadPrec DescribePageResponse
-> ReadPrec [DescribePageResponse]
-> Read DescribePageResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribePageResponse]
$creadListPrec :: ReadPrec [DescribePageResponse]
readPrec :: ReadPrec DescribePageResponse
$creadPrec :: ReadPrec DescribePageResponse
readList :: ReadS [DescribePageResponse]
$creadList :: ReadS [DescribePageResponse]
readsPrec :: Int -> ReadS DescribePageResponse
$creadsPrec :: Int -> ReadS DescribePageResponse
Prelude.Read, Int -> DescribePageResponse -> ShowS
[DescribePageResponse] -> ShowS
DescribePageResponse -> String
(Int -> DescribePageResponse -> ShowS)
-> (DescribePageResponse -> String)
-> ([DescribePageResponse] -> ShowS)
-> Show DescribePageResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribePageResponse] -> ShowS
$cshowList :: [DescribePageResponse] -> ShowS
show :: DescribePageResponse -> String
$cshow :: DescribePageResponse -> String
showsPrec :: Int -> DescribePageResponse -> ShowS
$cshowsPrec :: Int -> DescribePageResponse -> ShowS
Prelude.Show, (forall x. DescribePageResponse -> Rep DescribePageResponse x)
-> (forall x. Rep DescribePageResponse x -> DescribePageResponse)
-> Generic DescribePageResponse
forall x. Rep DescribePageResponse x -> DescribePageResponse
forall x. DescribePageResponse -> Rep DescribePageResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribePageResponse x -> DescribePageResponse
$cfrom :: forall x. DescribePageResponse -> Rep DescribePageResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribePageResponse' 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:
--
-- 'readTime', 'describePageResponse_readTime' - The time that the contact channel acknowledged the engagement.
--
-- 'publicSubject', 'describePageResponse_publicSubject' - The insecure subject of the message that was sent to the contact. Use
-- this field for engagements to @SMS@.
--
-- 'publicContent', 'describePageResponse_publicContent' - The insecure content of the message that was sent to the contact. Use
-- this field for engagements to @SMS@.
--
-- 'deliveryTime', 'describePageResponse_deliveryTime' - The time that the contact channel received the engagement.
--
-- 'incidentId', 'describePageResponse_incidentId' - The ARN of the incident that engaged the contact channel.
--
-- 'sentTime', 'describePageResponse_sentTime' - The time the engagement was sent to the contact channel.
--
-- 'httpStatus', 'describePageResponse_httpStatus' - The response's http status code.
--
-- 'pageArn', 'describePageResponse_pageArn' - The Amazon Resource Name (ARN) of the engagement to a contact channel.
--
-- 'engagementArn', 'describePageResponse_engagementArn' - The ARN of the engagement that engaged the contact channel.
--
-- 'contactArn', 'describePageResponse_contactArn' - The ARN of the contact that was engaged.
--
-- 'sender', 'describePageResponse_sender' - The user that started the engagement.
--
-- 'subject', 'describePageResponse_subject' - The secure subject of the message that was sent to the contact. Use this
-- field for engagements to @VOICE@ and @EMAIL@.
--
-- 'content', 'describePageResponse_content' - The secure content of the message that was sent to the contact. Use this
-- field for engagements to @VOICE@ and @EMAIL@.
newDescribePageResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'pageArn'
  Prelude.Text ->
  -- | 'engagementArn'
  Prelude.Text ->
  -- | 'contactArn'
  Prelude.Text ->
  -- | 'sender'
  Prelude.Text ->
  -- | 'subject'
  Prelude.Text ->
  -- | 'content'
  Prelude.Text ->
  DescribePageResponse
newDescribePageResponse :: Int
-> Text
-> Text
-> Text
-> Text
-> Text
-> Text
-> DescribePageResponse
newDescribePageResponse
  Int
pHttpStatus_
  Text
pPageArn_
  Text
pEngagementArn_
  Text
pContactArn_
  Text
pSender_
  Text
pSubject_
  Text
pContent_ =
    DescribePageResponse' :: Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Int
-> Text
-> Text
-> Text
-> Text
-> Text
-> Text
-> DescribePageResponse
DescribePageResponse'
      { $sel:readTime:DescribePageResponse' :: Maybe POSIX
readTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
        $sel:publicSubject:DescribePageResponse' :: Maybe Text
publicSubject = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:publicContent:DescribePageResponse' :: Maybe Text
publicContent = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:deliveryTime:DescribePageResponse' :: Maybe POSIX
deliveryTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
        $sel:incidentId:DescribePageResponse' :: Maybe Text
incidentId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:sentTime:DescribePageResponse' :: Maybe POSIX
sentTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:DescribePageResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:pageArn:DescribePageResponse' :: Text
pageArn = Text
pPageArn_,
        $sel:engagementArn:DescribePageResponse' :: Text
engagementArn = Text
pEngagementArn_,
        $sel:contactArn:DescribePageResponse' :: Text
contactArn = Text
pContactArn_,
        $sel:sender:DescribePageResponse' :: Text
sender = Text
pSender_,
        $sel:subject:DescribePageResponse' :: Text
subject = Text
pSubject_,
        $sel:content:DescribePageResponse' :: Text
content = Text
pContent_
      }

-- | The time that the contact channel acknowledged the engagement.
describePageResponse_readTime :: Lens.Lens' DescribePageResponse (Prelude.Maybe Prelude.UTCTime)
describePageResponse_readTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribePageResponse -> f DescribePageResponse
describePageResponse_readTime = (DescribePageResponse -> Maybe POSIX)
-> (DescribePageResponse -> Maybe POSIX -> DescribePageResponse)
-> Lens
     DescribePageResponse
     DescribePageResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePageResponse' {Maybe POSIX
readTime :: Maybe POSIX
$sel:readTime:DescribePageResponse' :: DescribePageResponse -> Maybe POSIX
readTime} -> Maybe POSIX
readTime) (\s :: DescribePageResponse
s@DescribePageResponse' {} Maybe POSIX
a -> DescribePageResponse
s {$sel:readTime:DescribePageResponse' :: Maybe POSIX
readTime = Maybe POSIX
a} :: DescribePageResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> DescribePageResponse -> f DescribePageResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribePageResponse
-> f DescribePageResponse
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 subject of the message that was sent to the contact. Use
-- this field for engagements to @SMS@.
describePageResponse_publicSubject :: Lens.Lens' DescribePageResponse (Prelude.Maybe Prelude.Text)
describePageResponse_publicSubject :: (Maybe Text -> f (Maybe Text))
-> DescribePageResponse -> f DescribePageResponse
describePageResponse_publicSubject = (DescribePageResponse -> Maybe Text)
-> (DescribePageResponse -> Maybe Text -> DescribePageResponse)
-> Lens
     DescribePageResponse DescribePageResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePageResponse' {Maybe Text
publicSubject :: Maybe Text
$sel:publicSubject:DescribePageResponse' :: DescribePageResponse -> Maybe Text
publicSubject} -> Maybe Text
publicSubject) (\s :: DescribePageResponse
s@DescribePageResponse' {} Maybe Text
a -> DescribePageResponse
s {$sel:publicSubject:DescribePageResponse' :: Maybe Text
publicSubject = Maybe Text
a} :: DescribePageResponse)

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

-- | The time that the contact channel received the engagement.
describePageResponse_deliveryTime :: Lens.Lens' DescribePageResponse (Prelude.Maybe Prelude.UTCTime)
describePageResponse_deliveryTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribePageResponse -> f DescribePageResponse
describePageResponse_deliveryTime = (DescribePageResponse -> Maybe POSIX)
-> (DescribePageResponse -> Maybe POSIX -> DescribePageResponse)
-> Lens
     DescribePageResponse
     DescribePageResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePageResponse' {Maybe POSIX
deliveryTime :: Maybe POSIX
$sel:deliveryTime:DescribePageResponse' :: DescribePageResponse -> Maybe POSIX
deliveryTime} -> Maybe POSIX
deliveryTime) (\s :: DescribePageResponse
s@DescribePageResponse' {} Maybe POSIX
a -> DescribePageResponse
s {$sel:deliveryTime:DescribePageResponse' :: Maybe POSIX
deliveryTime = Maybe POSIX
a} :: DescribePageResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> DescribePageResponse -> f DescribePageResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribePageResponse
-> f DescribePageResponse
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 that engaged the contact channel.
describePageResponse_incidentId :: Lens.Lens' DescribePageResponse (Prelude.Maybe Prelude.Text)
describePageResponse_incidentId :: (Maybe Text -> f (Maybe Text))
-> DescribePageResponse -> f DescribePageResponse
describePageResponse_incidentId = (DescribePageResponse -> Maybe Text)
-> (DescribePageResponse -> Maybe Text -> DescribePageResponse)
-> Lens
     DescribePageResponse DescribePageResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePageResponse' {Maybe Text
incidentId :: Maybe Text
$sel:incidentId:DescribePageResponse' :: DescribePageResponse -> Maybe Text
incidentId} -> Maybe Text
incidentId) (\s :: DescribePageResponse
s@DescribePageResponse' {} Maybe Text
a -> DescribePageResponse
s {$sel:incidentId:DescribePageResponse' :: Maybe Text
incidentId = Maybe Text
a} :: DescribePageResponse)

-- | The time the engagement was sent to the contact channel.
describePageResponse_sentTime :: Lens.Lens' DescribePageResponse (Prelude.Maybe Prelude.UTCTime)
describePageResponse_sentTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribePageResponse -> f DescribePageResponse
describePageResponse_sentTime = (DescribePageResponse -> Maybe POSIX)
-> (DescribePageResponse -> Maybe POSIX -> DescribePageResponse)
-> Lens
     DescribePageResponse
     DescribePageResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePageResponse' {Maybe POSIX
sentTime :: Maybe POSIX
$sel:sentTime:DescribePageResponse' :: DescribePageResponse -> Maybe POSIX
sentTime} -> Maybe POSIX
sentTime) (\s :: DescribePageResponse
s@DescribePageResponse' {} Maybe POSIX
a -> DescribePageResponse
s {$sel:sentTime:DescribePageResponse' :: Maybe POSIX
sentTime = Maybe POSIX
a} :: DescribePageResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> DescribePageResponse -> f DescribePageResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribePageResponse
-> f DescribePageResponse
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 response's http status code.
describePageResponse_httpStatus :: Lens.Lens' DescribePageResponse Prelude.Int
describePageResponse_httpStatus :: (Int -> f Int) -> DescribePageResponse -> f DescribePageResponse
describePageResponse_httpStatus = (DescribePageResponse -> Int)
-> (DescribePageResponse -> Int -> DescribePageResponse)
-> Lens DescribePageResponse DescribePageResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePageResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribePageResponse' :: DescribePageResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribePageResponse
s@DescribePageResponse' {} Int
a -> DescribePageResponse
s {$sel:httpStatus:DescribePageResponse' :: Int
httpStatus = Int
a} :: DescribePageResponse)

-- | The Amazon Resource Name (ARN) of the engagement to a contact channel.
describePageResponse_pageArn :: Lens.Lens' DescribePageResponse Prelude.Text
describePageResponse_pageArn :: (Text -> f Text) -> DescribePageResponse -> f DescribePageResponse
describePageResponse_pageArn = (DescribePageResponse -> Text)
-> (DescribePageResponse -> Text -> DescribePageResponse)
-> Lens DescribePageResponse DescribePageResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePageResponse' {Text
pageArn :: Text
$sel:pageArn:DescribePageResponse' :: DescribePageResponse -> Text
pageArn} -> Text
pageArn) (\s :: DescribePageResponse
s@DescribePageResponse' {} Text
a -> DescribePageResponse
s {$sel:pageArn:DescribePageResponse' :: Text
pageArn = Text
a} :: DescribePageResponse)

-- | The ARN of the engagement that engaged the contact channel.
describePageResponse_engagementArn :: Lens.Lens' DescribePageResponse Prelude.Text
describePageResponse_engagementArn :: (Text -> f Text) -> DescribePageResponse -> f DescribePageResponse
describePageResponse_engagementArn = (DescribePageResponse -> Text)
-> (DescribePageResponse -> Text -> DescribePageResponse)
-> Lens DescribePageResponse DescribePageResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePageResponse' {Text
engagementArn :: Text
$sel:engagementArn:DescribePageResponse' :: DescribePageResponse -> Text
engagementArn} -> Text
engagementArn) (\s :: DescribePageResponse
s@DescribePageResponse' {} Text
a -> DescribePageResponse
s {$sel:engagementArn:DescribePageResponse' :: Text
engagementArn = Text
a} :: DescribePageResponse)

-- | The ARN of the contact that was engaged.
describePageResponse_contactArn :: Lens.Lens' DescribePageResponse Prelude.Text
describePageResponse_contactArn :: (Text -> f Text) -> DescribePageResponse -> f DescribePageResponse
describePageResponse_contactArn = (DescribePageResponse -> Text)
-> (DescribePageResponse -> Text -> DescribePageResponse)
-> Lens DescribePageResponse DescribePageResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePageResponse' {Text
contactArn :: Text
$sel:contactArn:DescribePageResponse' :: DescribePageResponse -> Text
contactArn} -> Text
contactArn) (\s :: DescribePageResponse
s@DescribePageResponse' {} Text
a -> DescribePageResponse
s {$sel:contactArn:DescribePageResponse' :: Text
contactArn = Text
a} :: DescribePageResponse)

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

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

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

instance Prelude.NFData DescribePageResponse