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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SSM.Types.ParameterInlinePolicy
import Amazonka.SSM.Types.ParameterTier
import Amazonka.SSM.Types.ParameterType

-- | Information about parameter usage.
--
-- /See:/ 'newParameterHistory' smart constructor.
data ParameterHistory = ParameterHistory'
  { -- | Date the parameter was last changed or updated.
    ParameterHistory -> Maybe POSIX
lastModifiedDate :: Prelude.Maybe Core.POSIX,
    -- | The ID of the query key used for this parameter.
    ParameterHistory -> Maybe Text
keyId :: Prelude.Maybe Prelude.Text,
    -- | The parameter value.
    ParameterHistory -> Maybe (Sensitive Text)
value :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The name of the parameter.
    ParameterHistory -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The parameter tier.
    ParameterHistory -> Maybe ParameterTier
tier :: Prelude.Maybe ParameterTier,
    -- | The parameter version.
    ParameterHistory -> Maybe Integer
version :: Prelude.Maybe Prelude.Integer,
    -- | Amazon Resource Name (ARN) of the Amazon Web Services user who last
    -- changed the parameter.
    ParameterHistory -> Maybe Text
lastModifiedUser :: Prelude.Maybe Prelude.Text,
    -- | Labels assigned to the parameter version.
    ParameterHistory -> Maybe (NonEmpty Text)
labels :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | Parameter names can include the following letters and symbols.
    --
    -- a-zA-Z0-9_.-
    ParameterHistory -> Maybe Text
allowedPattern :: Prelude.Maybe Prelude.Text,
    -- | The type of parameter used.
    ParameterHistory -> Maybe ParameterType
type' :: Prelude.Maybe ParameterType,
    -- | The data type of the parameter, such as @text@ or @aws:ec2:image@. The
    -- default is @text@.
    ParameterHistory -> Maybe Text
dataType :: Prelude.Maybe Prelude.Text,
    -- | Information about the parameter.
    ParameterHistory -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | Information about the policies assigned to a parameter.
    --
    -- <https://docs.aws.amazon.com/systems-manager/latest/userguide/parameter-store-policies.html Assigning parameter policies>
    -- in the /Amazon Web Services Systems Manager User Guide/.
    ParameterHistory -> Maybe [ParameterInlinePolicy]
policies :: Prelude.Maybe [ParameterInlinePolicy]
  }
  deriving (ParameterHistory -> ParameterHistory -> Bool
(ParameterHistory -> ParameterHistory -> Bool)
-> (ParameterHistory -> ParameterHistory -> Bool)
-> Eq ParameterHistory
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ParameterHistory -> ParameterHistory -> Bool
$c/= :: ParameterHistory -> ParameterHistory -> Bool
== :: ParameterHistory -> ParameterHistory -> Bool
$c== :: ParameterHistory -> ParameterHistory -> Bool
Prelude.Eq, Int -> ParameterHistory -> ShowS
[ParameterHistory] -> ShowS
ParameterHistory -> String
(Int -> ParameterHistory -> ShowS)
-> (ParameterHistory -> String)
-> ([ParameterHistory] -> ShowS)
-> Show ParameterHistory
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ParameterHistory] -> ShowS
$cshowList :: [ParameterHistory] -> ShowS
show :: ParameterHistory -> String
$cshow :: ParameterHistory -> String
showsPrec :: Int -> ParameterHistory -> ShowS
$cshowsPrec :: Int -> ParameterHistory -> ShowS
Prelude.Show, (forall x. ParameterHistory -> Rep ParameterHistory x)
-> (forall x. Rep ParameterHistory x -> ParameterHistory)
-> Generic ParameterHistory
forall x. Rep ParameterHistory x -> ParameterHistory
forall x. ParameterHistory -> Rep ParameterHistory x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ParameterHistory x -> ParameterHistory
$cfrom :: forall x. ParameterHistory -> Rep ParameterHistory x
Prelude.Generic)

-- |
-- Create a value of 'ParameterHistory' 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:
--
-- 'lastModifiedDate', 'parameterHistory_lastModifiedDate' - Date the parameter was last changed or updated.
--
-- 'keyId', 'parameterHistory_keyId' - The ID of the query key used for this parameter.
--
-- 'value', 'parameterHistory_value' - The parameter value.
--
-- 'name', 'parameterHistory_name' - The name of the parameter.
--
-- 'tier', 'parameterHistory_tier' - The parameter tier.
--
-- 'version', 'parameterHistory_version' - The parameter version.
--
-- 'lastModifiedUser', 'parameterHistory_lastModifiedUser' - Amazon Resource Name (ARN) of the Amazon Web Services user who last
-- changed the parameter.
--
-- 'labels', 'parameterHistory_labels' - Labels assigned to the parameter version.
--
-- 'allowedPattern', 'parameterHistory_allowedPattern' - Parameter names can include the following letters and symbols.
--
-- a-zA-Z0-9_.-
--
-- 'type'', 'parameterHistory_type' - The type of parameter used.
--
-- 'dataType', 'parameterHistory_dataType' - The data type of the parameter, such as @text@ or @aws:ec2:image@. The
-- default is @text@.
--
-- 'description', 'parameterHistory_description' - Information about the parameter.
--
-- 'policies', 'parameterHistory_policies' - Information about the policies assigned to a parameter.
--
-- <https://docs.aws.amazon.com/systems-manager/latest/userguide/parameter-store-policies.html Assigning parameter policies>
-- in the /Amazon Web Services Systems Manager User Guide/.
newParameterHistory ::
  ParameterHistory
newParameterHistory :: ParameterHistory
newParameterHistory =
  ParameterHistory' :: Maybe POSIX
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe ParameterTier
-> Maybe Integer
-> Maybe Text
-> Maybe (NonEmpty Text)
-> Maybe Text
-> Maybe ParameterType
-> Maybe Text
-> Maybe Text
-> Maybe [ParameterInlinePolicy]
-> ParameterHistory
ParameterHistory'
    { $sel:lastModifiedDate:ParameterHistory' :: Maybe POSIX
lastModifiedDate =
        Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:keyId:ParameterHistory' :: Maybe Text
keyId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:value:ParameterHistory' :: Maybe (Sensitive Text)
value = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:name:ParameterHistory' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tier:ParameterHistory' :: Maybe ParameterTier
tier = Maybe ParameterTier
forall a. Maybe a
Prelude.Nothing,
      $sel:version:ParameterHistory' :: Maybe Integer
version = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:lastModifiedUser:ParameterHistory' :: Maybe Text
lastModifiedUser = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:labels:ParameterHistory' :: Maybe (NonEmpty Text)
labels = Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:allowedPattern:ParameterHistory' :: Maybe Text
allowedPattern = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:type':ParameterHistory' :: Maybe ParameterType
type' = Maybe ParameterType
forall a. Maybe a
Prelude.Nothing,
      $sel:dataType:ParameterHistory' :: Maybe Text
dataType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:ParameterHistory' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:policies:ParameterHistory' :: Maybe [ParameterInlinePolicy]
policies = Maybe [ParameterInlinePolicy]
forall a. Maybe a
Prelude.Nothing
    }

-- | Date the parameter was last changed or updated.
parameterHistory_lastModifiedDate :: Lens.Lens' ParameterHistory (Prelude.Maybe Prelude.UTCTime)
parameterHistory_lastModifiedDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ParameterHistory -> f ParameterHistory
parameterHistory_lastModifiedDate = (ParameterHistory -> Maybe POSIX)
-> (ParameterHistory -> Maybe POSIX -> ParameterHistory)
-> Lens
     ParameterHistory ParameterHistory (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParameterHistory' {Maybe POSIX
lastModifiedDate :: Maybe POSIX
$sel:lastModifiedDate:ParameterHistory' :: ParameterHistory -> Maybe POSIX
lastModifiedDate} -> Maybe POSIX
lastModifiedDate) (\s :: ParameterHistory
s@ParameterHistory' {} Maybe POSIX
a -> ParameterHistory
s {$sel:lastModifiedDate:ParameterHistory' :: Maybe POSIX
lastModifiedDate = Maybe POSIX
a} :: ParameterHistory) ((Maybe POSIX -> f (Maybe POSIX))
 -> ParameterHistory -> f ParameterHistory)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ParameterHistory
-> f ParameterHistory
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The ID of the query key used for this parameter.
parameterHistory_keyId :: Lens.Lens' ParameterHistory (Prelude.Maybe Prelude.Text)
parameterHistory_keyId :: (Maybe Text -> f (Maybe Text))
-> ParameterHistory -> f ParameterHistory
parameterHistory_keyId = (ParameterHistory -> Maybe Text)
-> (ParameterHistory -> Maybe Text -> ParameterHistory)
-> Lens ParameterHistory ParameterHistory (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParameterHistory' {Maybe Text
keyId :: Maybe Text
$sel:keyId:ParameterHistory' :: ParameterHistory -> Maybe Text
keyId} -> Maybe Text
keyId) (\s :: ParameterHistory
s@ParameterHistory' {} Maybe Text
a -> ParameterHistory
s {$sel:keyId:ParameterHistory' :: Maybe Text
keyId = Maybe Text
a} :: ParameterHistory)

-- | The parameter value.
parameterHistory_value :: Lens.Lens' ParameterHistory (Prelude.Maybe Prelude.Text)
parameterHistory_value :: (Maybe Text -> f (Maybe Text))
-> ParameterHistory -> f ParameterHistory
parameterHistory_value = (ParameterHistory -> Maybe (Sensitive Text))
-> (ParameterHistory -> Maybe (Sensitive Text) -> ParameterHistory)
-> Lens
     ParameterHistory
     ParameterHistory
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParameterHistory' {Maybe (Sensitive Text)
value :: Maybe (Sensitive Text)
$sel:value:ParameterHistory' :: ParameterHistory -> Maybe (Sensitive Text)
value} -> Maybe (Sensitive Text)
value) (\s :: ParameterHistory
s@ParameterHistory' {} Maybe (Sensitive Text)
a -> ParameterHistory
s {$sel:value:ParameterHistory' :: Maybe (Sensitive Text)
value = Maybe (Sensitive Text)
a} :: ParameterHistory) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> ParameterHistory -> f ParameterHistory)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> ParameterHistory
-> f ParameterHistory
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 parameter.
parameterHistory_name :: Lens.Lens' ParameterHistory (Prelude.Maybe Prelude.Text)
parameterHistory_name :: (Maybe Text -> f (Maybe Text))
-> ParameterHistory -> f ParameterHistory
parameterHistory_name = (ParameterHistory -> Maybe Text)
-> (ParameterHistory -> Maybe Text -> ParameterHistory)
-> Lens ParameterHistory ParameterHistory (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParameterHistory' {Maybe Text
name :: Maybe Text
$sel:name:ParameterHistory' :: ParameterHistory -> Maybe Text
name} -> Maybe Text
name) (\s :: ParameterHistory
s@ParameterHistory' {} Maybe Text
a -> ParameterHistory
s {$sel:name:ParameterHistory' :: Maybe Text
name = Maybe Text
a} :: ParameterHistory)

-- | The parameter tier.
parameterHistory_tier :: Lens.Lens' ParameterHistory (Prelude.Maybe ParameterTier)
parameterHistory_tier :: (Maybe ParameterTier -> f (Maybe ParameterTier))
-> ParameterHistory -> f ParameterHistory
parameterHistory_tier = (ParameterHistory -> Maybe ParameterTier)
-> (ParameterHistory -> Maybe ParameterTier -> ParameterHistory)
-> Lens
     ParameterHistory
     ParameterHistory
     (Maybe ParameterTier)
     (Maybe ParameterTier)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParameterHistory' {Maybe ParameterTier
tier :: Maybe ParameterTier
$sel:tier:ParameterHistory' :: ParameterHistory -> Maybe ParameterTier
tier} -> Maybe ParameterTier
tier) (\s :: ParameterHistory
s@ParameterHistory' {} Maybe ParameterTier
a -> ParameterHistory
s {$sel:tier:ParameterHistory' :: Maybe ParameterTier
tier = Maybe ParameterTier
a} :: ParameterHistory)

-- | The parameter version.
parameterHistory_version :: Lens.Lens' ParameterHistory (Prelude.Maybe Prelude.Integer)
parameterHistory_version :: (Maybe Integer -> f (Maybe Integer))
-> ParameterHistory -> f ParameterHistory
parameterHistory_version = (ParameterHistory -> Maybe Integer)
-> (ParameterHistory -> Maybe Integer -> ParameterHistory)
-> Lens
     ParameterHistory ParameterHistory (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParameterHistory' {Maybe Integer
version :: Maybe Integer
$sel:version:ParameterHistory' :: ParameterHistory -> Maybe Integer
version} -> Maybe Integer
version) (\s :: ParameterHistory
s@ParameterHistory' {} Maybe Integer
a -> ParameterHistory
s {$sel:version:ParameterHistory' :: Maybe Integer
version = Maybe Integer
a} :: ParameterHistory)

-- | Amazon Resource Name (ARN) of the Amazon Web Services user who last
-- changed the parameter.
parameterHistory_lastModifiedUser :: Lens.Lens' ParameterHistory (Prelude.Maybe Prelude.Text)
parameterHistory_lastModifiedUser :: (Maybe Text -> f (Maybe Text))
-> ParameterHistory -> f ParameterHistory
parameterHistory_lastModifiedUser = (ParameterHistory -> Maybe Text)
-> (ParameterHistory -> Maybe Text -> ParameterHistory)
-> Lens ParameterHistory ParameterHistory (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParameterHistory' {Maybe Text
lastModifiedUser :: Maybe Text
$sel:lastModifiedUser:ParameterHistory' :: ParameterHistory -> Maybe Text
lastModifiedUser} -> Maybe Text
lastModifiedUser) (\s :: ParameterHistory
s@ParameterHistory' {} Maybe Text
a -> ParameterHistory
s {$sel:lastModifiedUser:ParameterHistory' :: Maybe Text
lastModifiedUser = Maybe Text
a} :: ParameterHistory)

-- | Labels assigned to the parameter version.
parameterHistory_labels :: Lens.Lens' ParameterHistory (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
parameterHistory_labels :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> ParameterHistory -> f ParameterHistory
parameterHistory_labels = (ParameterHistory -> Maybe (NonEmpty Text))
-> (ParameterHistory -> Maybe (NonEmpty Text) -> ParameterHistory)
-> Lens
     ParameterHistory
     ParameterHistory
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParameterHistory' {Maybe (NonEmpty Text)
labels :: Maybe (NonEmpty Text)
$sel:labels:ParameterHistory' :: ParameterHistory -> Maybe (NonEmpty Text)
labels} -> Maybe (NonEmpty Text)
labels) (\s :: ParameterHistory
s@ParameterHistory' {} Maybe (NonEmpty Text)
a -> ParameterHistory
s {$sel:labels:ParameterHistory' :: Maybe (NonEmpty Text)
labels = Maybe (NonEmpty Text)
a} :: ParameterHistory) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
 -> ParameterHistory -> f ParameterHistory)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
    -> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> ParameterHistory
-> f ParameterHistory
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
-> Iso
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty 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
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Parameter names can include the following letters and symbols.
--
-- a-zA-Z0-9_.-
parameterHistory_allowedPattern :: Lens.Lens' ParameterHistory (Prelude.Maybe Prelude.Text)
parameterHistory_allowedPattern :: (Maybe Text -> f (Maybe Text))
-> ParameterHistory -> f ParameterHistory
parameterHistory_allowedPattern = (ParameterHistory -> Maybe Text)
-> (ParameterHistory -> Maybe Text -> ParameterHistory)
-> Lens ParameterHistory ParameterHistory (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParameterHistory' {Maybe Text
allowedPattern :: Maybe Text
$sel:allowedPattern:ParameterHistory' :: ParameterHistory -> Maybe Text
allowedPattern} -> Maybe Text
allowedPattern) (\s :: ParameterHistory
s@ParameterHistory' {} Maybe Text
a -> ParameterHistory
s {$sel:allowedPattern:ParameterHistory' :: Maybe Text
allowedPattern = Maybe Text
a} :: ParameterHistory)

-- | The type of parameter used.
parameterHistory_type :: Lens.Lens' ParameterHistory (Prelude.Maybe ParameterType)
parameterHistory_type :: (Maybe ParameterType -> f (Maybe ParameterType))
-> ParameterHistory -> f ParameterHistory
parameterHistory_type = (ParameterHistory -> Maybe ParameterType)
-> (ParameterHistory -> Maybe ParameterType -> ParameterHistory)
-> Lens
     ParameterHistory
     ParameterHistory
     (Maybe ParameterType)
     (Maybe ParameterType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParameterHistory' {Maybe ParameterType
type' :: Maybe ParameterType
$sel:type':ParameterHistory' :: ParameterHistory -> Maybe ParameterType
type'} -> Maybe ParameterType
type') (\s :: ParameterHistory
s@ParameterHistory' {} Maybe ParameterType
a -> ParameterHistory
s {$sel:type':ParameterHistory' :: Maybe ParameterType
type' = Maybe ParameterType
a} :: ParameterHistory)

-- | The data type of the parameter, such as @text@ or @aws:ec2:image@. The
-- default is @text@.
parameterHistory_dataType :: Lens.Lens' ParameterHistory (Prelude.Maybe Prelude.Text)
parameterHistory_dataType :: (Maybe Text -> f (Maybe Text))
-> ParameterHistory -> f ParameterHistory
parameterHistory_dataType = (ParameterHistory -> Maybe Text)
-> (ParameterHistory -> Maybe Text -> ParameterHistory)
-> Lens ParameterHistory ParameterHistory (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParameterHistory' {Maybe Text
dataType :: Maybe Text
$sel:dataType:ParameterHistory' :: ParameterHistory -> Maybe Text
dataType} -> Maybe Text
dataType) (\s :: ParameterHistory
s@ParameterHistory' {} Maybe Text
a -> ParameterHistory
s {$sel:dataType:ParameterHistory' :: Maybe Text
dataType = Maybe Text
a} :: ParameterHistory)

-- | Information about the parameter.
parameterHistory_description :: Lens.Lens' ParameterHistory (Prelude.Maybe Prelude.Text)
parameterHistory_description :: (Maybe Text -> f (Maybe Text))
-> ParameterHistory -> f ParameterHistory
parameterHistory_description = (ParameterHistory -> Maybe Text)
-> (ParameterHistory -> Maybe Text -> ParameterHistory)
-> Lens ParameterHistory ParameterHistory (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParameterHistory' {Maybe Text
description :: Maybe Text
$sel:description:ParameterHistory' :: ParameterHistory -> Maybe Text
description} -> Maybe Text
description) (\s :: ParameterHistory
s@ParameterHistory' {} Maybe Text
a -> ParameterHistory
s {$sel:description:ParameterHistory' :: Maybe Text
description = Maybe Text
a} :: ParameterHistory)

-- | Information about the policies assigned to a parameter.
--
-- <https://docs.aws.amazon.com/systems-manager/latest/userguide/parameter-store-policies.html Assigning parameter policies>
-- in the /Amazon Web Services Systems Manager User Guide/.
parameterHistory_policies :: Lens.Lens' ParameterHistory (Prelude.Maybe [ParameterInlinePolicy])
parameterHistory_policies :: (Maybe [ParameterInlinePolicy]
 -> f (Maybe [ParameterInlinePolicy]))
-> ParameterHistory -> f ParameterHistory
parameterHistory_policies = (ParameterHistory -> Maybe [ParameterInlinePolicy])
-> (ParameterHistory
    -> Maybe [ParameterInlinePolicy] -> ParameterHistory)
-> Lens
     ParameterHistory
     ParameterHistory
     (Maybe [ParameterInlinePolicy])
     (Maybe [ParameterInlinePolicy])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParameterHistory' {Maybe [ParameterInlinePolicy]
policies :: Maybe [ParameterInlinePolicy]
$sel:policies:ParameterHistory' :: ParameterHistory -> Maybe [ParameterInlinePolicy]
policies} -> Maybe [ParameterInlinePolicy]
policies) (\s :: ParameterHistory
s@ParameterHistory' {} Maybe [ParameterInlinePolicy]
a -> ParameterHistory
s {$sel:policies:ParameterHistory' :: Maybe [ParameterInlinePolicy]
policies = Maybe [ParameterInlinePolicy]
a} :: ParameterHistory) ((Maybe [ParameterInlinePolicy]
  -> f (Maybe [ParameterInlinePolicy]))
 -> ParameterHistory -> f ParameterHistory)
-> ((Maybe [ParameterInlinePolicy]
     -> f (Maybe [ParameterInlinePolicy]))
    -> Maybe [ParameterInlinePolicy]
    -> f (Maybe [ParameterInlinePolicy]))
-> (Maybe [ParameterInlinePolicy]
    -> f (Maybe [ParameterInlinePolicy]))
-> ParameterHistory
-> f ParameterHistory
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ParameterInlinePolicy]
  [ParameterInlinePolicy]
  [ParameterInlinePolicy]
  [ParameterInlinePolicy]
-> Iso
     (Maybe [ParameterInlinePolicy])
     (Maybe [ParameterInlinePolicy])
     (Maybe [ParameterInlinePolicy])
     (Maybe [ParameterInlinePolicy])
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
  [ParameterInlinePolicy]
  [ParameterInlinePolicy]
  [ParameterInlinePolicy]
  [ParameterInlinePolicy]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON ParameterHistory where
  parseJSON :: Value -> Parser ParameterHistory
parseJSON =
    String
-> (Object -> Parser ParameterHistory)
-> Value
-> Parser ParameterHistory
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ParameterHistory"
      ( \Object
x ->
          Maybe POSIX
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe ParameterTier
-> Maybe Integer
-> Maybe Text
-> Maybe (NonEmpty Text)
-> Maybe Text
-> Maybe ParameterType
-> Maybe Text
-> Maybe Text
-> Maybe [ParameterInlinePolicy]
-> ParameterHistory
ParameterHistory'
            (Maybe POSIX
 -> Maybe Text
 -> Maybe (Sensitive Text)
 -> Maybe Text
 -> Maybe ParameterTier
 -> Maybe Integer
 -> Maybe Text
 -> Maybe (NonEmpty Text)
 -> Maybe Text
 -> Maybe ParameterType
 -> Maybe Text
 -> Maybe Text
 -> Maybe [ParameterInlinePolicy]
 -> ParameterHistory)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe (Sensitive Text)
      -> Maybe Text
      -> Maybe ParameterTier
      -> Maybe Integer
      -> Maybe Text
      -> Maybe (NonEmpty Text)
      -> Maybe Text
      -> Maybe ParameterType
      -> Maybe Text
      -> Maybe Text
      -> Maybe [ParameterInlinePolicy]
      -> ParameterHistory)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LastModifiedDate")
            Parser
  (Maybe Text
   -> Maybe (Sensitive Text)
   -> Maybe Text
   -> Maybe ParameterTier
   -> Maybe Integer
   -> Maybe Text
   -> Maybe (NonEmpty Text)
   -> Maybe Text
   -> Maybe ParameterType
   -> Maybe Text
   -> Maybe Text
   -> Maybe [ParameterInlinePolicy]
   -> ParameterHistory)
-> Parser (Maybe Text)
-> Parser
     (Maybe (Sensitive Text)
      -> Maybe Text
      -> Maybe ParameterTier
      -> Maybe Integer
      -> Maybe Text
      -> Maybe (NonEmpty Text)
      -> Maybe Text
      -> Maybe ParameterType
      -> Maybe Text
      -> Maybe Text
      -> Maybe [ParameterInlinePolicy]
      -> ParameterHistory)
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
"KeyId")
            Parser
  (Maybe (Sensitive Text)
   -> Maybe Text
   -> Maybe ParameterTier
   -> Maybe Integer
   -> Maybe Text
   -> Maybe (NonEmpty Text)
   -> Maybe Text
   -> Maybe ParameterType
   -> Maybe Text
   -> Maybe Text
   -> Maybe [ParameterInlinePolicy]
   -> ParameterHistory)
-> Parser (Maybe (Sensitive Text))
-> Parser
     (Maybe Text
      -> Maybe ParameterTier
      -> Maybe Integer
      -> Maybe Text
      -> Maybe (NonEmpty Text)
      -> Maybe Text
      -> Maybe ParameterType
      -> Maybe Text
      -> Maybe Text
      -> Maybe [ParameterInlinePolicy]
      -> ParameterHistory)
forall (f :: * -> *) a b. Applicative f => 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
"Value")
            Parser
  (Maybe Text
   -> Maybe ParameterTier
   -> Maybe Integer
   -> Maybe Text
   -> Maybe (NonEmpty Text)
   -> Maybe Text
   -> Maybe ParameterType
   -> Maybe Text
   -> Maybe Text
   -> Maybe [ParameterInlinePolicy]
   -> ParameterHistory)
-> Parser (Maybe Text)
-> Parser
     (Maybe ParameterTier
      -> Maybe Integer
      -> Maybe Text
      -> Maybe (NonEmpty Text)
      -> Maybe Text
      -> Maybe ParameterType
      -> Maybe Text
      -> Maybe Text
      -> Maybe [ParameterInlinePolicy]
      -> ParameterHistory)
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")
            Parser
  (Maybe ParameterTier
   -> Maybe Integer
   -> Maybe Text
   -> Maybe (NonEmpty Text)
   -> Maybe Text
   -> Maybe ParameterType
   -> Maybe Text
   -> Maybe Text
   -> Maybe [ParameterInlinePolicy]
   -> ParameterHistory)
-> Parser (Maybe ParameterTier)
-> Parser
     (Maybe Integer
      -> Maybe Text
      -> Maybe (NonEmpty Text)
      -> Maybe Text
      -> Maybe ParameterType
      -> Maybe Text
      -> Maybe Text
      -> Maybe [ParameterInlinePolicy]
      -> ParameterHistory)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ParameterTier)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Tier")
            Parser
  (Maybe Integer
   -> Maybe Text
   -> Maybe (NonEmpty Text)
   -> Maybe Text
   -> Maybe ParameterType
   -> Maybe Text
   -> Maybe Text
   -> Maybe [ParameterInlinePolicy]
   -> ParameterHistory)
-> Parser (Maybe Integer)
-> Parser
     (Maybe Text
      -> Maybe (NonEmpty Text)
      -> Maybe Text
      -> Maybe ParameterType
      -> Maybe Text
      -> Maybe Text
      -> Maybe [ParameterInlinePolicy]
      -> ParameterHistory)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Version")
            Parser
  (Maybe Text
   -> Maybe (NonEmpty Text)
   -> Maybe Text
   -> Maybe ParameterType
   -> Maybe Text
   -> Maybe Text
   -> Maybe [ParameterInlinePolicy]
   -> ParameterHistory)
-> Parser (Maybe Text)
-> Parser
     (Maybe (NonEmpty Text)
      -> Maybe Text
      -> Maybe ParameterType
      -> Maybe Text
      -> Maybe Text
      -> Maybe [ParameterInlinePolicy]
      -> ParameterHistory)
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
"LastModifiedUser")
            Parser
  (Maybe (NonEmpty Text)
   -> Maybe Text
   -> Maybe ParameterType
   -> Maybe Text
   -> Maybe Text
   -> Maybe [ParameterInlinePolicy]
   -> ParameterHistory)
-> Parser (Maybe (NonEmpty Text))
-> Parser
     (Maybe Text
      -> Maybe ParameterType
      -> Maybe Text
      -> Maybe Text
      -> Maybe [ParameterInlinePolicy]
      -> ParameterHistory)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (NonEmpty Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Labels")
            Parser
  (Maybe Text
   -> Maybe ParameterType
   -> Maybe Text
   -> Maybe Text
   -> Maybe [ParameterInlinePolicy]
   -> ParameterHistory)
-> Parser (Maybe Text)
-> Parser
     (Maybe ParameterType
      -> Maybe Text
      -> Maybe Text
      -> Maybe [ParameterInlinePolicy]
      -> ParameterHistory)
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
"AllowedPattern")
            Parser
  (Maybe ParameterType
   -> Maybe Text
   -> Maybe Text
   -> Maybe [ParameterInlinePolicy]
   -> ParameterHistory)
-> Parser (Maybe ParameterType)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe [ParameterInlinePolicy] -> ParameterHistory)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ParameterType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Type")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe [ParameterInlinePolicy] -> ParameterHistory)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe [ParameterInlinePolicy] -> ParameterHistory)
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
"DataType")
            Parser
  (Maybe Text -> Maybe [ParameterInlinePolicy] -> ParameterHistory)
-> Parser (Maybe Text)
-> Parser (Maybe [ParameterInlinePolicy] -> ParameterHistory)
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
"Description")
            Parser (Maybe [ParameterInlinePolicy] -> ParameterHistory)
-> Parser (Maybe [ParameterInlinePolicy])
-> Parser ParameterHistory
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [ParameterInlinePolicy]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Policies" Parser (Maybe (Maybe [ParameterInlinePolicy]))
-> Maybe [ParameterInlinePolicy]
-> Parser (Maybe [ParameterInlinePolicy])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [ParameterInlinePolicy]
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable ParameterHistory

instance Prelude.NFData ParameterHistory