{-# 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-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)
module Amazonka.SSMIncidents.Types.ResponsePlanSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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
(ResponsePlanSummary -> ResponsePlanSummary -> Bool)
-> (ResponsePlanSummary -> ResponsePlanSummary -> Bool)
-> Eq ResponsePlanSummary
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]
(Int -> ReadS ResponsePlanSummary)
-> ReadS [ResponsePlanSummary]
-> ReadPrec ResponsePlanSummary
-> ReadPrec [ResponsePlanSummary]
-> Read 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
(Int -> ResponsePlanSummary -> ShowS)
-> (ResponsePlanSummary -> String)
-> ([ResponsePlanSummary] -> ShowS)
-> Show ResponsePlanSummary
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. ResponsePlanSummary -> Rep ResponsePlanSummary x)
-> (forall x. Rep ResponsePlanSummary x -> ResponsePlanSummary)
-> Generic ResponsePlanSummary
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' :: Maybe Text -> Text -> Text -> ResponsePlanSummary
ResponsePlanSummary'
    { $sel:displayName:ResponsePlanSummary' :: Maybe Text
displayName = Maybe Text
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 :: (Maybe Text -> f (Maybe Text))
-> ResponsePlanSummary -> f ResponsePlanSummary
responsePlanSummary_displayName = (ResponsePlanSummary -> Maybe Text)
-> (ResponsePlanSummary -> Maybe Text -> ResponsePlanSummary)
-> Lens
     ResponsePlanSummary ResponsePlanSummary (Maybe Text) (Maybe Text)
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 :: (Text -> f Text) -> ResponsePlanSummary -> f ResponsePlanSummary
responsePlanSummary_arn = (ResponsePlanSummary -> Text)
-> (ResponsePlanSummary -> Text -> ResponsePlanSummary)
-> Lens ResponsePlanSummary ResponsePlanSummary Text Text
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 :: (Text -> f Text) -> ResponsePlanSummary -> f ResponsePlanSummary
responsePlanSummary_name = (ResponsePlanSummary -> Text)
-> (ResponsePlanSummary -> Text -> ResponsePlanSummary)
-> Lens ResponsePlanSummary ResponsePlanSummary Text Text
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 Core.FromJSON ResponsePlanSummary where
  parseJSON :: Value -> Parser ResponsePlanSummary
parseJSON =
    String
-> (Object -> Parser ResponsePlanSummary)
-> Value
-> Parser ResponsePlanSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ResponsePlanSummary"
      ( \Object
x ->
          Maybe Text -> Text -> Text -> ResponsePlanSummary
ResponsePlanSummary'
            (Maybe Text -> Text -> Text -> ResponsePlanSummary)
-> Parser (Maybe Text)
-> Parser (Text -> Text -> ResponsePlanSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"displayName")
            Parser (Text -> Text -> ResponsePlanSummary)
-> Parser Text -> Parser (Text -> ResponsePlanSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"arn")
            Parser (Text -> ResponsePlanSummary)
-> Parser Text -> Parser ResponsePlanSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"name")
      )

instance Prelude.Hashable ResponsePlanSummary

instance Prelude.NFData ResponsePlanSummary