{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.MigrationHubStrategy.Types.StrategyOption
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
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

-- | Information about all the available strategy options for migrating and
-- modernizing an application component.
--
-- /See:/ 'newStrategyOption' smart constructor.
data StrategyOption = StrategyOption'
  { -- | Indicates if a specific strategy is preferred for the application
    -- component.
    StrategyOption -> Maybe Bool
isPreferred :: Prelude.Maybe Prelude.Bool,
    -- | Type of transformation. For example, Rehost, Replatform, and so on.
    StrategyOption -> Maybe Strategy
strategy :: Prelude.Maybe Strategy,
    -- | Destination information about where the application component can
    -- migrate to. For example, @EC2@, @ECS@, and so on.
    StrategyOption -> Maybe TargetDestination
targetDestination :: Prelude.Maybe TargetDestination,
    -- | The name of the tool that can be used to transform an application
    -- component using this strategy.
    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)

-- |
-- Create a value of 'StrategyOption' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'isPreferred', 'strategyOption_isPreferred' - Indicates if a specific strategy is preferred for the application
-- component.
--
-- 'strategy', 'strategyOption_strategy' - Type of transformation. For example, Rehost, Replatform, and so on.
--
-- 'targetDestination', 'strategyOption_targetDestination' - Destination information about where the application component can
-- migrate to. For example, @EC2@, @ECS@, and so on.
--
-- 'toolName', 'strategyOption_toolName' - The name of the tool that can be used to transform an application
-- component using this strategy.
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
    }

-- | Indicates if a specific strategy is preferred for the application
-- component.
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)

-- | Type of transformation. For example, Rehost, Replatform, and so on.
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)

-- | Destination information about where the application component can
-- migrate to. For example, @EC2@, @ECS@, and so on.
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)

-- | The name of the tool that can be used to transform an application
-- component using this strategy.
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
          ]
      )