{-# 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.ServiceCatalog.Types.StackInstance where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.ServiceCatalog.Types.StackInstanceStatus
data StackInstance = StackInstance'
{
StackInstance -> Maybe Text
account :: Prelude.Maybe Prelude.Text,
StackInstance -> Maybe Text
region :: Prelude.Maybe Prelude.Text,
StackInstance -> Maybe StackInstanceStatus
stackInstanceStatus :: Prelude.Maybe StackInstanceStatus
}
deriving (StackInstance -> StackInstance -> Bool
(StackInstance -> StackInstance -> Bool)
-> (StackInstance -> StackInstance -> Bool) -> Eq StackInstance
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StackInstance -> StackInstance -> Bool
$c/= :: StackInstance -> StackInstance -> Bool
== :: StackInstance -> StackInstance -> Bool
$c== :: StackInstance -> StackInstance -> Bool
Prelude.Eq, ReadPrec [StackInstance]
ReadPrec StackInstance
Int -> ReadS StackInstance
ReadS [StackInstance]
(Int -> ReadS StackInstance)
-> ReadS [StackInstance]
-> ReadPrec StackInstance
-> ReadPrec [StackInstance]
-> Read StackInstance
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StackInstance]
$creadListPrec :: ReadPrec [StackInstance]
readPrec :: ReadPrec StackInstance
$creadPrec :: ReadPrec StackInstance
readList :: ReadS [StackInstance]
$creadList :: ReadS [StackInstance]
readsPrec :: Int -> ReadS StackInstance
$creadsPrec :: Int -> ReadS StackInstance
Prelude.Read, Int -> StackInstance -> ShowS
[StackInstance] -> ShowS
StackInstance -> String
(Int -> StackInstance -> ShowS)
-> (StackInstance -> String)
-> ([StackInstance] -> ShowS)
-> Show StackInstance
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StackInstance] -> ShowS
$cshowList :: [StackInstance] -> ShowS
show :: StackInstance -> String
$cshow :: StackInstance -> String
showsPrec :: Int -> StackInstance -> ShowS
$cshowsPrec :: Int -> StackInstance -> ShowS
Prelude.Show, (forall x. StackInstance -> Rep StackInstance x)
-> (forall x. Rep StackInstance x -> StackInstance)
-> Generic StackInstance
forall x. Rep StackInstance x -> StackInstance
forall x. StackInstance -> Rep StackInstance x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StackInstance x -> StackInstance
$cfrom :: forall x. StackInstance -> Rep StackInstance x
Prelude.Generic)
newStackInstance ::
StackInstance
newStackInstance :: StackInstance
newStackInstance =
StackInstance' :: Maybe Text
-> Maybe Text -> Maybe StackInstanceStatus -> StackInstance
StackInstance'
{ $sel:account:StackInstance' :: Maybe Text
account = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:region:StackInstance' :: Maybe Text
region = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:stackInstanceStatus:StackInstance' :: Maybe StackInstanceStatus
stackInstanceStatus = Maybe StackInstanceStatus
forall a. Maybe a
Prelude.Nothing
}
stackInstance_account :: Lens.Lens' StackInstance (Prelude.Maybe Prelude.Text)
stackInstance_account :: (Maybe Text -> f (Maybe Text)) -> StackInstance -> f StackInstance
stackInstance_account = (StackInstance -> Maybe Text)
-> (StackInstance -> Maybe Text -> StackInstance)
-> Lens StackInstance StackInstance (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackInstance' {Maybe Text
account :: Maybe Text
$sel:account:StackInstance' :: StackInstance -> Maybe Text
account} -> Maybe Text
account) (\s :: StackInstance
s@StackInstance' {} Maybe Text
a -> StackInstance
s {$sel:account:StackInstance' :: Maybe Text
account = Maybe Text
a} :: StackInstance)
stackInstance_region :: Lens.Lens' StackInstance (Prelude.Maybe Prelude.Text)
stackInstance_region :: (Maybe Text -> f (Maybe Text)) -> StackInstance -> f StackInstance
stackInstance_region = (StackInstance -> Maybe Text)
-> (StackInstance -> Maybe Text -> StackInstance)
-> Lens StackInstance StackInstance (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackInstance' {Maybe Text
region :: Maybe Text
$sel:region:StackInstance' :: StackInstance -> Maybe Text
region} -> Maybe Text
region) (\s :: StackInstance
s@StackInstance' {} Maybe Text
a -> StackInstance
s {$sel:region:StackInstance' :: Maybe Text
region = Maybe Text
a} :: StackInstance)
stackInstance_stackInstanceStatus :: Lens.Lens' StackInstance (Prelude.Maybe StackInstanceStatus)
stackInstance_stackInstanceStatus :: (Maybe StackInstanceStatus -> f (Maybe StackInstanceStatus))
-> StackInstance -> f StackInstance
stackInstance_stackInstanceStatus = (StackInstance -> Maybe StackInstanceStatus)
-> (StackInstance -> Maybe StackInstanceStatus -> StackInstance)
-> Lens
StackInstance
StackInstance
(Maybe StackInstanceStatus)
(Maybe StackInstanceStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackInstance' {Maybe StackInstanceStatus
stackInstanceStatus :: Maybe StackInstanceStatus
$sel:stackInstanceStatus:StackInstance' :: StackInstance -> Maybe StackInstanceStatus
stackInstanceStatus} -> Maybe StackInstanceStatus
stackInstanceStatus) (\s :: StackInstance
s@StackInstance' {} Maybe StackInstanceStatus
a -> StackInstance
s {$sel:stackInstanceStatus:StackInstance' :: Maybe StackInstanceStatus
stackInstanceStatus = Maybe StackInstanceStatus
a} :: StackInstance)
instance Core.FromJSON StackInstance where
parseJSON :: Value -> Parser StackInstance
parseJSON =
String
-> (Object -> Parser StackInstance)
-> Value
-> Parser StackInstance
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"StackInstance"
( \Object
x ->
Maybe Text
-> Maybe Text -> Maybe StackInstanceStatus -> StackInstance
StackInstance'
(Maybe Text
-> Maybe Text -> Maybe StackInstanceStatus -> StackInstance)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe StackInstanceStatus -> StackInstance)
forall (f :: * -> *) a b. Functor 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
"Account")
Parser (Maybe Text -> Maybe StackInstanceStatus -> StackInstance)
-> Parser (Maybe Text)
-> Parser (Maybe StackInstanceStatus -> StackInstance)
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
"Region")
Parser (Maybe StackInstanceStatus -> StackInstance)
-> Parser (Maybe StackInstanceStatus) -> Parser StackInstance
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe StackInstanceStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"StackInstanceStatus")
)
instance Prelude.Hashable StackInstance
instance Prelude.NFData StackInstance