{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.PutSourceServerAction
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Put source server post migration custom action.
module Amazonka.MGN.PutSourceServerAction
  ( -- * Creating a Request
    PutSourceServerAction (..),
    newPutSourceServerAction,

    -- * Request Lenses
    putSourceServerAction_active,
    putSourceServerAction_documentVersion,
    putSourceServerAction_mustSucceedForCutover,
    putSourceServerAction_parameters,
    putSourceServerAction_timeoutSeconds,
    putSourceServerAction_actionID,
    putSourceServerAction_actionName,
    putSourceServerAction_documentIdentifier,
    putSourceServerAction_order,
    putSourceServerAction_sourceServerID,

    -- * Destructuring the Response
    SourceServerActionDocument (..),
    newSourceServerActionDocument,

    -- * Response Lenses
    sourceServerActionDocument_actionID,
    sourceServerActionDocument_actionName,
    sourceServerActionDocument_active,
    sourceServerActionDocument_documentIdentifier,
    sourceServerActionDocument_documentVersion,
    sourceServerActionDocument_mustSucceedForCutover,
    sourceServerActionDocument_order,
    sourceServerActionDocument_parameters,
    sourceServerActionDocument_timeoutSeconds,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MGN.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newPutSourceServerAction' smart constructor.
data PutSourceServerAction = PutSourceServerAction'
  { -- | Source server post migration custom action active status.
    PutSourceServerAction -> Maybe Bool
active :: Prelude.Maybe Prelude.Bool,
    -- | Source server post migration custom action document version.
    PutSourceServerAction -> Maybe Text
documentVersion :: Prelude.Maybe Prelude.Text,
    -- | Source server post migration custom action must succeed for cutover.
    PutSourceServerAction -> Maybe Bool
mustSucceedForCutover :: Prelude.Maybe Prelude.Bool,
    -- | Source server post migration custom action parameters.
    PutSourceServerAction
-> Maybe (HashMap Text [SsmParameterStoreParameter])
parameters :: Prelude.Maybe (Prelude.HashMap Prelude.Text [SsmParameterStoreParameter]),
    -- | Source server post migration custom action timeout in seconds.
    PutSourceServerAction -> Maybe Natural
timeoutSeconds :: Prelude.Maybe Prelude.Natural,
    -- | Source server post migration custom action ID.
    PutSourceServerAction -> Text
actionID :: Prelude.Text,
    -- | Source server post migration custom action name.
    PutSourceServerAction -> Text
actionName :: Prelude.Text,
    -- | Source server post migration custom action document identifier.
    PutSourceServerAction -> Text
documentIdentifier :: Prelude.Text,
    -- | Source server post migration custom action order.
    PutSourceServerAction -> Natural
order :: Prelude.Natural,
    -- | Source server ID.
    PutSourceServerAction -> Text
sourceServerID :: Prelude.Text
  }
  deriving (PutSourceServerAction -> PutSourceServerAction -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutSourceServerAction -> PutSourceServerAction -> Bool
$c/= :: PutSourceServerAction -> PutSourceServerAction -> Bool
== :: PutSourceServerAction -> PutSourceServerAction -> Bool
$c== :: PutSourceServerAction -> PutSourceServerAction -> Bool
Prelude.Eq, ReadPrec [PutSourceServerAction]
ReadPrec PutSourceServerAction
Int -> ReadS PutSourceServerAction
ReadS [PutSourceServerAction]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutSourceServerAction]
$creadListPrec :: ReadPrec [PutSourceServerAction]
readPrec :: ReadPrec PutSourceServerAction
$creadPrec :: ReadPrec PutSourceServerAction
readList :: ReadS [PutSourceServerAction]
$creadList :: ReadS [PutSourceServerAction]
readsPrec :: Int -> ReadS PutSourceServerAction
$creadsPrec :: Int -> ReadS PutSourceServerAction
Prelude.Read, Int -> PutSourceServerAction -> ShowS
[PutSourceServerAction] -> ShowS
PutSourceServerAction -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutSourceServerAction] -> ShowS
$cshowList :: [PutSourceServerAction] -> ShowS
show :: PutSourceServerAction -> String
$cshow :: PutSourceServerAction -> String
showsPrec :: Int -> PutSourceServerAction -> ShowS
$cshowsPrec :: Int -> PutSourceServerAction -> ShowS
Prelude.Show, forall x. Rep PutSourceServerAction x -> PutSourceServerAction
forall x. PutSourceServerAction -> Rep PutSourceServerAction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutSourceServerAction x -> PutSourceServerAction
$cfrom :: forall x. PutSourceServerAction -> Rep PutSourceServerAction x
Prelude.Generic)

-- |
-- Create a value of 'PutSourceServerAction' 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:
--
-- 'active', 'putSourceServerAction_active' - Source server post migration custom action active status.
--
-- 'documentVersion', 'putSourceServerAction_documentVersion' - Source server post migration custom action document version.
--
-- 'mustSucceedForCutover', 'putSourceServerAction_mustSucceedForCutover' - Source server post migration custom action must succeed for cutover.
--
-- 'parameters', 'putSourceServerAction_parameters' - Source server post migration custom action parameters.
--
-- 'timeoutSeconds', 'putSourceServerAction_timeoutSeconds' - Source server post migration custom action timeout in seconds.
--
-- 'actionID', 'putSourceServerAction_actionID' - Source server post migration custom action ID.
--
-- 'actionName', 'putSourceServerAction_actionName' - Source server post migration custom action name.
--
-- 'documentIdentifier', 'putSourceServerAction_documentIdentifier' - Source server post migration custom action document identifier.
--
-- 'order', 'putSourceServerAction_order' - Source server post migration custom action order.
--
-- 'sourceServerID', 'putSourceServerAction_sourceServerID' - Source server ID.
newPutSourceServerAction ::
  -- | 'actionID'
  Prelude.Text ->
  -- | 'actionName'
  Prelude.Text ->
  -- | 'documentIdentifier'
  Prelude.Text ->
  -- | 'order'
  Prelude.Natural ->
  -- | 'sourceServerID'
  Prelude.Text ->
  PutSourceServerAction
newPutSourceServerAction :: Text -> Text -> Text -> Natural -> Text -> PutSourceServerAction
newPutSourceServerAction
  Text
pActionID_
  Text
pActionName_
  Text
pDocumentIdentifier_
  Natural
pOrder_
  Text
pSourceServerID_ =
    PutSourceServerAction'
      { $sel:active:PutSourceServerAction' :: Maybe Bool
active = forall a. Maybe a
Prelude.Nothing,
        $sel:documentVersion:PutSourceServerAction' :: Maybe Text
documentVersion = forall a. Maybe a
Prelude.Nothing,
        $sel:mustSucceedForCutover:PutSourceServerAction' :: Maybe Bool
mustSucceedForCutover = forall a. Maybe a
Prelude.Nothing,
        $sel:parameters:PutSourceServerAction' :: Maybe (HashMap Text [SsmParameterStoreParameter])
parameters = forall a. Maybe a
Prelude.Nothing,
        $sel:timeoutSeconds:PutSourceServerAction' :: Maybe Natural
timeoutSeconds = forall a. Maybe a
Prelude.Nothing,
        $sel:actionID:PutSourceServerAction' :: Text
actionID = Text
pActionID_,
        $sel:actionName:PutSourceServerAction' :: Text
actionName = Text
pActionName_,
        $sel:documentIdentifier:PutSourceServerAction' :: Text
documentIdentifier = Text
pDocumentIdentifier_,
        $sel:order:PutSourceServerAction' :: Natural
order = Natural
pOrder_,
        $sel:sourceServerID:PutSourceServerAction' :: Text
sourceServerID = Text
pSourceServerID_
      }

-- | Source server post migration custom action active status.
putSourceServerAction_active :: Lens.Lens' PutSourceServerAction (Prelude.Maybe Prelude.Bool)
putSourceServerAction_active :: Lens' PutSourceServerAction (Maybe Bool)
putSourceServerAction_active = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutSourceServerAction' {Maybe Bool
active :: Maybe Bool
$sel:active:PutSourceServerAction' :: PutSourceServerAction -> Maybe Bool
active} -> Maybe Bool
active) (\s :: PutSourceServerAction
s@PutSourceServerAction' {} Maybe Bool
a -> PutSourceServerAction
s {$sel:active:PutSourceServerAction' :: Maybe Bool
active = Maybe Bool
a} :: PutSourceServerAction)

-- | Source server post migration custom action document version.
putSourceServerAction_documentVersion :: Lens.Lens' PutSourceServerAction (Prelude.Maybe Prelude.Text)
putSourceServerAction_documentVersion :: Lens' PutSourceServerAction (Maybe Text)
putSourceServerAction_documentVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutSourceServerAction' {Maybe Text
documentVersion :: Maybe Text
$sel:documentVersion:PutSourceServerAction' :: PutSourceServerAction -> Maybe Text
documentVersion} -> Maybe Text
documentVersion) (\s :: PutSourceServerAction
s@PutSourceServerAction' {} Maybe Text
a -> PutSourceServerAction
s {$sel:documentVersion:PutSourceServerAction' :: Maybe Text
documentVersion = Maybe Text
a} :: PutSourceServerAction)

-- | Source server post migration custom action must succeed for cutover.
putSourceServerAction_mustSucceedForCutover :: Lens.Lens' PutSourceServerAction (Prelude.Maybe Prelude.Bool)
putSourceServerAction_mustSucceedForCutover :: Lens' PutSourceServerAction (Maybe Bool)
putSourceServerAction_mustSucceedForCutover = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutSourceServerAction' {Maybe Bool
mustSucceedForCutover :: Maybe Bool
$sel:mustSucceedForCutover:PutSourceServerAction' :: PutSourceServerAction -> Maybe Bool
mustSucceedForCutover} -> Maybe Bool
mustSucceedForCutover) (\s :: PutSourceServerAction
s@PutSourceServerAction' {} Maybe Bool
a -> PutSourceServerAction
s {$sel:mustSucceedForCutover:PutSourceServerAction' :: Maybe Bool
mustSucceedForCutover = Maybe Bool
a} :: PutSourceServerAction)

-- | Source server post migration custom action parameters.
putSourceServerAction_parameters :: Lens.Lens' PutSourceServerAction (Prelude.Maybe (Prelude.HashMap Prelude.Text [SsmParameterStoreParameter]))
putSourceServerAction_parameters :: Lens'
  PutSourceServerAction
  (Maybe (HashMap Text [SsmParameterStoreParameter]))
putSourceServerAction_parameters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutSourceServerAction' {Maybe (HashMap Text [SsmParameterStoreParameter])
parameters :: Maybe (HashMap Text [SsmParameterStoreParameter])
$sel:parameters:PutSourceServerAction' :: PutSourceServerAction
-> Maybe (HashMap Text [SsmParameterStoreParameter])
parameters} -> Maybe (HashMap Text [SsmParameterStoreParameter])
parameters) (\s :: PutSourceServerAction
s@PutSourceServerAction' {} Maybe (HashMap Text [SsmParameterStoreParameter])
a -> PutSourceServerAction
s {$sel:parameters:PutSourceServerAction' :: Maybe (HashMap Text [SsmParameterStoreParameter])
parameters = Maybe (HashMap Text [SsmParameterStoreParameter])
a} :: PutSourceServerAction) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Source server post migration custom action timeout in seconds.
putSourceServerAction_timeoutSeconds :: Lens.Lens' PutSourceServerAction (Prelude.Maybe Prelude.Natural)
putSourceServerAction_timeoutSeconds :: Lens' PutSourceServerAction (Maybe Natural)
putSourceServerAction_timeoutSeconds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutSourceServerAction' {Maybe Natural
timeoutSeconds :: Maybe Natural
$sel:timeoutSeconds:PutSourceServerAction' :: PutSourceServerAction -> Maybe Natural
timeoutSeconds} -> Maybe Natural
timeoutSeconds) (\s :: PutSourceServerAction
s@PutSourceServerAction' {} Maybe Natural
a -> PutSourceServerAction
s {$sel:timeoutSeconds:PutSourceServerAction' :: Maybe Natural
timeoutSeconds = Maybe Natural
a} :: PutSourceServerAction)

-- | Source server post migration custom action ID.
putSourceServerAction_actionID :: Lens.Lens' PutSourceServerAction Prelude.Text
putSourceServerAction_actionID :: Lens' PutSourceServerAction Text
putSourceServerAction_actionID = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutSourceServerAction' {Text
actionID :: Text
$sel:actionID:PutSourceServerAction' :: PutSourceServerAction -> Text
actionID} -> Text
actionID) (\s :: PutSourceServerAction
s@PutSourceServerAction' {} Text
a -> PutSourceServerAction
s {$sel:actionID:PutSourceServerAction' :: Text
actionID = Text
a} :: PutSourceServerAction)

-- | Source server post migration custom action name.
putSourceServerAction_actionName :: Lens.Lens' PutSourceServerAction Prelude.Text
putSourceServerAction_actionName :: Lens' PutSourceServerAction Text
putSourceServerAction_actionName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutSourceServerAction' {Text
actionName :: Text
$sel:actionName:PutSourceServerAction' :: PutSourceServerAction -> Text
actionName} -> Text
actionName) (\s :: PutSourceServerAction
s@PutSourceServerAction' {} Text
a -> PutSourceServerAction
s {$sel:actionName:PutSourceServerAction' :: Text
actionName = Text
a} :: PutSourceServerAction)

-- | Source server post migration custom action document identifier.
putSourceServerAction_documentIdentifier :: Lens.Lens' PutSourceServerAction Prelude.Text
putSourceServerAction_documentIdentifier :: Lens' PutSourceServerAction Text
putSourceServerAction_documentIdentifier = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutSourceServerAction' {Text
documentIdentifier :: Text
$sel:documentIdentifier:PutSourceServerAction' :: PutSourceServerAction -> Text
documentIdentifier} -> Text
documentIdentifier) (\s :: PutSourceServerAction
s@PutSourceServerAction' {} Text
a -> PutSourceServerAction
s {$sel:documentIdentifier:PutSourceServerAction' :: Text
documentIdentifier = Text
a} :: PutSourceServerAction)

-- | Source server post migration custom action order.
putSourceServerAction_order :: Lens.Lens' PutSourceServerAction Prelude.Natural
putSourceServerAction_order :: Lens' PutSourceServerAction Natural
putSourceServerAction_order = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutSourceServerAction' {Natural
order :: Natural
$sel:order:PutSourceServerAction' :: PutSourceServerAction -> Natural
order} -> Natural
order) (\s :: PutSourceServerAction
s@PutSourceServerAction' {} Natural
a -> PutSourceServerAction
s {$sel:order:PutSourceServerAction' :: Natural
order = Natural
a} :: PutSourceServerAction)

-- | Source server ID.
putSourceServerAction_sourceServerID :: Lens.Lens' PutSourceServerAction Prelude.Text
putSourceServerAction_sourceServerID :: Lens' PutSourceServerAction Text
putSourceServerAction_sourceServerID = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutSourceServerAction' {Text
sourceServerID :: Text
$sel:sourceServerID:PutSourceServerAction' :: PutSourceServerAction -> Text
sourceServerID} -> Text
sourceServerID) (\s :: PutSourceServerAction
s@PutSourceServerAction' {} Text
a -> PutSourceServerAction
s {$sel:sourceServerID:PutSourceServerAction' :: Text
sourceServerID = Text
a} :: PutSourceServerAction)

instance Core.AWSRequest PutSourceServerAction where
  type
    AWSResponse PutSourceServerAction =
      SourceServerActionDocument
  request :: (Service -> Service)
-> PutSourceServerAction -> Request PutSourceServerAction
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy PutSourceServerAction
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse PutSourceServerAction)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      (\Int
s ResponseHeaders
h Object
x -> forall a. FromJSON a => Object -> Either String a
Data.eitherParseJSON Object
x)

instance Prelude.Hashable PutSourceServerAction where
  hashWithSalt :: Int -> PutSourceServerAction -> Int
hashWithSalt Int
_salt PutSourceServerAction' {Natural
Maybe Bool
Maybe Natural
Maybe Text
Maybe (HashMap Text [SsmParameterStoreParameter])
Text
sourceServerID :: Text
order :: Natural
documentIdentifier :: Text
actionName :: Text
actionID :: Text
timeoutSeconds :: Maybe Natural
parameters :: Maybe (HashMap Text [SsmParameterStoreParameter])
mustSucceedForCutover :: Maybe Bool
documentVersion :: Maybe Text
active :: Maybe Bool
$sel:sourceServerID:PutSourceServerAction' :: PutSourceServerAction -> Text
$sel:order:PutSourceServerAction' :: PutSourceServerAction -> Natural
$sel:documentIdentifier:PutSourceServerAction' :: PutSourceServerAction -> Text
$sel:actionName:PutSourceServerAction' :: PutSourceServerAction -> Text
$sel:actionID:PutSourceServerAction' :: PutSourceServerAction -> Text
$sel:timeoutSeconds:PutSourceServerAction' :: PutSourceServerAction -> Maybe Natural
$sel:parameters:PutSourceServerAction' :: PutSourceServerAction
-> Maybe (HashMap Text [SsmParameterStoreParameter])
$sel:mustSucceedForCutover:PutSourceServerAction' :: PutSourceServerAction -> Maybe Bool
$sel:documentVersion:PutSourceServerAction' :: PutSourceServerAction -> Maybe Text
$sel:active:PutSourceServerAction' :: PutSourceServerAction -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
active
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
documentVersion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
mustSucceedForCutover
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text [SsmParameterStoreParameter])
parameters
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
timeoutSeconds
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
actionID
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
actionName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
documentIdentifier
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
order
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
sourceServerID

instance Prelude.NFData PutSourceServerAction where
  rnf :: PutSourceServerAction -> ()
rnf PutSourceServerAction' {Natural
Maybe Bool
Maybe Natural
Maybe Text
Maybe (HashMap Text [SsmParameterStoreParameter])
Text
sourceServerID :: Text
order :: Natural
documentIdentifier :: Text
actionName :: Text
actionID :: Text
timeoutSeconds :: Maybe Natural
parameters :: Maybe (HashMap Text [SsmParameterStoreParameter])
mustSucceedForCutover :: Maybe Bool
documentVersion :: Maybe Text
active :: Maybe Bool
$sel:sourceServerID:PutSourceServerAction' :: PutSourceServerAction -> Text
$sel:order:PutSourceServerAction' :: PutSourceServerAction -> Natural
$sel:documentIdentifier:PutSourceServerAction' :: PutSourceServerAction -> Text
$sel:actionName:PutSourceServerAction' :: PutSourceServerAction -> Text
$sel:actionID:PutSourceServerAction' :: PutSourceServerAction -> Text
$sel:timeoutSeconds:PutSourceServerAction' :: PutSourceServerAction -> Maybe Natural
$sel:parameters:PutSourceServerAction' :: PutSourceServerAction
-> Maybe (HashMap Text [SsmParameterStoreParameter])
$sel:mustSucceedForCutover:PutSourceServerAction' :: PutSourceServerAction -> Maybe Bool
$sel:documentVersion:PutSourceServerAction' :: PutSourceServerAction -> Maybe Text
$sel:active:PutSourceServerAction' :: PutSourceServerAction -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
active
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
documentVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
mustSucceedForCutover
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text [SsmParameterStoreParameter])
parameters
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
timeoutSeconds
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
actionID
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
actionName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
documentIdentifier
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
order
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
sourceServerID

instance Data.ToHeaders PutSourceServerAction where
  toHeaders :: PutSourceServerAction -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON PutSourceServerAction where
  toJSON :: PutSourceServerAction -> Value
toJSON PutSourceServerAction' {Natural
Maybe Bool
Maybe Natural
Maybe Text
Maybe (HashMap Text [SsmParameterStoreParameter])
Text
sourceServerID :: Text
order :: Natural
documentIdentifier :: Text
actionName :: Text
actionID :: Text
timeoutSeconds :: Maybe Natural
parameters :: Maybe (HashMap Text [SsmParameterStoreParameter])
mustSucceedForCutover :: Maybe Bool
documentVersion :: Maybe Text
active :: Maybe Bool
$sel:sourceServerID:PutSourceServerAction' :: PutSourceServerAction -> Text
$sel:order:PutSourceServerAction' :: PutSourceServerAction -> Natural
$sel:documentIdentifier:PutSourceServerAction' :: PutSourceServerAction -> Text
$sel:actionName:PutSourceServerAction' :: PutSourceServerAction -> Text
$sel:actionID:PutSourceServerAction' :: PutSourceServerAction -> Text
$sel:timeoutSeconds:PutSourceServerAction' :: PutSourceServerAction -> Maybe Natural
$sel:parameters:PutSourceServerAction' :: PutSourceServerAction
-> Maybe (HashMap Text [SsmParameterStoreParameter])
$sel:mustSucceedForCutover:PutSourceServerAction' :: PutSourceServerAction -> Maybe Bool
$sel:documentVersion:PutSourceServerAction' :: PutSourceServerAction -> Maybe Text
$sel:active:PutSourceServerAction' :: PutSourceServerAction -> Maybe Bool
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"active" 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
active,
            (Key
"documentVersion" 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 Text
documentVersion,
            (Key
"mustSucceedForCutover" 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
mustSucceedForCutover,
            (Key
"parameters" 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 (HashMap Text [SsmParameterStoreParameter])
parameters,
            (Key
"timeoutSeconds" 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 Natural
timeoutSeconds,
            forall a. a -> Maybe a
Prelude.Just (Key
"actionID" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
actionID),
            forall a. a -> Maybe a
Prelude.Just (Key
"actionName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
actionName),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"documentIdentifier" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
documentIdentifier),
            forall a. a -> Maybe a
Prelude.Just (Key
"order" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
order),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"sourceServerID" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
sourceServerID)
          ]
      )

instance Data.ToPath PutSourceServerAction where
  toPath :: PutSourceServerAction -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/PutSourceServerAction"

instance Data.ToQuery PutSourceServerAction where
  toQuery :: PutSourceServerAction -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty