{-# 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.SSM.Types.MaintenanceWindowAutomationParameters
-- 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.SSM.Types.MaintenanceWindowAutomationParameters 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

-- | The parameters for an @AUTOMATION@ task type.
--
-- /See:/ 'newMaintenanceWindowAutomationParameters' smart constructor.
data MaintenanceWindowAutomationParameters = MaintenanceWindowAutomationParameters'
  { -- | The version of an Automation runbook to use during task execution.
    MaintenanceWindowAutomationParameters -> Maybe Text
documentVersion :: Prelude.Maybe Prelude.Text,
    -- | The parameters for the @AUTOMATION@ task.
    --
    -- For information about specifying and updating task parameters, see
    -- RegisterTaskWithMaintenanceWindow and UpdateMaintenanceWindowTask.
    --
    -- @LoggingInfo@ has been deprecated. To specify an Amazon Simple Storage
    -- Service (Amazon S3) bucket to contain logs, instead use the
    -- @OutputS3BucketName@ and @OutputS3KeyPrefix@ options in the
    -- @TaskInvocationParameters@ structure. For information about how Amazon
    -- Web Services Systems Manager handles these options for the supported
    -- maintenance window task types, see
    -- MaintenanceWindowTaskInvocationParameters.
    --
    -- @TaskParameters@ has been deprecated. To specify parameters to pass to a
    -- task when it runs, instead use the @Parameters@ option in the
    -- @TaskInvocationParameters@ structure. For information about how Systems
    -- Manager handles these options for the supported maintenance window task
    -- types, see MaintenanceWindowTaskInvocationParameters.
    --
    -- For @AUTOMATION@ task types, Amazon Web Services Systems Manager ignores
    -- any values specified for these parameters.
    MaintenanceWindowAutomationParameters
-> Maybe (HashMap Text [Text])
parameters :: Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text])
  }
  deriving (MaintenanceWindowAutomationParameters
-> MaintenanceWindowAutomationParameters -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MaintenanceWindowAutomationParameters
-> MaintenanceWindowAutomationParameters -> Bool
$c/= :: MaintenanceWindowAutomationParameters
-> MaintenanceWindowAutomationParameters -> Bool
== :: MaintenanceWindowAutomationParameters
-> MaintenanceWindowAutomationParameters -> Bool
$c== :: MaintenanceWindowAutomationParameters
-> MaintenanceWindowAutomationParameters -> Bool
Prelude.Eq, ReadPrec [MaintenanceWindowAutomationParameters]
ReadPrec MaintenanceWindowAutomationParameters
Int -> ReadS MaintenanceWindowAutomationParameters
ReadS [MaintenanceWindowAutomationParameters]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MaintenanceWindowAutomationParameters]
$creadListPrec :: ReadPrec [MaintenanceWindowAutomationParameters]
readPrec :: ReadPrec MaintenanceWindowAutomationParameters
$creadPrec :: ReadPrec MaintenanceWindowAutomationParameters
readList :: ReadS [MaintenanceWindowAutomationParameters]
$creadList :: ReadS [MaintenanceWindowAutomationParameters]
readsPrec :: Int -> ReadS MaintenanceWindowAutomationParameters
$creadsPrec :: Int -> ReadS MaintenanceWindowAutomationParameters
Prelude.Read, Int -> MaintenanceWindowAutomationParameters -> ShowS
[MaintenanceWindowAutomationParameters] -> ShowS
MaintenanceWindowAutomationParameters -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MaintenanceWindowAutomationParameters] -> ShowS
$cshowList :: [MaintenanceWindowAutomationParameters] -> ShowS
show :: MaintenanceWindowAutomationParameters -> String
$cshow :: MaintenanceWindowAutomationParameters -> String
showsPrec :: Int -> MaintenanceWindowAutomationParameters -> ShowS
$cshowsPrec :: Int -> MaintenanceWindowAutomationParameters -> ShowS
Prelude.Show, forall x.
Rep MaintenanceWindowAutomationParameters x
-> MaintenanceWindowAutomationParameters
forall x.
MaintenanceWindowAutomationParameters
-> Rep MaintenanceWindowAutomationParameters x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep MaintenanceWindowAutomationParameters x
-> MaintenanceWindowAutomationParameters
$cfrom :: forall x.
MaintenanceWindowAutomationParameters
-> Rep MaintenanceWindowAutomationParameters x
Prelude.Generic)

-- |
-- Create a value of 'MaintenanceWindowAutomationParameters' 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:
--
-- 'documentVersion', 'maintenanceWindowAutomationParameters_documentVersion' - The version of an Automation runbook to use during task execution.
--
-- 'parameters', 'maintenanceWindowAutomationParameters_parameters' - The parameters for the @AUTOMATION@ task.
--
-- For information about specifying and updating task parameters, see
-- RegisterTaskWithMaintenanceWindow and UpdateMaintenanceWindowTask.
--
-- @LoggingInfo@ has been deprecated. To specify an Amazon Simple Storage
-- Service (Amazon S3) bucket to contain logs, instead use the
-- @OutputS3BucketName@ and @OutputS3KeyPrefix@ options in the
-- @TaskInvocationParameters@ structure. For information about how Amazon
-- Web Services Systems Manager handles these options for the supported
-- maintenance window task types, see
-- MaintenanceWindowTaskInvocationParameters.
--
-- @TaskParameters@ has been deprecated. To specify parameters to pass to a
-- task when it runs, instead use the @Parameters@ option in the
-- @TaskInvocationParameters@ structure. For information about how Systems
-- Manager handles these options for the supported maintenance window task
-- types, see MaintenanceWindowTaskInvocationParameters.
--
-- For @AUTOMATION@ task types, Amazon Web Services Systems Manager ignores
-- any values specified for these parameters.
newMaintenanceWindowAutomationParameters ::
  MaintenanceWindowAutomationParameters
newMaintenanceWindowAutomationParameters :: MaintenanceWindowAutomationParameters
newMaintenanceWindowAutomationParameters =
  MaintenanceWindowAutomationParameters'
    { $sel:documentVersion:MaintenanceWindowAutomationParameters' :: Maybe Text
documentVersion =
        forall a. Maybe a
Prelude.Nothing,
      $sel:parameters:MaintenanceWindowAutomationParameters' :: Maybe (HashMap Text [Text])
parameters = forall a. Maybe a
Prelude.Nothing
    }

-- | The version of an Automation runbook to use during task execution.
maintenanceWindowAutomationParameters_documentVersion :: Lens.Lens' MaintenanceWindowAutomationParameters (Prelude.Maybe Prelude.Text)
maintenanceWindowAutomationParameters_documentVersion :: Lens' MaintenanceWindowAutomationParameters (Maybe Text)
maintenanceWindowAutomationParameters_documentVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MaintenanceWindowAutomationParameters' {Maybe Text
documentVersion :: Maybe Text
$sel:documentVersion:MaintenanceWindowAutomationParameters' :: MaintenanceWindowAutomationParameters -> Maybe Text
documentVersion} -> Maybe Text
documentVersion) (\s :: MaintenanceWindowAutomationParameters
s@MaintenanceWindowAutomationParameters' {} Maybe Text
a -> MaintenanceWindowAutomationParameters
s {$sel:documentVersion:MaintenanceWindowAutomationParameters' :: Maybe Text
documentVersion = Maybe Text
a} :: MaintenanceWindowAutomationParameters)

-- | The parameters for the @AUTOMATION@ task.
--
-- For information about specifying and updating task parameters, see
-- RegisterTaskWithMaintenanceWindow and UpdateMaintenanceWindowTask.
--
-- @LoggingInfo@ has been deprecated. To specify an Amazon Simple Storage
-- Service (Amazon S3) bucket to contain logs, instead use the
-- @OutputS3BucketName@ and @OutputS3KeyPrefix@ options in the
-- @TaskInvocationParameters@ structure. For information about how Amazon
-- Web Services Systems Manager handles these options for the supported
-- maintenance window task types, see
-- MaintenanceWindowTaskInvocationParameters.
--
-- @TaskParameters@ has been deprecated. To specify parameters to pass to a
-- task when it runs, instead use the @Parameters@ option in the
-- @TaskInvocationParameters@ structure. For information about how Systems
-- Manager handles these options for the supported maintenance window task
-- types, see MaintenanceWindowTaskInvocationParameters.
--
-- For @AUTOMATION@ task types, Amazon Web Services Systems Manager ignores
-- any values specified for these parameters.
maintenanceWindowAutomationParameters_parameters :: Lens.Lens' MaintenanceWindowAutomationParameters (Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text]))
maintenanceWindowAutomationParameters_parameters :: Lens'
  MaintenanceWindowAutomationParameters (Maybe (HashMap Text [Text]))
maintenanceWindowAutomationParameters_parameters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MaintenanceWindowAutomationParameters' {Maybe (HashMap Text [Text])
parameters :: Maybe (HashMap Text [Text])
$sel:parameters:MaintenanceWindowAutomationParameters' :: MaintenanceWindowAutomationParameters
-> Maybe (HashMap Text [Text])
parameters} -> Maybe (HashMap Text [Text])
parameters) (\s :: MaintenanceWindowAutomationParameters
s@MaintenanceWindowAutomationParameters' {} Maybe (HashMap Text [Text])
a -> MaintenanceWindowAutomationParameters
s {$sel:parameters:MaintenanceWindowAutomationParameters' :: Maybe (HashMap Text [Text])
parameters = Maybe (HashMap Text [Text])
a} :: MaintenanceWindowAutomationParameters) 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

instance
  Data.FromJSON
    MaintenanceWindowAutomationParameters
  where
  parseJSON :: Value -> Parser MaintenanceWindowAutomationParameters
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"MaintenanceWindowAutomationParameters"
      ( \Object
x ->
          Maybe Text
-> Maybe (HashMap Text [Text])
-> MaintenanceWindowAutomationParameters
MaintenanceWindowAutomationParameters'
            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
"DocumentVersion")
            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)
      )

instance
  Prelude.Hashable
    MaintenanceWindowAutomationParameters
  where
  hashWithSalt :: Int -> MaintenanceWindowAutomationParameters -> Int
hashWithSalt
    Int
_salt
    MaintenanceWindowAutomationParameters' {Maybe Text
Maybe (HashMap Text [Text])
parameters :: Maybe (HashMap Text [Text])
documentVersion :: Maybe Text
$sel:parameters:MaintenanceWindowAutomationParameters' :: MaintenanceWindowAutomationParameters
-> Maybe (HashMap Text [Text])
$sel:documentVersion:MaintenanceWindowAutomationParameters' :: MaintenanceWindowAutomationParameters -> Maybe Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
documentVersion
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text [Text])
parameters

instance
  Prelude.NFData
    MaintenanceWindowAutomationParameters
  where
  rnf :: MaintenanceWindowAutomationParameters -> ()
rnf MaintenanceWindowAutomationParameters' {Maybe Text
Maybe (HashMap Text [Text])
parameters :: Maybe (HashMap Text [Text])
documentVersion :: Maybe Text
$sel:parameters:MaintenanceWindowAutomationParameters' :: MaintenanceWindowAutomationParameters
-> Maybe (HashMap Text [Text])
$sel:documentVersion:MaintenanceWindowAutomationParameters' :: MaintenanceWindowAutomationParameters -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
documentVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text [Text])
parameters

instance
  Data.ToJSON
    MaintenanceWindowAutomationParameters
  where
  toJSON :: MaintenanceWindowAutomationParameters -> Value
toJSON MaintenanceWindowAutomationParameters' {Maybe Text
Maybe (HashMap Text [Text])
parameters :: Maybe (HashMap Text [Text])
documentVersion :: Maybe Text
$sel:parameters:MaintenanceWindowAutomationParameters' :: MaintenanceWindowAutomationParameters
-> Maybe (HashMap Text [Text])
$sel:documentVersion:MaintenanceWindowAutomationParameters' :: MaintenanceWindowAutomationParameters -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"DocumentVersion" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
documentVersion,
            (Key
"Parameters" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text [Text])
parameters
          ]
      )