{-# 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.ServiceCatalogAppRegistry.Types.ResourceGroup where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.ServiceCatalogAppRegistry.Types.ResourceGroupState
data ResourceGroup = ResourceGroup'
{
ResourceGroup -> Maybe ResourceGroupState
state :: Prelude.Maybe ResourceGroupState,
ResourceGroup -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
ResourceGroup -> Maybe Text
errorMessage :: Prelude.Maybe Prelude.Text
}
deriving (ResourceGroup -> ResourceGroup -> Bool
(ResourceGroup -> ResourceGroup -> Bool)
-> (ResourceGroup -> ResourceGroup -> Bool) -> Eq ResourceGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResourceGroup -> ResourceGroup -> Bool
$c/= :: ResourceGroup -> ResourceGroup -> Bool
== :: ResourceGroup -> ResourceGroup -> Bool
$c== :: ResourceGroup -> ResourceGroup -> Bool
Prelude.Eq, ReadPrec [ResourceGroup]
ReadPrec ResourceGroup
Int -> ReadS ResourceGroup
ReadS [ResourceGroup]
(Int -> ReadS ResourceGroup)
-> ReadS [ResourceGroup]
-> ReadPrec ResourceGroup
-> ReadPrec [ResourceGroup]
-> Read ResourceGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResourceGroup]
$creadListPrec :: ReadPrec [ResourceGroup]
readPrec :: ReadPrec ResourceGroup
$creadPrec :: ReadPrec ResourceGroup
readList :: ReadS [ResourceGroup]
$creadList :: ReadS [ResourceGroup]
readsPrec :: Int -> ReadS ResourceGroup
$creadsPrec :: Int -> ReadS ResourceGroup
Prelude.Read, Int -> ResourceGroup -> ShowS
[ResourceGroup] -> ShowS
ResourceGroup -> String
(Int -> ResourceGroup -> ShowS)
-> (ResourceGroup -> String)
-> ([ResourceGroup] -> ShowS)
-> Show ResourceGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResourceGroup] -> ShowS
$cshowList :: [ResourceGroup] -> ShowS
show :: ResourceGroup -> String
$cshow :: ResourceGroup -> String
showsPrec :: Int -> ResourceGroup -> ShowS
$cshowsPrec :: Int -> ResourceGroup -> ShowS
Prelude.Show, (forall x. ResourceGroup -> Rep ResourceGroup x)
-> (forall x. Rep ResourceGroup x -> ResourceGroup)
-> Generic ResourceGroup
forall x. Rep ResourceGroup x -> ResourceGroup
forall x. ResourceGroup -> Rep ResourceGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ResourceGroup x -> ResourceGroup
$cfrom :: forall x. ResourceGroup -> Rep ResourceGroup x
Prelude.Generic)
newResourceGroup ::
ResourceGroup
newResourceGroup :: ResourceGroup
newResourceGroup =
ResourceGroup' :: Maybe ResourceGroupState
-> Maybe Text -> Maybe Text -> ResourceGroup
ResourceGroup'
{ $sel:state:ResourceGroup' :: Maybe ResourceGroupState
state = Maybe ResourceGroupState
forall a. Maybe a
Prelude.Nothing,
$sel:arn:ResourceGroup' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:errorMessage:ResourceGroup' :: Maybe Text
errorMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
resourceGroup_state :: Lens.Lens' ResourceGroup (Prelude.Maybe ResourceGroupState)
resourceGroup_state :: (Maybe ResourceGroupState -> f (Maybe ResourceGroupState))
-> ResourceGroup -> f ResourceGroup
resourceGroup_state = (ResourceGroup -> Maybe ResourceGroupState)
-> (ResourceGroup -> Maybe ResourceGroupState -> ResourceGroup)
-> Lens
ResourceGroup
ResourceGroup
(Maybe ResourceGroupState)
(Maybe ResourceGroupState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceGroup' {Maybe ResourceGroupState
state :: Maybe ResourceGroupState
$sel:state:ResourceGroup' :: ResourceGroup -> Maybe ResourceGroupState
state} -> Maybe ResourceGroupState
state) (\s :: ResourceGroup
s@ResourceGroup' {} Maybe ResourceGroupState
a -> ResourceGroup
s {$sel:state:ResourceGroup' :: Maybe ResourceGroupState
state = Maybe ResourceGroupState
a} :: ResourceGroup)
resourceGroup_arn :: Lens.Lens' ResourceGroup (Prelude.Maybe Prelude.Text)
resourceGroup_arn :: (Maybe Text -> f (Maybe Text)) -> ResourceGroup -> f ResourceGroup
resourceGroup_arn = (ResourceGroup -> Maybe Text)
-> (ResourceGroup -> Maybe Text -> ResourceGroup)
-> Lens ResourceGroup ResourceGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceGroup' {Maybe Text
arn :: Maybe Text
$sel:arn:ResourceGroup' :: ResourceGroup -> Maybe Text
arn} -> Maybe Text
arn) (\s :: ResourceGroup
s@ResourceGroup' {} Maybe Text
a -> ResourceGroup
s {$sel:arn:ResourceGroup' :: Maybe Text
arn = Maybe Text
a} :: ResourceGroup)
resourceGroup_errorMessage :: Lens.Lens' ResourceGroup (Prelude.Maybe Prelude.Text)
resourceGroup_errorMessage :: (Maybe Text -> f (Maybe Text)) -> ResourceGroup -> f ResourceGroup
resourceGroup_errorMessage = (ResourceGroup -> Maybe Text)
-> (ResourceGroup -> Maybe Text -> ResourceGroup)
-> Lens ResourceGroup ResourceGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceGroup' {Maybe Text
errorMessage :: Maybe Text
$sel:errorMessage:ResourceGroup' :: ResourceGroup -> Maybe Text
errorMessage} -> Maybe Text
errorMessage) (\s :: ResourceGroup
s@ResourceGroup' {} Maybe Text
a -> ResourceGroup
s {$sel:errorMessage:ResourceGroup' :: Maybe Text
errorMessage = Maybe Text
a} :: ResourceGroup)
instance Core.FromJSON ResourceGroup where
parseJSON :: Value -> Parser ResourceGroup
parseJSON =
String
-> (Object -> Parser ResourceGroup)
-> Value
-> Parser ResourceGroup
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ResourceGroup"
( \Object
x ->
Maybe ResourceGroupState
-> Maybe Text -> Maybe Text -> ResourceGroup
ResourceGroup'
(Maybe ResourceGroupState
-> Maybe Text -> Maybe Text -> ResourceGroup)
-> Parser (Maybe ResourceGroupState)
-> Parser (Maybe Text -> Maybe Text -> ResourceGroup)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ResourceGroupState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"state")
Parser (Maybe Text -> Maybe Text -> ResourceGroup)
-> Parser (Maybe Text) -> Parser (Maybe Text -> ResourceGroup)
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
"arn")
Parser (Maybe Text -> ResourceGroup)
-> Parser (Maybe Text) -> Parser ResourceGroup
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
"errorMessage")
)
instance Prelude.Hashable ResourceGroup
instance Prelude.NFData ResourceGroup