{-# 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.SSM.UpdateOpsItem
-- 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)
--
-- Edit or change an OpsItem. You must have permission in Identity and
-- Access Management (IAM) to update an OpsItem. For more information, see
-- <https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-getting-started.html Getting started with OpsCenter>
-- in the /Amazon Web Services Systems Manager User Guide/.
--
-- Operations engineers and IT professionals use Amazon Web Services
-- Systems Manager OpsCenter to view, investigate, and remediate
-- operational issues impacting the performance and health of their Amazon
-- Web Services resources. For more information, see
-- <https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter.html OpsCenter>
-- in the /Amazon Web Services Systems Manager User Guide/.
module Amazonka.SSM.UpdateOpsItem
  ( -- * Creating a Request
    UpdateOpsItem (..),
    newUpdateOpsItem,

    -- * Request Lenses
    updateOpsItem_actualEndTime,
    updateOpsItem_status,
    updateOpsItem_operationalDataToDelete,
    updateOpsItem_priority,
    updateOpsItem_category,
    updateOpsItem_severity,
    updateOpsItem_relatedOpsItems,
    updateOpsItem_title,
    updateOpsItem_operationalData,
    updateOpsItem_actualStartTime,
    updateOpsItem_description,
    updateOpsItem_plannedEndTime,
    updateOpsItem_notifications,
    updateOpsItem_plannedStartTime,
    updateOpsItem_opsItemId,

    -- * Destructuring the Response
    UpdateOpsItemResponse (..),
    newUpdateOpsItemResponse,

    -- * Response Lenses
    updateOpsItemResponse_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.SSM.Types

-- | /See:/ 'newUpdateOpsItem' smart constructor.
data UpdateOpsItem = UpdateOpsItem'
  { -- | The time a runbook workflow ended. Currently reported only for the
    -- OpsItem type @\/aws\/changerequest@.
    UpdateOpsItem -> Maybe POSIX
actualEndTime :: Prelude.Maybe Core.POSIX,
    -- | The OpsItem status. Status can be @Open@, @In Progress@, or @Resolved@.
    -- For more information, see
    -- <https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-working-with-OpsItems.html#OpsCenter-working-with-OpsItems-editing-details Editing OpsItem details>
    -- in the /Amazon Web Services Systems Manager User Guide/.
    UpdateOpsItem -> Maybe OpsItemStatus
status :: Prelude.Maybe OpsItemStatus,
    -- | Keys that you want to remove from the OperationalData map.
    UpdateOpsItem -> Maybe [Text]
operationalDataToDelete :: Prelude.Maybe [Prelude.Text],
    -- | The importance of this OpsItem in relation to other OpsItems in the
    -- system.
    UpdateOpsItem -> Maybe Natural
priority :: Prelude.Maybe Prelude.Natural,
    -- | Specify a new category for an OpsItem.
    UpdateOpsItem -> Maybe Text
category :: Prelude.Maybe Prelude.Text,
    -- | Specify a new severity for an OpsItem.
    UpdateOpsItem -> Maybe Text
severity :: Prelude.Maybe Prelude.Text,
    -- | One or more OpsItems that share something in common with the current
    -- OpsItems. For example, related OpsItems can include OpsItems with
    -- similar error messages, impacted resources, or statuses for the impacted
    -- resource.
    UpdateOpsItem -> Maybe [RelatedOpsItem]
relatedOpsItems :: Prelude.Maybe [RelatedOpsItem],
    -- | A short heading that describes the nature of the OpsItem and the
    -- impacted resource.
    UpdateOpsItem -> Maybe Text
title :: Prelude.Maybe Prelude.Text,
    -- | Add new keys or edit existing key-value pairs of the OperationalData map
    -- in the OpsItem object.
    --
    -- Operational data is custom data that provides useful reference details
    -- about the OpsItem. For example, you can specify log files, error
    -- strings, license keys, troubleshooting tips, or other relevant data. You
    -- enter operational data as key-value pairs. The key has a maximum length
    -- of 128 characters. The value has a maximum size of 20 KB.
    --
    -- Operational data keys /can\'t/ begin with the following: @amazon@,
    -- @aws@, @amzn@, @ssm@, @\/amazon@, @\/aws@, @\/amzn@, @\/ssm@.
    --
    -- You can choose to make the data searchable by other users in the account
    -- or you can restrict search access. Searchable data means that all users
    -- with access to the OpsItem Overview page (as provided by the
    -- DescribeOpsItems API operation) can view and search on the specified
    -- data. Operational data that isn\'t searchable is only viewable by users
    -- who have access to the OpsItem (as provided by the GetOpsItem API
    -- operation).
    --
    -- Use the @\/aws\/resources@ key in OperationalData to specify a related
    -- resource in the request. Use the @\/aws\/automations@ key in
    -- OperationalData to associate an Automation runbook with the OpsItem. To
    -- view Amazon Web Services CLI example commands that use these keys, see
    -- <https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-creating-OpsItems.html#OpsCenter-manually-create-OpsItems Creating OpsItems manually>
    -- in the /Amazon Web Services Systems Manager User Guide/.
    UpdateOpsItem -> Maybe (HashMap Text OpsItemDataValue)
operationalData :: Prelude.Maybe (Prelude.HashMap Prelude.Text OpsItemDataValue),
    -- | The time a runbook workflow started. Currently reported only for the
    -- OpsItem type @\/aws\/changerequest@.
    UpdateOpsItem -> Maybe POSIX
actualStartTime :: Prelude.Maybe Core.POSIX,
    -- | Update the information about the OpsItem. Provide enough information so
    -- that users reading this OpsItem for the first time understand the issue.
    UpdateOpsItem -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The time specified in a change request for a runbook workflow to end.
    -- Currently supported only for the OpsItem type @\/aws\/changerequest@.
    UpdateOpsItem -> Maybe POSIX
plannedEndTime :: Prelude.Maybe Core.POSIX,
    -- | The Amazon Resource Name (ARN) of an SNS topic where notifications are
    -- sent when this OpsItem is edited or changed.
    UpdateOpsItem -> Maybe [OpsItemNotification]
notifications :: Prelude.Maybe [OpsItemNotification],
    -- | The time specified in a change request for a runbook workflow to start.
    -- Currently supported only for the OpsItem type @\/aws\/changerequest@.
    UpdateOpsItem -> Maybe POSIX
plannedStartTime :: Prelude.Maybe Core.POSIX,
    -- | The ID of the OpsItem.
    UpdateOpsItem -> Text
opsItemId :: Prelude.Text
  }
  deriving (UpdateOpsItem -> UpdateOpsItem -> Bool
(UpdateOpsItem -> UpdateOpsItem -> Bool)
-> (UpdateOpsItem -> UpdateOpsItem -> Bool) -> Eq UpdateOpsItem
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateOpsItem -> UpdateOpsItem -> Bool
$c/= :: UpdateOpsItem -> UpdateOpsItem -> Bool
== :: UpdateOpsItem -> UpdateOpsItem -> Bool
$c== :: UpdateOpsItem -> UpdateOpsItem -> Bool
Prelude.Eq, ReadPrec [UpdateOpsItem]
ReadPrec UpdateOpsItem
Int -> ReadS UpdateOpsItem
ReadS [UpdateOpsItem]
(Int -> ReadS UpdateOpsItem)
-> ReadS [UpdateOpsItem]
-> ReadPrec UpdateOpsItem
-> ReadPrec [UpdateOpsItem]
-> Read UpdateOpsItem
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateOpsItem]
$creadListPrec :: ReadPrec [UpdateOpsItem]
readPrec :: ReadPrec UpdateOpsItem
$creadPrec :: ReadPrec UpdateOpsItem
readList :: ReadS [UpdateOpsItem]
$creadList :: ReadS [UpdateOpsItem]
readsPrec :: Int -> ReadS UpdateOpsItem
$creadsPrec :: Int -> ReadS UpdateOpsItem
Prelude.Read, Int -> UpdateOpsItem -> ShowS
[UpdateOpsItem] -> ShowS
UpdateOpsItem -> String
(Int -> UpdateOpsItem -> ShowS)
-> (UpdateOpsItem -> String)
-> ([UpdateOpsItem] -> ShowS)
-> Show UpdateOpsItem
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateOpsItem] -> ShowS
$cshowList :: [UpdateOpsItem] -> ShowS
show :: UpdateOpsItem -> String
$cshow :: UpdateOpsItem -> String
showsPrec :: Int -> UpdateOpsItem -> ShowS
$cshowsPrec :: Int -> UpdateOpsItem -> ShowS
Prelude.Show, (forall x. UpdateOpsItem -> Rep UpdateOpsItem x)
-> (forall x. Rep UpdateOpsItem x -> UpdateOpsItem)
-> Generic UpdateOpsItem
forall x. Rep UpdateOpsItem x -> UpdateOpsItem
forall x. UpdateOpsItem -> Rep UpdateOpsItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateOpsItem x -> UpdateOpsItem
$cfrom :: forall x. UpdateOpsItem -> Rep UpdateOpsItem x
Prelude.Generic)

-- |
-- Create a value of 'UpdateOpsItem' 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:
--
-- 'actualEndTime', 'updateOpsItem_actualEndTime' - The time a runbook workflow ended. Currently reported only for the
-- OpsItem type @\/aws\/changerequest@.
--
-- 'status', 'updateOpsItem_status' - The OpsItem status. Status can be @Open@, @In Progress@, or @Resolved@.
-- For more information, see
-- <https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-working-with-OpsItems.html#OpsCenter-working-with-OpsItems-editing-details Editing OpsItem details>
-- in the /Amazon Web Services Systems Manager User Guide/.
--
-- 'operationalDataToDelete', 'updateOpsItem_operationalDataToDelete' - Keys that you want to remove from the OperationalData map.
--
-- 'priority', 'updateOpsItem_priority' - The importance of this OpsItem in relation to other OpsItems in the
-- system.
--
-- 'category', 'updateOpsItem_category' - Specify a new category for an OpsItem.
--
-- 'severity', 'updateOpsItem_severity' - Specify a new severity for an OpsItem.
--
-- 'relatedOpsItems', 'updateOpsItem_relatedOpsItems' - One or more OpsItems that share something in common with the current
-- OpsItems. For example, related OpsItems can include OpsItems with
-- similar error messages, impacted resources, or statuses for the impacted
-- resource.
--
-- 'title', 'updateOpsItem_title' - A short heading that describes the nature of the OpsItem and the
-- impacted resource.
--
-- 'operationalData', 'updateOpsItem_operationalData' - Add new keys or edit existing key-value pairs of the OperationalData map
-- in the OpsItem object.
--
-- Operational data is custom data that provides useful reference details
-- about the OpsItem. For example, you can specify log files, error
-- strings, license keys, troubleshooting tips, or other relevant data. You
-- enter operational data as key-value pairs. The key has a maximum length
-- of 128 characters. The value has a maximum size of 20 KB.
--
-- Operational data keys /can\'t/ begin with the following: @amazon@,
-- @aws@, @amzn@, @ssm@, @\/amazon@, @\/aws@, @\/amzn@, @\/ssm@.
--
-- You can choose to make the data searchable by other users in the account
-- or you can restrict search access. Searchable data means that all users
-- with access to the OpsItem Overview page (as provided by the
-- DescribeOpsItems API operation) can view and search on the specified
-- data. Operational data that isn\'t searchable is only viewable by users
-- who have access to the OpsItem (as provided by the GetOpsItem API
-- operation).
--
-- Use the @\/aws\/resources@ key in OperationalData to specify a related
-- resource in the request. Use the @\/aws\/automations@ key in
-- OperationalData to associate an Automation runbook with the OpsItem. To
-- view Amazon Web Services CLI example commands that use these keys, see
-- <https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-creating-OpsItems.html#OpsCenter-manually-create-OpsItems Creating OpsItems manually>
-- in the /Amazon Web Services Systems Manager User Guide/.
--
-- 'actualStartTime', 'updateOpsItem_actualStartTime' - The time a runbook workflow started. Currently reported only for the
-- OpsItem type @\/aws\/changerequest@.
--
-- 'description', 'updateOpsItem_description' - Update the information about the OpsItem. Provide enough information so
-- that users reading this OpsItem for the first time understand the issue.
--
-- 'plannedEndTime', 'updateOpsItem_plannedEndTime' - The time specified in a change request for a runbook workflow to end.
-- Currently supported only for the OpsItem type @\/aws\/changerequest@.
--
-- 'notifications', 'updateOpsItem_notifications' - The Amazon Resource Name (ARN) of an SNS topic where notifications are
-- sent when this OpsItem is edited or changed.
--
-- 'plannedStartTime', 'updateOpsItem_plannedStartTime' - The time specified in a change request for a runbook workflow to start.
-- Currently supported only for the OpsItem type @\/aws\/changerequest@.
--
-- 'opsItemId', 'updateOpsItem_opsItemId' - The ID of the OpsItem.
newUpdateOpsItem ::
  -- | 'opsItemId'
  Prelude.Text ->
  UpdateOpsItem
newUpdateOpsItem :: Text -> UpdateOpsItem
newUpdateOpsItem Text
pOpsItemId_ =
  UpdateOpsItem' :: Maybe POSIX
-> Maybe OpsItemStatus
-> Maybe [Text]
-> Maybe Natural
-> Maybe Text
-> Maybe Text
-> Maybe [RelatedOpsItem]
-> Maybe Text
-> Maybe (HashMap Text OpsItemDataValue)
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe [OpsItemNotification]
-> Maybe POSIX
-> Text
-> UpdateOpsItem
UpdateOpsItem'
    { $sel:actualEndTime:UpdateOpsItem' :: Maybe POSIX
actualEndTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:status:UpdateOpsItem' :: Maybe OpsItemStatus
status = Maybe OpsItemStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:operationalDataToDelete:UpdateOpsItem' :: Maybe [Text]
operationalDataToDelete = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:priority:UpdateOpsItem' :: Maybe Natural
priority = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:category:UpdateOpsItem' :: Maybe Text
category = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:severity:UpdateOpsItem' :: Maybe Text
severity = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:relatedOpsItems:UpdateOpsItem' :: Maybe [RelatedOpsItem]
relatedOpsItems = Maybe [RelatedOpsItem]
forall a. Maybe a
Prelude.Nothing,
      $sel:title:UpdateOpsItem' :: Maybe Text
title = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:operationalData:UpdateOpsItem' :: Maybe (HashMap Text OpsItemDataValue)
operationalData = Maybe (HashMap Text OpsItemDataValue)
forall a. Maybe a
Prelude.Nothing,
      $sel:actualStartTime:UpdateOpsItem' :: Maybe POSIX
actualStartTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:description:UpdateOpsItem' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:plannedEndTime:UpdateOpsItem' :: Maybe POSIX
plannedEndTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:notifications:UpdateOpsItem' :: Maybe [OpsItemNotification]
notifications = Maybe [OpsItemNotification]
forall a. Maybe a
Prelude.Nothing,
      $sel:plannedStartTime:UpdateOpsItem' :: Maybe POSIX
plannedStartTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:opsItemId:UpdateOpsItem' :: Text
opsItemId = Text
pOpsItemId_
    }

-- | The time a runbook workflow ended. Currently reported only for the
-- OpsItem type @\/aws\/changerequest@.
updateOpsItem_actualEndTime :: Lens.Lens' UpdateOpsItem (Prelude.Maybe Prelude.UTCTime)
updateOpsItem_actualEndTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> UpdateOpsItem -> f UpdateOpsItem
updateOpsItem_actualEndTime = (UpdateOpsItem -> Maybe POSIX)
-> (UpdateOpsItem -> Maybe POSIX -> UpdateOpsItem)
-> Lens UpdateOpsItem UpdateOpsItem (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateOpsItem' {Maybe POSIX
actualEndTime :: Maybe POSIX
$sel:actualEndTime:UpdateOpsItem' :: UpdateOpsItem -> Maybe POSIX
actualEndTime} -> Maybe POSIX
actualEndTime) (\s :: UpdateOpsItem
s@UpdateOpsItem' {} Maybe POSIX
a -> UpdateOpsItem
s {$sel:actualEndTime:UpdateOpsItem' :: Maybe POSIX
actualEndTime = Maybe POSIX
a} :: UpdateOpsItem) ((Maybe POSIX -> f (Maybe POSIX))
 -> UpdateOpsItem -> f UpdateOpsItem)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> UpdateOpsItem
-> f UpdateOpsItem
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 OpsItem status. Status can be @Open@, @In Progress@, or @Resolved@.
-- For more information, see
-- <https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-working-with-OpsItems.html#OpsCenter-working-with-OpsItems-editing-details Editing OpsItem details>
-- in the /Amazon Web Services Systems Manager User Guide/.
updateOpsItem_status :: Lens.Lens' UpdateOpsItem (Prelude.Maybe OpsItemStatus)
updateOpsItem_status :: (Maybe OpsItemStatus -> f (Maybe OpsItemStatus))
-> UpdateOpsItem -> f UpdateOpsItem
updateOpsItem_status = (UpdateOpsItem -> Maybe OpsItemStatus)
-> (UpdateOpsItem -> Maybe OpsItemStatus -> UpdateOpsItem)
-> Lens
     UpdateOpsItem
     UpdateOpsItem
     (Maybe OpsItemStatus)
     (Maybe OpsItemStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateOpsItem' {Maybe OpsItemStatus
status :: Maybe OpsItemStatus
$sel:status:UpdateOpsItem' :: UpdateOpsItem -> Maybe OpsItemStatus
status} -> Maybe OpsItemStatus
status) (\s :: UpdateOpsItem
s@UpdateOpsItem' {} Maybe OpsItemStatus
a -> UpdateOpsItem
s {$sel:status:UpdateOpsItem' :: Maybe OpsItemStatus
status = Maybe OpsItemStatus
a} :: UpdateOpsItem)

-- | Keys that you want to remove from the OperationalData map.
updateOpsItem_operationalDataToDelete :: Lens.Lens' UpdateOpsItem (Prelude.Maybe [Prelude.Text])
updateOpsItem_operationalDataToDelete :: (Maybe [Text] -> f (Maybe [Text]))
-> UpdateOpsItem -> f UpdateOpsItem
updateOpsItem_operationalDataToDelete = (UpdateOpsItem -> Maybe [Text])
-> (UpdateOpsItem -> Maybe [Text] -> UpdateOpsItem)
-> Lens UpdateOpsItem UpdateOpsItem (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateOpsItem' {Maybe [Text]
operationalDataToDelete :: Maybe [Text]
$sel:operationalDataToDelete:UpdateOpsItem' :: UpdateOpsItem -> Maybe [Text]
operationalDataToDelete} -> Maybe [Text]
operationalDataToDelete) (\s :: UpdateOpsItem
s@UpdateOpsItem' {} Maybe [Text]
a -> UpdateOpsItem
s {$sel:operationalDataToDelete:UpdateOpsItem' :: Maybe [Text]
operationalDataToDelete = Maybe [Text]
a} :: UpdateOpsItem) ((Maybe [Text] -> f (Maybe [Text]))
 -> UpdateOpsItem -> f UpdateOpsItem)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> UpdateOpsItem
-> f UpdateOpsItem
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The importance of this OpsItem in relation to other OpsItems in the
-- system.
updateOpsItem_priority :: Lens.Lens' UpdateOpsItem (Prelude.Maybe Prelude.Natural)
updateOpsItem_priority :: (Maybe Natural -> f (Maybe Natural))
-> UpdateOpsItem -> f UpdateOpsItem
updateOpsItem_priority = (UpdateOpsItem -> Maybe Natural)
-> (UpdateOpsItem -> Maybe Natural -> UpdateOpsItem)
-> Lens UpdateOpsItem UpdateOpsItem (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateOpsItem' {Maybe Natural
priority :: Maybe Natural
$sel:priority:UpdateOpsItem' :: UpdateOpsItem -> Maybe Natural
priority} -> Maybe Natural
priority) (\s :: UpdateOpsItem
s@UpdateOpsItem' {} Maybe Natural
a -> UpdateOpsItem
s {$sel:priority:UpdateOpsItem' :: Maybe Natural
priority = Maybe Natural
a} :: UpdateOpsItem)

-- | Specify a new category for an OpsItem.
updateOpsItem_category :: Lens.Lens' UpdateOpsItem (Prelude.Maybe Prelude.Text)
updateOpsItem_category :: (Maybe Text -> f (Maybe Text)) -> UpdateOpsItem -> f UpdateOpsItem
updateOpsItem_category = (UpdateOpsItem -> Maybe Text)
-> (UpdateOpsItem -> Maybe Text -> UpdateOpsItem)
-> Lens UpdateOpsItem UpdateOpsItem (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateOpsItem' {Maybe Text
category :: Maybe Text
$sel:category:UpdateOpsItem' :: UpdateOpsItem -> Maybe Text
category} -> Maybe Text
category) (\s :: UpdateOpsItem
s@UpdateOpsItem' {} Maybe Text
a -> UpdateOpsItem
s {$sel:category:UpdateOpsItem' :: Maybe Text
category = Maybe Text
a} :: UpdateOpsItem)

-- | Specify a new severity for an OpsItem.
updateOpsItem_severity :: Lens.Lens' UpdateOpsItem (Prelude.Maybe Prelude.Text)
updateOpsItem_severity :: (Maybe Text -> f (Maybe Text)) -> UpdateOpsItem -> f UpdateOpsItem
updateOpsItem_severity = (UpdateOpsItem -> Maybe Text)
-> (UpdateOpsItem -> Maybe Text -> UpdateOpsItem)
-> Lens UpdateOpsItem UpdateOpsItem (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateOpsItem' {Maybe Text
severity :: Maybe Text
$sel:severity:UpdateOpsItem' :: UpdateOpsItem -> Maybe Text
severity} -> Maybe Text
severity) (\s :: UpdateOpsItem
s@UpdateOpsItem' {} Maybe Text
a -> UpdateOpsItem
s {$sel:severity:UpdateOpsItem' :: Maybe Text
severity = Maybe Text
a} :: UpdateOpsItem)

-- | One or more OpsItems that share something in common with the current
-- OpsItems. For example, related OpsItems can include OpsItems with
-- similar error messages, impacted resources, or statuses for the impacted
-- resource.
updateOpsItem_relatedOpsItems :: Lens.Lens' UpdateOpsItem (Prelude.Maybe [RelatedOpsItem])
updateOpsItem_relatedOpsItems :: (Maybe [RelatedOpsItem] -> f (Maybe [RelatedOpsItem]))
-> UpdateOpsItem -> f UpdateOpsItem
updateOpsItem_relatedOpsItems = (UpdateOpsItem -> Maybe [RelatedOpsItem])
-> (UpdateOpsItem -> Maybe [RelatedOpsItem] -> UpdateOpsItem)
-> Lens
     UpdateOpsItem
     UpdateOpsItem
     (Maybe [RelatedOpsItem])
     (Maybe [RelatedOpsItem])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateOpsItem' {Maybe [RelatedOpsItem]
relatedOpsItems :: Maybe [RelatedOpsItem]
$sel:relatedOpsItems:UpdateOpsItem' :: UpdateOpsItem -> Maybe [RelatedOpsItem]
relatedOpsItems} -> Maybe [RelatedOpsItem]
relatedOpsItems) (\s :: UpdateOpsItem
s@UpdateOpsItem' {} Maybe [RelatedOpsItem]
a -> UpdateOpsItem
s {$sel:relatedOpsItems:UpdateOpsItem' :: Maybe [RelatedOpsItem]
relatedOpsItems = Maybe [RelatedOpsItem]
a} :: UpdateOpsItem) ((Maybe [RelatedOpsItem] -> f (Maybe [RelatedOpsItem]))
 -> UpdateOpsItem -> f UpdateOpsItem)
-> ((Maybe [RelatedOpsItem] -> f (Maybe [RelatedOpsItem]))
    -> Maybe [RelatedOpsItem] -> f (Maybe [RelatedOpsItem]))
-> (Maybe [RelatedOpsItem] -> f (Maybe [RelatedOpsItem]))
-> UpdateOpsItem
-> f UpdateOpsItem
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [RelatedOpsItem] [RelatedOpsItem] [RelatedOpsItem] [RelatedOpsItem]
-> Iso
     (Maybe [RelatedOpsItem])
     (Maybe [RelatedOpsItem])
     (Maybe [RelatedOpsItem])
     (Maybe [RelatedOpsItem])
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
  [RelatedOpsItem] [RelatedOpsItem] [RelatedOpsItem] [RelatedOpsItem]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A short heading that describes the nature of the OpsItem and the
-- impacted resource.
updateOpsItem_title :: Lens.Lens' UpdateOpsItem (Prelude.Maybe Prelude.Text)
updateOpsItem_title :: (Maybe Text -> f (Maybe Text)) -> UpdateOpsItem -> f UpdateOpsItem
updateOpsItem_title = (UpdateOpsItem -> Maybe Text)
-> (UpdateOpsItem -> Maybe Text -> UpdateOpsItem)
-> Lens UpdateOpsItem UpdateOpsItem (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateOpsItem' {Maybe Text
title :: Maybe Text
$sel:title:UpdateOpsItem' :: UpdateOpsItem -> Maybe Text
title} -> Maybe Text
title) (\s :: UpdateOpsItem
s@UpdateOpsItem' {} Maybe Text
a -> UpdateOpsItem
s {$sel:title:UpdateOpsItem' :: Maybe Text
title = Maybe Text
a} :: UpdateOpsItem)

-- | Add new keys or edit existing key-value pairs of the OperationalData map
-- in the OpsItem object.
--
-- Operational data is custom data that provides useful reference details
-- about the OpsItem. For example, you can specify log files, error
-- strings, license keys, troubleshooting tips, or other relevant data. You
-- enter operational data as key-value pairs. The key has a maximum length
-- of 128 characters. The value has a maximum size of 20 KB.
--
-- Operational data keys /can\'t/ begin with the following: @amazon@,
-- @aws@, @amzn@, @ssm@, @\/amazon@, @\/aws@, @\/amzn@, @\/ssm@.
--
-- You can choose to make the data searchable by other users in the account
-- or you can restrict search access. Searchable data means that all users
-- with access to the OpsItem Overview page (as provided by the
-- DescribeOpsItems API operation) can view and search on the specified
-- data. Operational data that isn\'t searchable is only viewable by users
-- who have access to the OpsItem (as provided by the GetOpsItem API
-- operation).
--
-- Use the @\/aws\/resources@ key in OperationalData to specify a related
-- resource in the request. Use the @\/aws\/automations@ key in
-- OperationalData to associate an Automation runbook with the OpsItem. To
-- view Amazon Web Services CLI example commands that use these keys, see
-- <https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-creating-OpsItems.html#OpsCenter-manually-create-OpsItems Creating OpsItems manually>
-- in the /Amazon Web Services Systems Manager User Guide/.
updateOpsItem_operationalData :: Lens.Lens' UpdateOpsItem (Prelude.Maybe (Prelude.HashMap Prelude.Text OpsItemDataValue))
updateOpsItem_operationalData :: (Maybe (HashMap Text OpsItemDataValue)
 -> f (Maybe (HashMap Text OpsItemDataValue)))
-> UpdateOpsItem -> f UpdateOpsItem
updateOpsItem_operationalData = (UpdateOpsItem -> Maybe (HashMap Text OpsItemDataValue))
-> (UpdateOpsItem
    -> Maybe (HashMap Text OpsItemDataValue) -> UpdateOpsItem)
-> Lens
     UpdateOpsItem
     UpdateOpsItem
     (Maybe (HashMap Text OpsItemDataValue))
     (Maybe (HashMap Text OpsItemDataValue))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateOpsItem' {Maybe (HashMap Text OpsItemDataValue)
operationalData :: Maybe (HashMap Text OpsItemDataValue)
$sel:operationalData:UpdateOpsItem' :: UpdateOpsItem -> Maybe (HashMap Text OpsItemDataValue)
operationalData} -> Maybe (HashMap Text OpsItemDataValue)
operationalData) (\s :: UpdateOpsItem
s@UpdateOpsItem' {} Maybe (HashMap Text OpsItemDataValue)
a -> UpdateOpsItem
s {$sel:operationalData:UpdateOpsItem' :: Maybe (HashMap Text OpsItemDataValue)
operationalData = Maybe (HashMap Text OpsItemDataValue)
a} :: UpdateOpsItem) ((Maybe (HashMap Text OpsItemDataValue)
  -> f (Maybe (HashMap Text OpsItemDataValue)))
 -> UpdateOpsItem -> f UpdateOpsItem)
-> ((Maybe (HashMap Text OpsItemDataValue)
     -> f (Maybe (HashMap Text OpsItemDataValue)))
    -> Maybe (HashMap Text OpsItemDataValue)
    -> f (Maybe (HashMap Text OpsItemDataValue)))
-> (Maybe (HashMap Text OpsItemDataValue)
    -> f (Maybe (HashMap Text OpsItemDataValue)))
-> UpdateOpsItem
-> f UpdateOpsItem
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text OpsItemDataValue)
  (HashMap Text OpsItemDataValue)
  (HashMap Text OpsItemDataValue)
  (HashMap Text OpsItemDataValue)
-> Iso
     (Maybe (HashMap Text OpsItemDataValue))
     (Maybe (HashMap Text OpsItemDataValue))
     (Maybe (HashMap Text OpsItemDataValue))
     (Maybe (HashMap Text OpsItemDataValue))
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
  (HashMap Text OpsItemDataValue)
  (HashMap Text OpsItemDataValue)
  (HashMap Text OpsItemDataValue)
  (HashMap Text OpsItemDataValue)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The time a runbook workflow started. Currently reported only for the
-- OpsItem type @\/aws\/changerequest@.
updateOpsItem_actualStartTime :: Lens.Lens' UpdateOpsItem (Prelude.Maybe Prelude.UTCTime)
updateOpsItem_actualStartTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> UpdateOpsItem -> f UpdateOpsItem
updateOpsItem_actualStartTime = (UpdateOpsItem -> Maybe POSIX)
-> (UpdateOpsItem -> Maybe POSIX -> UpdateOpsItem)
-> Lens UpdateOpsItem UpdateOpsItem (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateOpsItem' {Maybe POSIX
actualStartTime :: Maybe POSIX
$sel:actualStartTime:UpdateOpsItem' :: UpdateOpsItem -> Maybe POSIX
actualStartTime} -> Maybe POSIX
actualStartTime) (\s :: UpdateOpsItem
s@UpdateOpsItem' {} Maybe POSIX
a -> UpdateOpsItem
s {$sel:actualStartTime:UpdateOpsItem' :: Maybe POSIX
actualStartTime = Maybe POSIX
a} :: UpdateOpsItem) ((Maybe POSIX -> f (Maybe POSIX))
 -> UpdateOpsItem -> f UpdateOpsItem)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> UpdateOpsItem
-> f UpdateOpsItem
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

-- | Update the information about the OpsItem. Provide enough information so
-- that users reading this OpsItem for the first time understand the issue.
updateOpsItem_description :: Lens.Lens' UpdateOpsItem (Prelude.Maybe Prelude.Text)
updateOpsItem_description :: (Maybe Text -> f (Maybe Text)) -> UpdateOpsItem -> f UpdateOpsItem
updateOpsItem_description = (UpdateOpsItem -> Maybe Text)
-> (UpdateOpsItem -> Maybe Text -> UpdateOpsItem)
-> Lens UpdateOpsItem UpdateOpsItem (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateOpsItem' {Maybe Text
description :: Maybe Text
$sel:description:UpdateOpsItem' :: UpdateOpsItem -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateOpsItem
s@UpdateOpsItem' {} Maybe Text
a -> UpdateOpsItem
s {$sel:description:UpdateOpsItem' :: Maybe Text
description = Maybe Text
a} :: UpdateOpsItem)

-- | The time specified in a change request for a runbook workflow to end.
-- Currently supported only for the OpsItem type @\/aws\/changerequest@.
updateOpsItem_plannedEndTime :: Lens.Lens' UpdateOpsItem (Prelude.Maybe Prelude.UTCTime)
updateOpsItem_plannedEndTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> UpdateOpsItem -> f UpdateOpsItem
updateOpsItem_plannedEndTime = (UpdateOpsItem -> Maybe POSIX)
-> (UpdateOpsItem -> Maybe POSIX -> UpdateOpsItem)
-> Lens UpdateOpsItem UpdateOpsItem (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateOpsItem' {Maybe POSIX
plannedEndTime :: Maybe POSIX
$sel:plannedEndTime:UpdateOpsItem' :: UpdateOpsItem -> Maybe POSIX
plannedEndTime} -> Maybe POSIX
plannedEndTime) (\s :: UpdateOpsItem
s@UpdateOpsItem' {} Maybe POSIX
a -> UpdateOpsItem
s {$sel:plannedEndTime:UpdateOpsItem' :: Maybe POSIX
plannedEndTime = Maybe POSIX
a} :: UpdateOpsItem) ((Maybe POSIX -> f (Maybe POSIX))
 -> UpdateOpsItem -> f UpdateOpsItem)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> UpdateOpsItem
-> f UpdateOpsItem
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 Amazon Resource Name (ARN) of an SNS topic where notifications are
-- sent when this OpsItem is edited or changed.
updateOpsItem_notifications :: Lens.Lens' UpdateOpsItem (Prelude.Maybe [OpsItemNotification])
updateOpsItem_notifications :: (Maybe [OpsItemNotification] -> f (Maybe [OpsItemNotification]))
-> UpdateOpsItem -> f UpdateOpsItem
updateOpsItem_notifications = (UpdateOpsItem -> Maybe [OpsItemNotification])
-> (UpdateOpsItem -> Maybe [OpsItemNotification] -> UpdateOpsItem)
-> Lens
     UpdateOpsItem
     UpdateOpsItem
     (Maybe [OpsItemNotification])
     (Maybe [OpsItemNotification])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateOpsItem' {Maybe [OpsItemNotification]
notifications :: Maybe [OpsItemNotification]
$sel:notifications:UpdateOpsItem' :: UpdateOpsItem -> Maybe [OpsItemNotification]
notifications} -> Maybe [OpsItemNotification]
notifications) (\s :: UpdateOpsItem
s@UpdateOpsItem' {} Maybe [OpsItemNotification]
a -> UpdateOpsItem
s {$sel:notifications:UpdateOpsItem' :: Maybe [OpsItemNotification]
notifications = Maybe [OpsItemNotification]
a} :: UpdateOpsItem) ((Maybe [OpsItemNotification] -> f (Maybe [OpsItemNotification]))
 -> UpdateOpsItem -> f UpdateOpsItem)
-> ((Maybe [OpsItemNotification]
     -> f (Maybe [OpsItemNotification]))
    -> Maybe [OpsItemNotification] -> f (Maybe [OpsItemNotification]))
-> (Maybe [OpsItemNotification] -> f (Maybe [OpsItemNotification]))
-> UpdateOpsItem
-> f UpdateOpsItem
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [OpsItemNotification]
  [OpsItemNotification]
  [OpsItemNotification]
  [OpsItemNotification]
-> Iso
     (Maybe [OpsItemNotification])
     (Maybe [OpsItemNotification])
     (Maybe [OpsItemNotification])
     (Maybe [OpsItemNotification])
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
  [OpsItemNotification]
  [OpsItemNotification]
  [OpsItemNotification]
  [OpsItemNotification]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The time specified in a change request for a runbook workflow to start.
-- Currently supported only for the OpsItem type @\/aws\/changerequest@.
updateOpsItem_plannedStartTime :: Lens.Lens' UpdateOpsItem (Prelude.Maybe Prelude.UTCTime)
updateOpsItem_plannedStartTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> UpdateOpsItem -> f UpdateOpsItem
updateOpsItem_plannedStartTime = (UpdateOpsItem -> Maybe POSIX)
-> (UpdateOpsItem -> Maybe POSIX -> UpdateOpsItem)
-> Lens UpdateOpsItem UpdateOpsItem (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateOpsItem' {Maybe POSIX
plannedStartTime :: Maybe POSIX
$sel:plannedStartTime:UpdateOpsItem' :: UpdateOpsItem -> Maybe POSIX
plannedStartTime} -> Maybe POSIX
plannedStartTime) (\s :: UpdateOpsItem
s@UpdateOpsItem' {} Maybe POSIX
a -> UpdateOpsItem
s {$sel:plannedStartTime:UpdateOpsItem' :: Maybe POSIX
plannedStartTime = Maybe POSIX
a} :: UpdateOpsItem) ((Maybe POSIX -> f (Maybe POSIX))
 -> UpdateOpsItem -> f UpdateOpsItem)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> UpdateOpsItem
-> f UpdateOpsItem
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 ID of the OpsItem.
updateOpsItem_opsItemId :: Lens.Lens' UpdateOpsItem Prelude.Text
updateOpsItem_opsItemId :: (Text -> f Text) -> UpdateOpsItem -> f UpdateOpsItem
updateOpsItem_opsItemId = (UpdateOpsItem -> Text)
-> (UpdateOpsItem -> Text -> UpdateOpsItem)
-> Lens UpdateOpsItem UpdateOpsItem Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateOpsItem' {Text
opsItemId :: Text
$sel:opsItemId:UpdateOpsItem' :: UpdateOpsItem -> Text
opsItemId} -> Text
opsItemId) (\s :: UpdateOpsItem
s@UpdateOpsItem' {} Text
a -> UpdateOpsItem
s {$sel:opsItemId:UpdateOpsItem' :: Text
opsItemId = Text
a} :: UpdateOpsItem)

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

instance Prelude.NFData UpdateOpsItem

instance Core.ToHeaders UpdateOpsItem where
  toHeaders :: UpdateOpsItem -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateOpsItem -> 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
"AmazonSSM.UpdateOpsItem" :: 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 UpdateOpsItem where
  toJSON :: UpdateOpsItem -> Value
toJSON UpdateOpsItem' {Maybe Natural
Maybe [Text]
Maybe [OpsItemNotification]
Maybe [RelatedOpsItem]
Maybe Text
Maybe (HashMap Text OpsItemDataValue)
Maybe POSIX
Maybe OpsItemStatus
Text
opsItemId :: Text
plannedStartTime :: Maybe POSIX
notifications :: Maybe [OpsItemNotification]
plannedEndTime :: Maybe POSIX
description :: Maybe Text
actualStartTime :: Maybe POSIX
operationalData :: Maybe (HashMap Text OpsItemDataValue)
title :: Maybe Text
relatedOpsItems :: Maybe [RelatedOpsItem]
severity :: Maybe Text
category :: Maybe Text
priority :: Maybe Natural
operationalDataToDelete :: Maybe [Text]
status :: Maybe OpsItemStatus
actualEndTime :: Maybe POSIX
$sel:opsItemId:UpdateOpsItem' :: UpdateOpsItem -> Text
$sel:plannedStartTime:UpdateOpsItem' :: UpdateOpsItem -> Maybe POSIX
$sel:notifications:UpdateOpsItem' :: UpdateOpsItem -> Maybe [OpsItemNotification]
$sel:plannedEndTime:UpdateOpsItem' :: UpdateOpsItem -> Maybe POSIX
$sel:description:UpdateOpsItem' :: UpdateOpsItem -> Maybe Text
$sel:actualStartTime:UpdateOpsItem' :: UpdateOpsItem -> Maybe POSIX
$sel:operationalData:UpdateOpsItem' :: UpdateOpsItem -> Maybe (HashMap Text OpsItemDataValue)
$sel:title:UpdateOpsItem' :: UpdateOpsItem -> Maybe Text
$sel:relatedOpsItems:UpdateOpsItem' :: UpdateOpsItem -> Maybe [RelatedOpsItem]
$sel:severity:UpdateOpsItem' :: UpdateOpsItem -> Maybe Text
$sel:category:UpdateOpsItem' :: UpdateOpsItem -> Maybe Text
$sel:priority:UpdateOpsItem' :: UpdateOpsItem -> Maybe Natural
$sel:operationalDataToDelete:UpdateOpsItem' :: UpdateOpsItem -> Maybe [Text]
$sel:status:UpdateOpsItem' :: UpdateOpsItem -> Maybe OpsItemStatus
$sel:actualEndTime:UpdateOpsItem' :: UpdateOpsItem -> Maybe POSIX
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"ActualEndTime" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (POSIX -> Pair) -> Maybe POSIX -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
actualEndTime,
            (Text
"Status" Text -> OpsItemStatus -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (OpsItemStatus -> Pair) -> Maybe OpsItemStatus -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe OpsItemStatus
status,
            (Text
"OperationalDataToDelete" 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]
operationalDataToDelete,
            (Text
"Priority" 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
priority,
            (Text
"Category" 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
category,
            (Text
"Severity" 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
severity,
            (Text
"RelatedOpsItems" Text -> [RelatedOpsItem] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([RelatedOpsItem] -> Pair) -> Maybe [RelatedOpsItem] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [RelatedOpsItem]
relatedOpsItems,
            (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,
            (Text
"OperationalData" Text -> HashMap Text OpsItemDataValue -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (HashMap Text OpsItemDataValue -> Pair)
-> Maybe (HashMap Text OpsItemDataValue) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text OpsItemDataValue)
operationalData,
            (Text
"ActualStartTime" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (POSIX -> Pair) -> Maybe POSIX -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
actualStartTime,
            (Text
"Description" 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
description,
            (Text
"PlannedEndTime" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (POSIX -> Pair) -> Maybe POSIX -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
plannedEndTime,
            (Text
"Notifications" Text -> [OpsItemNotification] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([OpsItemNotification] -> Pair)
-> Maybe [OpsItemNotification] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [OpsItemNotification]
notifications,
            (Text
"PlannedStartTime" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (POSIX -> Pair) -> Maybe POSIX -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
plannedStartTime,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"OpsItemId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
opsItemId)
          ]
      )

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

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

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

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

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

instance Prelude.NFData UpdateOpsItemResponse