{-# 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 #-}
module Amazonka.DocumentDB.Types.ResourcePendingMaintenanceActions where
import qualified Amazonka.Core as Core
import Amazonka.DocumentDB.Types.PendingMaintenanceAction
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ResourcePendingMaintenanceActions = ResourcePendingMaintenanceActions'
{
ResourcePendingMaintenanceActions
-> Maybe [PendingMaintenanceAction]
pendingMaintenanceActionDetails :: Prelude.Maybe [PendingMaintenanceAction],
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)
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
}
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
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.FromXML
ResourcePendingMaintenanceActions
where
parseXML :: [Node] -> Either String ResourcePendingMaintenanceActions
parseXML [Node]
x =
Maybe [PendingMaintenanceAction]
-> Maybe Text -> ResourcePendingMaintenanceActions
ResourcePendingMaintenanceActions'
(Maybe [PendingMaintenanceAction]
-> Maybe Text -> ResourcePendingMaintenanceActions)
-> Either String (Maybe [PendingMaintenanceAction])
-> Either String (Maybe Text -> ResourcePendingMaintenanceActions)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"PendingMaintenanceActionDetails"
Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
Either String [Node]
-> ([Node] -> Either String (Maybe [PendingMaintenanceAction]))
-> Either String (Maybe [PendingMaintenanceAction])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [PendingMaintenanceAction])
-> [Node] -> Either String (Maybe [PendingMaintenanceAction])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may
(Text -> [Node] -> Either String [PendingMaintenanceAction]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"PendingMaintenanceAction")
)
Either String (Maybe Text -> ResourcePendingMaintenanceActions)
-> Either String (Maybe Text)
-> Either String ResourcePendingMaintenanceActions
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ResourceIdentifier")
instance
Prelude.Hashable
ResourcePendingMaintenanceActions
instance
Prelude.NFData
ResourcePendingMaintenanceActions