{-# 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.SageMaker.StopEdgeDeploymentStage
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Stops a stage in an edge deployment plan.
module Amazonka.SageMaker.StopEdgeDeploymentStage
  ( -- * Creating a Request
    StopEdgeDeploymentStage (..),
    newStopEdgeDeploymentStage,

    -- * Request Lenses
    stopEdgeDeploymentStage_edgeDeploymentPlanName,
    stopEdgeDeploymentStage_stageName,

    -- * Destructuring the Response
    StopEdgeDeploymentStageResponse (..),
    newStopEdgeDeploymentStageResponse,
  )
where

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

-- | /See:/ 'newStopEdgeDeploymentStage' smart constructor.
data StopEdgeDeploymentStage = StopEdgeDeploymentStage'
  { -- | The name of the edge deployment plan to stop.
    StopEdgeDeploymentStage -> Text
edgeDeploymentPlanName :: Prelude.Text,
    -- | The name of the stage to stop.
    StopEdgeDeploymentStage -> Text
stageName :: Prelude.Text
  }
  deriving (StopEdgeDeploymentStage -> StopEdgeDeploymentStage -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopEdgeDeploymentStage -> StopEdgeDeploymentStage -> Bool
$c/= :: StopEdgeDeploymentStage -> StopEdgeDeploymentStage -> Bool
== :: StopEdgeDeploymentStage -> StopEdgeDeploymentStage -> Bool
$c== :: StopEdgeDeploymentStage -> StopEdgeDeploymentStage -> Bool
Prelude.Eq, ReadPrec [StopEdgeDeploymentStage]
ReadPrec StopEdgeDeploymentStage
Int -> ReadS StopEdgeDeploymentStage
ReadS [StopEdgeDeploymentStage]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopEdgeDeploymentStage]
$creadListPrec :: ReadPrec [StopEdgeDeploymentStage]
readPrec :: ReadPrec StopEdgeDeploymentStage
$creadPrec :: ReadPrec StopEdgeDeploymentStage
readList :: ReadS [StopEdgeDeploymentStage]
$creadList :: ReadS [StopEdgeDeploymentStage]
readsPrec :: Int -> ReadS StopEdgeDeploymentStage
$creadsPrec :: Int -> ReadS StopEdgeDeploymentStage
Prelude.Read, Int -> StopEdgeDeploymentStage -> ShowS
[StopEdgeDeploymentStage] -> ShowS
StopEdgeDeploymentStage -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopEdgeDeploymentStage] -> ShowS
$cshowList :: [StopEdgeDeploymentStage] -> ShowS
show :: StopEdgeDeploymentStage -> String
$cshow :: StopEdgeDeploymentStage -> String
showsPrec :: Int -> StopEdgeDeploymentStage -> ShowS
$cshowsPrec :: Int -> StopEdgeDeploymentStage -> ShowS
Prelude.Show, forall x. Rep StopEdgeDeploymentStage x -> StopEdgeDeploymentStage
forall x. StopEdgeDeploymentStage -> Rep StopEdgeDeploymentStage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StopEdgeDeploymentStage x -> StopEdgeDeploymentStage
$cfrom :: forall x. StopEdgeDeploymentStage -> Rep StopEdgeDeploymentStage x
Prelude.Generic)

-- |
-- Create a value of 'StopEdgeDeploymentStage' 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:
--
-- 'edgeDeploymentPlanName', 'stopEdgeDeploymentStage_edgeDeploymentPlanName' - The name of the edge deployment plan to stop.
--
-- 'stageName', 'stopEdgeDeploymentStage_stageName' - The name of the stage to stop.
newStopEdgeDeploymentStage ::
  -- | 'edgeDeploymentPlanName'
  Prelude.Text ->
  -- | 'stageName'
  Prelude.Text ->
  StopEdgeDeploymentStage
newStopEdgeDeploymentStage :: Text -> Text -> StopEdgeDeploymentStage
newStopEdgeDeploymentStage
  Text
pEdgeDeploymentPlanName_
  Text
pStageName_ =
    StopEdgeDeploymentStage'
      { $sel:edgeDeploymentPlanName:StopEdgeDeploymentStage' :: Text
edgeDeploymentPlanName =
          Text
pEdgeDeploymentPlanName_,
        $sel:stageName:StopEdgeDeploymentStage' :: Text
stageName = Text
pStageName_
      }

-- | The name of the edge deployment plan to stop.
stopEdgeDeploymentStage_edgeDeploymentPlanName :: Lens.Lens' StopEdgeDeploymentStage Prelude.Text
stopEdgeDeploymentStage_edgeDeploymentPlanName :: Lens' StopEdgeDeploymentStage Text
stopEdgeDeploymentStage_edgeDeploymentPlanName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopEdgeDeploymentStage' {Text
edgeDeploymentPlanName :: Text
$sel:edgeDeploymentPlanName:StopEdgeDeploymentStage' :: StopEdgeDeploymentStage -> Text
edgeDeploymentPlanName} -> Text
edgeDeploymentPlanName) (\s :: StopEdgeDeploymentStage
s@StopEdgeDeploymentStage' {} Text
a -> StopEdgeDeploymentStage
s {$sel:edgeDeploymentPlanName:StopEdgeDeploymentStage' :: Text
edgeDeploymentPlanName = Text
a} :: StopEdgeDeploymentStage)

-- | The name of the stage to stop.
stopEdgeDeploymentStage_stageName :: Lens.Lens' StopEdgeDeploymentStage Prelude.Text
stopEdgeDeploymentStage_stageName :: Lens' StopEdgeDeploymentStage Text
stopEdgeDeploymentStage_stageName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopEdgeDeploymentStage' {Text
stageName :: Text
$sel:stageName:StopEdgeDeploymentStage' :: StopEdgeDeploymentStage -> Text
stageName} -> Text
stageName) (\s :: StopEdgeDeploymentStage
s@StopEdgeDeploymentStage' {} Text
a -> StopEdgeDeploymentStage
s {$sel:stageName:StopEdgeDeploymentStage' :: Text
stageName = Text
a} :: StopEdgeDeploymentStage)

instance Core.AWSRequest StopEdgeDeploymentStage where
  type
    AWSResponse StopEdgeDeploymentStage =
      StopEdgeDeploymentStageResponse
  request :: (Service -> Service)
-> StopEdgeDeploymentStage -> Request StopEdgeDeploymentStage
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 StopEdgeDeploymentStage
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse StopEdgeDeploymentStage)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
      StopEdgeDeploymentStageResponse
StopEdgeDeploymentStageResponse'

instance Prelude.Hashable StopEdgeDeploymentStage where
  hashWithSalt :: Int -> StopEdgeDeploymentStage -> Int
hashWithSalt Int
_salt StopEdgeDeploymentStage' {Text
stageName :: Text
edgeDeploymentPlanName :: Text
$sel:stageName:StopEdgeDeploymentStage' :: StopEdgeDeploymentStage -> Text
$sel:edgeDeploymentPlanName:StopEdgeDeploymentStage' :: StopEdgeDeploymentStage -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
edgeDeploymentPlanName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
stageName

instance Prelude.NFData StopEdgeDeploymentStage where
  rnf :: StopEdgeDeploymentStage -> ()
rnf StopEdgeDeploymentStage' {Text
stageName :: Text
edgeDeploymentPlanName :: Text
$sel:stageName:StopEdgeDeploymentStage' :: StopEdgeDeploymentStage -> Text
$sel:edgeDeploymentPlanName:StopEdgeDeploymentStage' :: StopEdgeDeploymentStage -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
edgeDeploymentPlanName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
stageName

instance Data.ToHeaders StopEdgeDeploymentStage where
  toHeaders :: StopEdgeDeploymentStage -> [Header]
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> [Header]
Data.=# ( ByteString
"SageMaker.StopEdgeDeploymentStage" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> [Header]
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON StopEdgeDeploymentStage where
  toJSON :: StopEdgeDeploymentStage -> Value
toJSON StopEdgeDeploymentStage' {Text
stageName :: Text
edgeDeploymentPlanName :: Text
$sel:stageName:StopEdgeDeploymentStage' :: StopEdgeDeploymentStage -> Text
$sel:edgeDeploymentPlanName:StopEdgeDeploymentStage' :: StopEdgeDeploymentStage -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just
              ( Key
"EdgeDeploymentPlanName"
                  forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
edgeDeploymentPlanName
              ),
            forall a. a -> Maybe a
Prelude.Just (Key
"StageName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
stageName)
          ]
      )

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

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

-- | /See:/ 'newStopEdgeDeploymentStageResponse' smart constructor.
data StopEdgeDeploymentStageResponse = StopEdgeDeploymentStageResponse'
  {
  }
  deriving (StopEdgeDeploymentStageResponse
-> StopEdgeDeploymentStageResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopEdgeDeploymentStageResponse
-> StopEdgeDeploymentStageResponse -> Bool
$c/= :: StopEdgeDeploymentStageResponse
-> StopEdgeDeploymentStageResponse -> Bool
== :: StopEdgeDeploymentStageResponse
-> StopEdgeDeploymentStageResponse -> Bool
$c== :: StopEdgeDeploymentStageResponse
-> StopEdgeDeploymentStageResponse -> Bool
Prelude.Eq, ReadPrec [StopEdgeDeploymentStageResponse]
ReadPrec StopEdgeDeploymentStageResponse
Int -> ReadS StopEdgeDeploymentStageResponse
ReadS [StopEdgeDeploymentStageResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopEdgeDeploymentStageResponse]
$creadListPrec :: ReadPrec [StopEdgeDeploymentStageResponse]
readPrec :: ReadPrec StopEdgeDeploymentStageResponse
$creadPrec :: ReadPrec StopEdgeDeploymentStageResponse
readList :: ReadS [StopEdgeDeploymentStageResponse]
$creadList :: ReadS [StopEdgeDeploymentStageResponse]
readsPrec :: Int -> ReadS StopEdgeDeploymentStageResponse
$creadsPrec :: Int -> ReadS StopEdgeDeploymentStageResponse
Prelude.Read, Int -> StopEdgeDeploymentStageResponse -> ShowS
[StopEdgeDeploymentStageResponse] -> ShowS
StopEdgeDeploymentStageResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopEdgeDeploymentStageResponse] -> ShowS
$cshowList :: [StopEdgeDeploymentStageResponse] -> ShowS
show :: StopEdgeDeploymentStageResponse -> String
$cshow :: StopEdgeDeploymentStageResponse -> String
showsPrec :: Int -> StopEdgeDeploymentStageResponse -> ShowS
$cshowsPrec :: Int -> StopEdgeDeploymentStageResponse -> ShowS
Prelude.Show, forall x.
Rep StopEdgeDeploymentStageResponse x
-> StopEdgeDeploymentStageResponse
forall x.
StopEdgeDeploymentStageResponse
-> Rep StopEdgeDeploymentStageResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StopEdgeDeploymentStageResponse x
-> StopEdgeDeploymentStageResponse
$cfrom :: forall x.
StopEdgeDeploymentStageResponse
-> Rep StopEdgeDeploymentStageResponse x
Prelude.Generic)

-- |
-- Create a value of 'StopEdgeDeploymentStageResponse' 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.
newStopEdgeDeploymentStageResponse ::
  StopEdgeDeploymentStageResponse
newStopEdgeDeploymentStageResponse :: StopEdgeDeploymentStageResponse
newStopEdgeDeploymentStageResponse =
  StopEdgeDeploymentStageResponse
StopEdgeDeploymentStageResponse'

instance
  Prelude.NFData
    StopEdgeDeploymentStageResponse
  where
  rnf :: StopEdgeDeploymentStageResponse -> ()
rnf StopEdgeDeploymentStageResponse
_ = ()