{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

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

-- |
-- Module      : Amazonka.SSMIncidents.UpdateIncidentRecord
-- 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)
--
-- Update the details of an incident record. You can use this action to
-- update an incident record from the defined chat channel. For more
-- information about using actions in chat channels, see
-- <https://docs.aws.amazon.com/incident-manager/latest/userguide/chat.html#chat-interact Interacting through chat>.
module Amazonka.SSMIncidents.UpdateIncidentRecord
  ( -- * Creating a Request
    UpdateIncidentRecord (..),
    newUpdateIncidentRecord,

    -- * Request Lenses
    updateIncidentRecord_summary,
    updateIncidentRecord_status,
    updateIncidentRecord_notificationTargets,
    updateIncidentRecord_clientToken,
    updateIncidentRecord_impact,
    updateIncidentRecord_chatChannel,
    updateIncidentRecord_title,
    updateIncidentRecord_arn,

    -- * Destructuring the Response
    UpdateIncidentRecordResponse (..),
    newUpdateIncidentRecordResponse,

    -- * Response Lenses
    updateIncidentRecordResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SSMIncidents.Types

-- | /See:/ 'newUpdateIncidentRecord' smart constructor.
data UpdateIncidentRecord = UpdateIncidentRecord'
  { -- | The summary describes what has happened during the incident.
    UpdateIncidentRecord -> Maybe Text
summary :: Prelude.Maybe Prelude.Text,
    -- | The status of the incident. An incident can be @Open@ or @Resolved@.
    UpdateIncidentRecord -> Maybe IncidentRecordStatus
status :: Prelude.Maybe IncidentRecordStatus,
    -- | The SNS targets that are notified when updates are made to an incident.
    --
    -- Using multiple SNS topics creates redundancy in the case that a Region
    -- is down during the incident.
    UpdateIncidentRecord -> Maybe [NotificationTargetItem]
notificationTargets :: Prelude.Maybe [NotificationTargetItem],
    -- | A token ensuring that the action is called only once with the specified
    -- details.
    UpdateIncidentRecord -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | Defines the impact to customers and applications. Providing an impact
    -- overwrites the impact provided by the response plan.
    --
    -- __Possible impacts:__
    --
    -- -   @1@ - Critical impact, this typically relates to full application
    --     failure that impacts many to all customers.
    --
    -- -   @2@ - High impact, partial application failure with impact to many
    --     customers.
    --
    -- -   @3@ - Medium impact, the application is providing reduced service to
    --     customers.
    --
    -- -   @4@ - Low impact, customer might aren\'t impacted by the problem
    --     yet.
    --
    -- -   @5@ - No impact, customers aren\'t currently impacted but urgent
    --     action is needed to avoid impact.
    UpdateIncidentRecord -> Maybe Natural
impact :: Prelude.Maybe Prelude.Natural,
    -- | The AWS Chatbot chat channel for responders to collaborate in.
    UpdateIncidentRecord -> Maybe ChatChannel
chatChannel :: Prelude.Maybe ChatChannel,
    -- | The title of the incident is a brief and easily recognizable.
    UpdateIncidentRecord -> Maybe Text
title :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the incident record you are updating.
    UpdateIncidentRecord -> Text
arn :: Prelude.Text
  }
  deriving (UpdateIncidentRecord -> UpdateIncidentRecord -> Bool
(UpdateIncidentRecord -> UpdateIncidentRecord -> Bool)
-> (UpdateIncidentRecord -> UpdateIncidentRecord -> Bool)
-> Eq UpdateIncidentRecord
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateIncidentRecord -> UpdateIncidentRecord -> Bool
$c/= :: UpdateIncidentRecord -> UpdateIncidentRecord -> Bool
== :: UpdateIncidentRecord -> UpdateIncidentRecord -> Bool
$c== :: UpdateIncidentRecord -> UpdateIncidentRecord -> Bool
Prelude.Eq, ReadPrec [UpdateIncidentRecord]
ReadPrec UpdateIncidentRecord
Int -> ReadS UpdateIncidentRecord
ReadS [UpdateIncidentRecord]
(Int -> ReadS UpdateIncidentRecord)
-> ReadS [UpdateIncidentRecord]
-> ReadPrec UpdateIncidentRecord
-> ReadPrec [UpdateIncidentRecord]
-> Read UpdateIncidentRecord
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateIncidentRecord]
$creadListPrec :: ReadPrec [UpdateIncidentRecord]
readPrec :: ReadPrec UpdateIncidentRecord
$creadPrec :: ReadPrec UpdateIncidentRecord
readList :: ReadS [UpdateIncidentRecord]
$creadList :: ReadS [UpdateIncidentRecord]
readsPrec :: Int -> ReadS UpdateIncidentRecord
$creadsPrec :: Int -> ReadS UpdateIncidentRecord
Prelude.Read, Int -> UpdateIncidentRecord -> ShowS
[UpdateIncidentRecord] -> ShowS
UpdateIncidentRecord -> String
(Int -> UpdateIncidentRecord -> ShowS)
-> (UpdateIncidentRecord -> String)
-> ([UpdateIncidentRecord] -> ShowS)
-> Show UpdateIncidentRecord
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateIncidentRecord] -> ShowS
$cshowList :: [UpdateIncidentRecord] -> ShowS
show :: UpdateIncidentRecord -> String
$cshow :: UpdateIncidentRecord -> String
showsPrec :: Int -> UpdateIncidentRecord -> ShowS
$cshowsPrec :: Int -> UpdateIncidentRecord -> ShowS
Prelude.Show, (forall x. UpdateIncidentRecord -> Rep UpdateIncidentRecord x)
-> (forall x. Rep UpdateIncidentRecord x -> UpdateIncidentRecord)
-> Generic UpdateIncidentRecord
forall x. Rep UpdateIncidentRecord x -> UpdateIncidentRecord
forall x. UpdateIncidentRecord -> Rep UpdateIncidentRecord x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateIncidentRecord x -> UpdateIncidentRecord
$cfrom :: forall x. UpdateIncidentRecord -> Rep UpdateIncidentRecord x
Prelude.Generic)

-- |
-- Create a value of 'UpdateIncidentRecord' 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:
--
-- 'summary', 'updateIncidentRecord_summary' - The summary describes what has happened during the incident.
--
-- 'status', 'updateIncidentRecord_status' - The status of the incident. An incident can be @Open@ or @Resolved@.
--
-- 'notificationTargets', 'updateIncidentRecord_notificationTargets' - The SNS targets that are notified when updates are made to an incident.
--
-- Using multiple SNS topics creates redundancy in the case that a Region
-- is down during the incident.
--
-- 'clientToken', 'updateIncidentRecord_clientToken' - A token ensuring that the action is called only once with the specified
-- details.
--
-- 'impact', 'updateIncidentRecord_impact' - Defines the impact to customers and applications. Providing an impact
-- overwrites the impact provided by the response plan.
--
-- __Possible impacts:__
--
-- -   @1@ - Critical impact, this typically relates to full application
--     failure that impacts many to all customers.
--
-- -   @2@ - High impact, partial application failure with impact to many
--     customers.
--
-- -   @3@ - Medium impact, the application is providing reduced service to
--     customers.
--
-- -   @4@ - Low impact, customer might aren\'t impacted by the problem
--     yet.
--
-- -   @5@ - No impact, customers aren\'t currently impacted but urgent
--     action is needed to avoid impact.
--
-- 'chatChannel', 'updateIncidentRecord_chatChannel' - The AWS Chatbot chat channel for responders to collaborate in.
--
-- 'title', 'updateIncidentRecord_title' - The title of the incident is a brief and easily recognizable.
--
-- 'arn', 'updateIncidentRecord_arn' - The Amazon Resource Name (ARN) of the incident record you are updating.
newUpdateIncidentRecord ::
  -- | 'arn'
  Prelude.Text ->
  UpdateIncidentRecord
newUpdateIncidentRecord :: Text -> UpdateIncidentRecord
newUpdateIncidentRecord Text
pArn_ =
  UpdateIncidentRecord' :: Maybe Text
-> Maybe IncidentRecordStatus
-> Maybe [NotificationTargetItem]
-> Maybe Text
-> Maybe Natural
-> Maybe ChatChannel
-> Maybe Text
-> Text
-> UpdateIncidentRecord
UpdateIncidentRecord'
    { $sel:summary:UpdateIncidentRecord' :: Maybe Text
summary = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:status:UpdateIncidentRecord' :: Maybe IncidentRecordStatus
status = Maybe IncidentRecordStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:notificationTargets:UpdateIncidentRecord' :: Maybe [NotificationTargetItem]
notificationTargets = Maybe [NotificationTargetItem]
forall a. Maybe a
Prelude.Nothing,
      $sel:clientToken:UpdateIncidentRecord' :: Maybe Text
clientToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:impact:UpdateIncidentRecord' :: Maybe Natural
impact = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:chatChannel:UpdateIncidentRecord' :: Maybe ChatChannel
chatChannel = Maybe ChatChannel
forall a. Maybe a
Prelude.Nothing,
      $sel:title:UpdateIncidentRecord' :: Maybe Text
title = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:UpdateIncidentRecord' :: Text
arn = Text
pArn_
    }

-- | The summary describes what has happened during the incident.
updateIncidentRecord_summary :: Lens.Lens' UpdateIncidentRecord (Prelude.Maybe Prelude.Text)
updateIncidentRecord_summary :: (Maybe Text -> f (Maybe Text))
-> UpdateIncidentRecord -> f UpdateIncidentRecord
updateIncidentRecord_summary = (UpdateIncidentRecord -> Maybe Text)
-> (UpdateIncidentRecord -> Maybe Text -> UpdateIncidentRecord)
-> Lens
     UpdateIncidentRecord UpdateIncidentRecord (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateIncidentRecord' {Maybe Text
summary :: Maybe Text
$sel:summary:UpdateIncidentRecord' :: UpdateIncidentRecord -> Maybe Text
summary} -> Maybe Text
summary) (\s :: UpdateIncidentRecord
s@UpdateIncidentRecord' {} Maybe Text
a -> UpdateIncidentRecord
s {$sel:summary:UpdateIncidentRecord' :: Maybe Text
summary = Maybe Text
a} :: UpdateIncidentRecord)

-- | The status of the incident. An incident can be @Open@ or @Resolved@.
updateIncidentRecord_status :: Lens.Lens' UpdateIncidentRecord (Prelude.Maybe IncidentRecordStatus)
updateIncidentRecord_status :: (Maybe IncidentRecordStatus -> f (Maybe IncidentRecordStatus))
-> UpdateIncidentRecord -> f UpdateIncidentRecord
updateIncidentRecord_status = (UpdateIncidentRecord -> Maybe IncidentRecordStatus)
-> (UpdateIncidentRecord
    -> Maybe IncidentRecordStatus -> UpdateIncidentRecord)
-> Lens
     UpdateIncidentRecord
     UpdateIncidentRecord
     (Maybe IncidentRecordStatus)
     (Maybe IncidentRecordStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateIncidentRecord' {Maybe IncidentRecordStatus
status :: Maybe IncidentRecordStatus
$sel:status:UpdateIncidentRecord' :: UpdateIncidentRecord -> Maybe IncidentRecordStatus
status} -> Maybe IncidentRecordStatus
status) (\s :: UpdateIncidentRecord
s@UpdateIncidentRecord' {} Maybe IncidentRecordStatus
a -> UpdateIncidentRecord
s {$sel:status:UpdateIncidentRecord' :: Maybe IncidentRecordStatus
status = Maybe IncidentRecordStatus
a} :: UpdateIncidentRecord)

-- | The SNS targets that are notified when updates are made to an incident.
--
-- Using multiple SNS topics creates redundancy in the case that a Region
-- is down during the incident.
updateIncidentRecord_notificationTargets :: Lens.Lens' UpdateIncidentRecord (Prelude.Maybe [NotificationTargetItem])
updateIncidentRecord_notificationTargets :: (Maybe [NotificationTargetItem]
 -> f (Maybe [NotificationTargetItem]))
-> UpdateIncidentRecord -> f UpdateIncidentRecord
updateIncidentRecord_notificationTargets = (UpdateIncidentRecord -> Maybe [NotificationTargetItem])
-> (UpdateIncidentRecord
    -> Maybe [NotificationTargetItem] -> UpdateIncidentRecord)
-> Lens
     UpdateIncidentRecord
     UpdateIncidentRecord
     (Maybe [NotificationTargetItem])
     (Maybe [NotificationTargetItem])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateIncidentRecord' {Maybe [NotificationTargetItem]
notificationTargets :: Maybe [NotificationTargetItem]
$sel:notificationTargets:UpdateIncidentRecord' :: UpdateIncidentRecord -> Maybe [NotificationTargetItem]
notificationTargets} -> Maybe [NotificationTargetItem]
notificationTargets) (\s :: UpdateIncidentRecord
s@UpdateIncidentRecord' {} Maybe [NotificationTargetItem]
a -> UpdateIncidentRecord
s {$sel:notificationTargets:UpdateIncidentRecord' :: Maybe [NotificationTargetItem]
notificationTargets = Maybe [NotificationTargetItem]
a} :: UpdateIncidentRecord) ((Maybe [NotificationTargetItem]
  -> f (Maybe [NotificationTargetItem]))
 -> UpdateIncidentRecord -> f UpdateIncidentRecord)
-> ((Maybe [NotificationTargetItem]
     -> f (Maybe [NotificationTargetItem]))
    -> Maybe [NotificationTargetItem]
    -> f (Maybe [NotificationTargetItem]))
-> (Maybe [NotificationTargetItem]
    -> f (Maybe [NotificationTargetItem]))
-> UpdateIncidentRecord
-> f UpdateIncidentRecord
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [NotificationTargetItem]
  [NotificationTargetItem]
  [NotificationTargetItem]
  [NotificationTargetItem]
-> Iso
     (Maybe [NotificationTargetItem])
     (Maybe [NotificationTargetItem])
     (Maybe [NotificationTargetItem])
     (Maybe [NotificationTargetItem])
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
  [NotificationTargetItem]
  [NotificationTargetItem]
  [NotificationTargetItem]
  [NotificationTargetItem]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

-- | Defines the impact to customers and applications. Providing an impact
-- overwrites the impact provided by the response plan.
--
-- __Possible impacts:__
--
-- -   @1@ - Critical impact, this typically relates to full application
--     failure that impacts many to all customers.
--
-- -   @2@ - High impact, partial application failure with impact to many
--     customers.
--
-- -   @3@ - Medium impact, the application is providing reduced service to
--     customers.
--
-- -   @4@ - Low impact, customer might aren\'t impacted by the problem
--     yet.
--
-- -   @5@ - No impact, customers aren\'t currently impacted but urgent
--     action is needed to avoid impact.
updateIncidentRecord_impact :: Lens.Lens' UpdateIncidentRecord (Prelude.Maybe Prelude.Natural)
updateIncidentRecord_impact :: (Maybe Natural -> f (Maybe Natural))
-> UpdateIncidentRecord -> f UpdateIncidentRecord
updateIncidentRecord_impact = (UpdateIncidentRecord -> Maybe Natural)
-> (UpdateIncidentRecord -> Maybe Natural -> UpdateIncidentRecord)
-> Lens
     UpdateIncidentRecord
     UpdateIncidentRecord
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateIncidentRecord' {Maybe Natural
impact :: Maybe Natural
$sel:impact:UpdateIncidentRecord' :: UpdateIncidentRecord -> Maybe Natural
impact} -> Maybe Natural
impact) (\s :: UpdateIncidentRecord
s@UpdateIncidentRecord' {} Maybe Natural
a -> UpdateIncidentRecord
s {$sel:impact:UpdateIncidentRecord' :: Maybe Natural
impact = Maybe Natural
a} :: UpdateIncidentRecord)

-- | The AWS Chatbot chat channel for responders to collaborate in.
updateIncidentRecord_chatChannel :: Lens.Lens' UpdateIncidentRecord (Prelude.Maybe ChatChannel)
updateIncidentRecord_chatChannel :: (Maybe ChatChannel -> f (Maybe ChatChannel))
-> UpdateIncidentRecord -> f UpdateIncidentRecord
updateIncidentRecord_chatChannel = (UpdateIncidentRecord -> Maybe ChatChannel)
-> (UpdateIncidentRecord
    -> Maybe ChatChannel -> UpdateIncidentRecord)
-> Lens
     UpdateIncidentRecord
     UpdateIncidentRecord
     (Maybe ChatChannel)
     (Maybe ChatChannel)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateIncidentRecord' {Maybe ChatChannel
chatChannel :: Maybe ChatChannel
$sel:chatChannel:UpdateIncidentRecord' :: UpdateIncidentRecord -> Maybe ChatChannel
chatChannel} -> Maybe ChatChannel
chatChannel) (\s :: UpdateIncidentRecord
s@UpdateIncidentRecord' {} Maybe ChatChannel
a -> UpdateIncidentRecord
s {$sel:chatChannel:UpdateIncidentRecord' :: Maybe ChatChannel
chatChannel = Maybe ChatChannel
a} :: UpdateIncidentRecord)

-- | The title of the incident is a brief and easily recognizable.
updateIncidentRecord_title :: Lens.Lens' UpdateIncidentRecord (Prelude.Maybe Prelude.Text)
updateIncidentRecord_title :: (Maybe Text -> f (Maybe Text))
-> UpdateIncidentRecord -> f UpdateIncidentRecord
updateIncidentRecord_title = (UpdateIncidentRecord -> Maybe Text)
-> (UpdateIncidentRecord -> Maybe Text -> UpdateIncidentRecord)
-> Lens
     UpdateIncidentRecord UpdateIncidentRecord (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateIncidentRecord' {Maybe Text
title :: Maybe Text
$sel:title:UpdateIncidentRecord' :: UpdateIncidentRecord -> Maybe Text
title} -> Maybe Text
title) (\s :: UpdateIncidentRecord
s@UpdateIncidentRecord' {} Maybe Text
a -> UpdateIncidentRecord
s {$sel:title:UpdateIncidentRecord' :: Maybe Text
title = Maybe Text
a} :: UpdateIncidentRecord)

-- | The Amazon Resource Name (ARN) of the incident record you are updating.
updateIncidentRecord_arn :: Lens.Lens' UpdateIncidentRecord Prelude.Text
updateIncidentRecord_arn :: (Text -> f Text) -> UpdateIncidentRecord -> f UpdateIncidentRecord
updateIncidentRecord_arn = (UpdateIncidentRecord -> Text)
-> (UpdateIncidentRecord -> Text -> UpdateIncidentRecord)
-> Lens UpdateIncidentRecord UpdateIncidentRecord Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateIncidentRecord' {Text
arn :: Text
$sel:arn:UpdateIncidentRecord' :: UpdateIncidentRecord -> Text
arn} -> Text
arn) (\s :: UpdateIncidentRecord
s@UpdateIncidentRecord' {} Text
a -> UpdateIncidentRecord
s {$sel:arn:UpdateIncidentRecord' :: Text
arn = Text
a} :: UpdateIncidentRecord)

instance Core.AWSRequest UpdateIncidentRecord where
  type
    AWSResponse UpdateIncidentRecord =
      UpdateIncidentRecordResponse
  request :: UpdateIncidentRecord -> Request UpdateIncidentRecord
request = Service -> UpdateIncidentRecord -> Request UpdateIncidentRecord
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateIncidentRecord
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateIncidentRecord)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse UpdateIncidentRecord))
-> Logger
-> Service
-> Proxy UpdateIncidentRecord
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateIncidentRecord)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> UpdateIncidentRecordResponse
UpdateIncidentRecordResponse'
            (Int -> UpdateIncidentRecordResponse)
-> Either String Int -> Either String UpdateIncidentRecordResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable UpdateIncidentRecord

instance Prelude.NFData UpdateIncidentRecord

instance Core.ToHeaders UpdateIncidentRecord where
  toHeaders :: UpdateIncidentRecord -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateIncidentRecord -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON UpdateIncidentRecord where
  toJSON :: UpdateIncidentRecord -> Value
toJSON UpdateIncidentRecord' {Maybe Natural
Maybe [NotificationTargetItem]
Maybe Text
Maybe ChatChannel
Maybe IncidentRecordStatus
Text
arn :: Text
title :: Maybe Text
chatChannel :: Maybe ChatChannel
impact :: Maybe Natural
clientToken :: Maybe Text
notificationTargets :: Maybe [NotificationTargetItem]
status :: Maybe IncidentRecordStatus
summary :: Maybe Text
$sel:arn:UpdateIncidentRecord' :: UpdateIncidentRecord -> Text
$sel:title:UpdateIncidentRecord' :: UpdateIncidentRecord -> Maybe Text
$sel:chatChannel:UpdateIncidentRecord' :: UpdateIncidentRecord -> Maybe ChatChannel
$sel:impact:UpdateIncidentRecord' :: UpdateIncidentRecord -> Maybe Natural
$sel:clientToken:UpdateIncidentRecord' :: UpdateIncidentRecord -> Maybe Text
$sel:notificationTargets:UpdateIncidentRecord' :: UpdateIncidentRecord -> Maybe [NotificationTargetItem]
$sel:status:UpdateIncidentRecord' :: UpdateIncidentRecord -> Maybe IncidentRecordStatus
$sel:summary:UpdateIncidentRecord' :: UpdateIncidentRecord -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"summary" 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
summary,
            (Text
"status" Text -> IncidentRecordStatus -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (IncidentRecordStatus -> Pair)
-> Maybe IncidentRecordStatus -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe IncidentRecordStatus
status,
            (Text
"notificationTargets" Text -> [NotificationTargetItem] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([NotificationTargetItem] -> Pair)
-> Maybe [NotificationTargetItem] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [NotificationTargetItem]
notificationTargets,
            (Text
"clientToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
clientToken,
            (Text
"impact" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
impact,
            (Text
"chatChannel" Text -> ChatChannel -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ChatChannel -> Pair) -> Maybe ChatChannel -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ChatChannel
chatChannel,
            (Text
"title" 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
title,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"arn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
arn)
          ]
      )

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

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

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

-- |
-- Create a value of 'UpdateIncidentRecordResponse' 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', 'updateIncidentRecordResponse_httpStatus' - The response's http status code.
newUpdateIncidentRecordResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateIncidentRecordResponse
newUpdateIncidentRecordResponse :: Int -> UpdateIncidentRecordResponse
newUpdateIncidentRecordResponse Int
pHttpStatus_ =
  UpdateIncidentRecordResponse' :: Int -> UpdateIncidentRecordResponse
UpdateIncidentRecordResponse'
    { $sel:httpStatus:UpdateIncidentRecordResponse' :: Int
httpStatus =
        Int
pHttpStatus_
    }

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

instance Prelude.NFData UpdateIncidentRecordResponse