{-# 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.SopRecommendation 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.RecommendationItem
import Amazonka.ResilienceHub.Types.SopServiceType
data SopRecommendation = SopRecommendation'
{
SopRecommendation -> Maybe Text
appComponentName :: Prelude.Maybe Prelude.Text,
SopRecommendation -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
SopRecommendation -> Maybe [RecommendationItem]
items :: Prelude.Maybe [RecommendationItem],
SopRecommendation -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
SopRecommendation -> Maybe Text
prerequisite :: Prelude.Maybe Prelude.Text,
SopRecommendation -> Text
recommendationId :: Prelude.Text,
SopRecommendation -> Text
referenceId :: Prelude.Text,
SopRecommendation -> SopServiceType
serviceType :: SopServiceType
}
deriving (SopRecommendation -> SopRecommendation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SopRecommendation -> SopRecommendation -> Bool
$c/= :: SopRecommendation -> SopRecommendation -> Bool
== :: SopRecommendation -> SopRecommendation -> Bool
$c== :: SopRecommendation -> SopRecommendation -> Bool
Prelude.Eq, ReadPrec [SopRecommendation]
ReadPrec SopRecommendation
Int -> ReadS SopRecommendation
ReadS [SopRecommendation]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SopRecommendation]
$creadListPrec :: ReadPrec [SopRecommendation]
readPrec :: ReadPrec SopRecommendation
$creadPrec :: ReadPrec SopRecommendation
readList :: ReadS [SopRecommendation]
$creadList :: ReadS [SopRecommendation]
readsPrec :: Int -> ReadS SopRecommendation
$creadsPrec :: Int -> ReadS SopRecommendation
Prelude.Read, Int -> SopRecommendation -> ShowS
[SopRecommendation] -> ShowS
SopRecommendation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SopRecommendation] -> ShowS
$cshowList :: [SopRecommendation] -> ShowS
show :: SopRecommendation -> String
$cshow :: SopRecommendation -> String
showsPrec :: Int -> SopRecommendation -> ShowS
$cshowsPrec :: Int -> SopRecommendation -> ShowS
Prelude.Show, forall x. Rep SopRecommendation x -> SopRecommendation
forall x. SopRecommendation -> Rep SopRecommendation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SopRecommendation x -> SopRecommendation
$cfrom :: forall x. SopRecommendation -> Rep SopRecommendation x
Prelude.Generic)
newSopRecommendation ::
Prelude.Text ->
Prelude.Text ->
SopServiceType ->
SopRecommendation
newSopRecommendation :: Text -> Text -> SopServiceType -> SopRecommendation
newSopRecommendation
Text
pRecommendationId_
Text
pReferenceId_
SopServiceType
pServiceType_ =
SopRecommendation'
{ $sel:appComponentName:SopRecommendation' :: Maybe Text
appComponentName =
forall a. Maybe a
Prelude.Nothing,
$sel:description:SopRecommendation' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
$sel:items:SopRecommendation' :: Maybe [RecommendationItem]
items = forall a. Maybe a
Prelude.Nothing,
$sel:name:SopRecommendation' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
$sel:prerequisite:SopRecommendation' :: Maybe Text
prerequisite = forall a. Maybe a
Prelude.Nothing,
$sel:recommendationId:SopRecommendation' :: Text
recommendationId = Text
pRecommendationId_,
$sel:referenceId:SopRecommendation' :: Text
referenceId = Text
pReferenceId_,
$sel:serviceType:SopRecommendation' :: SopServiceType
serviceType = SopServiceType
pServiceType_
}
sopRecommendation_appComponentName :: Lens.Lens' SopRecommendation (Prelude.Maybe Prelude.Text)
sopRecommendation_appComponentName :: Lens' SopRecommendation (Maybe Text)
sopRecommendation_appComponentName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SopRecommendation' {Maybe Text
appComponentName :: Maybe Text
$sel:appComponentName:SopRecommendation' :: SopRecommendation -> Maybe Text
appComponentName} -> Maybe Text
appComponentName) (\s :: SopRecommendation
s@SopRecommendation' {} Maybe Text
a -> SopRecommendation
s {$sel:appComponentName:SopRecommendation' :: Maybe Text
appComponentName = Maybe Text
a} :: SopRecommendation)
sopRecommendation_description :: Lens.Lens' SopRecommendation (Prelude.Maybe Prelude.Text)
sopRecommendation_description :: Lens' SopRecommendation (Maybe Text)
sopRecommendation_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SopRecommendation' {Maybe Text
description :: Maybe Text
$sel:description:SopRecommendation' :: SopRecommendation -> Maybe Text
description} -> Maybe Text
description) (\s :: SopRecommendation
s@SopRecommendation' {} Maybe Text
a -> SopRecommendation
s {$sel:description:SopRecommendation' :: Maybe Text
description = Maybe Text
a} :: SopRecommendation)
sopRecommendation_items :: Lens.Lens' SopRecommendation (Prelude.Maybe [RecommendationItem])
sopRecommendation_items :: Lens' SopRecommendation (Maybe [RecommendationItem])
sopRecommendation_items = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SopRecommendation' {Maybe [RecommendationItem]
items :: Maybe [RecommendationItem]
$sel:items:SopRecommendation' :: SopRecommendation -> Maybe [RecommendationItem]
items} -> Maybe [RecommendationItem]
items) (\s :: SopRecommendation
s@SopRecommendation' {} Maybe [RecommendationItem]
a -> SopRecommendation
s {$sel:items:SopRecommendation' :: Maybe [RecommendationItem]
items = Maybe [RecommendationItem]
a} :: SopRecommendation) 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
sopRecommendation_name :: Lens.Lens' SopRecommendation (Prelude.Maybe Prelude.Text)
sopRecommendation_name :: Lens' SopRecommendation (Maybe Text)
sopRecommendation_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SopRecommendation' {Maybe Text
name :: Maybe Text
$sel:name:SopRecommendation' :: SopRecommendation -> Maybe Text
name} -> Maybe Text
name) (\s :: SopRecommendation
s@SopRecommendation' {} Maybe Text
a -> SopRecommendation
s {$sel:name:SopRecommendation' :: Maybe Text
name = Maybe Text
a} :: SopRecommendation)
sopRecommendation_prerequisite :: Lens.Lens' SopRecommendation (Prelude.Maybe Prelude.Text)
sopRecommendation_prerequisite :: Lens' SopRecommendation (Maybe Text)
sopRecommendation_prerequisite = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SopRecommendation' {Maybe Text
prerequisite :: Maybe Text
$sel:prerequisite:SopRecommendation' :: SopRecommendation -> Maybe Text
prerequisite} -> Maybe Text
prerequisite) (\s :: SopRecommendation
s@SopRecommendation' {} Maybe Text
a -> SopRecommendation
s {$sel:prerequisite:SopRecommendation' :: Maybe Text
prerequisite = Maybe Text
a} :: SopRecommendation)
sopRecommendation_recommendationId :: Lens.Lens' SopRecommendation Prelude.Text
sopRecommendation_recommendationId :: Lens' SopRecommendation Text
sopRecommendation_recommendationId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SopRecommendation' {Text
recommendationId :: Text
$sel:recommendationId:SopRecommendation' :: SopRecommendation -> Text
recommendationId} -> Text
recommendationId) (\s :: SopRecommendation
s@SopRecommendation' {} Text
a -> SopRecommendation
s {$sel:recommendationId:SopRecommendation' :: Text
recommendationId = Text
a} :: SopRecommendation)
sopRecommendation_referenceId :: Lens.Lens' SopRecommendation Prelude.Text
sopRecommendation_referenceId :: Lens' SopRecommendation Text
sopRecommendation_referenceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SopRecommendation' {Text
referenceId :: Text
$sel:referenceId:SopRecommendation' :: SopRecommendation -> Text
referenceId} -> Text
referenceId) (\s :: SopRecommendation
s@SopRecommendation' {} Text
a -> SopRecommendation
s {$sel:referenceId:SopRecommendation' :: Text
referenceId = Text
a} :: SopRecommendation)
sopRecommendation_serviceType :: Lens.Lens' SopRecommendation SopServiceType
sopRecommendation_serviceType :: Lens' SopRecommendation SopServiceType
sopRecommendation_serviceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SopRecommendation' {SopServiceType
serviceType :: SopServiceType
$sel:serviceType:SopRecommendation' :: SopRecommendation -> SopServiceType
serviceType} -> SopServiceType
serviceType) (\s :: SopRecommendation
s@SopRecommendation' {} SopServiceType
a -> SopRecommendation
s {$sel:serviceType:SopRecommendation' :: SopServiceType
serviceType = SopServiceType
a} :: SopRecommendation)
instance Data.FromJSON SopRecommendation where
parseJSON :: Value -> Parser SopRecommendation
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"SopRecommendation"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe [RecommendationItem]
-> Maybe Text
-> Maybe Text
-> Text
-> Text
-> SopServiceType
-> SopRecommendation
SopRecommendation'
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
"appComponentName")
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
"description")
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
"items" 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
"name")
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
"prerequisite")
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
"recommendationId")
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
"referenceId")
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
"serviceType")
)
instance Prelude.Hashable SopRecommendation where
hashWithSalt :: Int -> SopRecommendation -> Int
hashWithSalt Int
_salt SopRecommendation' {Maybe [RecommendationItem]
Maybe Text
Text
SopServiceType
serviceType :: SopServiceType
referenceId :: Text
recommendationId :: Text
prerequisite :: Maybe Text
name :: Maybe Text
items :: Maybe [RecommendationItem]
description :: Maybe Text
appComponentName :: Maybe Text
$sel:serviceType:SopRecommendation' :: SopRecommendation -> SopServiceType
$sel:referenceId:SopRecommendation' :: SopRecommendation -> Text
$sel:recommendationId:SopRecommendation' :: SopRecommendation -> Text
$sel:prerequisite:SopRecommendation' :: SopRecommendation -> Maybe Text
$sel:name:SopRecommendation' :: SopRecommendation -> Maybe Text
$sel:items:SopRecommendation' :: SopRecommendation -> Maybe [RecommendationItem]
$sel:description:SopRecommendation' :: SopRecommendation -> Maybe Text
$sel:appComponentName:SopRecommendation' :: SopRecommendation -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
appComponentName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [RecommendationItem]
items
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
prerequisite
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
recommendationId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
referenceId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` SopServiceType
serviceType
instance Prelude.NFData SopRecommendation where
rnf :: SopRecommendation -> ()
rnf SopRecommendation' {Maybe [RecommendationItem]
Maybe Text
Text
SopServiceType
serviceType :: SopServiceType
referenceId :: Text
recommendationId :: Text
prerequisite :: Maybe Text
name :: Maybe Text
items :: Maybe [RecommendationItem]
description :: Maybe Text
appComponentName :: Maybe Text
$sel:serviceType:SopRecommendation' :: SopRecommendation -> SopServiceType
$sel:referenceId:SopRecommendation' :: SopRecommendation -> Text
$sel:recommendationId:SopRecommendation' :: SopRecommendation -> Text
$sel:prerequisite:SopRecommendation' :: SopRecommendation -> Maybe Text
$sel:name:SopRecommendation' :: SopRecommendation -> Maybe Text
$sel:items:SopRecommendation' :: SopRecommendation -> Maybe [RecommendationItem]
$sel:description:SopRecommendation' :: SopRecommendation -> Maybe Text
$sel:appComponentName:SopRecommendation' :: SopRecommendation -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
appComponentName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [RecommendationItem]
items
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
prerequisite
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
recommendationId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
referenceId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf SopServiceType
serviceType