{-# 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.DMS.Types.ResourcePendingMaintenanceActions
-- 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.DMS.Types.ResourcePendingMaintenanceActions where

import qualified Amazonka.Core as Core
import Amazonka.DMS.Types.PendingMaintenanceAction
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Identifies an DMS resource and any pending actions for it.
--
-- /See:/ 'newResourcePendingMaintenanceActions' smart constructor.
data ResourcePendingMaintenanceActions = ResourcePendingMaintenanceActions'
  { -- | Detailed information about the pending maintenance action.
    ResourcePendingMaintenanceActions
-> Maybe [PendingMaintenanceAction]
pendingMaintenanceActionDetails :: Prelude.Maybe [PendingMaintenanceAction],
    -- | The Amazon Resource Name (ARN) of the DMS resource that the pending
    -- maintenance action applies to. For information about creating an ARN,
    -- see
    -- <https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Introduction.AWS.ARN.html Constructing an Amazon Resource Name (ARN) for DMS>
    -- in the DMS documentation.
    ResourcePendingMaintenanceActions -> Maybe Text
resourceIdentifier :: Prelude.Maybe Prelude.Text
  }
  deriving (ResourcePendingMaintenanceActions
-> ResourcePendingMaintenanceActions -> Bool
(ResourcePendingMaintenanceActions
 -> ResourcePendingMaintenanceActions -> Bool)
-> (ResourcePendingMaintenanceActions
    -> ResourcePendingMaintenanceActions -> Bool)
-> Eq ResourcePendingMaintenanceActions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResourcePendingMaintenanceActions
-> ResourcePendingMaintenanceActions -> Bool
$c/= :: ResourcePendingMaintenanceActions
-> ResourcePendingMaintenanceActions -> Bool
== :: ResourcePendingMaintenanceActions
-> ResourcePendingMaintenanceActions -> Bool
$c== :: ResourcePendingMaintenanceActions
-> ResourcePendingMaintenanceActions -> Bool
Prelude.Eq, ReadPrec [ResourcePendingMaintenanceActions]
ReadPrec ResourcePendingMaintenanceActions
Int -> ReadS ResourcePendingMaintenanceActions
ReadS [ResourcePendingMaintenanceActions]
(Int -> ReadS ResourcePendingMaintenanceActions)
-> ReadS [ResourcePendingMaintenanceActions]
-> ReadPrec ResourcePendingMaintenanceActions
-> ReadPrec [ResourcePendingMaintenanceActions]
-> Read ResourcePendingMaintenanceActions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResourcePendingMaintenanceActions]
$creadListPrec :: ReadPrec [ResourcePendingMaintenanceActions]
readPrec :: ReadPrec ResourcePendingMaintenanceActions
$creadPrec :: ReadPrec ResourcePendingMaintenanceActions
readList :: ReadS [ResourcePendingMaintenanceActions]
$creadList :: ReadS [ResourcePendingMaintenanceActions]
readsPrec :: Int -> ReadS ResourcePendingMaintenanceActions
$creadsPrec :: Int -> ReadS ResourcePendingMaintenanceActions
Prelude.Read, Int -> ResourcePendingMaintenanceActions -> ShowS
[ResourcePendingMaintenanceActions] -> ShowS
ResourcePendingMaintenanceActions -> String
(Int -> ResourcePendingMaintenanceActions -> ShowS)
-> (ResourcePendingMaintenanceActions -> String)
-> ([ResourcePendingMaintenanceActions] -> ShowS)
-> Show ResourcePendingMaintenanceActions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResourcePendingMaintenanceActions] -> ShowS
$cshowList :: [ResourcePendingMaintenanceActions] -> ShowS
show :: ResourcePendingMaintenanceActions -> String
$cshow :: ResourcePendingMaintenanceActions -> String
showsPrec :: Int -> ResourcePendingMaintenanceActions -> ShowS
$cshowsPrec :: Int -> ResourcePendingMaintenanceActions -> ShowS
Prelude.Show, (forall x.
 ResourcePendingMaintenanceActions
 -> Rep ResourcePendingMaintenanceActions x)
-> (forall x.
    Rep ResourcePendingMaintenanceActions x
    -> ResourcePendingMaintenanceActions)
-> Generic ResourcePendingMaintenanceActions
forall x.
Rep ResourcePendingMaintenanceActions x
-> ResourcePendingMaintenanceActions
forall x.
ResourcePendingMaintenanceActions
-> Rep ResourcePendingMaintenanceActions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ResourcePendingMaintenanceActions x
-> ResourcePendingMaintenanceActions
$cfrom :: forall x.
ResourcePendingMaintenanceActions
-> Rep ResourcePendingMaintenanceActions x
Prelude.Generic)

-- |
-- Create a value of 'ResourcePendingMaintenanceActions' 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:
--
-- 'pendingMaintenanceActionDetails', 'resourcePendingMaintenanceActions_pendingMaintenanceActionDetails' - Detailed information about the pending maintenance action.
--
-- 'resourceIdentifier', 'resourcePendingMaintenanceActions_resourceIdentifier' - The Amazon Resource Name (ARN) of the DMS resource that the pending
-- maintenance action applies to. For information about creating an ARN,
-- see
-- <https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Introduction.AWS.ARN.html Constructing an Amazon Resource Name (ARN) for DMS>
-- in the DMS documentation.
newResourcePendingMaintenanceActions ::
  ResourcePendingMaintenanceActions
newResourcePendingMaintenanceActions :: ResourcePendingMaintenanceActions
newResourcePendingMaintenanceActions =
  ResourcePendingMaintenanceActions' :: Maybe [PendingMaintenanceAction]
-> Maybe Text -> ResourcePendingMaintenanceActions
ResourcePendingMaintenanceActions'
    { $sel:pendingMaintenanceActionDetails:ResourcePendingMaintenanceActions' :: Maybe [PendingMaintenanceAction]
pendingMaintenanceActionDetails =
        Maybe [PendingMaintenanceAction]
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceIdentifier:ResourcePendingMaintenanceActions' :: Maybe Text
resourceIdentifier = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | Detailed information about the pending maintenance action.
resourcePendingMaintenanceActions_pendingMaintenanceActionDetails :: Lens.Lens' ResourcePendingMaintenanceActions (Prelude.Maybe [PendingMaintenanceAction])
resourcePendingMaintenanceActions_pendingMaintenanceActionDetails :: (Maybe [PendingMaintenanceAction]
 -> f (Maybe [PendingMaintenanceAction]))
-> ResourcePendingMaintenanceActions
-> f ResourcePendingMaintenanceActions
resourcePendingMaintenanceActions_pendingMaintenanceActionDetails = (ResourcePendingMaintenanceActions
 -> Maybe [PendingMaintenanceAction])
-> (ResourcePendingMaintenanceActions
    -> Maybe [PendingMaintenanceAction]
    -> ResourcePendingMaintenanceActions)
-> Lens
     ResourcePendingMaintenanceActions
     ResourcePendingMaintenanceActions
     (Maybe [PendingMaintenanceAction])
     (Maybe [PendingMaintenanceAction])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourcePendingMaintenanceActions' {Maybe [PendingMaintenanceAction]
pendingMaintenanceActionDetails :: Maybe [PendingMaintenanceAction]
$sel:pendingMaintenanceActionDetails:ResourcePendingMaintenanceActions' :: ResourcePendingMaintenanceActions
-> Maybe [PendingMaintenanceAction]
pendingMaintenanceActionDetails} -> Maybe [PendingMaintenanceAction]
pendingMaintenanceActionDetails) (\s :: ResourcePendingMaintenanceActions
s@ResourcePendingMaintenanceActions' {} Maybe [PendingMaintenanceAction]
a -> ResourcePendingMaintenanceActions
s {$sel:pendingMaintenanceActionDetails:ResourcePendingMaintenanceActions' :: Maybe [PendingMaintenanceAction]
pendingMaintenanceActionDetails = Maybe [PendingMaintenanceAction]
a} :: ResourcePendingMaintenanceActions) ((Maybe [PendingMaintenanceAction]
  -> f (Maybe [PendingMaintenanceAction]))
 -> ResourcePendingMaintenanceActions
 -> f ResourcePendingMaintenanceActions)
-> ((Maybe [PendingMaintenanceAction]
     -> f (Maybe [PendingMaintenanceAction]))
    -> Maybe [PendingMaintenanceAction]
    -> f (Maybe [PendingMaintenanceAction]))
-> (Maybe [PendingMaintenanceAction]
    -> f (Maybe [PendingMaintenanceAction]))
-> ResourcePendingMaintenanceActions
-> f ResourcePendingMaintenanceActions
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [PendingMaintenanceAction]
  [PendingMaintenanceAction]
  [PendingMaintenanceAction]
  [PendingMaintenanceAction]
-> Iso
     (Maybe [PendingMaintenanceAction])
     (Maybe [PendingMaintenanceAction])
     (Maybe [PendingMaintenanceAction])
     (Maybe [PendingMaintenanceAction])
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
  [PendingMaintenanceAction]
  [PendingMaintenanceAction]
  [PendingMaintenanceAction]
  [PendingMaintenanceAction]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The Amazon Resource Name (ARN) of the DMS resource that the pending
-- maintenance action applies to. For information about creating an ARN,
-- see
-- <https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Introduction.AWS.ARN.html Constructing an Amazon Resource Name (ARN) for DMS>
-- in the DMS documentation.
resourcePendingMaintenanceActions_resourceIdentifier :: Lens.Lens' ResourcePendingMaintenanceActions (Prelude.Maybe Prelude.Text)
resourcePendingMaintenanceActions_resourceIdentifier :: (Maybe Text -> f (Maybe Text))
-> ResourcePendingMaintenanceActions
-> f ResourcePendingMaintenanceActions
resourcePendingMaintenanceActions_resourceIdentifier = (ResourcePendingMaintenanceActions -> Maybe Text)
-> (ResourcePendingMaintenanceActions
    -> Maybe Text -> ResourcePendingMaintenanceActions)
-> Lens
     ResourcePendingMaintenanceActions
     ResourcePendingMaintenanceActions
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourcePendingMaintenanceActions' {Maybe Text
resourceIdentifier :: Maybe Text
$sel:resourceIdentifier:ResourcePendingMaintenanceActions' :: ResourcePendingMaintenanceActions -> Maybe Text
resourceIdentifier} -> Maybe Text
resourceIdentifier) (\s :: ResourcePendingMaintenanceActions
s@ResourcePendingMaintenanceActions' {} Maybe Text
a -> ResourcePendingMaintenanceActions
s {$sel:resourceIdentifier:ResourcePendingMaintenanceActions' :: Maybe Text
resourceIdentifier = Maybe Text
a} :: ResourcePendingMaintenanceActions)

instance
  Core.FromJSON
    ResourcePendingMaintenanceActions
  where
  parseJSON :: Value -> Parser ResourcePendingMaintenanceActions
parseJSON =
    String
-> (Object -> Parser ResourcePendingMaintenanceActions)
-> Value
-> Parser ResourcePendingMaintenanceActions
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ResourcePendingMaintenanceActions"
      ( \Object
x ->
          Maybe [PendingMaintenanceAction]
-> Maybe Text -> ResourcePendingMaintenanceActions
ResourcePendingMaintenanceActions'
            (Maybe [PendingMaintenanceAction]
 -> Maybe Text -> ResourcePendingMaintenanceActions)
-> Parser (Maybe [PendingMaintenanceAction])
-> Parser (Maybe Text -> ResourcePendingMaintenanceActions)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Parser (Maybe (Maybe [PendingMaintenanceAction]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PendingMaintenanceActionDetails"
                            Parser (Maybe (Maybe [PendingMaintenanceAction]))
-> Maybe [PendingMaintenanceAction]
-> Parser (Maybe [PendingMaintenanceAction])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [PendingMaintenanceAction]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser (Maybe Text -> ResourcePendingMaintenanceActions)
-> Parser (Maybe Text) -> Parser ResourcePendingMaintenanceActions
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
"ResourceIdentifier")
      )

instance
  Prelude.Hashable
    ResourcePendingMaintenanceActions

instance
  Prelude.NFData
    ResourcePendingMaintenanceActions