{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# 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.Types.ResponsePlanSummary
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SSMIncidents.Types.ResponsePlanSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | Details of the response plan that are used when creating an incident.
--
-- /See:/ 'newResponsePlanSummary' smart constructor.
data ResponsePlanSummary = ResponsePlanSummary'
  { -- | The human readable name of the response plan. This can include spaces.
    ResponsePlanSummary -> Maybe Text
displayName :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the response plan.
    ResponsePlanSummary -> Text
arn :: Prelude.Text,
    -- | The name of the response plan. This can\'t include spaces.
    ResponsePlanSummary -> Text
name :: Prelude.Text
  }
  deriving (ResponsePlanSummary -> ResponsePlanSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResponsePlanSummary -> ResponsePlanSummary -> Bool
$c/= :: ResponsePlanSummary -> ResponsePlanSummary -> Bool
== :: ResponsePlanSummary -> ResponsePlanSummary -> Bool
$c== :: ResponsePlanSummary -> ResponsePlanSummary -> Bool
Prelude.Eq, ReadPrec [ResponsePlanSummary]
ReadPrec ResponsePlanSummary
Int -> ReadS ResponsePlanSummary
ReadS [ResponsePlanSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResponsePlanSummary]
$creadListPrec :: ReadPrec [ResponsePlanSummary]
readPrec :: ReadPrec ResponsePlanSummary
$creadPrec :: ReadPrec ResponsePlanSummary
readList :: ReadS [ResponsePlanSummary]
$creadList :: ReadS [ResponsePlanSummary]
readsPrec :: Int -> ReadS ResponsePlanSummary
$creadsPrec :: Int -> ReadS ResponsePlanSummary
Prelude.Read, Int -> ResponsePlanSummary -> ShowS
[ResponsePlanSummary] -> ShowS
ResponsePlanSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResponsePlanSummary] -> ShowS
$cshowList :: [ResponsePlanSummary] -> ShowS
show :: ResponsePlanSummary -> String
$cshow :: ResponsePlanSummary -> String
showsPrec :: Int -> ResponsePlanSummary -> ShowS
$cshowsPrec :: Int -> ResponsePlanSummary -> ShowS
Prelude.Show, forall x. Rep ResponsePlanSummary x -> ResponsePlanSummary
forall x. ResponsePlanSummary -> Rep ResponsePlanSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ResponsePlanSummary x -> ResponsePlanSummary
$cfrom :: forall x. ResponsePlanSummary -> Rep ResponsePlanSummary x
Prelude.Generic)

-- |
-- Create a value of 'ResponsePlanSummary' 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:
--
-- 'displayName', 'responsePlanSummary_displayName' - The human readable name of the response plan. This can include spaces.
--
-- 'arn', 'responsePlanSummary_arn' - The Amazon Resource Name (ARN) of the response plan.
--
-- 'name', 'responsePlanSummary_name' - The name of the response plan. This can\'t include spaces.
newResponsePlanSummary ::
  -- | 'arn'
  Prelude.Text ->
  -- | 'name'
  Prelude.Text ->
  ResponsePlanSummary
newResponsePlanSummary :: Text -> Text -> ResponsePlanSummary
newResponsePlanSummary Text
pArn_ Text
pName_ =
  ResponsePlanSummary'
    { $sel:displayName:ResponsePlanSummary' :: Maybe Text
displayName = forall a. Maybe a
Prelude.Nothing,
      $sel:arn:ResponsePlanSummary' :: Text
arn = Text
pArn_,
      $sel:name:ResponsePlanSummary' :: Text
name = Text
pName_
    }

-- | The human readable name of the response plan. This can include spaces.
responsePlanSummary_displayName :: Lens.Lens' ResponsePlanSummary (Prelude.Maybe Prelude.Text)
responsePlanSummary_displayName :: Lens' ResponsePlanSummary (Maybe Text)
responsePlanSummary_displayName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResponsePlanSummary' {Maybe Text
displayName :: Maybe Text
$sel:displayName:ResponsePlanSummary' :: ResponsePlanSummary -> Maybe Text
displayName} -> Maybe Text
displayName) (\s :: ResponsePlanSummary
s@ResponsePlanSummary' {} Maybe Text
a -> ResponsePlanSummary
s {$sel:displayName:ResponsePlanSummary' :: Maybe Text
displayName = Maybe Text
a} :: ResponsePlanSummary)

-- | The Amazon Resource Name (ARN) of the response plan.
responsePlanSummary_arn :: Lens.Lens' ResponsePlanSummary Prelude.Text
responsePlanSummary_arn :: Lens' ResponsePlanSummary Text
responsePlanSummary_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResponsePlanSummary' {Text
arn :: Text
$sel:arn:ResponsePlanSummary' :: ResponsePlanSummary -> Text
arn} -> Text
arn) (\s :: ResponsePlanSummary
s@ResponsePlanSummary' {} Text
a -> ResponsePlanSummary
s {$sel:arn:ResponsePlanSummary' :: Text
arn = Text
a} :: ResponsePlanSummary)

-- | The name of the response plan. This can\'t include spaces.
responsePlanSummary_name :: Lens.Lens' ResponsePlanSummary Prelude.Text
responsePlanSummary_name :: Lens' ResponsePlanSummary Text
responsePlanSummary_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResponsePlanSummary' {Text
name :: Text
$sel:name:ResponsePlanSummary' :: ResponsePlanSummary -> Text
name} -> Text
name) (\s :: ResponsePlanSummary
s@ResponsePlanSummary' {} Text
a -> ResponsePlanSummary
s {$sel:name:ResponsePlanSummary' :: Text
name = Text
a} :: ResponsePlanSummary)

instance Data.FromJSON ResponsePlanSummary where
  parseJSON :: Value -> Parser ResponsePlanSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ResponsePlanSummary"
      ( \Object
x ->
          Maybe Text -> Text -> Text -> ResponsePlanSummary
ResponsePlanSummary'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"displayName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"arn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"name")
      )

instance Prelude.Hashable ResponsePlanSummary where
  hashWithSalt :: Int -> ResponsePlanSummary -> Int
hashWithSalt Int
_salt ResponsePlanSummary' {Maybe Text
Text
name :: Text
arn :: Text
displayName :: Maybe Text
$sel:name:ResponsePlanSummary' :: ResponsePlanSummary -> Text
$sel:arn:ResponsePlanSummary' :: ResponsePlanSummary -> Text
$sel:displayName:ResponsePlanSummary' :: ResponsePlanSummary -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
displayName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
arn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name

instance Prelude.NFData ResponsePlanSummary where
  rnf :: ResponsePlanSummary -> ()
rnf ResponsePlanSummary' {Maybe Text
Text
name :: Text
arn :: Text
displayName :: Maybe Text
$sel:name:ResponsePlanSummary' :: ResponsePlanSummary -> Text
$sel:arn:ResponsePlanSummary' :: ResponsePlanSummary -> Text
$sel:displayName:ResponsePlanSummary' :: ResponsePlanSummary -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
displayName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
arn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name