{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.ServiceCatalog.Types.ServiceActionSummary 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
import Amazonka.ServiceCatalog.Types.ServiceActionDefinitionType

-- | Detailed information about the self-service action.
--
-- /See:/ 'newServiceActionSummary' smart constructor.
data ServiceActionSummary = ServiceActionSummary'
  { -- | 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,
    -- | The self-service action identifier.
    ServiceActionSummary -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The self-service action name.
    ServiceActionSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text
  }
  deriving (ServiceActionSummary -> ServiceActionSummary -> Bool
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]
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
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. 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:
--
-- 'definitionType', 'serviceActionSummary_definitionType' - The self-service action definition type. For example, @SSM_AUTOMATION@.
--
-- 'description', 'serviceActionSummary_description' - The self-service action description.
--
-- 'id', 'serviceActionSummary_id' - The self-service action identifier.
--
-- 'name', 'serviceActionSummary_name' - The self-service action name.
newServiceActionSummary ::
  ServiceActionSummary
newServiceActionSummary :: ServiceActionSummary
newServiceActionSummary =
  ServiceActionSummary'
    { $sel:definitionType:ServiceActionSummary' :: Maybe ServiceActionDefinitionType
definitionType =
        forall a. Maybe a
Prelude.Nothing,
      $sel:description:ServiceActionSummary' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:id:ServiceActionSummary' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:name:ServiceActionSummary' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing
    }

-- | The self-service action definition type. For example, @SSM_AUTOMATION@.
serviceActionSummary_definitionType :: Lens.Lens' ServiceActionSummary (Prelude.Maybe ServiceActionDefinitionType)
serviceActionSummary_definitionType :: Lens' ServiceActionSummary (Maybe ServiceActionDefinitionType)
serviceActionSummary_definitionType = 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 :: Lens' ServiceActionSummary (Maybe Text)
serviceActionSummary_description = 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)

-- | The self-service action identifier.
serviceActionSummary_id :: Lens.Lens' ServiceActionSummary (Prelude.Maybe Prelude.Text)
serviceActionSummary_id :: Lens' ServiceActionSummary (Maybe Text)
serviceActionSummary_id = 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 name.
serviceActionSummary_name :: Lens.Lens' ServiceActionSummary (Prelude.Maybe Prelude.Text)
serviceActionSummary_name :: Lens' ServiceActionSummary (Maybe Text)
serviceActionSummary_name = 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)

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

instance Prelude.Hashable ServiceActionSummary where
  hashWithSalt :: Int -> ServiceActionSummary -> Int
hashWithSalt Int
_salt ServiceActionSummary' {Maybe Text
Maybe ServiceActionDefinitionType
name :: Maybe Text
id :: Maybe Text
description :: Maybe Text
definitionType :: Maybe ServiceActionDefinitionType
$sel:name:ServiceActionSummary' :: ServiceActionSummary -> Maybe Text
$sel:id:ServiceActionSummary' :: ServiceActionSummary -> Maybe Text
$sel:description:ServiceActionSummary' :: ServiceActionSummary -> Maybe Text
$sel:definitionType:ServiceActionSummary' :: ServiceActionSummary -> Maybe ServiceActionDefinitionType
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ServiceActionDefinitionType
definitionType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
id
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name

instance Prelude.NFData ServiceActionSummary where
  rnf :: ServiceActionSummary -> ()
rnf ServiceActionSummary' {Maybe Text
Maybe ServiceActionDefinitionType
name :: Maybe Text
id :: Maybe Text
description :: Maybe Text
definitionType :: Maybe ServiceActionDefinitionType
$sel:name:ServiceActionSummary' :: ServiceActionSummary -> Maybe Text
$sel:id:ServiceActionSummary' :: ServiceActionSummary -> Maybe Text
$sel:description:ServiceActionSummary' :: ServiceActionSummary -> Maybe Text
$sel:definitionType:ServiceActionSummary' :: ServiceActionSummary -> Maybe ServiceActionDefinitionType
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ServiceActionDefinitionType
definitionType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name