{-# 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.DataReplicationInitiationStep
-- 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.DataReplicationInitiationStep where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MGN.Types.DataReplicationInitiationStepName
import Amazonka.MGN.Types.DataReplicationInitiationStepStatus
import qualified Amazonka.Prelude as Prelude

-- | Data replication intiation step.
--
-- /See:/ 'newDataReplicationInitiationStep' smart constructor.
data DataReplicationInitiationStep = DataReplicationInitiationStep'
  { -- | Request to query data initiation status.
    DataReplicationInitiationStep
-> Maybe DataReplicationInitiationStepStatus
status :: Prelude.Maybe DataReplicationInitiationStepStatus,
    -- | Request to query data initiation step name.
    DataReplicationInitiationStep
-> Maybe DataReplicationInitiationStepName
name :: Prelude.Maybe DataReplicationInitiationStepName
  }
  deriving (DataReplicationInitiationStep
-> DataReplicationInitiationStep -> Bool
(DataReplicationInitiationStep
 -> DataReplicationInitiationStep -> Bool)
-> (DataReplicationInitiationStep
    -> DataReplicationInitiationStep -> Bool)
-> Eq DataReplicationInitiationStep
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DataReplicationInitiationStep
-> DataReplicationInitiationStep -> Bool
$c/= :: DataReplicationInitiationStep
-> DataReplicationInitiationStep -> Bool
== :: DataReplicationInitiationStep
-> DataReplicationInitiationStep -> Bool
$c== :: DataReplicationInitiationStep
-> DataReplicationInitiationStep -> Bool
Prelude.Eq, ReadPrec [DataReplicationInitiationStep]
ReadPrec DataReplicationInitiationStep
Int -> ReadS DataReplicationInitiationStep
ReadS [DataReplicationInitiationStep]
(Int -> ReadS DataReplicationInitiationStep)
-> ReadS [DataReplicationInitiationStep]
-> ReadPrec DataReplicationInitiationStep
-> ReadPrec [DataReplicationInitiationStep]
-> Read DataReplicationInitiationStep
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DataReplicationInitiationStep]
$creadListPrec :: ReadPrec [DataReplicationInitiationStep]
readPrec :: ReadPrec DataReplicationInitiationStep
$creadPrec :: ReadPrec DataReplicationInitiationStep
readList :: ReadS [DataReplicationInitiationStep]
$creadList :: ReadS [DataReplicationInitiationStep]
readsPrec :: Int -> ReadS DataReplicationInitiationStep
$creadsPrec :: Int -> ReadS DataReplicationInitiationStep
Prelude.Read, Int -> DataReplicationInitiationStep -> ShowS
[DataReplicationInitiationStep] -> ShowS
DataReplicationInitiationStep -> String
(Int -> DataReplicationInitiationStep -> ShowS)
-> (DataReplicationInitiationStep -> String)
-> ([DataReplicationInitiationStep] -> ShowS)
-> Show DataReplicationInitiationStep
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DataReplicationInitiationStep] -> ShowS
$cshowList :: [DataReplicationInitiationStep] -> ShowS
show :: DataReplicationInitiationStep -> String
$cshow :: DataReplicationInitiationStep -> String
showsPrec :: Int -> DataReplicationInitiationStep -> ShowS
$cshowsPrec :: Int -> DataReplicationInitiationStep -> ShowS
Prelude.Show, (forall x.
 DataReplicationInitiationStep
 -> Rep DataReplicationInitiationStep x)
-> (forall x.
    Rep DataReplicationInitiationStep x
    -> DataReplicationInitiationStep)
-> Generic DataReplicationInitiationStep
forall x.
Rep DataReplicationInitiationStep x
-> DataReplicationInitiationStep
forall x.
DataReplicationInitiationStep
-> Rep DataReplicationInitiationStep x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DataReplicationInitiationStep x
-> DataReplicationInitiationStep
$cfrom :: forall x.
DataReplicationInitiationStep
-> Rep DataReplicationInitiationStep x
Prelude.Generic)

-- |
-- Create a value of 'DataReplicationInitiationStep' 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:
--
-- 'status', 'dataReplicationInitiationStep_status' - Request to query data initiation status.
--
-- 'name', 'dataReplicationInitiationStep_name' - Request to query data initiation step name.
newDataReplicationInitiationStep ::
  DataReplicationInitiationStep
newDataReplicationInitiationStep :: DataReplicationInitiationStep
newDataReplicationInitiationStep =
  DataReplicationInitiationStep' :: Maybe DataReplicationInitiationStepStatus
-> Maybe DataReplicationInitiationStepName
-> DataReplicationInitiationStep
DataReplicationInitiationStep'
    { $sel:status:DataReplicationInitiationStep' :: Maybe DataReplicationInitiationStepStatus
status =
        Maybe DataReplicationInitiationStepStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:name:DataReplicationInitiationStep' :: Maybe DataReplicationInitiationStepName
name = Maybe DataReplicationInitiationStepName
forall a. Maybe a
Prelude.Nothing
    }

-- | Request to query data initiation status.
dataReplicationInitiationStep_status :: Lens.Lens' DataReplicationInitiationStep (Prelude.Maybe DataReplicationInitiationStepStatus)
dataReplicationInitiationStep_status :: (Maybe DataReplicationInitiationStepStatus
 -> f (Maybe DataReplicationInitiationStepStatus))
-> DataReplicationInitiationStep -> f DataReplicationInitiationStep
dataReplicationInitiationStep_status = (DataReplicationInitiationStep
 -> Maybe DataReplicationInitiationStepStatus)
-> (DataReplicationInitiationStep
    -> Maybe DataReplicationInitiationStepStatus
    -> DataReplicationInitiationStep)
-> Lens
     DataReplicationInitiationStep
     DataReplicationInitiationStep
     (Maybe DataReplicationInitiationStepStatus)
     (Maybe DataReplicationInitiationStepStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataReplicationInitiationStep' {Maybe DataReplicationInitiationStepStatus
status :: Maybe DataReplicationInitiationStepStatus
$sel:status:DataReplicationInitiationStep' :: DataReplicationInitiationStep
-> Maybe DataReplicationInitiationStepStatus
status} -> Maybe DataReplicationInitiationStepStatus
status) (\s :: DataReplicationInitiationStep
s@DataReplicationInitiationStep' {} Maybe DataReplicationInitiationStepStatus
a -> DataReplicationInitiationStep
s {$sel:status:DataReplicationInitiationStep' :: Maybe DataReplicationInitiationStepStatus
status = Maybe DataReplicationInitiationStepStatus
a} :: DataReplicationInitiationStep)

-- | Request to query data initiation step name.
dataReplicationInitiationStep_name :: Lens.Lens' DataReplicationInitiationStep (Prelude.Maybe DataReplicationInitiationStepName)
dataReplicationInitiationStep_name :: (Maybe DataReplicationInitiationStepName
 -> f (Maybe DataReplicationInitiationStepName))
-> DataReplicationInitiationStep -> f DataReplicationInitiationStep
dataReplicationInitiationStep_name = (DataReplicationInitiationStep
 -> Maybe DataReplicationInitiationStepName)
-> (DataReplicationInitiationStep
    -> Maybe DataReplicationInitiationStepName
    -> DataReplicationInitiationStep)
-> Lens
     DataReplicationInitiationStep
     DataReplicationInitiationStep
     (Maybe DataReplicationInitiationStepName)
     (Maybe DataReplicationInitiationStepName)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataReplicationInitiationStep' {Maybe DataReplicationInitiationStepName
name :: Maybe DataReplicationInitiationStepName
$sel:name:DataReplicationInitiationStep' :: DataReplicationInitiationStep
-> Maybe DataReplicationInitiationStepName
name} -> Maybe DataReplicationInitiationStepName
name) (\s :: DataReplicationInitiationStep
s@DataReplicationInitiationStep' {} Maybe DataReplicationInitiationStepName
a -> DataReplicationInitiationStep
s {$sel:name:DataReplicationInitiationStep' :: Maybe DataReplicationInitiationStepName
name = Maybe DataReplicationInitiationStepName
a} :: DataReplicationInitiationStep)

instance Core.FromJSON DataReplicationInitiationStep where
  parseJSON :: Value -> Parser DataReplicationInitiationStep
parseJSON =
    String
-> (Object -> Parser DataReplicationInitiationStep)
-> Value
-> Parser DataReplicationInitiationStep
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"DataReplicationInitiationStep"
      ( \Object
x ->
          Maybe DataReplicationInitiationStepStatus
-> Maybe DataReplicationInitiationStepName
-> DataReplicationInitiationStep
DataReplicationInitiationStep'
            (Maybe DataReplicationInitiationStepStatus
 -> Maybe DataReplicationInitiationStepName
 -> DataReplicationInitiationStep)
-> Parser (Maybe DataReplicationInitiationStepStatus)
-> Parser
     (Maybe DataReplicationInitiationStepName
      -> DataReplicationInitiationStep)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text -> Parser (Maybe DataReplicationInitiationStepStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"status")
            Parser
  (Maybe DataReplicationInitiationStepName
   -> DataReplicationInitiationStep)
-> Parser (Maybe DataReplicationInitiationStepName)
-> Parser DataReplicationInitiationStep
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DataReplicationInitiationStepName)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"name")
      )

instance
  Prelude.Hashable
    DataReplicationInitiationStep

instance Prelude.NFData DataReplicationInitiationStep