{-# 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.AppComponent 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
data AppComponent = AppComponent'
{
AppComponent -> Text
name :: Prelude.Text,
AppComponent -> Text
type' :: Prelude.Text
}
deriving (AppComponent -> AppComponent -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AppComponent -> AppComponent -> Bool
$c/= :: AppComponent -> AppComponent -> Bool
== :: AppComponent -> AppComponent -> Bool
$c== :: AppComponent -> AppComponent -> Bool
Prelude.Eq, ReadPrec [AppComponent]
ReadPrec AppComponent
Int -> ReadS AppComponent
ReadS [AppComponent]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AppComponent]
$creadListPrec :: ReadPrec [AppComponent]
readPrec :: ReadPrec AppComponent
$creadPrec :: ReadPrec AppComponent
readList :: ReadS [AppComponent]
$creadList :: ReadS [AppComponent]
readsPrec :: Int -> ReadS AppComponent
$creadsPrec :: Int -> ReadS AppComponent
Prelude.Read, Int -> AppComponent -> ShowS
[AppComponent] -> ShowS
AppComponent -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AppComponent] -> ShowS
$cshowList :: [AppComponent] -> ShowS
show :: AppComponent -> String
$cshow :: AppComponent -> String
showsPrec :: Int -> AppComponent -> ShowS
$cshowsPrec :: Int -> AppComponent -> ShowS
Prelude.Show, forall x. Rep AppComponent x -> AppComponent
forall x. AppComponent -> Rep AppComponent x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AppComponent x -> AppComponent
$cfrom :: forall x. AppComponent -> Rep AppComponent x
Prelude.Generic)
newAppComponent ::
Prelude.Text ->
Prelude.Text ->
AppComponent
newAppComponent :: Text -> Text -> AppComponent
newAppComponent Text
pName_ Text
pType_ =
AppComponent' {$sel:name:AppComponent' :: Text
name = Text
pName_, $sel:type':AppComponent' :: Text
type' = Text
pType_}
appComponent_name :: Lens.Lens' AppComponent Prelude.Text
appComponent_name :: Lens' AppComponent Text
appComponent_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppComponent' {Text
name :: Text
$sel:name:AppComponent' :: AppComponent -> Text
name} -> Text
name) (\s :: AppComponent
s@AppComponent' {} Text
a -> AppComponent
s {$sel:name:AppComponent' :: Text
name = Text
a} :: AppComponent)
appComponent_type :: Lens.Lens' AppComponent Prelude.Text
appComponent_type :: Lens' AppComponent Text
appComponent_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppComponent' {Text
type' :: Text
$sel:type':AppComponent' :: AppComponent -> Text
type'} -> Text
type') (\s :: AppComponent
s@AppComponent' {} Text
a -> AppComponent
s {$sel:type':AppComponent' :: Text
type' = Text
a} :: AppComponent)
instance Data.FromJSON AppComponent where
parseJSON :: Value -> Parser AppComponent
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"AppComponent"
( \Object
x ->
Text -> Text -> AppComponent
AppComponent'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"name")
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
"type")
)
instance Prelude.Hashable AppComponent where
hashWithSalt :: Int -> AppComponent -> Int
hashWithSalt Int
_salt AppComponent' {Text
type' :: Text
name :: Text
$sel:type':AppComponent' :: AppComponent -> Text
$sel:name:AppComponent' :: AppComponent -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
type'
instance Prelude.NFData AppComponent where
rnf :: AppComponent -> ()
rnf AppComponent' {Text
type' :: Text
name :: Text
$sel:type':AppComponent' :: AppComponent -> Text
$sel:name:AppComponent' :: AppComponent -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
name seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
type'