{-# 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.StartEngagement
-- 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)
--
-- Starts an engagement to a contact or escalation plan. The engagement
-- engages each contact specified in the incident.
module Amazonka.SSMContacts.StartEngagement
  ( -- * Creating a Request
    StartEngagement (..),
    newStartEngagement,

    -- * Request Lenses
    startEngagement_idempotencyToken,
    startEngagement_publicSubject,
    startEngagement_publicContent,
    startEngagement_incidentId,
    startEngagement_contactId,
    startEngagement_sender,
    startEngagement_subject,
    startEngagement_content,

    -- * Destructuring the Response
    StartEngagementResponse (..),
    newStartEngagementResponse,

    -- * Response Lenses
    startEngagementResponse_httpStatus,
    startEngagementResponse_engagementArn,
  )
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:/ 'newStartEngagement' smart constructor.
data StartEngagement = StartEngagement'
  { -- | A token ensuring that the operation is called only once with the
    -- specified details.
    StartEngagement -> Maybe Text
idempotencyToken :: Prelude.Maybe Prelude.Text,
    -- | The insecure subject of the message that was sent to the contact. Use
    -- this field for engagements to @SMS@.
    StartEngagement -> 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@.
    StartEngagement -> Maybe Text
publicContent :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the incident that the engagement is part of.
    StartEngagement -> Maybe Text
incidentId :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the contact being engaged.
    StartEngagement -> Text
contactId :: Prelude.Text,
    -- | The user that started the engagement.
    StartEngagement -> Text
sender :: Prelude.Text,
    -- | The secure subject of the message that was sent to the contact. Use this
    -- field for engagements to @VOICE@ or @EMAIL@.
    StartEngagement -> Text
subject :: Prelude.Text,
    -- | The secure content of the message that was sent to the contact. Use this
    -- field for engagements to @VOICE@ or @EMAIL@.
    StartEngagement -> Text
content :: Prelude.Text
  }
  deriving (StartEngagement -> StartEngagement -> Bool
(StartEngagement -> StartEngagement -> Bool)
-> (StartEngagement -> StartEngagement -> Bool)
-> Eq StartEngagement
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartEngagement -> StartEngagement -> Bool
$c/= :: StartEngagement -> StartEngagement -> Bool
== :: StartEngagement -> StartEngagement -> Bool
$c== :: StartEngagement -> StartEngagement -> Bool
Prelude.Eq, ReadPrec [StartEngagement]
ReadPrec StartEngagement
Int -> ReadS StartEngagement
ReadS [StartEngagement]
(Int -> ReadS StartEngagement)
-> ReadS [StartEngagement]
-> ReadPrec StartEngagement
-> ReadPrec [StartEngagement]
-> Read StartEngagement
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartEngagement]
$creadListPrec :: ReadPrec [StartEngagement]
readPrec :: ReadPrec StartEngagement
$creadPrec :: ReadPrec StartEngagement
readList :: ReadS [StartEngagement]
$creadList :: ReadS [StartEngagement]
readsPrec :: Int -> ReadS StartEngagement
$creadsPrec :: Int -> ReadS StartEngagement
Prelude.Read, Int -> StartEngagement -> ShowS
[StartEngagement] -> ShowS
StartEngagement -> String
(Int -> StartEngagement -> ShowS)
-> (StartEngagement -> String)
-> ([StartEngagement] -> ShowS)
-> Show StartEngagement
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartEngagement] -> ShowS
$cshowList :: [StartEngagement] -> ShowS
show :: StartEngagement -> String
$cshow :: StartEngagement -> String
showsPrec :: Int -> StartEngagement -> ShowS
$cshowsPrec :: Int -> StartEngagement -> ShowS
Prelude.Show, (forall x. StartEngagement -> Rep StartEngagement x)
-> (forall x. Rep StartEngagement x -> StartEngagement)
-> Generic StartEngagement
forall x. Rep StartEngagement x -> StartEngagement
forall x. StartEngagement -> Rep StartEngagement x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartEngagement x -> StartEngagement
$cfrom :: forall x. StartEngagement -> Rep StartEngagement x
Prelude.Generic)

-- |
-- Create a value of 'StartEngagement' 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:
--
-- 'idempotencyToken', 'startEngagement_idempotencyToken' - A token ensuring that the operation is called only once with the
-- specified details.
--
-- 'publicSubject', 'startEngagement_publicSubject' - The insecure subject of the message that was sent to the contact. Use
-- this field for engagements to @SMS@.
--
-- 'publicContent', 'startEngagement_publicContent' - The insecure content of the message that was sent to the contact. Use
-- this field for engagements to @SMS@.
--
-- 'incidentId', 'startEngagement_incidentId' - The ARN of the incident that the engagement is part of.
--
-- 'contactId', 'startEngagement_contactId' - The Amazon Resource Name (ARN) of the contact being engaged.
--
-- 'sender', 'startEngagement_sender' - The user that started the engagement.
--
-- 'subject', 'startEngagement_subject' - The secure subject of the message that was sent to the contact. Use this
-- field for engagements to @VOICE@ or @EMAIL@.
--
-- 'content', 'startEngagement_content' - The secure content of the message that was sent to the contact. Use this
-- field for engagements to @VOICE@ or @EMAIL@.
newStartEngagement ::
  -- | 'contactId'
  Prelude.Text ->
  -- | 'sender'
  Prelude.Text ->
  -- | 'subject'
  Prelude.Text ->
  -- | 'content'
  Prelude.Text ->
  StartEngagement
newStartEngagement :: Text -> Text -> Text -> Text -> StartEngagement
newStartEngagement
  Text
pContactId_
  Text
pSender_
  Text
pSubject_
  Text
pContent_ =
    StartEngagement' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Text
-> Text
-> Text
-> Text
-> StartEngagement
StartEngagement'
      { $sel:idempotencyToken:StartEngagement' :: Maybe Text
idempotencyToken =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:publicSubject:StartEngagement' :: Maybe Text
publicSubject = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:publicContent:StartEngagement' :: Maybe Text
publicContent = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:incidentId:StartEngagement' :: Maybe Text
incidentId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:contactId:StartEngagement' :: Text
contactId = Text
pContactId_,
        $sel:sender:StartEngagement' :: Text
sender = Text
pSender_,
        $sel:subject:StartEngagement' :: Text
subject = Text
pSubject_,
        $sel:content:StartEngagement' :: Text
content = Text
pContent_
      }

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

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

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

-- | The ARN of the incident that the engagement is part of.
startEngagement_incidentId :: Lens.Lens' StartEngagement (Prelude.Maybe Prelude.Text)
startEngagement_incidentId :: (Maybe Text -> f (Maybe Text))
-> StartEngagement -> f StartEngagement
startEngagement_incidentId = (StartEngagement -> Maybe Text)
-> (StartEngagement -> Maybe Text -> StartEngagement)
-> Lens StartEngagement StartEngagement (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartEngagement' {Maybe Text
incidentId :: Maybe Text
$sel:incidentId:StartEngagement' :: StartEngagement -> Maybe Text
incidentId} -> Maybe Text
incidentId) (\s :: StartEngagement
s@StartEngagement' {} Maybe Text
a -> StartEngagement
s {$sel:incidentId:StartEngagement' :: Maybe Text
incidentId = Maybe Text
a} :: StartEngagement)

-- | The Amazon Resource Name (ARN) of the contact being engaged.
startEngagement_contactId :: Lens.Lens' StartEngagement Prelude.Text
startEngagement_contactId :: (Text -> f Text) -> StartEngagement -> f StartEngagement
startEngagement_contactId = (StartEngagement -> Text)
-> (StartEngagement -> Text -> StartEngagement)
-> Lens StartEngagement StartEngagement Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartEngagement' {Text
contactId :: Text
$sel:contactId:StartEngagement' :: StartEngagement -> Text
contactId} -> Text
contactId) (\s :: StartEngagement
s@StartEngagement' {} Text
a -> StartEngagement
s {$sel:contactId:StartEngagement' :: Text
contactId = Text
a} :: StartEngagement)

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

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

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

instance Core.AWSRequest StartEngagement where
  type
    AWSResponse StartEngagement =
      StartEngagementResponse
  request :: StartEngagement -> Request StartEngagement
request = Service -> StartEngagement -> Request StartEngagement
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy StartEngagement
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StartEngagement)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse StartEngagement))
-> Logger
-> Service
-> Proxy StartEngagement
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StartEngagement)))
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 -> StartEngagementResponse
StartEngagementResponse'
            (Int -> Text -> StartEngagementResponse)
-> Either String Int
-> Either String (Text -> StartEngagementResponse)
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 -> StartEngagementResponse)
-> Either String Text -> Either String StartEngagementResponse
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")
      )

instance Prelude.Hashable StartEngagement

instance Prelude.NFData StartEngagement

instance Core.ToHeaders StartEngagement where
  toHeaders :: StartEngagement -> ResponseHeaders
toHeaders =
    ResponseHeaders -> StartEngagement -> 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.StartEngagement" ::
                          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 StartEngagement where
  toJSON :: StartEngagement -> Value
toJSON StartEngagement' {Maybe Text
Text
content :: Text
subject :: Text
sender :: Text
contactId :: Text
incidentId :: Maybe Text
publicContent :: Maybe Text
publicSubject :: Maybe Text
idempotencyToken :: Maybe Text
$sel:content:StartEngagement' :: StartEngagement -> Text
$sel:subject:StartEngagement' :: StartEngagement -> Text
$sel:sender:StartEngagement' :: StartEngagement -> Text
$sel:contactId:StartEngagement' :: StartEngagement -> Text
$sel:incidentId:StartEngagement' :: StartEngagement -> Maybe Text
$sel:publicContent:StartEngagement' :: StartEngagement -> Maybe Text
$sel:publicSubject:StartEngagement' :: StartEngagement -> Maybe Text
$sel:idempotencyToken:StartEngagement' :: StartEngagement -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"IdempotencyToken" 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
idempotencyToken,
            (Text
"PublicSubject" 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
publicSubject,
            (Text
"PublicContent" 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
publicContent,
            (Text
"IncidentId" 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
incidentId,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ContactId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
contactId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Sender" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
sender),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Subject" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
subject),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Content" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
content)
          ]
      )

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

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

-- | /See:/ 'newStartEngagementResponse' smart constructor.
data StartEngagementResponse = StartEngagementResponse'
  { -- | The response's http status code.
    StartEngagementResponse -> Int
httpStatus :: Prelude.Int,
    -- | The ARN of the engagement.
    StartEngagementResponse -> Text
engagementArn :: Prelude.Text
  }
  deriving (StartEngagementResponse -> StartEngagementResponse -> Bool
(StartEngagementResponse -> StartEngagementResponse -> Bool)
-> (StartEngagementResponse -> StartEngagementResponse -> Bool)
-> Eq StartEngagementResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartEngagementResponse -> StartEngagementResponse -> Bool
$c/= :: StartEngagementResponse -> StartEngagementResponse -> Bool
== :: StartEngagementResponse -> StartEngagementResponse -> Bool
$c== :: StartEngagementResponse -> StartEngagementResponse -> Bool
Prelude.Eq, ReadPrec [StartEngagementResponse]
ReadPrec StartEngagementResponse
Int -> ReadS StartEngagementResponse
ReadS [StartEngagementResponse]
(Int -> ReadS StartEngagementResponse)
-> ReadS [StartEngagementResponse]
-> ReadPrec StartEngagementResponse
-> ReadPrec [StartEngagementResponse]
-> Read StartEngagementResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartEngagementResponse]
$creadListPrec :: ReadPrec [StartEngagementResponse]
readPrec :: ReadPrec StartEngagementResponse
$creadPrec :: ReadPrec StartEngagementResponse
readList :: ReadS [StartEngagementResponse]
$creadList :: ReadS [StartEngagementResponse]
readsPrec :: Int -> ReadS StartEngagementResponse
$creadsPrec :: Int -> ReadS StartEngagementResponse
Prelude.Read, Int -> StartEngagementResponse -> ShowS
[StartEngagementResponse] -> ShowS
StartEngagementResponse -> String
(Int -> StartEngagementResponse -> ShowS)
-> (StartEngagementResponse -> String)
-> ([StartEngagementResponse] -> ShowS)
-> Show StartEngagementResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartEngagementResponse] -> ShowS
$cshowList :: [StartEngagementResponse] -> ShowS
show :: StartEngagementResponse -> String
$cshow :: StartEngagementResponse -> String
showsPrec :: Int -> StartEngagementResponse -> ShowS
$cshowsPrec :: Int -> StartEngagementResponse -> ShowS
Prelude.Show, (forall x.
 StartEngagementResponse -> Rep StartEngagementResponse x)
-> (forall x.
    Rep StartEngagementResponse x -> StartEngagementResponse)
-> Generic StartEngagementResponse
forall x. Rep StartEngagementResponse x -> StartEngagementResponse
forall x. StartEngagementResponse -> Rep StartEngagementResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartEngagementResponse x -> StartEngagementResponse
$cfrom :: forall x. StartEngagementResponse -> Rep StartEngagementResponse x
Prelude.Generic)

-- |
-- Create a value of 'StartEngagementResponse' 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', 'startEngagementResponse_httpStatus' - The response's http status code.
--
-- 'engagementArn', 'startEngagementResponse_engagementArn' - The ARN of the engagement.
newStartEngagementResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'engagementArn'
  Prelude.Text ->
  StartEngagementResponse
newStartEngagementResponse :: Int -> Text -> StartEngagementResponse
newStartEngagementResponse
  Int
pHttpStatus_
  Text
pEngagementArn_ =
    StartEngagementResponse' :: Int -> Text -> StartEngagementResponse
StartEngagementResponse'
      { $sel:httpStatus:StartEngagementResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:engagementArn:StartEngagementResponse' :: Text
engagementArn = Text
pEngagementArn_
      }

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

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

instance Prelude.NFData StartEngagementResponse