{-# 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.MGN.Types.ChangeServerLifeCycleStateSourceServerLifecycle
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.MGN.Types.ChangeServerLifeCycleStateSourceServerLifecycle where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MGN.Types.ChangeServerLifeCycleStateSourceServerLifecycleState
import qualified Amazonka.Prelude as Prelude

-- | The request to change the source server migration lifecycle state.
--
-- /See:/ 'newChangeServerLifeCycleStateSourceServerLifecycle' smart constructor.
data ChangeServerLifeCycleStateSourceServerLifecycle = ChangeServerLifeCycleStateSourceServerLifecycle'
  { -- | The request to change the source server migration lifecycle state.
    ChangeServerLifeCycleStateSourceServerLifecycle
-> ChangeServerLifeCycleStateSourceServerLifecycleState
state :: ChangeServerLifeCycleStateSourceServerLifecycleState
  }
  deriving (ChangeServerLifeCycleStateSourceServerLifecycle
-> ChangeServerLifeCycleStateSourceServerLifecycle -> Bool
(ChangeServerLifeCycleStateSourceServerLifecycle
 -> ChangeServerLifeCycleStateSourceServerLifecycle -> Bool)
-> (ChangeServerLifeCycleStateSourceServerLifecycle
    -> ChangeServerLifeCycleStateSourceServerLifecycle -> Bool)
-> Eq ChangeServerLifeCycleStateSourceServerLifecycle
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ChangeServerLifeCycleStateSourceServerLifecycle
-> ChangeServerLifeCycleStateSourceServerLifecycle -> Bool
$c/= :: ChangeServerLifeCycleStateSourceServerLifecycle
-> ChangeServerLifeCycleStateSourceServerLifecycle -> Bool
== :: ChangeServerLifeCycleStateSourceServerLifecycle
-> ChangeServerLifeCycleStateSourceServerLifecycle -> Bool
$c== :: ChangeServerLifeCycleStateSourceServerLifecycle
-> ChangeServerLifeCycleStateSourceServerLifecycle -> Bool
Prelude.Eq, ReadPrec [ChangeServerLifeCycleStateSourceServerLifecycle]
ReadPrec ChangeServerLifeCycleStateSourceServerLifecycle
Int -> ReadS ChangeServerLifeCycleStateSourceServerLifecycle
ReadS [ChangeServerLifeCycleStateSourceServerLifecycle]
(Int -> ReadS ChangeServerLifeCycleStateSourceServerLifecycle)
-> ReadS [ChangeServerLifeCycleStateSourceServerLifecycle]
-> ReadPrec ChangeServerLifeCycleStateSourceServerLifecycle
-> ReadPrec [ChangeServerLifeCycleStateSourceServerLifecycle]
-> Read ChangeServerLifeCycleStateSourceServerLifecycle
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ChangeServerLifeCycleStateSourceServerLifecycle]
$creadListPrec :: ReadPrec [ChangeServerLifeCycleStateSourceServerLifecycle]
readPrec :: ReadPrec ChangeServerLifeCycleStateSourceServerLifecycle
$creadPrec :: ReadPrec ChangeServerLifeCycleStateSourceServerLifecycle
readList :: ReadS [ChangeServerLifeCycleStateSourceServerLifecycle]
$creadList :: ReadS [ChangeServerLifeCycleStateSourceServerLifecycle]
readsPrec :: Int -> ReadS ChangeServerLifeCycleStateSourceServerLifecycle
$creadsPrec :: Int -> ReadS ChangeServerLifeCycleStateSourceServerLifecycle
Prelude.Read, Int -> ChangeServerLifeCycleStateSourceServerLifecycle -> ShowS
[ChangeServerLifeCycleStateSourceServerLifecycle] -> ShowS
ChangeServerLifeCycleStateSourceServerLifecycle -> String
(Int -> ChangeServerLifeCycleStateSourceServerLifecycle -> ShowS)
-> (ChangeServerLifeCycleStateSourceServerLifecycle -> String)
-> ([ChangeServerLifeCycleStateSourceServerLifecycle] -> ShowS)
-> Show ChangeServerLifeCycleStateSourceServerLifecycle
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChangeServerLifeCycleStateSourceServerLifecycle] -> ShowS
$cshowList :: [ChangeServerLifeCycleStateSourceServerLifecycle] -> ShowS
show :: ChangeServerLifeCycleStateSourceServerLifecycle -> String
$cshow :: ChangeServerLifeCycleStateSourceServerLifecycle -> String
showsPrec :: Int -> ChangeServerLifeCycleStateSourceServerLifecycle -> ShowS
$cshowsPrec :: Int -> ChangeServerLifeCycleStateSourceServerLifecycle -> ShowS
Prelude.Show, (forall x.
 ChangeServerLifeCycleStateSourceServerLifecycle
 -> Rep ChangeServerLifeCycleStateSourceServerLifecycle x)
-> (forall x.
    Rep ChangeServerLifeCycleStateSourceServerLifecycle x
    -> ChangeServerLifeCycleStateSourceServerLifecycle)
-> Generic ChangeServerLifeCycleStateSourceServerLifecycle
forall x.
Rep ChangeServerLifeCycleStateSourceServerLifecycle x
-> ChangeServerLifeCycleStateSourceServerLifecycle
forall x.
ChangeServerLifeCycleStateSourceServerLifecycle
-> Rep ChangeServerLifeCycleStateSourceServerLifecycle x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ChangeServerLifeCycleStateSourceServerLifecycle x
-> ChangeServerLifeCycleStateSourceServerLifecycle
$cfrom :: forall x.
ChangeServerLifeCycleStateSourceServerLifecycle
-> Rep ChangeServerLifeCycleStateSourceServerLifecycle x
Prelude.Generic)

-- |
-- Create a value of 'ChangeServerLifeCycleStateSourceServerLifecycle' 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:
--
-- 'state', 'changeServerLifeCycleStateSourceServerLifecycle_state' - The request to change the source server migration lifecycle state.
newChangeServerLifeCycleStateSourceServerLifecycle ::
  -- | 'state'
  ChangeServerLifeCycleStateSourceServerLifecycleState ->
  ChangeServerLifeCycleStateSourceServerLifecycle
newChangeServerLifeCycleStateSourceServerLifecycle :: ChangeServerLifeCycleStateSourceServerLifecycleState
-> ChangeServerLifeCycleStateSourceServerLifecycle
newChangeServerLifeCycleStateSourceServerLifecycle
  ChangeServerLifeCycleStateSourceServerLifecycleState
pState_ =
    ChangeServerLifeCycleStateSourceServerLifecycle' :: ChangeServerLifeCycleStateSourceServerLifecycleState
-> ChangeServerLifeCycleStateSourceServerLifecycle
ChangeServerLifeCycleStateSourceServerLifecycle'
      { $sel:state:ChangeServerLifeCycleStateSourceServerLifecycle' :: ChangeServerLifeCycleStateSourceServerLifecycleState
state =
          ChangeServerLifeCycleStateSourceServerLifecycleState
pState_
      }

-- | The request to change the source server migration lifecycle state.
changeServerLifeCycleStateSourceServerLifecycle_state :: Lens.Lens' ChangeServerLifeCycleStateSourceServerLifecycle ChangeServerLifeCycleStateSourceServerLifecycleState
changeServerLifeCycleStateSourceServerLifecycle_state :: (ChangeServerLifeCycleStateSourceServerLifecycleState
 -> f ChangeServerLifeCycleStateSourceServerLifecycleState)
-> ChangeServerLifeCycleStateSourceServerLifecycle
-> f ChangeServerLifeCycleStateSourceServerLifecycle
changeServerLifeCycleStateSourceServerLifecycle_state = (ChangeServerLifeCycleStateSourceServerLifecycle
 -> ChangeServerLifeCycleStateSourceServerLifecycleState)
-> (ChangeServerLifeCycleStateSourceServerLifecycle
    -> ChangeServerLifeCycleStateSourceServerLifecycleState
    -> ChangeServerLifeCycleStateSourceServerLifecycle)
-> Lens
     ChangeServerLifeCycleStateSourceServerLifecycle
     ChangeServerLifeCycleStateSourceServerLifecycle
     ChangeServerLifeCycleStateSourceServerLifecycleState
     ChangeServerLifeCycleStateSourceServerLifecycleState
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChangeServerLifeCycleStateSourceServerLifecycle' {ChangeServerLifeCycleStateSourceServerLifecycleState
state :: ChangeServerLifeCycleStateSourceServerLifecycleState
$sel:state:ChangeServerLifeCycleStateSourceServerLifecycle' :: ChangeServerLifeCycleStateSourceServerLifecycle
-> ChangeServerLifeCycleStateSourceServerLifecycleState
state} -> ChangeServerLifeCycleStateSourceServerLifecycleState
state) (\s :: ChangeServerLifeCycleStateSourceServerLifecycle
s@ChangeServerLifeCycleStateSourceServerLifecycle' {} ChangeServerLifeCycleStateSourceServerLifecycleState
a -> ChangeServerLifeCycleStateSourceServerLifecycle
s {$sel:state:ChangeServerLifeCycleStateSourceServerLifecycle' :: ChangeServerLifeCycleStateSourceServerLifecycleState
state = ChangeServerLifeCycleStateSourceServerLifecycleState
a} :: ChangeServerLifeCycleStateSourceServerLifecycle)

instance
  Prelude.Hashable
    ChangeServerLifeCycleStateSourceServerLifecycle

instance
  Prelude.NFData
    ChangeServerLifeCycleStateSourceServerLifecycle

instance
  Core.ToJSON
    ChangeServerLifeCycleStateSourceServerLifecycle
  where
  toJSON :: ChangeServerLifeCycleStateSourceServerLifecycle -> Value
toJSON
    ChangeServerLifeCycleStateSourceServerLifecycle' {ChangeServerLifeCycleStateSourceServerLifecycleState
state :: ChangeServerLifeCycleStateSourceServerLifecycleState
$sel:state:ChangeServerLifeCycleStateSourceServerLifecycle' :: ChangeServerLifeCycleStateSourceServerLifecycle
-> ChangeServerLifeCycleStateSourceServerLifecycleState
..} =
      [Pair] -> Value
Core.object
        ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
            [Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"state" Text
-> ChangeServerLifeCycleStateSourceServerLifecycleState -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ChangeServerLifeCycleStateSourceServerLifecycleState
state)]
        )