{-# 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.ResourceGroups.Types.GroupConfiguration where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.ResourceGroups.Types.GroupConfigurationItem
import Amazonka.ResourceGroups.Types.GroupConfigurationStatus
data GroupConfiguration = GroupConfiguration'
{
GroupConfiguration -> Maybe GroupConfigurationStatus
status :: Prelude.Maybe GroupConfigurationStatus,
GroupConfiguration -> Maybe Text
failureReason :: Prelude.Maybe Prelude.Text,
GroupConfiguration -> Maybe [GroupConfigurationItem]
proposedConfiguration :: Prelude.Maybe [GroupConfigurationItem],
GroupConfiguration -> Maybe [GroupConfigurationItem]
configuration :: Prelude.Maybe [GroupConfigurationItem]
}
deriving (GroupConfiguration -> GroupConfiguration -> Bool
(GroupConfiguration -> GroupConfiguration -> Bool)
-> (GroupConfiguration -> GroupConfiguration -> Bool)
-> Eq GroupConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GroupConfiguration -> GroupConfiguration -> Bool
$c/= :: GroupConfiguration -> GroupConfiguration -> Bool
== :: GroupConfiguration -> GroupConfiguration -> Bool
$c== :: GroupConfiguration -> GroupConfiguration -> Bool
Prelude.Eq, ReadPrec [GroupConfiguration]
ReadPrec GroupConfiguration
Int -> ReadS GroupConfiguration
ReadS [GroupConfiguration]
(Int -> ReadS GroupConfiguration)
-> ReadS [GroupConfiguration]
-> ReadPrec GroupConfiguration
-> ReadPrec [GroupConfiguration]
-> Read GroupConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GroupConfiguration]
$creadListPrec :: ReadPrec [GroupConfiguration]
readPrec :: ReadPrec GroupConfiguration
$creadPrec :: ReadPrec GroupConfiguration
readList :: ReadS [GroupConfiguration]
$creadList :: ReadS [GroupConfiguration]
readsPrec :: Int -> ReadS GroupConfiguration
$creadsPrec :: Int -> ReadS GroupConfiguration
Prelude.Read, Int -> GroupConfiguration -> ShowS
[GroupConfiguration] -> ShowS
GroupConfiguration -> String
(Int -> GroupConfiguration -> ShowS)
-> (GroupConfiguration -> String)
-> ([GroupConfiguration] -> ShowS)
-> Show GroupConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GroupConfiguration] -> ShowS
$cshowList :: [GroupConfiguration] -> ShowS
show :: GroupConfiguration -> String
$cshow :: GroupConfiguration -> String
showsPrec :: Int -> GroupConfiguration -> ShowS
$cshowsPrec :: Int -> GroupConfiguration -> ShowS
Prelude.Show, (forall x. GroupConfiguration -> Rep GroupConfiguration x)
-> (forall x. Rep GroupConfiguration x -> GroupConfiguration)
-> Generic GroupConfiguration
forall x. Rep GroupConfiguration x -> GroupConfiguration
forall x. GroupConfiguration -> Rep GroupConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GroupConfiguration x -> GroupConfiguration
$cfrom :: forall x. GroupConfiguration -> Rep GroupConfiguration x
Prelude.Generic)
newGroupConfiguration ::
GroupConfiguration
newGroupConfiguration :: GroupConfiguration
newGroupConfiguration =
GroupConfiguration' :: Maybe GroupConfigurationStatus
-> Maybe Text
-> Maybe [GroupConfigurationItem]
-> Maybe [GroupConfigurationItem]
-> GroupConfiguration
GroupConfiguration'
{ $sel:status:GroupConfiguration' :: Maybe GroupConfigurationStatus
status = Maybe GroupConfigurationStatus
forall a. Maybe a
Prelude.Nothing,
$sel:failureReason:GroupConfiguration' :: Maybe Text
failureReason = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:proposedConfiguration:GroupConfiguration' :: Maybe [GroupConfigurationItem]
proposedConfiguration = Maybe [GroupConfigurationItem]
forall a. Maybe a
Prelude.Nothing,
$sel:configuration:GroupConfiguration' :: Maybe [GroupConfigurationItem]
configuration = Maybe [GroupConfigurationItem]
forall a. Maybe a
Prelude.Nothing
}
groupConfiguration_status :: Lens.Lens' GroupConfiguration (Prelude.Maybe GroupConfigurationStatus)
groupConfiguration_status :: (Maybe GroupConfigurationStatus
-> f (Maybe GroupConfigurationStatus))
-> GroupConfiguration -> f GroupConfiguration
groupConfiguration_status = (GroupConfiguration -> Maybe GroupConfigurationStatus)
-> (GroupConfiguration
-> Maybe GroupConfigurationStatus -> GroupConfiguration)
-> Lens
GroupConfiguration
GroupConfiguration
(Maybe GroupConfigurationStatus)
(Maybe GroupConfigurationStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GroupConfiguration' {Maybe GroupConfigurationStatus
status :: Maybe GroupConfigurationStatus
$sel:status:GroupConfiguration' :: GroupConfiguration -> Maybe GroupConfigurationStatus
status} -> Maybe GroupConfigurationStatus
status) (\s :: GroupConfiguration
s@GroupConfiguration' {} Maybe GroupConfigurationStatus
a -> GroupConfiguration
s {$sel:status:GroupConfiguration' :: Maybe GroupConfigurationStatus
status = Maybe GroupConfigurationStatus
a} :: GroupConfiguration)
groupConfiguration_failureReason :: Lens.Lens' GroupConfiguration (Prelude.Maybe Prelude.Text)
groupConfiguration_failureReason :: (Maybe Text -> f (Maybe Text))
-> GroupConfiguration -> f GroupConfiguration
groupConfiguration_failureReason = (GroupConfiguration -> Maybe Text)
-> (GroupConfiguration -> Maybe Text -> GroupConfiguration)
-> Lens
GroupConfiguration GroupConfiguration (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GroupConfiguration' {Maybe Text
failureReason :: Maybe Text
$sel:failureReason:GroupConfiguration' :: GroupConfiguration -> Maybe Text
failureReason} -> Maybe Text
failureReason) (\s :: GroupConfiguration
s@GroupConfiguration' {} Maybe Text
a -> GroupConfiguration
s {$sel:failureReason:GroupConfiguration' :: Maybe Text
failureReason = Maybe Text
a} :: GroupConfiguration)
groupConfiguration_proposedConfiguration :: Lens.Lens' GroupConfiguration (Prelude.Maybe [GroupConfigurationItem])
groupConfiguration_proposedConfiguration :: (Maybe [GroupConfigurationItem]
-> f (Maybe [GroupConfigurationItem]))
-> GroupConfiguration -> f GroupConfiguration
groupConfiguration_proposedConfiguration = (GroupConfiguration -> Maybe [GroupConfigurationItem])
-> (GroupConfiguration
-> Maybe [GroupConfigurationItem] -> GroupConfiguration)
-> Lens
GroupConfiguration
GroupConfiguration
(Maybe [GroupConfigurationItem])
(Maybe [GroupConfigurationItem])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GroupConfiguration' {Maybe [GroupConfigurationItem]
proposedConfiguration :: Maybe [GroupConfigurationItem]
$sel:proposedConfiguration:GroupConfiguration' :: GroupConfiguration -> Maybe [GroupConfigurationItem]
proposedConfiguration} -> Maybe [GroupConfigurationItem]
proposedConfiguration) (\s :: GroupConfiguration
s@GroupConfiguration' {} Maybe [GroupConfigurationItem]
a -> GroupConfiguration
s {$sel:proposedConfiguration:GroupConfiguration' :: Maybe [GroupConfigurationItem]
proposedConfiguration = Maybe [GroupConfigurationItem]
a} :: GroupConfiguration) ((Maybe [GroupConfigurationItem]
-> f (Maybe [GroupConfigurationItem]))
-> GroupConfiguration -> f GroupConfiguration)
-> ((Maybe [GroupConfigurationItem]
-> f (Maybe [GroupConfigurationItem]))
-> Maybe [GroupConfigurationItem]
-> f (Maybe [GroupConfigurationItem]))
-> (Maybe [GroupConfigurationItem]
-> f (Maybe [GroupConfigurationItem]))
-> GroupConfiguration
-> f GroupConfiguration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[GroupConfigurationItem]
[GroupConfigurationItem]
[GroupConfigurationItem]
[GroupConfigurationItem]
-> Iso
(Maybe [GroupConfigurationItem])
(Maybe [GroupConfigurationItem])
(Maybe [GroupConfigurationItem])
(Maybe [GroupConfigurationItem])
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
[GroupConfigurationItem]
[GroupConfigurationItem]
[GroupConfigurationItem]
[GroupConfigurationItem]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
groupConfiguration_configuration :: Lens.Lens' GroupConfiguration (Prelude.Maybe [GroupConfigurationItem])
groupConfiguration_configuration :: (Maybe [GroupConfigurationItem]
-> f (Maybe [GroupConfigurationItem]))
-> GroupConfiguration -> f GroupConfiguration
groupConfiguration_configuration = (GroupConfiguration -> Maybe [GroupConfigurationItem])
-> (GroupConfiguration
-> Maybe [GroupConfigurationItem] -> GroupConfiguration)
-> Lens
GroupConfiguration
GroupConfiguration
(Maybe [GroupConfigurationItem])
(Maybe [GroupConfigurationItem])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GroupConfiguration' {Maybe [GroupConfigurationItem]
configuration :: Maybe [GroupConfigurationItem]
$sel:configuration:GroupConfiguration' :: GroupConfiguration -> Maybe [GroupConfigurationItem]
configuration} -> Maybe [GroupConfigurationItem]
configuration) (\s :: GroupConfiguration
s@GroupConfiguration' {} Maybe [GroupConfigurationItem]
a -> GroupConfiguration
s {$sel:configuration:GroupConfiguration' :: Maybe [GroupConfigurationItem]
configuration = Maybe [GroupConfigurationItem]
a} :: GroupConfiguration) ((Maybe [GroupConfigurationItem]
-> f (Maybe [GroupConfigurationItem]))
-> GroupConfiguration -> f GroupConfiguration)
-> ((Maybe [GroupConfigurationItem]
-> f (Maybe [GroupConfigurationItem]))
-> Maybe [GroupConfigurationItem]
-> f (Maybe [GroupConfigurationItem]))
-> (Maybe [GroupConfigurationItem]
-> f (Maybe [GroupConfigurationItem]))
-> GroupConfiguration
-> f GroupConfiguration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[GroupConfigurationItem]
[GroupConfigurationItem]
[GroupConfigurationItem]
[GroupConfigurationItem]
-> Iso
(Maybe [GroupConfigurationItem])
(Maybe [GroupConfigurationItem])
(Maybe [GroupConfigurationItem])
(Maybe [GroupConfigurationItem])
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
[GroupConfigurationItem]
[GroupConfigurationItem]
[GroupConfigurationItem]
[GroupConfigurationItem]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON GroupConfiguration where
parseJSON :: Value -> Parser GroupConfiguration
parseJSON =
String
-> (Object -> Parser GroupConfiguration)
-> Value
-> Parser GroupConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"GroupConfiguration"
( \Object
x ->
Maybe GroupConfigurationStatus
-> Maybe Text
-> Maybe [GroupConfigurationItem]
-> Maybe [GroupConfigurationItem]
-> GroupConfiguration
GroupConfiguration'
(Maybe GroupConfigurationStatus
-> Maybe Text
-> Maybe [GroupConfigurationItem]
-> Maybe [GroupConfigurationItem]
-> GroupConfiguration)
-> Parser (Maybe GroupConfigurationStatus)
-> Parser
(Maybe Text
-> Maybe [GroupConfigurationItem]
-> Maybe [GroupConfigurationItem]
-> GroupConfiguration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe GroupConfigurationStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
Parser
(Maybe Text
-> Maybe [GroupConfigurationItem]
-> Maybe [GroupConfigurationItem]
-> GroupConfiguration)
-> Parser (Maybe Text)
-> Parser
(Maybe [GroupConfigurationItem]
-> Maybe [GroupConfigurationItem] -> GroupConfiguration)
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
"FailureReason")
Parser
(Maybe [GroupConfigurationItem]
-> Maybe [GroupConfigurationItem] -> GroupConfiguration)
-> Parser (Maybe [GroupConfigurationItem])
-> Parser (Maybe [GroupConfigurationItem] -> GroupConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [GroupConfigurationItem]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ProposedConfiguration"
Parser (Maybe (Maybe [GroupConfigurationItem]))
-> Maybe [GroupConfigurationItem]
-> Parser (Maybe [GroupConfigurationItem])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [GroupConfigurationItem]
forall a. Monoid a => a
Prelude.mempty
)
Parser (Maybe [GroupConfigurationItem] -> GroupConfiguration)
-> Parser (Maybe [GroupConfigurationItem])
-> Parser GroupConfiguration
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [GroupConfigurationItem]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Configuration" Parser (Maybe (Maybe [GroupConfigurationItem]))
-> Maybe [GroupConfigurationItem]
-> Parser (Maybe [GroupConfigurationItem])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [GroupConfigurationItem]
forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable GroupConfiguration
instance Prelude.NFData GroupConfiguration