{-# 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.RecommendationSet
-- 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.RecommendationSet 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.TransformationTool
import qualified Amazonka.Prelude as Prelude

-- | Contains a recommendation set.
--
-- /See:/ 'newRecommendationSet' smart constructor.
data RecommendationSet = RecommendationSet'
  { -- | The recommended strategy.
    RecommendationSet -> Maybe Strategy
strategy :: Prelude.Maybe Strategy,
    -- | The recommended target destination.
    RecommendationSet -> Maybe TargetDestination
targetDestination :: Prelude.Maybe TargetDestination,
    -- | The target destination for the recommendation set.
    RecommendationSet -> Maybe TransformationTool
transformationTool :: Prelude.Maybe TransformationTool
  }
  deriving (RecommendationSet -> RecommendationSet -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RecommendationSet -> RecommendationSet -> Bool
$c/= :: RecommendationSet -> RecommendationSet -> Bool
== :: RecommendationSet -> RecommendationSet -> Bool
$c== :: RecommendationSet -> RecommendationSet -> Bool
Prelude.Eq, ReadPrec [RecommendationSet]
ReadPrec RecommendationSet
Int -> ReadS RecommendationSet
ReadS [RecommendationSet]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RecommendationSet]
$creadListPrec :: ReadPrec [RecommendationSet]
readPrec :: ReadPrec RecommendationSet
$creadPrec :: ReadPrec RecommendationSet
readList :: ReadS [RecommendationSet]
$creadList :: ReadS [RecommendationSet]
readsPrec :: Int -> ReadS RecommendationSet
$creadsPrec :: Int -> ReadS RecommendationSet
Prelude.Read, Int -> RecommendationSet -> ShowS
[RecommendationSet] -> ShowS
RecommendationSet -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RecommendationSet] -> ShowS
$cshowList :: [RecommendationSet] -> ShowS
show :: RecommendationSet -> String
$cshow :: RecommendationSet -> String
showsPrec :: Int -> RecommendationSet -> ShowS
$cshowsPrec :: Int -> RecommendationSet -> ShowS
Prelude.Show, forall x. Rep RecommendationSet x -> RecommendationSet
forall x. RecommendationSet -> Rep RecommendationSet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RecommendationSet x -> RecommendationSet
$cfrom :: forall x. RecommendationSet -> Rep RecommendationSet x
Prelude.Generic)

-- |
-- Create a value of 'RecommendationSet' 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:
--
-- 'strategy', 'recommendationSet_strategy' - The recommended strategy.
--
-- 'targetDestination', 'recommendationSet_targetDestination' - The recommended target destination.
--
-- 'transformationTool', 'recommendationSet_transformationTool' - The target destination for the recommendation set.
newRecommendationSet ::
  RecommendationSet
newRecommendationSet :: RecommendationSet
newRecommendationSet =
  RecommendationSet'
    { $sel:strategy:RecommendationSet' :: Maybe Strategy
strategy = forall a. Maybe a
Prelude.Nothing,
      $sel:targetDestination:RecommendationSet' :: Maybe TargetDestination
targetDestination = forall a. Maybe a
Prelude.Nothing,
      $sel:transformationTool:RecommendationSet' :: Maybe TransformationTool
transformationTool = forall a. Maybe a
Prelude.Nothing
    }

-- | The recommended strategy.
recommendationSet_strategy :: Lens.Lens' RecommendationSet (Prelude.Maybe Strategy)
recommendationSet_strategy :: Lens' RecommendationSet (Maybe Strategy)
recommendationSet_strategy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecommendationSet' {Maybe Strategy
strategy :: Maybe Strategy
$sel:strategy:RecommendationSet' :: RecommendationSet -> Maybe Strategy
strategy} -> Maybe Strategy
strategy) (\s :: RecommendationSet
s@RecommendationSet' {} Maybe Strategy
a -> RecommendationSet
s {$sel:strategy:RecommendationSet' :: Maybe Strategy
strategy = Maybe Strategy
a} :: RecommendationSet)

-- | The recommended target destination.
recommendationSet_targetDestination :: Lens.Lens' RecommendationSet (Prelude.Maybe TargetDestination)
recommendationSet_targetDestination :: Lens' RecommendationSet (Maybe TargetDestination)
recommendationSet_targetDestination = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecommendationSet' {Maybe TargetDestination
targetDestination :: Maybe TargetDestination
$sel:targetDestination:RecommendationSet' :: RecommendationSet -> Maybe TargetDestination
targetDestination} -> Maybe TargetDestination
targetDestination) (\s :: RecommendationSet
s@RecommendationSet' {} Maybe TargetDestination
a -> RecommendationSet
s {$sel:targetDestination:RecommendationSet' :: Maybe TargetDestination
targetDestination = Maybe TargetDestination
a} :: RecommendationSet)

-- | The target destination for the recommendation set.
recommendationSet_transformationTool :: Lens.Lens' RecommendationSet (Prelude.Maybe TransformationTool)
recommendationSet_transformationTool :: Lens' RecommendationSet (Maybe TransformationTool)
recommendationSet_transformationTool = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecommendationSet' {Maybe TransformationTool
transformationTool :: Maybe TransformationTool
$sel:transformationTool:RecommendationSet' :: RecommendationSet -> Maybe TransformationTool
transformationTool} -> Maybe TransformationTool
transformationTool) (\s :: RecommendationSet
s@RecommendationSet' {} Maybe TransformationTool
a -> RecommendationSet
s {$sel:transformationTool:RecommendationSet' :: Maybe TransformationTool
transformationTool = Maybe TransformationTool
a} :: RecommendationSet)

instance Data.FromJSON RecommendationSet where
  parseJSON :: Value -> Parser RecommendationSet
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"RecommendationSet"
      ( \Object
x ->
          Maybe Strategy
-> Maybe TargetDestination
-> Maybe TransformationTool
-> RecommendationSet
RecommendationSet'
            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
"strategy")
            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
"targetDestination")
            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
"transformationTool")
      )

instance Prelude.Hashable RecommendationSet where
  hashWithSalt :: Int -> RecommendationSet -> Int
hashWithSalt Int
_salt RecommendationSet' {Maybe Strategy
Maybe TargetDestination
Maybe TransformationTool
transformationTool :: Maybe TransformationTool
targetDestination :: Maybe TargetDestination
strategy :: Maybe Strategy
$sel:transformationTool:RecommendationSet' :: RecommendationSet -> Maybe TransformationTool
$sel:targetDestination:RecommendationSet' :: RecommendationSet -> Maybe TargetDestination
$sel:strategy:RecommendationSet' :: RecommendationSet -> Maybe Strategy
..} =
    Int
_salt
      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 TransformationTool
transformationTool

instance Prelude.NFData RecommendationSet where
  rnf :: RecommendationSet -> ()
rnf RecommendationSet' {Maybe Strategy
Maybe TargetDestination
Maybe TransformationTool
transformationTool :: Maybe TransformationTool
targetDestination :: Maybe TargetDestination
strategy :: Maybe Strategy
$sel:transformationTool:RecommendationSet' :: RecommendationSet -> Maybe TransformationTool
$sel:targetDestination:RecommendationSet' :: RecommendationSet -> Maybe TargetDestination
$sel:strategy:RecommendationSet' :: RecommendationSet -> Maybe Strategy
..} =
    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 TransformationTool
transformationTool