{-# 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.ServiceCatalog.Types.ServiceActionSummary
-- 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.ServiceCatalog.Types.ServiceActionSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.ServiceCatalog.Types.ServiceActionDefinitionType

-- | Detailed information about the self-service action.
--
-- /See:/ 'newServiceActionSummary' smart constructor.
data ServiceActionSummary = ServiceActionSummary'
  { -- | The self-service action name.
    ServiceActionSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The self-service action identifier.
    ServiceActionSummary -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The self-service action definition type. For example, @SSM_AUTOMATION@.
    ServiceActionSummary -> Maybe ServiceActionDefinitionType
definitionType :: Prelude.Maybe ServiceActionDefinitionType,
    -- | The self-service action description.
    ServiceActionSummary -> Maybe Text
description :: Prelude.Maybe Prelude.Text
  }
  deriving (ServiceActionSummary -> ServiceActionSummary -> Bool
(ServiceActionSummary -> ServiceActionSummary -> Bool)
-> (ServiceActionSummary -> ServiceActionSummary -> Bool)
-> Eq ServiceActionSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ServiceActionSummary -> ServiceActionSummary -> Bool
$c/= :: ServiceActionSummary -> ServiceActionSummary -> Bool
== :: ServiceActionSummary -> ServiceActionSummary -> Bool
$c== :: ServiceActionSummary -> ServiceActionSummary -> Bool
Prelude.Eq, ReadPrec [ServiceActionSummary]
ReadPrec ServiceActionSummary
Int -> ReadS ServiceActionSummary
ReadS [ServiceActionSummary]
(Int -> ReadS ServiceActionSummary)
-> ReadS [ServiceActionSummary]
-> ReadPrec ServiceActionSummary
-> ReadPrec [ServiceActionSummary]
-> Read ServiceActionSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ServiceActionSummary]
$creadListPrec :: ReadPrec [ServiceActionSummary]
readPrec :: ReadPrec ServiceActionSummary
$creadPrec :: ReadPrec ServiceActionSummary
readList :: ReadS [ServiceActionSummary]
$creadList :: ReadS [ServiceActionSummary]
readsPrec :: Int -> ReadS ServiceActionSummary
$creadsPrec :: Int -> ReadS ServiceActionSummary
Prelude.Read, Int -> ServiceActionSummary -> ShowS
[ServiceActionSummary] -> ShowS
ServiceActionSummary -> String
(Int -> ServiceActionSummary -> ShowS)
-> (ServiceActionSummary -> String)
-> ([ServiceActionSummary] -> ShowS)
-> Show ServiceActionSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ServiceActionSummary] -> ShowS
$cshowList :: [ServiceActionSummary] -> ShowS
show :: ServiceActionSummary -> String
$cshow :: ServiceActionSummary -> String
showsPrec :: Int -> ServiceActionSummary -> ShowS
$cshowsPrec :: Int -> ServiceActionSummary -> ShowS
Prelude.Show, (forall x. ServiceActionSummary -> Rep ServiceActionSummary x)
-> (forall x. Rep ServiceActionSummary x -> ServiceActionSummary)
-> Generic ServiceActionSummary
forall x. Rep ServiceActionSummary x -> ServiceActionSummary
forall x. ServiceActionSummary -> Rep ServiceActionSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ServiceActionSummary x -> ServiceActionSummary
$cfrom :: forall x. ServiceActionSummary -> Rep ServiceActionSummary x
Prelude.Generic)

-- |
-- Create a value of 'ServiceActionSummary' 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:
--
-- 'name', 'serviceActionSummary_name' - The self-service action name.
--
-- 'id', 'serviceActionSummary_id' - The self-service action identifier.
--
-- 'definitionType', 'serviceActionSummary_definitionType' - The self-service action definition type. For example, @SSM_AUTOMATION@.
--
-- 'description', 'serviceActionSummary_description' - The self-service action description.
newServiceActionSummary ::
  ServiceActionSummary
newServiceActionSummary :: ServiceActionSummary
newServiceActionSummary =
  ServiceActionSummary' :: Maybe Text
-> Maybe Text
-> Maybe ServiceActionDefinitionType
-> Maybe Text
-> ServiceActionSummary
ServiceActionSummary'
    { $sel:name:ServiceActionSummary' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:ServiceActionSummary' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:definitionType:ServiceActionSummary' :: Maybe ServiceActionDefinitionType
definitionType = Maybe ServiceActionDefinitionType
forall a. Maybe a
Prelude.Nothing,
      $sel:description:ServiceActionSummary' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The self-service action name.
serviceActionSummary_name :: Lens.Lens' ServiceActionSummary (Prelude.Maybe Prelude.Text)
serviceActionSummary_name :: (Maybe Text -> f (Maybe Text))
-> ServiceActionSummary -> f ServiceActionSummary
serviceActionSummary_name = (ServiceActionSummary -> Maybe Text)
-> (ServiceActionSummary -> Maybe Text -> ServiceActionSummary)
-> Lens
     ServiceActionSummary ServiceActionSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceActionSummary' {Maybe Text
name :: Maybe Text
$sel:name:ServiceActionSummary' :: ServiceActionSummary -> Maybe Text
name} -> Maybe Text
name) (\s :: ServiceActionSummary
s@ServiceActionSummary' {} Maybe Text
a -> ServiceActionSummary
s {$sel:name:ServiceActionSummary' :: Maybe Text
name = Maybe Text
a} :: ServiceActionSummary)

-- | The self-service action identifier.
serviceActionSummary_id :: Lens.Lens' ServiceActionSummary (Prelude.Maybe Prelude.Text)
serviceActionSummary_id :: (Maybe Text -> f (Maybe Text))
-> ServiceActionSummary -> f ServiceActionSummary
serviceActionSummary_id = (ServiceActionSummary -> Maybe Text)
-> (ServiceActionSummary -> Maybe Text -> ServiceActionSummary)
-> Lens
     ServiceActionSummary ServiceActionSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceActionSummary' {Maybe Text
id :: Maybe Text
$sel:id:ServiceActionSummary' :: ServiceActionSummary -> Maybe Text
id} -> Maybe Text
id) (\s :: ServiceActionSummary
s@ServiceActionSummary' {} Maybe Text
a -> ServiceActionSummary
s {$sel:id:ServiceActionSummary' :: Maybe Text
id = Maybe Text
a} :: ServiceActionSummary)

-- | The self-service action definition type. For example, @SSM_AUTOMATION@.
serviceActionSummary_definitionType :: Lens.Lens' ServiceActionSummary (Prelude.Maybe ServiceActionDefinitionType)
serviceActionSummary_definitionType :: (Maybe ServiceActionDefinitionType
 -> f (Maybe ServiceActionDefinitionType))
-> ServiceActionSummary -> f ServiceActionSummary
serviceActionSummary_definitionType = (ServiceActionSummary -> Maybe ServiceActionDefinitionType)
-> (ServiceActionSummary
    -> Maybe ServiceActionDefinitionType -> ServiceActionSummary)
-> Lens
     ServiceActionSummary
     ServiceActionSummary
     (Maybe ServiceActionDefinitionType)
     (Maybe ServiceActionDefinitionType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceActionSummary' {Maybe ServiceActionDefinitionType
definitionType :: Maybe ServiceActionDefinitionType
$sel:definitionType:ServiceActionSummary' :: ServiceActionSummary -> Maybe ServiceActionDefinitionType
definitionType} -> Maybe ServiceActionDefinitionType
definitionType) (\s :: ServiceActionSummary
s@ServiceActionSummary' {} Maybe ServiceActionDefinitionType
a -> ServiceActionSummary
s {$sel:definitionType:ServiceActionSummary' :: Maybe ServiceActionDefinitionType
definitionType = Maybe ServiceActionDefinitionType
a} :: ServiceActionSummary)

-- | The self-service action description.
serviceActionSummary_description :: Lens.Lens' ServiceActionSummary (Prelude.Maybe Prelude.Text)
serviceActionSummary_description :: (Maybe Text -> f (Maybe Text))
-> ServiceActionSummary -> f ServiceActionSummary
serviceActionSummary_description = (ServiceActionSummary -> Maybe Text)
-> (ServiceActionSummary -> Maybe Text -> ServiceActionSummary)
-> Lens
     ServiceActionSummary ServiceActionSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceActionSummary' {Maybe Text
description :: Maybe Text
$sel:description:ServiceActionSummary' :: ServiceActionSummary -> Maybe Text
description} -> Maybe Text
description) (\s :: ServiceActionSummary
s@ServiceActionSummary' {} Maybe Text
a -> ServiceActionSummary
s {$sel:description:ServiceActionSummary' :: Maybe Text
description = Maybe Text
a} :: ServiceActionSummary)

instance Core.FromJSON ServiceActionSummary where
  parseJSON :: Value -> Parser ServiceActionSummary
parseJSON =
    String
-> (Object -> Parser ServiceActionSummary)
-> Value
-> Parser ServiceActionSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ServiceActionSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe ServiceActionDefinitionType
-> Maybe Text
-> ServiceActionSummary
ServiceActionSummary'
            (Maybe Text
 -> Maybe Text
 -> Maybe ServiceActionDefinitionType
 -> Maybe Text
 -> ServiceActionSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe ServiceActionDefinitionType
      -> Maybe Text
      -> ServiceActionSummary)
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
"Name")
            Parser
  (Maybe Text
   -> Maybe ServiceActionDefinitionType
   -> Maybe Text
   -> ServiceActionSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe ServiceActionDefinitionType
      -> Maybe Text -> ServiceActionSummary)
forall (f :: * -> *) a b. Applicative f => 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
"Id")
            Parser
  (Maybe ServiceActionDefinitionType
   -> Maybe Text -> ServiceActionSummary)
-> Parser (Maybe ServiceActionDefinitionType)
-> Parser (Maybe Text -> ServiceActionSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ServiceActionDefinitionType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DefinitionType")
            Parser (Maybe Text -> ServiceActionSummary)
-> Parser (Maybe Text) -> Parser ServiceActionSummary
forall (f :: * -> *) a b. Applicative f => 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
"Description")
      )

instance Prelude.Hashable ServiceActionSummary

instance Prelude.NFData ServiceActionSummary