{-# 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.MigrationHubStrategy.Types.ServerStrategy where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MigrationHubStrategy.Types.RecommendationSet
import Amazonka.MigrationHubStrategy.Types.StrategyRecommendation
import qualified Amazonka.Prelude as Prelude
data ServerStrategy = ServerStrategy'
{
ServerStrategy -> Maybe Bool
isPreferred :: Prelude.Maybe Prelude.Bool,
ServerStrategy -> Maybe Int
numberOfApplicationComponents :: Prelude.Maybe Prelude.Int,
ServerStrategy -> Maybe RecommendationSet
recommendation :: Prelude.Maybe RecommendationSet,
ServerStrategy -> Maybe StrategyRecommendation
status :: Prelude.Maybe StrategyRecommendation
}
deriving (ServerStrategy -> ServerStrategy -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ServerStrategy -> ServerStrategy -> Bool
$c/= :: ServerStrategy -> ServerStrategy -> Bool
== :: ServerStrategy -> ServerStrategy -> Bool
$c== :: ServerStrategy -> ServerStrategy -> Bool
Prelude.Eq, ReadPrec [ServerStrategy]
ReadPrec ServerStrategy
Int -> ReadS ServerStrategy
ReadS [ServerStrategy]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ServerStrategy]
$creadListPrec :: ReadPrec [ServerStrategy]
readPrec :: ReadPrec ServerStrategy
$creadPrec :: ReadPrec ServerStrategy
readList :: ReadS [ServerStrategy]
$creadList :: ReadS [ServerStrategy]
readsPrec :: Int -> ReadS ServerStrategy
$creadsPrec :: Int -> ReadS ServerStrategy
Prelude.Read, Int -> ServerStrategy -> ShowS
[ServerStrategy] -> ShowS
ServerStrategy -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ServerStrategy] -> ShowS
$cshowList :: [ServerStrategy] -> ShowS
show :: ServerStrategy -> String
$cshow :: ServerStrategy -> String
showsPrec :: Int -> ServerStrategy -> ShowS
$cshowsPrec :: Int -> ServerStrategy -> ShowS
Prelude.Show, forall x. Rep ServerStrategy x -> ServerStrategy
forall x. ServerStrategy -> Rep ServerStrategy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ServerStrategy x -> ServerStrategy
$cfrom :: forall x. ServerStrategy -> Rep ServerStrategy x
Prelude.Generic)
newServerStrategy ::
ServerStrategy
newServerStrategy :: ServerStrategy
newServerStrategy =
ServerStrategy'
{ $sel:isPreferred:ServerStrategy' :: Maybe Bool
isPreferred = forall a. Maybe a
Prelude.Nothing,
$sel:numberOfApplicationComponents:ServerStrategy' :: Maybe Int
numberOfApplicationComponents = forall a. Maybe a
Prelude.Nothing,
$sel:recommendation:ServerStrategy' :: Maybe RecommendationSet
recommendation = forall a. Maybe a
Prelude.Nothing,
$sel:status:ServerStrategy' :: Maybe StrategyRecommendation
status = forall a. Maybe a
Prelude.Nothing
}
serverStrategy_isPreferred :: Lens.Lens' ServerStrategy (Prelude.Maybe Prelude.Bool)
serverStrategy_isPreferred :: Lens' ServerStrategy (Maybe Bool)
serverStrategy_isPreferred = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServerStrategy' {Maybe Bool
isPreferred :: Maybe Bool
$sel:isPreferred:ServerStrategy' :: ServerStrategy -> Maybe Bool
isPreferred} -> Maybe Bool
isPreferred) (\s :: ServerStrategy
s@ServerStrategy' {} Maybe Bool
a -> ServerStrategy
s {$sel:isPreferred:ServerStrategy' :: Maybe Bool
isPreferred = Maybe Bool
a} :: ServerStrategy)
serverStrategy_numberOfApplicationComponents :: Lens.Lens' ServerStrategy (Prelude.Maybe Prelude.Int)
serverStrategy_numberOfApplicationComponents :: Lens' ServerStrategy (Maybe Int)
serverStrategy_numberOfApplicationComponents = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServerStrategy' {Maybe Int
numberOfApplicationComponents :: Maybe Int
$sel:numberOfApplicationComponents:ServerStrategy' :: ServerStrategy -> Maybe Int
numberOfApplicationComponents} -> Maybe Int
numberOfApplicationComponents) (\s :: ServerStrategy
s@ServerStrategy' {} Maybe Int
a -> ServerStrategy
s {$sel:numberOfApplicationComponents:ServerStrategy' :: Maybe Int
numberOfApplicationComponents = Maybe Int
a} :: ServerStrategy)
serverStrategy_recommendation :: Lens.Lens' ServerStrategy (Prelude.Maybe RecommendationSet)
serverStrategy_recommendation :: Lens' ServerStrategy (Maybe RecommendationSet)
serverStrategy_recommendation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServerStrategy' {Maybe RecommendationSet
recommendation :: Maybe RecommendationSet
$sel:recommendation:ServerStrategy' :: ServerStrategy -> Maybe RecommendationSet
recommendation} -> Maybe RecommendationSet
recommendation) (\s :: ServerStrategy
s@ServerStrategy' {} Maybe RecommendationSet
a -> ServerStrategy
s {$sel:recommendation:ServerStrategy' :: Maybe RecommendationSet
recommendation = Maybe RecommendationSet
a} :: ServerStrategy)
serverStrategy_status :: Lens.Lens' ServerStrategy (Prelude.Maybe StrategyRecommendation)
serverStrategy_status :: Lens' ServerStrategy (Maybe StrategyRecommendation)
serverStrategy_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServerStrategy' {Maybe StrategyRecommendation
status :: Maybe StrategyRecommendation
$sel:status:ServerStrategy' :: ServerStrategy -> Maybe StrategyRecommendation
status} -> Maybe StrategyRecommendation
status) (\s :: ServerStrategy
s@ServerStrategy' {} Maybe StrategyRecommendation
a -> ServerStrategy
s {$sel:status:ServerStrategy' :: Maybe StrategyRecommendation
status = Maybe StrategyRecommendation
a} :: ServerStrategy)
instance Data.FromJSON ServerStrategy where
parseJSON :: Value -> Parser ServerStrategy
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ServerStrategy"
( \Object
x ->
Maybe Bool
-> Maybe Int
-> Maybe RecommendationSet
-> Maybe StrategyRecommendation
-> ServerStrategy
ServerStrategy'
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
"isPreferred")
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
"numberOfApplicationComponents")
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
"recommendation")
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
"status")
)
instance Prelude.Hashable ServerStrategy where
hashWithSalt :: Int -> ServerStrategy -> Int
hashWithSalt Int
_salt ServerStrategy' {Maybe Bool
Maybe Int
Maybe StrategyRecommendation
Maybe RecommendationSet
status :: Maybe StrategyRecommendation
recommendation :: Maybe RecommendationSet
numberOfApplicationComponents :: Maybe Int
isPreferred :: Maybe Bool
$sel:status:ServerStrategy' :: ServerStrategy -> Maybe StrategyRecommendation
$sel:recommendation:ServerStrategy' :: ServerStrategy -> Maybe RecommendationSet
$sel:numberOfApplicationComponents:ServerStrategy' :: ServerStrategy -> Maybe Int
$sel:isPreferred:ServerStrategy' :: ServerStrategy -> Maybe Bool
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
isPreferred
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
numberOfApplicationComponents
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe RecommendationSet
recommendation
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe StrategyRecommendation
status
instance Prelude.NFData ServerStrategy where
rnf :: ServerStrategy -> ()
rnf ServerStrategy' {Maybe Bool
Maybe Int
Maybe StrategyRecommendation
Maybe RecommendationSet
status :: Maybe StrategyRecommendation
recommendation :: Maybe RecommendationSet
numberOfApplicationComponents :: Maybe Int
isPreferred :: Maybe Bool
$sel:status:ServerStrategy' :: ServerStrategy -> Maybe StrategyRecommendation
$sel:recommendation:ServerStrategy' :: ServerStrategy -> Maybe RecommendationSet
$sel:numberOfApplicationComponents:ServerStrategy' :: ServerStrategy -> Maybe Int
$sel:isPreferred:ServerStrategy' :: ServerStrategy -> Maybe Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
isPreferred
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
numberOfApplicationComponents
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RecommendationSet
recommendation
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe StrategyRecommendation
status