{-# 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.StrategyOption 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.Strategy
import Amazonka.MigrationHubStrategy.Types.TargetDestination
import Amazonka.MigrationHubStrategy.Types.TransformationToolName
import qualified Amazonka.Prelude as Prelude
data StrategyOption = StrategyOption'
{
StrategyOption -> Maybe Bool
isPreferred :: Prelude.Maybe Prelude.Bool,
StrategyOption -> Maybe Strategy
strategy :: Prelude.Maybe Strategy,
StrategyOption -> Maybe TargetDestination
targetDestination :: Prelude.Maybe TargetDestination,
StrategyOption -> Maybe TransformationToolName
toolName :: Prelude.Maybe TransformationToolName
}
deriving (StrategyOption -> StrategyOption -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StrategyOption -> StrategyOption -> Bool
$c/= :: StrategyOption -> StrategyOption -> Bool
== :: StrategyOption -> StrategyOption -> Bool
$c== :: StrategyOption -> StrategyOption -> Bool
Prelude.Eq, ReadPrec [StrategyOption]
ReadPrec StrategyOption
Int -> ReadS StrategyOption
ReadS [StrategyOption]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StrategyOption]
$creadListPrec :: ReadPrec [StrategyOption]
readPrec :: ReadPrec StrategyOption
$creadPrec :: ReadPrec StrategyOption
readList :: ReadS [StrategyOption]
$creadList :: ReadS [StrategyOption]
readsPrec :: Int -> ReadS StrategyOption
$creadsPrec :: Int -> ReadS StrategyOption
Prelude.Read, Int -> StrategyOption -> ShowS
[StrategyOption] -> ShowS
StrategyOption -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StrategyOption] -> ShowS
$cshowList :: [StrategyOption] -> ShowS
show :: StrategyOption -> String
$cshow :: StrategyOption -> String
showsPrec :: Int -> StrategyOption -> ShowS
$cshowsPrec :: Int -> StrategyOption -> ShowS
Prelude.Show, forall x. Rep StrategyOption x -> StrategyOption
forall x. StrategyOption -> Rep StrategyOption x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StrategyOption x -> StrategyOption
$cfrom :: forall x. StrategyOption -> Rep StrategyOption x
Prelude.Generic)
newStrategyOption ::
StrategyOption
newStrategyOption :: StrategyOption
newStrategyOption =
StrategyOption'
{ $sel:isPreferred:StrategyOption' :: Maybe Bool
isPreferred = forall a. Maybe a
Prelude.Nothing,
$sel:strategy:StrategyOption' :: Maybe Strategy
strategy = forall a. Maybe a
Prelude.Nothing,
$sel:targetDestination:StrategyOption' :: Maybe TargetDestination
targetDestination = forall a. Maybe a
Prelude.Nothing,
$sel:toolName:StrategyOption' :: Maybe TransformationToolName
toolName = forall a. Maybe a
Prelude.Nothing
}
strategyOption_isPreferred :: Lens.Lens' StrategyOption (Prelude.Maybe Prelude.Bool)
strategyOption_isPreferred :: Lens' StrategyOption (Maybe Bool)
strategyOption_isPreferred = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StrategyOption' {Maybe Bool
isPreferred :: Maybe Bool
$sel:isPreferred:StrategyOption' :: StrategyOption -> Maybe Bool
isPreferred} -> Maybe Bool
isPreferred) (\s :: StrategyOption
s@StrategyOption' {} Maybe Bool
a -> StrategyOption
s {$sel:isPreferred:StrategyOption' :: Maybe Bool
isPreferred = Maybe Bool
a} :: StrategyOption)
strategyOption_strategy :: Lens.Lens' StrategyOption (Prelude.Maybe Strategy)
strategyOption_strategy :: Lens' StrategyOption (Maybe Strategy)
strategyOption_strategy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StrategyOption' {Maybe Strategy
strategy :: Maybe Strategy
$sel:strategy:StrategyOption' :: StrategyOption -> Maybe Strategy
strategy} -> Maybe Strategy
strategy) (\s :: StrategyOption
s@StrategyOption' {} Maybe Strategy
a -> StrategyOption
s {$sel:strategy:StrategyOption' :: Maybe Strategy
strategy = Maybe Strategy
a} :: StrategyOption)
strategyOption_targetDestination :: Lens.Lens' StrategyOption (Prelude.Maybe TargetDestination)
strategyOption_targetDestination :: Lens' StrategyOption (Maybe TargetDestination)
strategyOption_targetDestination = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StrategyOption' {Maybe TargetDestination
targetDestination :: Maybe TargetDestination
$sel:targetDestination:StrategyOption' :: StrategyOption -> Maybe TargetDestination
targetDestination} -> Maybe TargetDestination
targetDestination) (\s :: StrategyOption
s@StrategyOption' {} Maybe TargetDestination
a -> StrategyOption
s {$sel:targetDestination:StrategyOption' :: Maybe TargetDestination
targetDestination = Maybe TargetDestination
a} :: StrategyOption)
strategyOption_toolName :: Lens.Lens' StrategyOption (Prelude.Maybe TransformationToolName)
strategyOption_toolName :: Lens' StrategyOption (Maybe TransformationToolName)
strategyOption_toolName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StrategyOption' {Maybe TransformationToolName
toolName :: Maybe TransformationToolName
$sel:toolName:StrategyOption' :: StrategyOption -> Maybe TransformationToolName
toolName} -> Maybe TransformationToolName
toolName) (\s :: StrategyOption
s@StrategyOption' {} Maybe TransformationToolName
a -> StrategyOption
s {$sel:toolName:StrategyOption' :: Maybe TransformationToolName
toolName = Maybe TransformationToolName
a} :: StrategyOption)
instance Prelude.Hashable StrategyOption where
hashWithSalt :: Int -> StrategyOption -> Int
hashWithSalt Int
_salt StrategyOption' {Maybe Bool
Maybe Strategy
Maybe TargetDestination
Maybe TransformationToolName
toolName :: Maybe TransformationToolName
targetDestination :: Maybe TargetDestination
strategy :: Maybe Strategy
isPreferred :: Maybe Bool
$sel:toolName:StrategyOption' :: StrategyOption -> Maybe TransformationToolName
$sel:targetDestination:StrategyOption' :: StrategyOption -> Maybe TargetDestination
$sel:strategy:StrategyOption' :: StrategyOption -> Maybe Strategy
$sel:isPreferred:StrategyOption' :: StrategyOption -> 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 Strategy
strategy
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TargetDestination
targetDestination
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TransformationToolName
toolName
instance Prelude.NFData StrategyOption where
rnf :: StrategyOption -> ()
rnf StrategyOption' {Maybe Bool
Maybe Strategy
Maybe TargetDestination
Maybe TransformationToolName
toolName :: Maybe TransformationToolName
targetDestination :: Maybe TargetDestination
strategy :: Maybe Strategy
isPreferred :: Maybe Bool
$sel:toolName:StrategyOption' :: StrategyOption -> Maybe TransformationToolName
$sel:targetDestination:StrategyOption' :: StrategyOption -> Maybe TargetDestination
$sel:strategy:StrategyOption' :: StrategyOption -> Maybe Strategy
$sel:isPreferred:StrategyOption' :: StrategyOption -> 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 Strategy
strategy
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe TargetDestination
targetDestination
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe TransformationToolName
toolName
instance Data.ToJSON StrategyOption where
toJSON :: StrategyOption -> Value
toJSON StrategyOption' {Maybe Bool
Maybe Strategy
Maybe TargetDestination
Maybe TransformationToolName
toolName :: Maybe TransformationToolName
targetDestination :: Maybe TargetDestination
strategy :: Maybe Strategy
isPreferred :: Maybe Bool
$sel:toolName:StrategyOption' :: StrategyOption -> Maybe TransformationToolName
$sel:targetDestination:StrategyOption' :: StrategyOption -> Maybe TargetDestination
$sel:strategy:StrategyOption' :: StrategyOption -> Maybe Strategy
$sel:isPreferred:StrategyOption' :: StrategyOption -> Maybe Bool
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"isPreferred" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
isPreferred,
(Key
"strategy" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Strategy
strategy,
(Key
"targetDestination" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TargetDestination
targetDestination,
(Key
"toolName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TransformationToolName
toolName
]
)