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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The parameters for a @STEP_FUNCTIONS@ 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 Step Functions tasks, Systems Manager ignores any values specified
-- for @TaskParameters@ and @LoggingInfo@.
--
-- /See:/ 'newMaintenanceWindowStepFunctionsParameters' smart constructor.
data MaintenanceWindowStepFunctionsParameters = MaintenanceWindowStepFunctionsParameters'
  { -- | The inputs for the @STEP_FUNCTIONS@ task.
    MaintenanceWindowStepFunctionsParameters -> Maybe (Sensitive Text)
input :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The name of the @STEP_FUNCTIONS@ task.
    MaintenanceWindowStepFunctionsParameters -> Maybe Text
name :: Prelude.Maybe Prelude.Text
  }
  deriving (MaintenanceWindowStepFunctionsParameters
-> MaintenanceWindowStepFunctionsParameters -> Bool
(MaintenanceWindowStepFunctionsParameters
 -> MaintenanceWindowStepFunctionsParameters -> Bool)
-> (MaintenanceWindowStepFunctionsParameters
    -> MaintenanceWindowStepFunctionsParameters -> Bool)
-> Eq MaintenanceWindowStepFunctionsParameters
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MaintenanceWindowStepFunctionsParameters
-> MaintenanceWindowStepFunctionsParameters -> Bool
$c/= :: MaintenanceWindowStepFunctionsParameters
-> MaintenanceWindowStepFunctionsParameters -> Bool
== :: MaintenanceWindowStepFunctionsParameters
-> MaintenanceWindowStepFunctionsParameters -> Bool
$c== :: MaintenanceWindowStepFunctionsParameters
-> MaintenanceWindowStepFunctionsParameters -> Bool
Prelude.Eq, Int -> MaintenanceWindowStepFunctionsParameters -> ShowS
[MaintenanceWindowStepFunctionsParameters] -> ShowS
MaintenanceWindowStepFunctionsParameters -> String
(Int -> MaintenanceWindowStepFunctionsParameters -> ShowS)
-> (MaintenanceWindowStepFunctionsParameters -> String)
-> ([MaintenanceWindowStepFunctionsParameters] -> ShowS)
-> Show MaintenanceWindowStepFunctionsParameters
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MaintenanceWindowStepFunctionsParameters] -> ShowS
$cshowList :: [MaintenanceWindowStepFunctionsParameters] -> ShowS
show :: MaintenanceWindowStepFunctionsParameters -> String
$cshow :: MaintenanceWindowStepFunctionsParameters -> String
showsPrec :: Int -> MaintenanceWindowStepFunctionsParameters -> ShowS
$cshowsPrec :: Int -> MaintenanceWindowStepFunctionsParameters -> ShowS
Prelude.Show, (forall x.
 MaintenanceWindowStepFunctionsParameters
 -> Rep MaintenanceWindowStepFunctionsParameters x)
-> (forall x.
    Rep MaintenanceWindowStepFunctionsParameters x
    -> MaintenanceWindowStepFunctionsParameters)
-> Generic MaintenanceWindowStepFunctionsParameters
forall x.
Rep MaintenanceWindowStepFunctionsParameters x
-> MaintenanceWindowStepFunctionsParameters
forall x.
MaintenanceWindowStepFunctionsParameters
-> Rep MaintenanceWindowStepFunctionsParameters x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep MaintenanceWindowStepFunctionsParameters x
-> MaintenanceWindowStepFunctionsParameters
$cfrom :: forall x.
MaintenanceWindowStepFunctionsParameters
-> Rep MaintenanceWindowStepFunctionsParameters x
Prelude.Generic)

-- |
-- Create a value of 'MaintenanceWindowStepFunctionsParameters' 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:
--
-- 'input', 'maintenanceWindowStepFunctionsParameters_input' - The inputs for the @STEP_FUNCTIONS@ task.
--
-- 'name', 'maintenanceWindowStepFunctionsParameters_name' - The name of the @STEP_FUNCTIONS@ task.
newMaintenanceWindowStepFunctionsParameters ::
  MaintenanceWindowStepFunctionsParameters
newMaintenanceWindowStepFunctionsParameters :: MaintenanceWindowStepFunctionsParameters
newMaintenanceWindowStepFunctionsParameters =
  MaintenanceWindowStepFunctionsParameters' :: Maybe (Sensitive Text)
-> Maybe Text -> MaintenanceWindowStepFunctionsParameters
MaintenanceWindowStepFunctionsParameters'
    { $sel:input:MaintenanceWindowStepFunctionsParameters' :: Maybe (Sensitive Text)
input =
        Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:name:MaintenanceWindowStepFunctionsParameters' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The inputs for the @STEP_FUNCTIONS@ task.
maintenanceWindowStepFunctionsParameters_input :: Lens.Lens' MaintenanceWindowStepFunctionsParameters (Prelude.Maybe Prelude.Text)
maintenanceWindowStepFunctionsParameters_input :: (Maybe Text -> f (Maybe Text))
-> MaintenanceWindowStepFunctionsParameters
-> f MaintenanceWindowStepFunctionsParameters
maintenanceWindowStepFunctionsParameters_input = (MaintenanceWindowStepFunctionsParameters
 -> Maybe (Sensitive Text))
-> (MaintenanceWindowStepFunctionsParameters
    -> Maybe (Sensitive Text)
    -> MaintenanceWindowStepFunctionsParameters)
-> Lens
     MaintenanceWindowStepFunctionsParameters
     MaintenanceWindowStepFunctionsParameters
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MaintenanceWindowStepFunctionsParameters' {Maybe (Sensitive Text)
input :: Maybe (Sensitive Text)
$sel:input:MaintenanceWindowStepFunctionsParameters' :: MaintenanceWindowStepFunctionsParameters -> Maybe (Sensitive Text)
input} -> Maybe (Sensitive Text)
input) (\s :: MaintenanceWindowStepFunctionsParameters
s@MaintenanceWindowStepFunctionsParameters' {} Maybe (Sensitive Text)
a -> MaintenanceWindowStepFunctionsParameters
s {$sel:input:MaintenanceWindowStepFunctionsParameters' :: Maybe (Sensitive Text)
input = Maybe (Sensitive Text)
a} :: MaintenanceWindowStepFunctionsParameters) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> MaintenanceWindowStepFunctionsParameters
 -> f MaintenanceWindowStepFunctionsParameters)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> MaintenanceWindowStepFunctionsParameters
-> f MaintenanceWindowStepFunctionsParameters
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
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 AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | The name of the @STEP_FUNCTIONS@ task.
maintenanceWindowStepFunctionsParameters_name :: Lens.Lens' MaintenanceWindowStepFunctionsParameters (Prelude.Maybe Prelude.Text)
maintenanceWindowStepFunctionsParameters_name :: (Maybe Text -> f (Maybe Text))
-> MaintenanceWindowStepFunctionsParameters
-> f MaintenanceWindowStepFunctionsParameters
maintenanceWindowStepFunctionsParameters_name = (MaintenanceWindowStepFunctionsParameters -> Maybe Text)
-> (MaintenanceWindowStepFunctionsParameters
    -> Maybe Text -> MaintenanceWindowStepFunctionsParameters)
-> Lens
     MaintenanceWindowStepFunctionsParameters
     MaintenanceWindowStepFunctionsParameters
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MaintenanceWindowStepFunctionsParameters' {Maybe Text
name :: Maybe Text
$sel:name:MaintenanceWindowStepFunctionsParameters' :: MaintenanceWindowStepFunctionsParameters -> Maybe Text
name} -> Maybe Text
name) (\s :: MaintenanceWindowStepFunctionsParameters
s@MaintenanceWindowStepFunctionsParameters' {} Maybe Text
a -> MaintenanceWindowStepFunctionsParameters
s {$sel:name:MaintenanceWindowStepFunctionsParameters' :: Maybe Text
name = Maybe Text
a} :: MaintenanceWindowStepFunctionsParameters)

instance
  Core.FromJSON
    MaintenanceWindowStepFunctionsParameters
  where
  parseJSON :: Value -> Parser MaintenanceWindowStepFunctionsParameters
parseJSON =
    String
-> (Object -> Parser MaintenanceWindowStepFunctionsParameters)
-> Value
-> Parser MaintenanceWindowStepFunctionsParameters
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"MaintenanceWindowStepFunctionsParameters"
      ( \Object
x ->
          Maybe (Sensitive Text)
-> Maybe Text -> MaintenanceWindowStepFunctionsParameters
MaintenanceWindowStepFunctionsParameters'
            (Maybe (Sensitive Text)
 -> Maybe Text -> MaintenanceWindowStepFunctionsParameters)
-> Parser (Maybe (Sensitive Text))
-> Parser (Maybe Text -> MaintenanceWindowStepFunctionsParameters)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Input") Parser (Maybe Text -> MaintenanceWindowStepFunctionsParameters)
-> Parser (Maybe Text)
-> Parser MaintenanceWindowStepFunctionsParameters
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
"Name")
      )

instance
  Prelude.Hashable
    MaintenanceWindowStepFunctionsParameters

instance
  Prelude.NFData
    MaintenanceWindowStepFunctionsParameters

instance
  Core.ToJSON
    MaintenanceWindowStepFunctionsParameters
  where
  toJSON :: MaintenanceWindowStepFunctionsParameters -> Value
toJSON MaintenanceWindowStepFunctionsParameters' {Maybe Text
Maybe (Sensitive Text)
name :: Maybe Text
input :: Maybe (Sensitive Text)
$sel:name:MaintenanceWindowStepFunctionsParameters' :: MaintenanceWindowStepFunctionsParameters -> Maybe Text
$sel:input:MaintenanceWindowStepFunctionsParameters' :: MaintenanceWindowStepFunctionsParameters -> Maybe (Sensitive Text)
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Input" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
input,
            (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
name
          ]
      )