{-# 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.DLM.Types.LifecyclePolicy
-- 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.DLM.Types.LifecyclePolicy where

import qualified Amazonka.Core as Core
import Amazonka.DLM.Types.GettablePolicyStateValues
import Amazonka.DLM.Types.PolicyDetails
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Detailed information about a lifecycle policy.
--
-- /See:/ 'newLifecyclePolicy' smart constructor.
data LifecyclePolicy = LifecyclePolicy'
  { -- | The activation state of the lifecycle policy.
    LifecyclePolicy -> Maybe GettablePolicyStateValues
state :: Prelude.Maybe GettablePolicyStateValues,
    -- | The configuration of the lifecycle policy
    LifecyclePolicy -> Maybe PolicyDetails
policyDetails :: Prelude.Maybe PolicyDetails,
    -- | The identifier of the lifecycle policy.
    LifecyclePolicy -> Maybe Text
policyId :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the IAM role used to run the
    -- operations specified by the lifecycle policy.
    LifecyclePolicy -> Maybe Text
executionRoleArn :: Prelude.Maybe Prelude.Text,
    -- | The local date and time when the lifecycle policy was created.
    LifecyclePolicy -> Maybe POSIX
dateCreated :: Prelude.Maybe Core.POSIX,
    -- | The description of the status.
    LifecyclePolicy -> Maybe Text
statusMessage :: Prelude.Maybe Prelude.Text,
    -- | The local date and time when the lifecycle policy was last modified.
    LifecyclePolicy -> Maybe POSIX
dateModified :: Prelude.Maybe Core.POSIX,
    -- | The Amazon Resource Name (ARN) of the policy.
    LifecyclePolicy -> Maybe Text
policyArn :: Prelude.Maybe Prelude.Text,
    -- | The description of the lifecycle policy.
    LifecyclePolicy -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The tags.
    LifecyclePolicy -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)
  }
  deriving (LifecyclePolicy -> LifecyclePolicy -> Bool
(LifecyclePolicy -> LifecyclePolicy -> Bool)
-> (LifecyclePolicy -> LifecyclePolicy -> Bool)
-> Eq LifecyclePolicy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LifecyclePolicy -> LifecyclePolicy -> Bool
$c/= :: LifecyclePolicy -> LifecyclePolicy -> Bool
== :: LifecyclePolicy -> LifecyclePolicy -> Bool
$c== :: LifecyclePolicy -> LifecyclePolicy -> Bool
Prelude.Eq, ReadPrec [LifecyclePolicy]
ReadPrec LifecyclePolicy
Int -> ReadS LifecyclePolicy
ReadS [LifecyclePolicy]
(Int -> ReadS LifecyclePolicy)
-> ReadS [LifecyclePolicy]
-> ReadPrec LifecyclePolicy
-> ReadPrec [LifecyclePolicy]
-> Read LifecyclePolicy
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LifecyclePolicy]
$creadListPrec :: ReadPrec [LifecyclePolicy]
readPrec :: ReadPrec LifecyclePolicy
$creadPrec :: ReadPrec LifecyclePolicy
readList :: ReadS [LifecyclePolicy]
$creadList :: ReadS [LifecyclePolicy]
readsPrec :: Int -> ReadS LifecyclePolicy
$creadsPrec :: Int -> ReadS LifecyclePolicy
Prelude.Read, Int -> LifecyclePolicy -> ShowS
[LifecyclePolicy] -> ShowS
LifecyclePolicy -> String
(Int -> LifecyclePolicy -> ShowS)
-> (LifecyclePolicy -> String)
-> ([LifecyclePolicy] -> ShowS)
-> Show LifecyclePolicy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LifecyclePolicy] -> ShowS
$cshowList :: [LifecyclePolicy] -> ShowS
show :: LifecyclePolicy -> String
$cshow :: LifecyclePolicy -> String
showsPrec :: Int -> LifecyclePolicy -> ShowS
$cshowsPrec :: Int -> LifecyclePolicy -> ShowS
Prelude.Show, (forall x. LifecyclePolicy -> Rep LifecyclePolicy x)
-> (forall x. Rep LifecyclePolicy x -> LifecyclePolicy)
-> Generic LifecyclePolicy
forall x. Rep LifecyclePolicy x -> LifecyclePolicy
forall x. LifecyclePolicy -> Rep LifecyclePolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LifecyclePolicy x -> LifecyclePolicy
$cfrom :: forall x. LifecyclePolicy -> Rep LifecyclePolicy x
Prelude.Generic)

-- |
-- Create a value of 'LifecyclePolicy' 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:
--
-- 'state', 'lifecyclePolicy_state' - The activation state of the lifecycle policy.
--
-- 'policyDetails', 'lifecyclePolicy_policyDetails' - The configuration of the lifecycle policy
--
-- 'policyId', 'lifecyclePolicy_policyId' - The identifier of the lifecycle policy.
--
-- 'executionRoleArn', 'lifecyclePolicy_executionRoleArn' - The Amazon Resource Name (ARN) of the IAM role used to run the
-- operations specified by the lifecycle policy.
--
-- 'dateCreated', 'lifecyclePolicy_dateCreated' - The local date and time when the lifecycle policy was created.
--
-- 'statusMessage', 'lifecyclePolicy_statusMessage' - The description of the status.
--
-- 'dateModified', 'lifecyclePolicy_dateModified' - The local date and time when the lifecycle policy was last modified.
--
-- 'policyArn', 'lifecyclePolicy_policyArn' - The Amazon Resource Name (ARN) of the policy.
--
-- 'description', 'lifecyclePolicy_description' - The description of the lifecycle policy.
--
-- 'tags', 'lifecyclePolicy_tags' - The tags.
newLifecyclePolicy ::
  LifecyclePolicy
newLifecyclePolicy :: LifecyclePolicy
newLifecyclePolicy =
  LifecyclePolicy' :: Maybe GettablePolicyStateValues
-> Maybe PolicyDetails
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> LifecyclePolicy
LifecyclePolicy'
    { $sel:state:LifecyclePolicy' :: Maybe GettablePolicyStateValues
state = Maybe GettablePolicyStateValues
forall a. Maybe a
Prelude.Nothing,
      $sel:policyDetails:LifecyclePolicy' :: Maybe PolicyDetails
policyDetails = Maybe PolicyDetails
forall a. Maybe a
Prelude.Nothing,
      $sel:policyId:LifecyclePolicy' :: Maybe Text
policyId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:executionRoleArn:LifecyclePolicy' :: Maybe Text
executionRoleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:dateCreated:LifecyclePolicy' :: Maybe POSIX
dateCreated = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:statusMessage:LifecyclePolicy' :: Maybe Text
statusMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:dateModified:LifecyclePolicy' :: Maybe POSIX
dateModified = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:policyArn:LifecyclePolicy' :: Maybe Text
policyArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:LifecyclePolicy' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:LifecyclePolicy' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing
    }

-- | The activation state of the lifecycle policy.
lifecyclePolicy_state :: Lens.Lens' LifecyclePolicy (Prelude.Maybe GettablePolicyStateValues)
lifecyclePolicy_state :: (Maybe GettablePolicyStateValues
 -> f (Maybe GettablePolicyStateValues))
-> LifecyclePolicy -> f LifecyclePolicy
lifecyclePolicy_state = (LifecyclePolicy -> Maybe GettablePolicyStateValues)
-> (LifecyclePolicy
    -> Maybe GettablePolicyStateValues -> LifecyclePolicy)
-> Lens
     LifecyclePolicy
     LifecyclePolicy
     (Maybe GettablePolicyStateValues)
     (Maybe GettablePolicyStateValues)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LifecyclePolicy' {Maybe GettablePolicyStateValues
state :: Maybe GettablePolicyStateValues
$sel:state:LifecyclePolicy' :: LifecyclePolicy -> Maybe GettablePolicyStateValues
state} -> Maybe GettablePolicyStateValues
state) (\s :: LifecyclePolicy
s@LifecyclePolicy' {} Maybe GettablePolicyStateValues
a -> LifecyclePolicy
s {$sel:state:LifecyclePolicy' :: Maybe GettablePolicyStateValues
state = Maybe GettablePolicyStateValues
a} :: LifecyclePolicy)

-- | The configuration of the lifecycle policy
lifecyclePolicy_policyDetails :: Lens.Lens' LifecyclePolicy (Prelude.Maybe PolicyDetails)
lifecyclePolicy_policyDetails :: (Maybe PolicyDetails -> f (Maybe PolicyDetails))
-> LifecyclePolicy -> f LifecyclePolicy
lifecyclePolicy_policyDetails = (LifecyclePolicy -> Maybe PolicyDetails)
-> (LifecyclePolicy -> Maybe PolicyDetails -> LifecyclePolicy)
-> Lens
     LifecyclePolicy
     LifecyclePolicy
     (Maybe PolicyDetails)
     (Maybe PolicyDetails)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LifecyclePolicy' {Maybe PolicyDetails
policyDetails :: Maybe PolicyDetails
$sel:policyDetails:LifecyclePolicy' :: LifecyclePolicy -> Maybe PolicyDetails
policyDetails} -> Maybe PolicyDetails
policyDetails) (\s :: LifecyclePolicy
s@LifecyclePolicy' {} Maybe PolicyDetails
a -> LifecyclePolicy
s {$sel:policyDetails:LifecyclePolicy' :: Maybe PolicyDetails
policyDetails = Maybe PolicyDetails
a} :: LifecyclePolicy)

-- | The identifier of the lifecycle policy.
lifecyclePolicy_policyId :: Lens.Lens' LifecyclePolicy (Prelude.Maybe Prelude.Text)
lifecyclePolicy_policyId :: (Maybe Text -> f (Maybe Text))
-> LifecyclePolicy -> f LifecyclePolicy
lifecyclePolicy_policyId = (LifecyclePolicy -> Maybe Text)
-> (LifecyclePolicy -> Maybe Text -> LifecyclePolicy)
-> Lens LifecyclePolicy LifecyclePolicy (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LifecyclePolicy' {Maybe Text
policyId :: Maybe Text
$sel:policyId:LifecyclePolicy' :: LifecyclePolicy -> Maybe Text
policyId} -> Maybe Text
policyId) (\s :: LifecyclePolicy
s@LifecyclePolicy' {} Maybe Text
a -> LifecyclePolicy
s {$sel:policyId:LifecyclePolicy' :: Maybe Text
policyId = Maybe Text
a} :: LifecyclePolicy)

-- | The Amazon Resource Name (ARN) of the IAM role used to run the
-- operations specified by the lifecycle policy.
lifecyclePolicy_executionRoleArn :: Lens.Lens' LifecyclePolicy (Prelude.Maybe Prelude.Text)
lifecyclePolicy_executionRoleArn :: (Maybe Text -> f (Maybe Text))
-> LifecyclePolicy -> f LifecyclePolicy
lifecyclePolicy_executionRoleArn = (LifecyclePolicy -> Maybe Text)
-> (LifecyclePolicy -> Maybe Text -> LifecyclePolicy)
-> Lens LifecyclePolicy LifecyclePolicy (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LifecyclePolicy' {Maybe Text
executionRoleArn :: Maybe Text
$sel:executionRoleArn:LifecyclePolicy' :: LifecyclePolicy -> Maybe Text
executionRoleArn} -> Maybe Text
executionRoleArn) (\s :: LifecyclePolicy
s@LifecyclePolicy' {} Maybe Text
a -> LifecyclePolicy
s {$sel:executionRoleArn:LifecyclePolicy' :: Maybe Text
executionRoleArn = Maybe Text
a} :: LifecyclePolicy)

-- | The local date and time when the lifecycle policy was created.
lifecyclePolicy_dateCreated :: Lens.Lens' LifecyclePolicy (Prelude.Maybe Prelude.UTCTime)
lifecyclePolicy_dateCreated :: (Maybe UTCTime -> f (Maybe UTCTime))
-> LifecyclePolicy -> f LifecyclePolicy
lifecyclePolicy_dateCreated = (LifecyclePolicy -> Maybe POSIX)
-> (LifecyclePolicy -> Maybe POSIX -> LifecyclePolicy)
-> Lens LifecyclePolicy LifecyclePolicy (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LifecyclePolicy' {Maybe POSIX
dateCreated :: Maybe POSIX
$sel:dateCreated:LifecyclePolicy' :: LifecyclePolicy -> Maybe POSIX
dateCreated} -> Maybe POSIX
dateCreated) (\s :: LifecyclePolicy
s@LifecyclePolicy' {} Maybe POSIX
a -> LifecyclePolicy
s {$sel:dateCreated:LifecyclePolicy' :: Maybe POSIX
dateCreated = Maybe POSIX
a} :: LifecyclePolicy) ((Maybe POSIX -> f (Maybe POSIX))
 -> LifecyclePolicy -> f LifecyclePolicy)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> LifecyclePolicy
-> f LifecyclePolicy
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 description of the status.
lifecyclePolicy_statusMessage :: Lens.Lens' LifecyclePolicy (Prelude.Maybe Prelude.Text)
lifecyclePolicy_statusMessage :: (Maybe Text -> f (Maybe Text))
-> LifecyclePolicy -> f LifecyclePolicy
lifecyclePolicy_statusMessage = (LifecyclePolicy -> Maybe Text)
-> (LifecyclePolicy -> Maybe Text -> LifecyclePolicy)
-> Lens LifecyclePolicy LifecyclePolicy (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LifecyclePolicy' {Maybe Text
statusMessage :: Maybe Text
$sel:statusMessage:LifecyclePolicy' :: LifecyclePolicy -> Maybe Text
statusMessage} -> Maybe Text
statusMessage) (\s :: LifecyclePolicy
s@LifecyclePolicy' {} Maybe Text
a -> LifecyclePolicy
s {$sel:statusMessage:LifecyclePolicy' :: Maybe Text
statusMessage = Maybe Text
a} :: LifecyclePolicy)

-- | The local date and time when the lifecycle policy was last modified.
lifecyclePolicy_dateModified :: Lens.Lens' LifecyclePolicy (Prelude.Maybe Prelude.UTCTime)
lifecyclePolicy_dateModified :: (Maybe UTCTime -> f (Maybe UTCTime))
-> LifecyclePolicy -> f LifecyclePolicy
lifecyclePolicy_dateModified = (LifecyclePolicy -> Maybe POSIX)
-> (LifecyclePolicy -> Maybe POSIX -> LifecyclePolicy)
-> Lens LifecyclePolicy LifecyclePolicy (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LifecyclePolicy' {Maybe POSIX
dateModified :: Maybe POSIX
$sel:dateModified:LifecyclePolicy' :: LifecyclePolicy -> Maybe POSIX
dateModified} -> Maybe POSIX
dateModified) (\s :: LifecyclePolicy
s@LifecyclePolicy' {} Maybe POSIX
a -> LifecyclePolicy
s {$sel:dateModified:LifecyclePolicy' :: Maybe POSIX
dateModified = Maybe POSIX
a} :: LifecyclePolicy) ((Maybe POSIX -> f (Maybe POSIX))
 -> LifecyclePolicy -> f LifecyclePolicy)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> LifecyclePolicy
-> f LifecyclePolicy
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 Amazon Resource Name (ARN) of the policy.
lifecyclePolicy_policyArn :: Lens.Lens' LifecyclePolicy (Prelude.Maybe Prelude.Text)
lifecyclePolicy_policyArn :: (Maybe Text -> f (Maybe Text))
-> LifecyclePolicy -> f LifecyclePolicy
lifecyclePolicy_policyArn = (LifecyclePolicy -> Maybe Text)
-> (LifecyclePolicy -> Maybe Text -> LifecyclePolicy)
-> Lens LifecyclePolicy LifecyclePolicy (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LifecyclePolicy' {Maybe Text
policyArn :: Maybe Text
$sel:policyArn:LifecyclePolicy' :: LifecyclePolicy -> Maybe Text
policyArn} -> Maybe Text
policyArn) (\s :: LifecyclePolicy
s@LifecyclePolicy' {} Maybe Text
a -> LifecyclePolicy
s {$sel:policyArn:LifecyclePolicy' :: Maybe Text
policyArn = Maybe Text
a} :: LifecyclePolicy)

-- | The description of the lifecycle policy.
lifecyclePolicy_description :: Lens.Lens' LifecyclePolicy (Prelude.Maybe Prelude.Text)
lifecyclePolicy_description :: (Maybe Text -> f (Maybe Text))
-> LifecyclePolicy -> f LifecyclePolicy
lifecyclePolicy_description = (LifecyclePolicy -> Maybe Text)
-> (LifecyclePolicy -> Maybe Text -> LifecyclePolicy)
-> Lens LifecyclePolicy LifecyclePolicy (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LifecyclePolicy' {Maybe Text
description :: Maybe Text
$sel:description:LifecyclePolicy' :: LifecyclePolicy -> Maybe Text
description} -> Maybe Text
description) (\s :: LifecyclePolicy
s@LifecyclePolicy' {} Maybe Text
a -> LifecyclePolicy
s {$sel:description:LifecyclePolicy' :: Maybe Text
description = Maybe Text
a} :: LifecyclePolicy)

-- | The tags.
lifecyclePolicy_tags :: Lens.Lens' LifecyclePolicy (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
lifecyclePolicy_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> LifecyclePolicy -> f LifecyclePolicy
lifecyclePolicy_tags = (LifecyclePolicy -> Maybe (HashMap Text Text))
-> (LifecyclePolicy
    -> Maybe (HashMap Text Text) -> LifecyclePolicy)
-> Lens
     LifecyclePolicy
     LifecyclePolicy
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LifecyclePolicy' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:LifecyclePolicy' :: LifecyclePolicy -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: LifecyclePolicy
s@LifecyclePolicy' {} Maybe (HashMap Text Text)
a -> LifecyclePolicy
s {$sel:tags:LifecyclePolicy' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: LifecyclePolicy) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> LifecyclePolicy -> f LifecyclePolicy)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> LifecyclePolicy
-> f LifecyclePolicy
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text 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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON LifecyclePolicy where
  parseJSON :: Value -> Parser LifecyclePolicy
parseJSON =
    String
-> (Object -> Parser LifecyclePolicy)
-> Value
-> Parser LifecyclePolicy
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"LifecyclePolicy"
      ( \Object
x ->
          Maybe GettablePolicyStateValues
-> Maybe PolicyDetails
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> LifecyclePolicy
LifecyclePolicy'
            (Maybe GettablePolicyStateValues
 -> Maybe PolicyDetails
 -> Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe (HashMap Text Text)
 -> LifecyclePolicy)
-> Parser (Maybe GettablePolicyStateValues)
-> Parser
     (Maybe PolicyDetails
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> LifecyclePolicy)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe GettablePolicyStateValues)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"State")
            Parser
  (Maybe PolicyDetails
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> LifecyclePolicy)
-> Parser (Maybe PolicyDetails)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> LifecyclePolicy)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe PolicyDetails)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PolicyDetails")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> LifecyclePolicy)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> LifecyclePolicy)
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
"PolicyId")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> LifecyclePolicy)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> LifecyclePolicy)
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
"ExecutionRoleArn")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> LifecyclePolicy)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> LifecyclePolicy)
forall (f :: * -> *) a b. Applicative f => 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
"DateCreated")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> LifecyclePolicy)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> LifecyclePolicy)
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
"StatusMessage")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> LifecyclePolicy)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe (HashMap Text Text) -> LifecyclePolicy)
forall (f :: * -> *) a b. Applicative f => 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
"DateModified")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe (HashMap Text Text) -> LifecyclePolicy)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe (HashMap Text Text) -> LifecyclePolicy)
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
"PolicyArn")
            Parser (Maybe Text -> Maybe (HashMap Text Text) -> LifecyclePolicy)
-> Parser (Maybe Text)
-> Parser (Maybe (HashMap Text Text) -> LifecyclePolicy)
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 (HashMap Text Text) -> LifecyclePolicy)
-> Parser (Maybe (HashMap Text Text)) -> Parser LifecyclePolicy
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Tags" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable LifecyclePolicy

instance Prelude.NFData LifecyclePolicy