{-# 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.AppConfig.Types.AppliedExtension
-- 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.AppConfig.Types.AppliedExtension 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

-- | An extension that was invoked during a deployment.
--
-- /See:/ 'newAppliedExtension' smart constructor.
data AppliedExtension = AppliedExtension'
  { -- | The system-generated ID for the association.
    AppliedExtension -> Maybe Text
extensionAssociationId :: Prelude.Maybe Prelude.Text,
    -- | The system-generated ID of the extension.
    AppliedExtension -> Maybe Text
extensionId :: Prelude.Maybe Prelude.Text,
    -- | One or more parameters for the actions called by the extension.
    AppliedExtension -> Maybe (HashMap Text Text)
parameters :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The extension version number.
    AppliedExtension -> Maybe Int
versionNumber :: Prelude.Maybe Prelude.Int
  }
  deriving (AppliedExtension -> AppliedExtension -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AppliedExtension -> AppliedExtension -> Bool
$c/= :: AppliedExtension -> AppliedExtension -> Bool
== :: AppliedExtension -> AppliedExtension -> Bool
$c== :: AppliedExtension -> AppliedExtension -> Bool
Prelude.Eq, ReadPrec [AppliedExtension]
ReadPrec AppliedExtension
Int -> ReadS AppliedExtension
ReadS [AppliedExtension]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AppliedExtension]
$creadListPrec :: ReadPrec [AppliedExtension]
readPrec :: ReadPrec AppliedExtension
$creadPrec :: ReadPrec AppliedExtension
readList :: ReadS [AppliedExtension]
$creadList :: ReadS [AppliedExtension]
readsPrec :: Int -> ReadS AppliedExtension
$creadsPrec :: Int -> ReadS AppliedExtension
Prelude.Read, Int -> AppliedExtension -> ShowS
[AppliedExtension] -> ShowS
AppliedExtension -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AppliedExtension] -> ShowS
$cshowList :: [AppliedExtension] -> ShowS
show :: AppliedExtension -> String
$cshow :: AppliedExtension -> String
showsPrec :: Int -> AppliedExtension -> ShowS
$cshowsPrec :: Int -> AppliedExtension -> ShowS
Prelude.Show, forall x. Rep AppliedExtension x -> AppliedExtension
forall x. AppliedExtension -> Rep AppliedExtension x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AppliedExtension x -> AppliedExtension
$cfrom :: forall x. AppliedExtension -> Rep AppliedExtension x
Prelude.Generic)

-- |
-- Create a value of 'AppliedExtension' 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:
--
-- 'extensionAssociationId', 'appliedExtension_extensionAssociationId' - The system-generated ID for the association.
--
-- 'extensionId', 'appliedExtension_extensionId' - The system-generated ID of the extension.
--
-- 'parameters', 'appliedExtension_parameters' - One or more parameters for the actions called by the extension.
--
-- 'versionNumber', 'appliedExtension_versionNumber' - The extension version number.
newAppliedExtension ::
  AppliedExtension
newAppliedExtension :: AppliedExtension
newAppliedExtension =
  AppliedExtension'
    { $sel:extensionAssociationId:AppliedExtension' :: Maybe Text
extensionAssociationId =
        forall a. Maybe a
Prelude.Nothing,
      $sel:extensionId:AppliedExtension' :: Maybe Text
extensionId = forall a. Maybe a
Prelude.Nothing,
      $sel:parameters:AppliedExtension' :: Maybe (HashMap Text Text)
parameters = forall a. Maybe a
Prelude.Nothing,
      $sel:versionNumber:AppliedExtension' :: Maybe Int
versionNumber = forall a. Maybe a
Prelude.Nothing
    }

-- | The system-generated ID for the association.
appliedExtension_extensionAssociationId :: Lens.Lens' AppliedExtension (Prelude.Maybe Prelude.Text)
appliedExtension_extensionAssociationId :: Lens' AppliedExtension (Maybe Text)
appliedExtension_extensionAssociationId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppliedExtension' {Maybe Text
extensionAssociationId :: Maybe Text
$sel:extensionAssociationId:AppliedExtension' :: AppliedExtension -> Maybe Text
extensionAssociationId} -> Maybe Text
extensionAssociationId) (\s :: AppliedExtension
s@AppliedExtension' {} Maybe Text
a -> AppliedExtension
s {$sel:extensionAssociationId:AppliedExtension' :: Maybe Text
extensionAssociationId = Maybe Text
a} :: AppliedExtension)

-- | The system-generated ID of the extension.
appliedExtension_extensionId :: Lens.Lens' AppliedExtension (Prelude.Maybe Prelude.Text)
appliedExtension_extensionId :: Lens' AppliedExtension (Maybe Text)
appliedExtension_extensionId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppliedExtension' {Maybe Text
extensionId :: Maybe Text
$sel:extensionId:AppliedExtension' :: AppliedExtension -> Maybe Text
extensionId} -> Maybe Text
extensionId) (\s :: AppliedExtension
s@AppliedExtension' {} Maybe Text
a -> AppliedExtension
s {$sel:extensionId:AppliedExtension' :: Maybe Text
extensionId = Maybe Text
a} :: AppliedExtension)

-- | One or more parameters for the actions called by the extension.
appliedExtension_parameters :: Lens.Lens' AppliedExtension (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
appliedExtension_parameters :: Lens' AppliedExtension (Maybe (HashMap Text Text))
appliedExtension_parameters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppliedExtension' {Maybe (HashMap Text Text)
parameters :: Maybe (HashMap Text Text)
$sel:parameters:AppliedExtension' :: AppliedExtension -> Maybe (HashMap Text Text)
parameters} -> Maybe (HashMap Text Text)
parameters) (\s :: AppliedExtension
s@AppliedExtension' {} Maybe (HashMap Text Text)
a -> AppliedExtension
s {$sel:parameters:AppliedExtension' :: Maybe (HashMap Text Text)
parameters = Maybe (HashMap Text Text)
a} :: AppliedExtension) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The extension version number.
appliedExtension_versionNumber :: Lens.Lens' AppliedExtension (Prelude.Maybe Prelude.Int)
appliedExtension_versionNumber :: Lens' AppliedExtension (Maybe Int)
appliedExtension_versionNumber = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppliedExtension' {Maybe Int
versionNumber :: Maybe Int
$sel:versionNumber:AppliedExtension' :: AppliedExtension -> Maybe Int
versionNumber} -> Maybe Int
versionNumber) (\s :: AppliedExtension
s@AppliedExtension' {} Maybe Int
a -> AppliedExtension
s {$sel:versionNumber:AppliedExtension' :: Maybe Int
versionNumber = Maybe Int
a} :: AppliedExtension)

instance Data.FromJSON AppliedExtension where
  parseJSON :: Value -> Parser AppliedExtension
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"AppliedExtension"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Int
-> AppliedExtension
AppliedExtension'
            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
"ExtensionAssociationId")
            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
"ExtensionId")
            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
"Parameters" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            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
"VersionNumber")
      )

instance Prelude.Hashable AppliedExtension where
  hashWithSalt :: Int -> AppliedExtension -> Int
hashWithSalt Int
_salt AppliedExtension' {Maybe Int
Maybe Text
Maybe (HashMap Text Text)
versionNumber :: Maybe Int
parameters :: Maybe (HashMap Text Text)
extensionId :: Maybe Text
extensionAssociationId :: Maybe Text
$sel:versionNumber:AppliedExtension' :: AppliedExtension -> Maybe Int
$sel:parameters:AppliedExtension' :: AppliedExtension -> Maybe (HashMap Text Text)
$sel:extensionId:AppliedExtension' :: AppliedExtension -> Maybe Text
$sel:extensionAssociationId:AppliedExtension' :: AppliedExtension -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
extensionAssociationId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
extensionId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
parameters
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
versionNumber

instance Prelude.NFData AppliedExtension where
  rnf :: AppliedExtension -> ()
rnf AppliedExtension' {Maybe Int
Maybe Text
Maybe (HashMap Text Text)
versionNumber :: Maybe Int
parameters :: Maybe (HashMap Text Text)
extensionId :: Maybe Text
extensionAssociationId :: Maybe Text
$sel:versionNumber:AppliedExtension' :: AppliedExtension -> Maybe Int
$sel:parameters:AppliedExtension' :: AppliedExtension -> Maybe (HashMap Text Text)
$sel:extensionId:AppliedExtension' :: AppliedExtension -> Maybe Text
$sel:extensionAssociationId:AppliedExtension' :: AppliedExtension -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
extensionAssociationId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
extensionId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
parameters
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
versionNumber