{-# 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.ResilienceHub.Types.PhysicalResource where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.ResilienceHub.Types.AppComponent
import Amazonka.ResilienceHub.Types.LogicalResourceId
import Amazonka.ResilienceHub.Types.PhysicalResourceId
data PhysicalResource = PhysicalResource'
{
PhysicalResource -> Maybe [AppComponent]
appComponents :: Prelude.Maybe [AppComponent],
PhysicalResource -> Maybe Text
resourceName :: Prelude.Maybe Prelude.Text,
PhysicalResource -> LogicalResourceId
logicalResourceId :: LogicalResourceId,
PhysicalResource -> PhysicalResourceId
physicalResourceId :: PhysicalResourceId,
PhysicalResource -> Text
resourceType :: Prelude.Text
}
deriving (PhysicalResource -> PhysicalResource -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalResource -> PhysicalResource -> Bool
$c/= :: PhysicalResource -> PhysicalResource -> Bool
== :: PhysicalResource -> PhysicalResource -> Bool
$c== :: PhysicalResource -> PhysicalResource -> Bool
Prelude.Eq, ReadPrec [PhysicalResource]
ReadPrec PhysicalResource
Int -> ReadS PhysicalResource
ReadS [PhysicalResource]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PhysicalResource]
$creadListPrec :: ReadPrec [PhysicalResource]
readPrec :: ReadPrec PhysicalResource
$creadPrec :: ReadPrec PhysicalResource
readList :: ReadS [PhysicalResource]
$creadList :: ReadS [PhysicalResource]
readsPrec :: Int -> ReadS PhysicalResource
$creadsPrec :: Int -> ReadS PhysicalResource
Prelude.Read, Int -> PhysicalResource -> ShowS
[PhysicalResource] -> ShowS
PhysicalResource -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PhysicalResource] -> ShowS
$cshowList :: [PhysicalResource] -> ShowS
show :: PhysicalResource -> String
$cshow :: PhysicalResource -> String
showsPrec :: Int -> PhysicalResource -> ShowS
$cshowsPrec :: Int -> PhysicalResource -> ShowS
Prelude.Show, forall x. Rep PhysicalResource x -> PhysicalResource
forall x. PhysicalResource -> Rep PhysicalResource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PhysicalResource x -> PhysicalResource
$cfrom :: forall x. PhysicalResource -> Rep PhysicalResource x
Prelude.Generic)
newPhysicalResource ::
LogicalResourceId ->
PhysicalResourceId ->
Prelude.Text ->
PhysicalResource
newPhysicalResource :: LogicalResourceId -> PhysicalResourceId -> Text -> PhysicalResource
newPhysicalResource
LogicalResourceId
pLogicalResourceId_
PhysicalResourceId
pPhysicalResourceId_
Text
pResourceType_ =
PhysicalResource'
{ $sel:appComponents:PhysicalResource' :: Maybe [AppComponent]
appComponents = forall a. Maybe a
Prelude.Nothing,
$sel:resourceName:PhysicalResource' :: Maybe Text
resourceName = forall a. Maybe a
Prelude.Nothing,
$sel:logicalResourceId:PhysicalResource' :: LogicalResourceId
logicalResourceId = LogicalResourceId
pLogicalResourceId_,
$sel:physicalResourceId:PhysicalResource' :: PhysicalResourceId
physicalResourceId = PhysicalResourceId
pPhysicalResourceId_,
$sel:resourceType:PhysicalResource' :: Text
resourceType = Text
pResourceType_
}
physicalResource_appComponents :: Lens.Lens' PhysicalResource (Prelude.Maybe [AppComponent])
physicalResource_appComponents :: Lens' PhysicalResource (Maybe [AppComponent])
physicalResource_appComponents = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhysicalResource' {Maybe [AppComponent]
appComponents :: Maybe [AppComponent]
$sel:appComponents:PhysicalResource' :: PhysicalResource -> Maybe [AppComponent]
appComponents} -> Maybe [AppComponent]
appComponents) (\s :: PhysicalResource
s@PhysicalResource' {} Maybe [AppComponent]
a -> PhysicalResource
s {$sel:appComponents:PhysicalResource' :: Maybe [AppComponent]
appComponents = Maybe [AppComponent]
a} :: PhysicalResource) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
physicalResource_resourceName :: Lens.Lens' PhysicalResource (Prelude.Maybe Prelude.Text)
physicalResource_resourceName :: Lens' PhysicalResource (Maybe Text)
physicalResource_resourceName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhysicalResource' {Maybe Text
resourceName :: Maybe Text
$sel:resourceName:PhysicalResource' :: PhysicalResource -> Maybe Text
resourceName} -> Maybe Text
resourceName) (\s :: PhysicalResource
s@PhysicalResource' {} Maybe Text
a -> PhysicalResource
s {$sel:resourceName:PhysicalResource' :: Maybe Text
resourceName = Maybe Text
a} :: PhysicalResource)
physicalResource_logicalResourceId :: Lens.Lens' PhysicalResource LogicalResourceId
physicalResource_logicalResourceId :: Lens' PhysicalResource LogicalResourceId
physicalResource_logicalResourceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhysicalResource' {LogicalResourceId
logicalResourceId :: LogicalResourceId
$sel:logicalResourceId:PhysicalResource' :: PhysicalResource -> LogicalResourceId
logicalResourceId} -> LogicalResourceId
logicalResourceId) (\s :: PhysicalResource
s@PhysicalResource' {} LogicalResourceId
a -> PhysicalResource
s {$sel:logicalResourceId:PhysicalResource' :: LogicalResourceId
logicalResourceId = LogicalResourceId
a} :: PhysicalResource)
physicalResource_physicalResourceId :: Lens.Lens' PhysicalResource PhysicalResourceId
physicalResource_physicalResourceId :: Lens' PhysicalResource PhysicalResourceId
physicalResource_physicalResourceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhysicalResource' {PhysicalResourceId
physicalResourceId :: PhysicalResourceId
$sel:physicalResourceId:PhysicalResource' :: PhysicalResource -> PhysicalResourceId
physicalResourceId} -> PhysicalResourceId
physicalResourceId) (\s :: PhysicalResource
s@PhysicalResource' {} PhysicalResourceId
a -> PhysicalResource
s {$sel:physicalResourceId:PhysicalResource' :: PhysicalResourceId
physicalResourceId = PhysicalResourceId
a} :: PhysicalResource)
physicalResource_resourceType :: Lens.Lens' PhysicalResource Prelude.Text
physicalResource_resourceType :: Lens' PhysicalResource Text
physicalResource_resourceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhysicalResource' {Text
resourceType :: Text
$sel:resourceType:PhysicalResource' :: PhysicalResource -> Text
resourceType} -> Text
resourceType) (\s :: PhysicalResource
s@PhysicalResource' {} Text
a -> PhysicalResource
s {$sel:resourceType:PhysicalResource' :: Text
resourceType = Text
a} :: PhysicalResource)
instance Data.FromJSON PhysicalResource where
parseJSON :: Value -> Parser PhysicalResource
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"PhysicalResource"
( \Object
x ->
Maybe [AppComponent]
-> Maybe Text
-> LogicalResourceId
-> PhysicalResourceId
-> Text
-> PhysicalResource
PhysicalResource'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"appComponents" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"resourceName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"logicalResourceId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"physicalResourceId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"resourceType")
)
instance Prelude.Hashable PhysicalResource where
hashWithSalt :: Int -> PhysicalResource -> Int
hashWithSalt Int
_salt PhysicalResource' {Maybe [AppComponent]
Maybe Text
Text
LogicalResourceId
PhysicalResourceId
resourceType :: Text
physicalResourceId :: PhysicalResourceId
logicalResourceId :: LogicalResourceId
resourceName :: Maybe Text
appComponents :: Maybe [AppComponent]
$sel:resourceType:PhysicalResource' :: PhysicalResource -> Text
$sel:physicalResourceId:PhysicalResource' :: PhysicalResource -> PhysicalResourceId
$sel:logicalResourceId:PhysicalResource' :: PhysicalResource -> LogicalResourceId
$sel:resourceName:PhysicalResource' :: PhysicalResource -> Maybe Text
$sel:appComponents:PhysicalResource' :: PhysicalResource -> Maybe [AppComponent]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [AppComponent]
appComponents
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
resourceName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` LogicalResourceId
logicalResourceId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` PhysicalResourceId
physicalResourceId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
resourceType
instance Prelude.NFData PhysicalResource where
rnf :: PhysicalResource -> ()
rnf PhysicalResource' {Maybe [AppComponent]
Maybe Text
Text
LogicalResourceId
PhysicalResourceId
resourceType :: Text
physicalResourceId :: PhysicalResourceId
logicalResourceId :: LogicalResourceId
resourceName :: Maybe Text
appComponents :: Maybe [AppComponent]
$sel:resourceType:PhysicalResource' :: PhysicalResource -> Text
$sel:physicalResourceId:PhysicalResource' :: PhysicalResource -> PhysicalResourceId
$sel:logicalResourceId:PhysicalResource' :: PhysicalResource -> LogicalResourceId
$sel:resourceName:PhysicalResource' :: PhysicalResource -> Maybe Text
$sel:appComponents:PhysicalResource' :: PhysicalResource -> Maybe [AppComponent]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [AppComponent]
appComponents
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
resourceName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf LogicalResourceId
logicalResourceId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf PhysicalResourceId
physicalResourceId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
resourceType