{-# 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.MaintenanceWindowTaskParameterValueExpression
-- 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.MaintenanceWindowTaskParameterValueExpression where

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

-- | Defines the values for a task parameter.
--
-- /See:/ 'newMaintenanceWindowTaskParameterValueExpression' smart constructor.
data MaintenanceWindowTaskParameterValueExpression = MaintenanceWindowTaskParameterValueExpression'
  { -- | This field contains an array of 0 or more strings, each 1 to 255
    -- characters in length.
    MaintenanceWindowTaskParameterValueExpression
-> Maybe (Sensitive [Sensitive Text])
values :: Prelude.Maybe (Core.Sensitive [Core.Sensitive Prelude.Text])
  }
  deriving (MaintenanceWindowTaskParameterValueExpression
-> MaintenanceWindowTaskParameterValueExpression -> Bool
(MaintenanceWindowTaskParameterValueExpression
 -> MaintenanceWindowTaskParameterValueExpression -> Bool)
-> (MaintenanceWindowTaskParameterValueExpression
    -> MaintenanceWindowTaskParameterValueExpression -> Bool)
-> Eq MaintenanceWindowTaskParameterValueExpression
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MaintenanceWindowTaskParameterValueExpression
-> MaintenanceWindowTaskParameterValueExpression -> Bool
$c/= :: MaintenanceWindowTaskParameterValueExpression
-> MaintenanceWindowTaskParameterValueExpression -> Bool
== :: MaintenanceWindowTaskParameterValueExpression
-> MaintenanceWindowTaskParameterValueExpression -> Bool
$c== :: MaintenanceWindowTaskParameterValueExpression
-> MaintenanceWindowTaskParameterValueExpression -> Bool
Prelude.Eq, Int -> MaintenanceWindowTaskParameterValueExpression -> ShowS
[MaintenanceWindowTaskParameterValueExpression] -> ShowS
MaintenanceWindowTaskParameterValueExpression -> String
(Int -> MaintenanceWindowTaskParameterValueExpression -> ShowS)
-> (MaintenanceWindowTaskParameterValueExpression -> String)
-> ([MaintenanceWindowTaskParameterValueExpression] -> ShowS)
-> Show MaintenanceWindowTaskParameterValueExpression
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MaintenanceWindowTaskParameterValueExpression] -> ShowS
$cshowList :: [MaintenanceWindowTaskParameterValueExpression] -> ShowS
show :: MaintenanceWindowTaskParameterValueExpression -> String
$cshow :: MaintenanceWindowTaskParameterValueExpression -> String
showsPrec :: Int -> MaintenanceWindowTaskParameterValueExpression -> ShowS
$cshowsPrec :: Int -> MaintenanceWindowTaskParameterValueExpression -> ShowS
Prelude.Show, (forall x.
 MaintenanceWindowTaskParameterValueExpression
 -> Rep MaintenanceWindowTaskParameterValueExpression x)
-> (forall x.
    Rep MaintenanceWindowTaskParameterValueExpression x
    -> MaintenanceWindowTaskParameterValueExpression)
-> Generic MaintenanceWindowTaskParameterValueExpression
forall x.
Rep MaintenanceWindowTaskParameterValueExpression x
-> MaintenanceWindowTaskParameterValueExpression
forall x.
MaintenanceWindowTaskParameterValueExpression
-> Rep MaintenanceWindowTaskParameterValueExpression x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep MaintenanceWindowTaskParameterValueExpression x
-> MaintenanceWindowTaskParameterValueExpression
$cfrom :: forall x.
MaintenanceWindowTaskParameterValueExpression
-> Rep MaintenanceWindowTaskParameterValueExpression x
Prelude.Generic)

-- |
-- Create a value of 'MaintenanceWindowTaskParameterValueExpression' 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:
--
-- 'values', 'maintenanceWindowTaskParameterValueExpression_values' - This field contains an array of 0 or more strings, each 1 to 255
-- characters in length.
newMaintenanceWindowTaskParameterValueExpression ::
  MaintenanceWindowTaskParameterValueExpression
newMaintenanceWindowTaskParameterValueExpression :: MaintenanceWindowTaskParameterValueExpression
newMaintenanceWindowTaskParameterValueExpression =
  MaintenanceWindowTaskParameterValueExpression' :: Maybe (Sensitive [Sensitive Text])
-> MaintenanceWindowTaskParameterValueExpression
MaintenanceWindowTaskParameterValueExpression'
    { $sel:values:MaintenanceWindowTaskParameterValueExpression' :: Maybe (Sensitive [Sensitive Text])
values =
        Maybe (Sensitive [Sensitive Text])
forall a. Maybe a
Prelude.Nothing
    }

-- | This field contains an array of 0 or more strings, each 1 to 255
-- characters in length.
maintenanceWindowTaskParameterValueExpression_values :: Lens.Lens' MaintenanceWindowTaskParameterValueExpression (Prelude.Maybe [Prelude.Text])
maintenanceWindowTaskParameterValueExpression_values :: (Maybe [Text] -> f (Maybe [Text]))
-> MaintenanceWindowTaskParameterValueExpression
-> f MaintenanceWindowTaskParameterValueExpression
maintenanceWindowTaskParameterValueExpression_values = (MaintenanceWindowTaskParameterValueExpression
 -> Maybe (Sensitive [Sensitive Text]))
-> (MaintenanceWindowTaskParameterValueExpression
    -> Maybe (Sensitive [Sensitive Text])
    -> MaintenanceWindowTaskParameterValueExpression)
-> Lens
     MaintenanceWindowTaskParameterValueExpression
     MaintenanceWindowTaskParameterValueExpression
     (Maybe (Sensitive [Sensitive Text]))
     (Maybe (Sensitive [Sensitive Text]))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MaintenanceWindowTaskParameterValueExpression' {Maybe (Sensitive [Sensitive Text])
values :: Maybe (Sensitive [Sensitive Text])
$sel:values:MaintenanceWindowTaskParameterValueExpression' :: MaintenanceWindowTaskParameterValueExpression
-> Maybe (Sensitive [Sensitive Text])
values} -> Maybe (Sensitive [Sensitive Text])
values) (\s :: MaintenanceWindowTaskParameterValueExpression
s@MaintenanceWindowTaskParameterValueExpression' {} Maybe (Sensitive [Sensitive Text])
a -> MaintenanceWindowTaskParameterValueExpression
s {$sel:values:MaintenanceWindowTaskParameterValueExpression' :: Maybe (Sensitive [Sensitive Text])
values = Maybe (Sensitive [Sensitive Text])
a} :: MaintenanceWindowTaskParameterValueExpression) ((Maybe (Sensitive [Sensitive Text])
  -> f (Maybe (Sensitive [Sensitive Text])))
 -> MaintenanceWindowTaskParameterValueExpression
 -> f MaintenanceWindowTaskParameterValueExpression)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe (Sensitive [Sensitive Text])
    -> f (Maybe (Sensitive [Sensitive Text])))
-> (Maybe [Text] -> f (Maybe [Text]))
-> MaintenanceWindowTaskParameterValueExpression
-> f MaintenanceWindowTaskParameterValueExpression
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (Sensitive [Sensitive Text])
  (Sensitive [Sensitive Text])
  [Text]
  [Text]
-> Iso
     (Maybe (Sensitive [Sensitive Text]))
     (Maybe (Sensitive [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 (Exchange [Text] [Text] [Sensitive Text] (Identity [Sensitive Text])
-> Exchange
     [Text]
     [Text]
     (Sensitive [Sensitive Text])
     (Identity (Sensitive [Sensitive Text]))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Exchange
   [Text] [Text] [Sensitive Text] (Identity [Sensitive Text])
 -> Exchange
      [Text]
      [Text]
      (Sensitive [Sensitive Text])
      (Identity (Sensitive [Sensitive Text])))
-> (Exchange [Text] [Text] [Text] (Identity [Text])
    -> Exchange
         [Text] [Text] [Sensitive Text] (Identity [Sensitive Text]))
-> AnIso
     (Sensitive [Sensitive Text])
     (Sensitive [Sensitive Text])
     [Text]
     [Text]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Exchange [Text] [Text] [Text] (Identity [Text])
-> Exchange
     [Text] [Text] [Sensitive Text] (Identity [Sensitive Text])
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced)

instance
  Core.FromJSON
    MaintenanceWindowTaskParameterValueExpression
  where
  parseJSON :: Value -> Parser MaintenanceWindowTaskParameterValueExpression
parseJSON =
    String
-> (Object -> Parser MaintenanceWindowTaskParameterValueExpression)
-> Value
-> Parser MaintenanceWindowTaskParameterValueExpression
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"MaintenanceWindowTaskParameterValueExpression"
      ( \Object
x ->
          Maybe (Sensitive [Sensitive Text])
-> MaintenanceWindowTaskParameterValueExpression
MaintenanceWindowTaskParameterValueExpression'
            (Maybe (Sensitive [Sensitive Text])
 -> MaintenanceWindowTaskParameterValueExpression)
-> Parser (Maybe (Sensitive [Sensitive Text]))
-> Parser MaintenanceWindowTaskParameterValueExpression
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text -> Parser (Maybe (Maybe (Sensitive [Sensitive Text])))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Values" Parser (Maybe (Maybe (Sensitive [Sensitive Text])))
-> Maybe (Sensitive [Sensitive Text])
-> Parser (Maybe (Sensitive [Sensitive Text]))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (Sensitive [Sensitive Text])
forall a. Monoid a => a
Prelude.mempty)
      )

instance
  Prelude.Hashable
    MaintenanceWindowTaskParameterValueExpression

instance
  Prelude.NFData
    MaintenanceWindowTaskParameterValueExpression

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